Workspace Api Operation Policy - List By Operation
Obtenez la liste de la configuration de stratégie au niveau de l’opération d’API.
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/apis/{apiId}/operations/{operationId}/policies?api-version=2024-05-01
Paramètres URI
| Nom | Dans | Obligatoire | Type | Description |
|---|---|---|---|---|
|
api
|
path | True |
string minLength: 1maxLength: 256 pattern: ^[^*#&+:<>?]+$ |
Identificateur de révision d’API. Doit être unique dans l’instance actuelle du service Gestion des API. La révision non actuelle a ; rev=n en tant que suffixe où n est le numéro de révision. |
|
operation
|
path | True |
string minLength: 1maxLength: 80 |
Identificateur d’opération dans une API. Doit être unique dans l’instance actuelle du service Gestion des API. |
|
resource
|
path | True |
string minLength: 1maxLength: 90 |
Nom du groupe de ressources. Le nom ne respecte pas la casse. |
|
service
|
path | True |
string minLength: 1maxLength: 50 pattern: ^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$ |
Nom du service Gestion des API. |
|
subscription
|
path | True |
string (uuid) |
ID de l’abonnement cible. La valeur doit être un UUID. |
|
workspace
|
path | True |
string minLength: 1maxLength: 80 pattern: ^[^*#&+:<>?]+$ |
Identificateur de l’espace de travail. Doit être unique dans l’instance actuelle du service Gestion des API. |
|
api-version
|
query | True |
string minLength: 1 |
Version de l’API à utiliser pour cette opération. |
Réponses
| Nom | Type | Description |
|---|---|---|
| 200 OK |
Collection de stratégies d’opérations d’API. |
|
| Other Status Codes |
Réponse d’erreur décrivant pourquoi l’opération a échoué. |
Sécurité
azure_auth
Flux OAuth2 Azure Active Directory.
Type:
oauth2
Flux:
implicit
URL d’autorisation:
https://login.microsoftonline.com/common/oauth2/authorize
Étendues
| Nom | Description |
|---|---|
| user_impersonation | emprunter l’identité de votre compte d’utilisateur |
Exemples
ApiManagementListWorkspaceApiOperationPolicies
Exemple de requête
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/workspaces/wks1/apis/599e2953193c3c0bd0b3e2fa/operations/599e29ab193c3c0bd0b3e2fb/policies?api-version=2024-05-01
Exemple de réponse
{
"value": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/workspaces/wks1/apis/599e2953193c3c0bd0b3e2fa/operations/599e29ab193c3c0bd0b3e2fb/policies/policy",
"type": "Microsoft.ApiManagement/service/workspaces/apis/operations/policies",
"name": "policy",
"properties": {
"value": "<!--\r\n IMPORTANT:\r\n - Policy elements can appear only within the <inbound>, <outbound>, <backend> section elements.\r\n - Only the <forward-request> policy element can appear within the <backend> section element.\r\n - To apply a policy to the incoming request (before it is forwarded to the backend service), place a corresponding policy element within the <inbound> section element.\r\n - To apply a policy to the outgoing response (before it is sent back to the caller), place a corresponding policy element within the <outbound> section element.\r\n - To add a policy position the cursor at the desired insertion point and click on the round button associated with the policy.\r\n - To remove a policy, delete the corresponding policy statement from the policy document.\r\n - Position the <base> element within a section element to inherit all policies from the corresponding section element in the enclosing scope.\r\n - Remove the <base> element to prevent inheriting policies from the corresponding section element in the enclosing scope.\r\n - Policies are applied in the order of their appearance, from the top down.\r\n-->\r\n<policies>\r\n <inbound>\r\n <validate-jwt header-name=\"dd\">\r\n <required-claims>\r\n <claim name=\"bla\" separator=\"\">\r\n <value>xxx</value>\r\n </claim>\r\n </required-claims>\r\n </validate-jwt>\r\n <base />\r\n </inbound>\r\n <backend>\r\n <base />\r\n </backend>\r\n <outbound>\r\n <base />\r\n </outbound>\r\n</policies>"
}
}
],
"count": 1,
"nextLink": ""
}
Définitions
| Nom | Description |
|---|---|
|
Error |
Informations supplémentaires sur l’erreur de gestion des ressources. |
|
Error |
Détail de l’erreur. |
|
Error |
Réponse d’erreur |
|
Policy |
Réponse de l’opération de stratégie de liste. |
|
Policy |
Format de policyContent. |
|
Policy |
Détails du contrat de stratégie. |
ErrorAdditionalInfo
Informations supplémentaires sur l’erreur de gestion des ressources.
| Nom | Type | Description |
|---|---|---|
| info |
object |
Informations supplémentaires. |
| type |
string |
Type d’informations supplémentaire. |
ErrorDetail
Détail de l’erreur.
| Nom | Type | Description |
|---|---|---|
| additionalInfo |
Informations supplémentaires sur l’erreur. |
|
| code |
string |
Code d’erreur. |
| details |
Détails de l’erreur. |
|
| message |
string |
Message d’erreur. |
| target |
string |
Cible d’erreur. |
ErrorResponse
Réponse d’erreur
| Nom | Type | Description |
|---|---|---|
| error |
Objet d’erreur. |
PolicyCollection
Réponse de l’opération de stratégie de liste.
| Nom | Type | Description |
|---|---|---|
| count |
integer (int64) |
Nombre total d’enregistrements. |
| nextLink |
string |
Lien de page suivant le cas échéant. |
| value |
Valeur du contrat de stratégie. |
PolicyContentFormat
Format de policyContent.
| Valeur | Description |
|---|---|
| xml |
Le contenu est inline et le type de contenu est un document XML. |
| xml-link |
Le document XML de stratégie est hébergé sur un point de terminaison HTTP accessible à partir du service Gestion des API. |
| rawxml |
Le contenu est inline et le type de contenu est un document de stratégie encodé non XML. |
| rawxml-link |
Le document de stratégie n’est pas encodé XML et est hébergé sur un point de terminaison HTTP accessible à partir du service Gestion des API. |
PolicyContract
Détails du contrat de stratégie.
| Nom | Type | Valeur par défaut | Description |
|---|---|---|---|
| id |
string |
ID de ressource complet pour la ressource. ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} |
|
| name |
string |
Nom de la ressource |
|
| properties.format | xml |
Format de policyContent. |
|
| properties.value |
string |
Contenu de la stratégie tel que défini par le format. |
|
| type |
string |
Type de la ressource. Par exemple, « Microsoft.Compute/virtualMachines » ou « Microsoft.Storage/storageAccounts » |