Workspace Policy Fragment - Get

Lekéri a szabályzatrészletet.

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

URI-paraméterek

Név 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.

workspaceId
path True

string

minLength: 1
maxLength: 80
pattern: ^[^*#&+:<>?]+$

Munkaterület azonosítója. Az aktuális API Management szolgáltatáspéldányban egyedinek kell lennie.

api-version
query True

string

minLength: 1

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

format
query

PolicyFragmentContentFormat

Szabályzattöredék tartalomformátuma.

Válaszok

Név Típus Description
200 OK

PolicyFragmentContract

Sikeresen visszaadott egy szabályzattöredéket.

Fejlécek

ETag: 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

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

Példák

ApiManagementGetWorkspacePolicyFragment
ApiManagementGetWorkspacePolicyFragmentFormat

ApiManagementGetWorkspacePolicyFragment

Mintakérelem

GET 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

Mintaválasz

{
  "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": "<fragment><json-to-xml apply=\"always\" consider-accept-header=\"false\" /></fragment>"
  }
}

ApiManagementGetWorkspacePolicyFragmentFormat

Mintakérelem

GET 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&format=rawxml

Mintaválasz

{
  "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": "rawxml",
    "description": "A policy fragment example",
    "value": "<fragment><set-header name=\"correlationid\" exists-action=\"skip\">\r\n\t\t\t<value>@{\n                var guidBinary = new byte[16];\n                Array.Copy(Guid.NewGuid().ToByteArray(), 0, guidBinary, 0, 10);\n                long time = DateTime.Now.Ticks;\n                byte[] bytes = new byte[6];\n                unchecked\n                {\n                       bytes[5] = (byte)(time >> 40);\n                       bytes[4] = (byte)(time >> 32);\n                       bytes[3] = (byte)(time >> 24);\n                       bytes[2] = (byte)(time >> 16);\n                       bytes[1] = (byte)(time >> 8);\n                       bytes[0] = (byte)(time);\n                }\n                Array.Copy(bytes, 0, guidBinary, 10, 6);\n                return new Guid(guidBinary).ToString();\n            }\n            </value>\r\n\t\t</set-header></fragment>"
  }
}

Definíciók

Név 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.

Név 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.

Név 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

Név 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.

Név 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"