Sdílet prostřednictvím


Workspace Api Operation Policy - List By Operation

Získejte seznam konfigurace zásad na úrovni operace rozhraní 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

Parametry identifikátoru URI

Name V Vyžadováno Typ Description
apiId
path True

string

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

Identifikátor revize rozhraní API. V aktuální instanci služby API Management musí být jedinečné. Revize, která není aktuální, má ; rev=n jako přípona, kde n je číslo revize.

operationId
path True

string

minLength: 1
maxLength: 80

Identifikátor operace v rámci rozhraní API. V aktuální instanci služby API Management musí být jedinečné.

resourceGroupName
path True

string

minLength: 1
maxLength: 90

Název skupiny prostředků. Název nerozlišuje malá a velká písmena.

serviceName
path True

string

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

Název služby API Management.

subscriptionId
path True

string (uuid)

ID cílového předplatného. Hodnota musí být UUID.

workspaceId
path True

string

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

Identifikátor pracovního prostoru V aktuální instanci služby API Management musí být jedinečné.

api-version
query True

string

minLength: 1

Verze rozhraní API, která se má použít pro tuto operaci.

Odpovědi

Name Typ Description
200 OK

PolicyCollection

Kolekce zásad operací rozhraní API

Other Status Codes

ErrorResponse

Chybová odpověď popisující, proč operace selhala.

Zabezpečení

azure_auth

Tok OAuth2 v Azure Active Directory

Typ: oauth2
Tok: implicit
URL autorizace: https://login.microsoftonline.com/common/oauth2/authorize

Rozsahy

Name Description
user_impersonation zosobnění uživatelského účtu

Příklady

ApiManagementListWorkspaceApiOperationPolicies

Ukázkový požadavek

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

Ukázková odpověď

{
  "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": ""
}

Definice

Name Description
ErrorAdditionalInfo

Další informace o chybě správy prostředků

ErrorDetail

Podrobnosti o chybě.

ErrorResponse

Chybová odpověď

PolicyCollection

Odpověď operace zásad seznamu.

PolicyContentFormat

Formát policyContent.

PolicyContract

Podrobnosti smlouvy o zásadách

ErrorAdditionalInfo

Další informace o chybě správy prostředků

Name Typ Description
info

object

Další informace.

type

string

Další typ informací.

ErrorDetail

Podrobnosti o chybě.

Name Typ Description
additionalInfo

ErrorAdditionalInfo[]

Další informace o chybě.

code

string

Kód chyby.

details

ErrorDetail[]

Podrobnosti o chybě.

message

string

Chybová zpráva.

target

string

Cíl chyby.

ErrorResponse

Chybová odpověď

Name Typ Description
error

ErrorDetail

Objekt chyby.

PolicyCollection

Odpověď operace zásad seznamu.

Name Typ Description
count

integer (int64)

Celkový počet záznamů

nextLink

string

Další odkaz na stránku, pokud existuje.

value

PolicyContract[]

Hodnota kontraktu zásad

PolicyContentFormat

Formát policyContent.

Hodnota Description
xml

Obsah je vložený a typ obsahu je dokument XML.

xml-link

Dokument XML zásad je hostovaný na koncovém bodu HTTP přístupném ze služby API Management.

rawxml

Obsah je vložený a typ obsahu je dokument zásad, který není kódovaný kódem XML.

rawxml-link

Dokument zásad není kódovaný KÓD XML a je hostovaný na koncovém bodu HTTP přístupném ze služby API Management.

PolicyContract

Podrobnosti smlouvy o zásadách

Name Typ Default value Description
id

string

Plně kvalifikované ID prostředku pro prostředek. Příklad : /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}

name

string

Název prostředku

properties.format

PolicyContentFormat

xml

Formát policyContent.

properties.value

string

Obsah zásad definovaný formátem

type

string

Typ prostředku. Například Microsoft.Compute/virtualMachines nebo Microsoft.Storage/storageAccounts