次の方法で共有


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 パラメーター

名前 / 必須 説明
id
path True

string

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

リソース識別子。

resourceGroupName
path True

string

minLength: 1
maxLength: 90

リソース グループの名前。 名前では大文字と小文字が区別されません。

serviceName
path True

string

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

API Management サービスの名前。

subscriptionId
path True

string (uuid)

ターゲット サブスクリプションの ID。 値は UUID である必要があります。

api-version
query True

string

minLength: 1

この操作に使用する API バージョン。

要求ヘッダー

名前 必須 説明
If-Match

string

エンティティの ETag。 エンティティを作成する場合は必要ありませんが、エンティティを更新する場合は必須です。

要求本文

名前 必須 説明
properties.value True

string

ポリシー フラグメントの内容。

properties.description

string

minLength: 0
maxLength: 1000

ポリシー フラグメントの説明。

properties.format

PolicyFragmentContentFormat

ポリシー フラグメント コンテンツの形式。

応答

名前 説明
200 OK

PolicyFragmentContract

ポリシー フラグメントが正常に更新されました。

ヘッダー

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

PolicyFragmentContract

ポリシー フラグメントが正常に作成されました。

ヘッダー

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

ErrorResponse

操作が失敗した理由を説明するエラー応答。

セキュリティ

azure_auth

Azure Active Directory OAuth2 フロー。

型: oauth2
フロー: implicit
Authorization URL (承認 URL): https://login.microsoftonline.com/common/oauth2/authorize

スコープ

名前 説明
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"
  }
}

定義

名前 説明
ErrorAdditionalInfo

リソース管理エラーの追加情報。

ErrorDetail

エラーの詳細。

ErrorResponse

エラー応答

PolicyFragmentContentFormat

ポリシー フラグメント コンテンツの形式。

PolicyFragmentContract

ポリシー フラグメント コントラクトの詳細。

ErrorAdditionalInfo

リソース管理エラーの追加情報。

名前 説明
info

object

追加情報。

type

string

追加情報の種類。

ErrorDetail

エラーの詳細。

名前 説明
additionalInfo

ErrorAdditionalInfo[]

エラーの追加情報。

code

string

エラー コード。

details

ErrorDetail[]

エラーの詳細。

message

string

エラー メッセージ。

target

string

エラーターゲット。

ErrorResponse

エラー応答

名前 説明
error

ErrorDetail

エラー オブジェクト。

PolicyFragmentContentFormat

ポリシー フラグメント コンテンツの形式。

説明
rawxml

コンテンツはインラインで、コンテンツ タイプは XML エンコードされていないポリシー ドキュメントです。

xml

コンテンツはインラインで、コンテンツ タイプは XML ドキュメントです。

PolicyFragmentContract

ポリシー フラグメント コントラクトの詳細。

名前 規定値 説明
id

string

リソースの完全修飾リソース ID。 例 - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}

name

string

リソースの名前

properties.description

string

minLength: 0
maxLength: 1000

ポリシー フラグメントの説明。

properties.format

PolicyFragmentContentFormat

xml

ポリシー フラグメント コンテンツの形式。

properties.provisioningState

string

プロビジョニングの状態

properties.value

string

ポリシー フラグメントの内容。

type

string

リソースの種類。 例: "Microsoft.Compute/virtualMachines" または "Microsoft.Storage/storageAccounts"