Policy Fragment - Create Or Update
정책 조각을 만들거나 업데이트합니다.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policyFragments/{id}?api-version=2024-05-01
URI 매개 변수
| Name | In(다음 안에) | 필수 | 형식 | Description |
|---|---|---|---|---|
|
id
|
path | True |
string minLength: 1maxLength: 80 pattern: (^[\w]+$)|(^[\w][\w\-]+[\w]$) |
리소스 식별자입니다. |
|
resource
|
path | True |
string minLength: 1maxLength: 90 |
리소스 그룹의 이름입니다. 이름은 대/소문자를 구분하지 않습니다. |
|
service
|
path | True |
string minLength: 1maxLength: 50 pattern: ^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$ |
API Management 서비스의 이름입니다. |
|
subscription
|
path | True |
string (uuid) |
대상 구독의 ID입니다. 값은 UUID여야 합니다. |
|
api-version
|
query | True |
string minLength: 1 |
이 작업에 사용할 API 버전입니다. |
요청 헤더
| Name | 필수 | 형식 | Description |
|---|---|---|---|
| If-Match |
string |
엔터티의 ETag입니다. 엔터티를 만들 때는 필요하지 않지만 엔터티를 업데이트할 때 필요합니다. |
요청 본문
| Name | 필수 | 형식 | Description |
|---|---|---|---|
| properties.value | True |
string |
정책 조각의 내용입니다. |
| properties.description |
string minLength: 0maxLength: 1000 |
정책 조각 설명입니다. |
|
| properties.format |
정책 조각 콘텐츠의 형식입니다. |
응답
| Name | 형식 | Description |
|---|---|---|
| 200 OK |
정책 조각이 성공적으로 업데이트되었습니다. 헤더
|
|
| 201 Created |
정책 조각이 성공적으로 생성되었습니다. 헤더
|
|
| Other Status Codes |
작업이 실패한 이유를 설명하는 오류 응답입니다. |
보안
azure_auth
Azure Active Directory OAuth2 흐름.
형식:
oauth2
Flow:
implicit
권한 부여 URL:
https://login.microsoftonline.com/common/oauth2/authorize
범위
| Name | Description |
|---|---|
| user_impersonation | 사용자 계정 가장 |
예제
ApiManagementCreatePolicy
샘플 요청
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/policyFragments/policyFragment1?api-version=2024-05-01
{
"properties": {
"format": "xml",
"description": "A policy fragment example",
"value": "<fragment><json-to-xml apply=\"always\" consider-accept-header=\"false\" /></fragment>"
}
}
샘플 응답
location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/policyFragments/policyFragment1?api-version=2024-05-01&asyncId=5c730e343244df1b9cb56e85&asyncCode=200
Azure-AsyncOperation: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/tenant/operationResults/5c730e343244df1b9cb56e85?api-version=2024-05-01
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/policyFragments/policyFragment1",
"type": "Microsoft.ApiManagement/service/policyFragments",
"name": "policyFragment1",
"properties": {
"format": "xml",
"description": "A policy fragment example",
"value": "<json-to-xml apply=\"always\" consider-accept-header=\"false\" />",
"provisioningState": "InProgress"
}
}
location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/policyFragments/policyFragment1?api-version=2024-05-01&asyncId=5c730e343244df1b9cb56e85&asyncCode=201
Azure-AsyncOperation: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/tenant/operationResults/5c730e343244df1b9cb56e85?api-version=2024-05-01
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/policyFragments/policyFragment1",
"type": "Microsoft.ApiManagement/service/policyFragments",
"name": "policyFragment1",
"properties": {
"format": "xml",
"description": "A policy fragment example",
"value": "<json-to-xml apply=\"always\" consider-accept-header=\"false\" />",
"provisioningState": "InProgress"
}
}
정의
| Name | Description |
|---|---|
|
Error |
리소스 관리 오류 추가 정보입니다. |
|
Error |
오류 세부 정보입니다. |
|
Error |
오류 응답 |
|
Policy |
정책 조각 콘텐츠의 형식입니다. |
|
Policy |
정책 조각 계약 세부 정보입니다. |
ErrorAdditionalInfo
리소스 관리 오류 추가 정보입니다.
| Name | 형식 | Description |
|---|---|---|
| info |
object |
추가 정보입니다. |
| type |
string |
추가 정보 유형입니다. |
ErrorDetail
오류 세부 정보입니다.
| Name | 형식 | Description |
|---|---|---|
| additionalInfo |
오류 추가 정보입니다. |
|
| code |
string |
오류 코드입니다. |
| details |
오류 세부 정보입니다. |
|
| message |
string |
오류 메시지입니다. |
| target |
string |
오류 대상입니다. |
ErrorResponse
오류 응답
| Name | 형식 | Description |
|---|---|---|
| error |
오류 개체입니다. |
PolicyFragmentContentFormat
정책 조각 콘텐츠의 형식입니다.
| 값 | Description |
|---|---|
| xml |
콘텐츠는 인라인이고 콘텐츠 형식은 XML 문서입니다. |
| rawxml |
콘텐츠는 인라인이며 콘텐츠 형식은 XML로 인코딩되지 않은 정책 문서입니다. |
PolicyFragmentContract
정책 조각 계약 세부 정보입니다.
| Name | 형식 | Default value | Description |
|---|---|---|---|
| id |
string |
리소스에 대한 정규화된 리소스 ID입니다. 예 - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} |
|
| name |
string |
리소스의 이름 |
|
| properties.description |
string minLength: 0maxLength: 1000 |
정책 조각 설명입니다. |
|
| properties.format | xml |
정책 조각 콘텐츠의 형식입니다. |
|
| properties.provisioningState |
string |
프로비저닝 상태 |
|
| properties.value |
string |
정책 조각의 내용입니다. |
|
| type |
string |
리소스의 형식입니다. 예: "Microsoft.Compute/virtualMachines" 또는 "Microsoft.Storage/storageAccounts" |