Workspace Policy Fragment - Create Or Update
Erstellt oder aktualisiert ein Richtlinienfragment.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/policyFragments/{id}?api-version=2024-05-01
URI-Parameter
Name | In | Erforderlich | Typ | Beschreibung |
---|---|---|---|---|
id
|
path | True |
string minLength: 1maxLength: 80 pattern: (^[\w]+$)|(^[\w][\w\-]+[\w]$) |
Ein Ressourcenbezeichner. |
resource
|
path | True |
string minLength: 1maxLength: 90 |
Der Name der Ressourcengruppe. Bei dem Namen wird die Groß-/Kleinschreibung nicht beachtet. |
service
|
path | True |
string minLength: 1maxLength: 50 pattern: ^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$ |
Der Name des API-Verwaltungsdiensts. |
subscription
|
path | True |
string (uuid) |
Die ID des Zielabonnements. Der Wert muss eine UUID sein. |
workspace
|
path | True |
string minLength: 1maxLength: 80 pattern: ^[^*#&+:<>?]+$ |
Arbeitsbereichsbezeichner. Muss in der aktuellen API-Verwaltungsdienstinstanz eindeutig sein. |
api-version
|
query | True |
string minLength: 1 |
Die API-Version, die für diesen Vorgang verwendet werden soll. |
Anforderungsheader
Name | Erforderlich | Typ | Beschreibung |
---|---|---|---|
If-Match |
string |
ETag der Entität. Beim Erstellen einer Entität nicht erforderlich, aber beim Aktualisieren einer Entität erforderlich. |
Anforderungstext
Name | Erforderlich | Typ | Beschreibung |
---|---|---|---|
properties.value | True |
string |
Inhalt des Richtlinienfragments. |
properties.description |
string minLength: 0maxLength: 1000 |
Beschreibung des Richtlinienfragments. |
|
properties.format |
Format des Richtlinienfragmentinhalts. |
Antworten
Name | Typ | Beschreibung |
---|---|---|
200 OK |
Das Richtlinienfragment wurde erfolgreich aktualisiert. Header
|
|
201 Created |
Das Richtlinienfragment wurde erfolgreich erstellt. Header
|
|
Other Status Codes |
Fehlerantwort, die beschreibt, warum der Vorgang fehlgeschlagen ist. |
Sicherheit
azure_auth
Azure Active Directory OAuth2-Fluss.
Typ:
oauth2
Ablauf:
implicit
Autorisierungs-URL:
https://login.microsoftonline.com/common/oauth2/authorize
Bereiche
Name | Beschreibung |
---|---|
user_impersonation | Identitätswechsel ihres Benutzerkontos |
Beispiele
ApiManagementCreateWorkspacePolicyFragment
Beispielanforderung
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/workspaces/wks1/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>"
}
}
Beispiel für eine Antwort
location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/workspaces/wks1/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/workspaces/wks1/policyFragments/policyFragment1",
"type": "Microsoft.ApiManagement/service/workspaces/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/workspaces/wks1/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/workspaces/wks1/policyFragments/policyFragment1",
"type": "Microsoft.ApiManagement/service/workspaces/policyFragments",
"name": "policyFragment1",
"properties": {
"format": "xml",
"description": "A policy fragment example",
"value": "<json-to-xml apply=\"always\" consider-accept-header=\"false\" />",
"provisioningState": "InProgress"
}
}
Definitionen
Name | Beschreibung |
---|---|
Error |
Der Ressourcenverwaltungsfehler zusätzliche Informationen. |
Error |
Das Fehlerdetails. |
Error |
Fehlerantwort |
Policy |
Format des Richtlinienfragmentinhalts. |
Policy |
Details des Richtlinienfragmentvertrags. |
ErrorAdditionalInfo
Der Ressourcenverwaltungsfehler zusätzliche Informationen.
Name | Typ | Beschreibung |
---|---|---|
info |
object |
Die zusätzlichen Informationen. |
type |
string |
Der zusätzliche Informationstyp. |
ErrorDetail
Das Fehlerdetails.
Name | Typ | Beschreibung |
---|---|---|
additionalInfo |
Die zusätzlichen Informationen des Fehlers. |
|
code |
string |
Der Fehlercode. |
details |
Die Fehlerdetails. |
|
message |
string |
Die Fehlermeldung. |
target |
string |
Das Fehlerziel. |
ErrorResponse
Fehlerantwort
Name | Typ | Beschreibung |
---|---|---|
error |
Das Fehlerobjekt. |
PolicyFragmentContentFormat
Format des Richtlinienfragmentinhalts.
Wert | Beschreibung |
---|---|
rawxml |
Der Inhalt ist inline und der Inhaltstyp ist ein nicht XML-codiertes Richtliniendokument. |
xml |
Der Inhalt ist inline und der Inhaltstyp ist ein XML-Dokument. |
PolicyFragmentContract
Details des Richtlinienfragmentvertrags.
Name | Typ | Standardwert | Beschreibung |
---|---|---|---|
id |
string |
Vollqualifizierte Ressourcen-ID für die Ressource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} |
|
name |
string |
Der Name der Ressource |
|
properties.description |
string minLength: 0maxLength: 1000 |
Beschreibung des Richtlinienfragments. |
|
properties.format | xml |
Format des Richtlinienfragmentinhalts. |
|
properties.provisioningState |
string |
Der Bereitstellungsstatus |
|
properties.value |
string |
Inhalt des Richtlinienfragments. |
|
type |
string |
Der Typ der Ressource. Z. B. "Microsoft.Compute/virtualMachines" oder "Microsoft.Storage/storageAccounts" |