Ottiene la configurazione dell'URI del servizio e le intestazioni personalizzate per il webhook.
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}/getCallbackConfig?api-version=2023-01-01-preview
Parametri dell'URI
Nome |
In |
Necessario |
Tipo |
Descrizione |
registryName
|
path |
True
|
string
|
Nome del Registro contenitori.
Regex pattern: ^[a-zA-Z0-9]*$
|
resourceGroupName
|
path |
True
|
string
|
Nome del gruppo di risorse. Per il nome non viene fatta distinzione tra maiuscole e minuscole.
|
subscriptionId
|
path |
True
|
string
uuid
|
ID della sottoscrizione di destinazione. Il valore deve essere un UUID.
|
webhookName
|
path |
True
|
string
|
Nome del webhook.
Regex pattern: ^[a-zA-Z0-9]*$
|
api-version
|
query |
True
|
string
|
Versione dell'API da usare per questa operazione.
|
Risposte
Nome |
Tipo |
Descrizione |
200 OK
|
CallbackConfig
|
La richiesta ha avuto esito positivo; la richiesta è stata ben formata e ricevuta correttamente.
|
Sicurezza
azure_auth
Flusso OAuth2 di Azure Active Directory
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Nome |
Descrizione |
user_impersonation
|
rappresentare l'account utente
|
Esempio
WebhookGetCallbackConfig
Sample Request
POST https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/webhooks/myWebhook/getCallbackConfig?api-version=2023-01-01-preview
package armcontainerregistry_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-01-preview/examples/WebhookGetCallbackConfig.json
func ExampleWebhooksClient_GetCallbackConfig() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewWebhooksClient().GetCallbackConfig(ctx, "myResourceGroup", "myRegistry", "myWebhook", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.CallbackConfig = armcontainerregistry.CallbackConfig{
// CustomHeaders: map[string]*string{
// "Authorization": to.Ptr("Basic 000000000000000000000000000000000000000000000000000"),
// },
// ServiceURI: to.Ptr("http://myservice.com"),
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerRegistryManagementClient } = require("@azure/arm-containerregistry");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Gets the configuration of service URI and custom headers for the webhook.
*
* @summary Gets the configuration of service URI and custom headers for the webhook.
* x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-01-preview/examples/WebhookGetCallbackConfig.json
*/
async function webhookGetCallbackConfig() {
const subscriptionId =
process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup";
const registryName = "myRegistry";
const webhookName = "myWebhook";
const credential = new DefaultAzureCredential();
const client = new ContainerRegistryManagementClient(credential, subscriptionId);
const result = await client.webhooks.getCallbackConfig(
resourceGroupName,
registryName,
webhookName
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
{
"serviceUri": "http://myservice.com",
"customHeaders": {
"Authorization": "******"
}
}
Definizioni
CallbackConfig
Configurazione dell'URI del servizio e delle intestazioni personalizzate per il webhook.
Nome |
Tipo |
Descrizione |
customHeaders
|
object
|
Intestazioni personalizzate che verranno aggiunte alle notifiche webhook.
|
serviceUri
|
string
|
URI del servizio per il webhook per inviare notifiche.
|