Policy Fragment - Create Or Update
Hiermee maakt of werkt u een beleidsfragment bij.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policyFragments/{id}?api-version=2024-05-01
URI-parameters
| Name | In | Vereist | Type | Description |
|---|---|---|---|---|
|
id
|
path | True |
string minLength: 1maxLength: 80 pattern: (^[\w]+$)|(^[\w][\w\-]+[\w]$) |
Een resource-id. |
|
resource
|
path | True |
string minLength: 1maxLength: 90 |
De naam van de resourcegroep. De naam is niet hoofdlettergevoelig. |
|
service
|
path | True |
string minLength: 1maxLength: 50 pattern: ^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$ |
De naam van de API Management-service. |
|
subscription
|
path | True |
string (uuid) |
De id van het doelabonnement. De waarde moet een UUID zijn. |
|
api-version
|
query | True |
string minLength: 1 |
De API-versie die voor deze bewerking moet worden gebruikt. |
Aanvraagkoptekst
| Name | Vereist | Type | Description |
|---|---|---|---|
| If-Match |
string |
ETag van de entiteit. Niet vereist bij het maken van een entiteit, maar vereist bij het bijwerken van een entiteit. |
Aanvraagbody
| Name | Vereist | Type | Description |
|---|---|---|---|
| properties.value | True |
string |
Inhoud van het beleidsfragment. |
| properties.description |
string minLength: 0maxLength: 1000 |
Beschrijving van beleidsfragment. |
|
| properties.format |
Indeling van de inhoud van het beleidsfragment. |
Antwoorden
| Name | Type | Description |
|---|---|---|
| 200 OK |
Het beleidsfragment is bijgewerkt. Kopteksten
|
|
| 201 Created |
Het beleidsfragment is gemaakt. Kopteksten
|
|
| Other Status Codes |
Foutreactie waarin wordt beschreven waarom de bewerking is mislukt. |
Beveiliging
azure_auth
OAuth2-stroom voor Azure Active Directory.
Type:
oauth2
Stroom:
implicit
Autorisatie-URL:
https://login.microsoftonline.com/common/oauth2/authorize
Bereiken
| Name | Description |
|---|---|
| user_impersonation | Uw gebruikersaccount imiteren |
Voorbeelden
ApiManagementCreatePolicy
Voorbeeldaanvraag
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>"
}
}
Voorbeeldrespons
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"
}
}
Definities
| Name | Description |
|---|---|
|
Error |
Aanvullende informatie over de resourcebeheerfout. |
|
Error |
De foutdetails. |
|
Error |
Foutreactie |
|
Policy |
Indeling van de inhoud van het beleidsfragment. |
|
Policy |
Contractgegevens van beleidsfragment. |
ErrorAdditionalInfo
Aanvullende informatie over de resourcebeheerfout.
| Name | Type | Description |
|---|---|---|
| info |
object |
De aanvullende informatie. |
| type |
string |
Het extra informatietype. |
ErrorDetail
De foutdetails.
| Name | Type | Description |
|---|---|---|
| additionalInfo |
De fout bevat aanvullende informatie. |
|
| code |
string |
De foutcode. |
| details |
De foutdetails. |
|
| message |
string |
Het foutbericht. |
| target |
string |
Het foutdoel. |
ErrorResponse
Foutreactie
| Name | Type | Description |
|---|---|---|
| error |
Het foutobject. |
PolicyFragmentContentFormat
Indeling van de inhoud van het beleidsfragment.
| Waarde | Description |
|---|---|
| xml |
De inhoud is inline en het inhoudstype is een XML-document. |
| rawxml |
De inhoud is inline en het inhoudstype is een niet-XML-gecodeerd beleidsdocument. |
PolicyFragmentContract
Contractgegevens van beleidsfragment.
| Name | Type | Default value | Description |
|---|---|---|---|
| id |
string |
Volledig gekwalificeerde resource-id voor de resource. Vb.: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} |
|
| name |
string |
De naam van de resource |
|
| properties.description |
string minLength: 0maxLength: 1000 |
Beschrijving van beleidsfragment. |
|
| properties.format | xml |
Indeling van de inhoud van het beleidsfragment. |
|
| properties.provisioningState |
string |
De inrichtingsstatus |
|
| properties.value |
string |
Inhoud van het beleidsfragment. |
|
| type |
string |
Het type resource. Bijvoorbeeld 'Microsoft.Compute/virtualMachines' of 'Microsoft.Storage/storageAccounts' |