Udostępnij za pośrednictwem


Api Operation Policy - List By Operation

Pobierz listę konfiguracji zasad na poziomie operacji interfejsu API.

GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/policies?api-version=2024-05-01

Parametry identyfikatora URI

Nazwa W Wymagane Typ Opis
apiId
path True

string

minLength: 1
maxLength: 256
pattern: ^[^*#&+:<>?]+$

Identyfikator poprawki interfejsu API. Musi być unikatowa w bieżącym wystąpieniu usługi API Management. Nieobsługiwana poprawka ma wartość ; rev=n jako sufiks, gdzie n jest numerem poprawki.

operationId
path True

string

minLength: 1
maxLength: 80

Identyfikator operacji w interfejsie API. Musi być unikatowa w bieżącym wystąpieniu usługi API Management.

resourceGroupName
path True

string

minLength: 1
maxLength: 90

Nazwa grupy zasobów. Nazwa jest niewrażliwa na wielkość liter.

serviceName
path True

string

minLength: 1
maxLength: 50
pattern: ^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$

Nazwa usługi API Management.

subscriptionId
path True

string (uuid)

Identyfikator subskrypcji docelowej. Wartość musi być identyfikatorem UUID.

api-version
query True

string

minLength: 1

Wersja interfejsu API do użycia dla tej operacji.

Odpowiedzi

Nazwa Typ Opis
200 OK

PolicyCollection

Kolekcja zasad operacji interfejsu API.

Other Status Codes

ErrorResponse

Odpowiedź na błąd opisująca, dlaczego operacja nie powiodła się.

Zabezpieczenia

azure_auth

Przepływ protokołu OAuth2 usługi Azure Active Directory.

Typ: oauth2
Flow: implicit
Adres URL autoryzacji: https://login.microsoftonline.com/common/oauth2/authorize

Zakresy

Nazwa Opis
user_impersonation personifikacja konta użytkownika

Przykłady

ApiManagementListApiOperationPolicies

Przykładowe żądanie

GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/599e2953193c3c0bd0b3e2fa/operations/599e29ab193c3c0bd0b3e2fb/policies?api-version=2024-05-01

Przykładowa odpowiedź

{
  "value": [
    {
      "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/599e2953193c3c0bd0b3e2fa/operations/599e29ab193c3c0bd0b3e2fb/policies/policy",
      "type": "Microsoft.ApiManagement/service/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": ""
}

Definicje

Nazwa Opis
ErrorAdditionalInfo

Dodatkowe informacje o błędzie zarządzania zasobami.

ErrorDetail

Szczegóły błędu.

ErrorResponse

Odpowiedź na błąd

PolicyCollection

Odpowiedź operacji zasad listy.

PolicyContentFormat

Format zasadContent.

PolicyContract

Szczegóły kontraktu zasad.

ErrorAdditionalInfo

Dodatkowe informacje o błędzie zarządzania zasobami.

Nazwa Typ Opis
info

object

Dodatkowe informacje.

type

string

Dodatkowy typ informacji.

ErrorDetail

Szczegóły błędu.

Nazwa Typ Opis
additionalInfo

ErrorAdditionalInfo[]

Dodatkowe informacje o błędzie.

code

string

Kod błędu.

details

ErrorDetail[]

Szczegóły błędu.

message

string

Komunikat o błędzie.

target

string

Element docelowy błędu.

ErrorResponse

Odpowiedź na błąd

Nazwa Typ Opis
error

ErrorDetail

Obiekt błędu.

PolicyCollection

Odpowiedź operacji zasad listy.

Nazwa Typ Opis
count

integer (int64)

Całkowita liczba rekordów.

nextLink

string

Jeśli istnieje, link następnej strony.

value

PolicyContract[]

Wartość kontraktu zasad.

PolicyContentFormat

Format zasadContent.

Wartość Opis
rawxml

Zawartość jest śródliniowa, a typ zawartości jest dokumentem zasad niekodowanych w formacie XML.

rawxml-link

Dokument zasad nie jest zakodowany w formacie XML i jest hostowany w punkcie końcowym HTTP dostępnym z usługi API Management.

xml

Zawartość jest wbudowana, a typ zawartości jest dokumentem XML.

xml-link

Dokument XML zasad jest hostowany w punkcie końcowym HTTP dostępnym z poziomu usługi API Management.

PolicyContract

Szczegóły kontraktu zasad.

Nazwa Typ Domyślna wartość Opis
id

string

W pełni kwalifikowany identyfikator zasobu dla zasobu. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}

name

string

Nazwa zasobu

properties.format

PolicyContentFormat

xml

Format zasadContent.

properties.value

string

Zawartość zasad zgodnie z formatem.

type

string

Typ zasobu. Np. "Microsoft.Compute/virtualMachines" lub "Microsoft.Storage/storageAccounts"