Api Policy - Get
API 수준에서 정책 구성을 가져옵니다.
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/policies/policy?api-version=2021-08-01
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/policies/policy?format={format}&api-version=2021-08-01
URI 매개 변수
Name | In(다음 안에) | 필수 | 형식 | Description |
---|---|---|---|---|
api
|
path | True |
string |
API 수정 식별자입니다. 현재 API Management 서비스 instance 고유해야 합니다. 현재 버전이 아닌 수정 버전에는 가 있습니다. rev=n은 접미사로, 여기서 n은 수정 번호입니다. regex 패턴: |
policy
|
path | True |
정책의 식별자입니다. |
|
resource
|
path | True |
string |
리소스 그룹의 이름. |
service
|
path | True |
string |
API Management 서비스의 이름입니다. regex 패턴: |
subscription
|
path | True |
string |
Microsoft Azure 구독을 고유하게 식별하는 구독 자격 증명 구독 ID는 모든 서비스 호출에 대한 URI의 파트를 형성합니다. |
api-version
|
query | True |
string |
클라이언트 요청과 함께 사용할 API의 버전입니다. |
format
|
query |
정책 내보내기 형식입니다. |
응답
Name | 형식 | Description |
---|---|---|
200 OK |
API 정책 정보입니다. Media Types: "application/json", "application/vnd.ms-azure-apim.policy+xml", "application/vnd.ms-azure-apim.policy.raw+xml" 헤더 ETag: string |
|
Other Status Codes |
작업이 실패한 이유를 설명하는 오류 응답입니다. Media Types: "application/json", "application/vnd.ms-azure-apim.policy+xml", "application/vnd.ms-azure-apim.policy.raw+xml" |
보안
azure_auth
Azure Active Directory OAuth2 Flow.
형식:
oauth2
Flow:
implicit
권한 부여 URL:
https://login.microsoftonline.com/common/oauth2/authorize
범위
Name | Description |
---|---|
user_impersonation | 사용자 계정 가장 |
예제
ApiManagementGetApiPolicy
샘플 요청
샘플 응답
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/5600b59475ff190048040001/policies/policy",
"type": "Microsoft.ApiManagement/service/apis/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 <quota-by-key calls=\"5\" bandwidth=\"2\" renewal-period=\"	P3Y6M4DT12H30M5S\" counter-key=\"ba\" />\r\n <base />\r\n </inbound>\r\n <backend>\r\n <base />\r\n </backend>\r\n <outbound>\r\n <log-to-eventhub logger-id=\"apimService1\" partition-key=\"@(context.Subscription.Id)\">\r\n@{\r\n\tRandom Random = new Random();\r\n\t\t\t\tconst string Chars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz \"; \r\n return string.Join(\",\", DateTime.UtcNow, new string(\r\n Enumerable.Repeat(Chars, Random.Next(2150400))\r\n .Select(s => s[Random.Next(s.Length)])\r\n .ToArray()));\r\n } \r\n </log-to-eventhub>\r\n <base />\r\n </outbound>\r\n</policies>"
}
}
정의
Name | Description |
---|---|
Error |
오류 필드 계약. |
Error |
오류 응답. |
Policy |
policyContent의 형식입니다. |
Policy |
정책 계약 세부 정보. |
Policy |
정책 내보내기 형식입니다. |
Policy |
정책의 식별자입니다. |
ErrorFieldContract
오류 필드 계약.
Name | 형식 | Description |
---|---|---|
code |
string |
속성 수준 오류 코드입니다. |
message |
string |
사람이 읽을 수 있는 속성 수준 오류 표현입니다. |
target |
string |
속성 이름입니다. |
ErrorResponse
오류 응답.
Name | 형식 | Description |
---|---|---|
error.code |
string |
서비스에서 정의한 오류 코드입니다. 이 코드는 응답에 지정된 HTTP 오류 코드의 하위 상태로 사용됩니다. |
error.details |
유효성 검사 오류가 발생한 경우 요청에 잘못된 필드가 전송됩니다. |
|
error.message |
string |
사람이 읽을 수 있는 오류 표현입니다. |
PolicyContentFormat
policyContent의 형식입니다.
Name | 형식 | Description |
---|---|---|
rawxml |
string |
콘텐츠는 인라인이고 콘텐츠 형식은 XML로 인코딩되지 않은 정책 문서입니다. |
rawxml-link |
string |
정책 문서는 Xml로 인코딩되지 않으며 API Management 서비스에서 액세스할 수 있는 http 엔드포인트에서 호스트됩니다. |
xml |
string |
콘텐츠는 인라인이고 콘텐츠 형식은 XML 문서입니다. |
xml-link |
string |
정책 XML 문서는 API Management 서비스에서 액세스할 수 있는 http 엔드포인트에서 호스트됩니다. |
PolicyContract
정책 계약 세부 정보.
Name | 형식 | Default value | Description |
---|---|---|---|
id |
string |
리소스에 대한 정규화된 리소스 ID입니다. 예 - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} |
|
name |
string |
리소스의 이름입니다. |
|
properties.format | xml |
policyContent의 형식입니다. |
|
properties.value |
string |
형식으로 정의된 정책의 내용입니다. |
|
type |
string |
리소스 형식입니다. 예: "Microsoft.Compute/virtualMachines" 또는 "Microsoft.Storage/storageAccounts" |
PolicyExportFormat
정책 내보내기 형식입니다.
Name | 형식 | Description |
---|---|---|
rawxml |
string |
콘텐츠는 인라인이고 콘텐츠 형식은 XML로 인코딩되지 않은 정책 문서입니다. |
xml |
string |
콘텐츠는 인라인이고 콘텐츠 형식은 XML 문서입니다. |
PolicyIdName
정책의 식별자입니다.
Name | 형식 | Description |
---|---|---|
policy |
string |