Dela via


Workspace Api Operation Policy - List By Operation

Hämta listan över principkonfiguration på API-åtgärdsnivå.

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

URI-parametrar

Name I Obligatorisk Typ Description
apiId
path True

string

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

API-revisionsidentifierare. Måste vara unikt i den aktuella API Management-tjänstinstansen. Icke-aktuell revision har ; rev=n som ett suffix där n är revisionsnumret.

operationId
path True

string

minLength: 1
maxLength: 80

Åtgärdsidentifierare i ett API. Måste vara unikt i den aktuella API Management-tjänstinstansen.

resourceGroupName
path True

string

minLength: 1
maxLength: 90

Namnet på resursgruppen. Namnet är skiftlägesokänsligt.

serviceName
path True

string

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

Namnet på API Management-tjänsten.

subscriptionId
path True

string (uuid)

ID för målprenumerationen. Värdet måste vara ett UUID.

workspaceId
path True

string

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

Arbetsyteidentifierare. Måste vara unikt i den aktuella API Management-tjänstinstansen.

api-version
query True

string

minLength: 1

DEN API-version som ska användas för den här åtgärden.

Svar

Name Typ Description
200 OK

PolicyCollection

Principinsamling för API-åtgärder.

Other Status Codes

ErrorResponse

Felsvar som beskriver varför åtgärden misslyckades.

Säkerhet

azure_auth

Azure Active Directory OAuth2-flöde.

Typ: oauth2
Flow: implicit
Auktoriseringswebbadress: https://login.microsoftonline.com/common/oauth2/authorize

Omfattningar

Name Description
user_impersonation personifiera ditt användarkonto

Exempel

ApiManagementListWorkspaceApiOperationPolicies

Exempelbegäran

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

Exempelsvar

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

Definitioner

Name Description
ErrorAdditionalInfo

Ytterligare information om resurshanteringsfelet.

ErrorDetail

Felinformationen.

ErrorResponse

Felsvar

PolicyCollection

Svaret från listprincipåtgärden.

PolicyContentFormat

Format för policyContent.

PolicyContract

Information om principkontrakt.

ErrorAdditionalInfo

Ytterligare information om resurshanteringsfelet.

Name Typ Description
info

object

Ytterligare information.

type

string

Ytterligare informationstyp.

ErrorDetail

Felinformationen.

Name Typ Description
additionalInfo

ErrorAdditionalInfo[]

Ytterligare information om felet.

code

string

Felkoden.

details

ErrorDetail[]

Felinformationen.

message

string

Felmeddelandet.

target

string

Felmålet.

ErrorResponse

Felsvar

Name Typ Description
error

ErrorDetail

Felobjektet.

PolicyCollection

Svaret från listprincipåtgärden.

Name Typ Description
count

integer (int64)

Totalt antal poster.

nextLink

string

Om det finns någon länk till nästa sida.

value

PolicyContract[]

Värde för principkontrakt.

PolicyContentFormat

Format för policyContent.

Värde Description
xml

Innehållet är infogat och innehållstypen är ett XML-dokument.

xml-link

Princip-XML-dokumentet finns på en HTTP-slutpunkt som är tillgänglig från API Management-tjänsten.

rawxml

Innehållet är infogat och Innehållstyp är ett icke XML-kodat principdokument.

rawxml-link

Principdokumentet är inte XML-kodat och finns på en HTTP-slutpunkt som är tillgänglig från API Management-tjänsten.

PolicyContract

Information om principkontrakt.

Name Typ Standardvärde Description
id

string

Fullständigt kvalificerat resurs-ID för resursen. Ex – /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}

name

string

Namnet på resursen

properties.format

PolicyContentFormat

xml

Format för policyContent.

properties.value

string

Innehållet i principen enligt formatet.

type

string

Resurstypen. Till exempel "Microsoft.Compute/virtualMachines" eller "Microsoft.Storage/storageAccounts"