Policy Fragment - Create Or Update

Szabályzattöredék létrehozása vagy frissítése.

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policyFragments/{id}?api-version=2024-05-01

URI-paraméterek

Name In Kötelező Típus Description
id
path True

string

minLength: 1
maxLength: 80
pattern: (^[\w]+$)|(^[\w][\w\-]+[\w]$)

Erőforrás-azonosító.

resourceGroupName
path True

string

minLength: 1
maxLength: 90

Az erőforráscsoport neve. A név nem megkülönbözteti a kis- és nagybetűket.

serviceName
path True

string

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

Az API Management szolgáltatás neve.

subscriptionId
path True

string (uuid)

A cél-előfizetés azonosítója. Az értéknek UUID-nek kell lennie.

api-version
query True

string

minLength: 1

A művelethez használni kívánt API-verzió.

Kérelem fejléce

Name Kötelező Típus Description
If-Match

string

Az entitás ETagje. Entitás létrehozásakor nem kötelező, de egy entitás frissítésekor kötelező.

Kérelem törzse

Name Kötelező Típus Description
properties.value True

string

A szabályzattöredék tartalma.

properties.description

string

minLength: 0
maxLength: 1000

Szabályzattöredék leírása.

properties.format

PolicyFragmentContentFormat

A szabályzattöredék tartalmának formátuma.

Válaszok

Name Típus Description
200 OK

PolicyFragmentContract

A szabályzattöredék frissítése sikeresen megtörtént.

Fejlécek

  • ETag: string
  • location: string
  • Azure-AsyncOperation: string
201 Created

PolicyFragmentContract

A szabályzattöredék létrehozása sikeresen megtörtént.

Fejlécek

  • ETag: string
  • location: string
  • Azure-AsyncOperation: string
Other Status Codes

ErrorResponse

Hibaválasz, amely leírja, hogy miért nem sikerült a művelet.

Biztonság

azure_auth

Azure Active Directory Oauth2-folyamat.

Típus: oauth2
Folyamat: implicit
Engedélyezési URL: https://login.microsoftonline.com/common/oauth2/authorize

Hatókörök

Name Description
user_impersonation a felhasználói fiók megszemélyesítése

Példák

ApiManagementCreatePolicy

Mintakérelem

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

Mintaválasz

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

Definíciók

Name Description
ErrorAdditionalInfo

Az erőforrás-kezelési hiba további információi.

ErrorDetail

A hiba részletei.

ErrorResponse

Hibaválasz

PolicyFragmentContentFormat

A szabályzattöredék tartalmának formátuma.

PolicyFragmentContract

Szabályzattöredék szerződés részletei.

ErrorAdditionalInfo

Az erőforrás-kezelési hiba további információi.

Name Típus Description
info

object

A további információk.

type

string

A további információtípus.

ErrorDetail

A hiba részletei.

Name Típus Description
additionalInfo

ErrorAdditionalInfo[]

A hiba további információi.

code

string

A hibakód.

details

ErrorDetail[]

A hiba részletei.

message

string

A hibaüzenet.

target

string

A hibacél.

ErrorResponse

Hibaválasz

Name Típus Description
error

ErrorDetail

A hibaobjektum.

PolicyFragmentContentFormat

A szabályzattöredék tartalmának formátuma.

Érték Description
xml

A tartalom beágyazott, a tartalomtípus pedig XML-dokumentum.

rawxml

A tartalom beágyazott, a tartalomtípus pedig nem XML-kódolású szabályzatdokumentum.

PolicyFragmentContract

Szabályzattöredék szerződés részletei.

Name Típus Alapértelmezett érték Description
id

string

Az erőforrás teljes erőforrás-azonosítója. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}

name

string

Az erőforrás neve

properties.description

string

minLength: 0
maxLength: 1000

Szabályzattöredék leírása.

properties.format

PolicyFragmentContentFormat

xml

A szabályzattöredék tartalmának formátuma.

properties.provisioningState

string

A kiépítés állapota

properties.value

string

A szabályzattöredék tartalma.

type

string

Az erőforrás típusa. Pl. "Microsoft.Compute/virtualMachines" vagy "Microsoft.Storage/storageAccounts"