Microsoft。ApiManagement service/apis/operations 2019-12-01-preview

Bicep リソース定義

サービス/apis/operations リソースの種類は、次を対象とする操作と共にデプロイできます。

  • リソース グループの - リソース グループのデプロイ コマンド 参照

各 API バージョンで変更されたプロパティの一覧については、変更ログの参照してください。

使用例

Bicep サンプル

API Management サービス内に API 操作をデプロイする基本的な例。

param location string = 'westus'
param resourceName string = 'acctest0001'

resource service 'Microsoft.ApiManagement/service@2022-08-01' = {
  name: '${resourceName}-am'
  location: location
  sku: {
    capacity: 0
    name: 'Consumption'
  }
  properties: {
    certificates: []
    customProperties: {
      'Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Ssl30': 'false'
      'Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10': 'false'
      'Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11': 'false'
      'Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10': 'false'
      'Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11': 'false'
    }
    disableGateway: false
    publicNetworkAccess: 'Enabled'
    publisherEmail: 'pub1@email.com'
    publisherName: 'pub1'
    virtualNetworkType: 'None'
  }
}

resource api 'Microsoft.ApiManagement/service/apis@2022-08-01' = {
  name: '${resourceName}-api;rev=1'
  parent: service
  properties: {
    apiRevisionDescription: ''
    apiType: 'http'
    apiVersionDescription: ''
    authenticationSettings: {}
    description: 'What is my purpose? You parse butter.'
    displayName: 'Butter Parser'
    path: 'butter-parser'
    protocols: [
      'http'
      'https'
    ]
    serviceUrl: 'https://example.com/foo/bar'
    subscriptionKeyParameterNames: {
      header: 'X-Butter-Robot-API-Key'
      query: 'location'
    }
    subscriptionRequired: true
    type: 'http'
  }
}

resource operation 'Microsoft.ApiManagement/service/apis/operations@2022-08-01' = {
  name: '${resourceName}-operation'
  parent: api
  properties: {
    description: ''
    displayName: 'DELETE Resource'
    method: 'DELETE'
    responses: []
    templateParameters: []
    urlTemplate: '/resource'
  }
}

Azure 検証済みモジュール

次の Azure 検証済みモジュール を使用して、このリソースの種類をデプロイできます。

Module 形容
API管理サービス - API - 操作 API管理サービス用AVM子モジュール - API - 操作

リソースの形式

Microsoft.ApiManagement/service/apis/operations リソースを作成するには、次の Bicep をテンプレートに追加します。

resource symbolicname 'Microsoft.ApiManagement/service/apis/operations@2019-12-01-preview' = {
  parent: resourceSymbolicName
  name: 'string'
  properties: {
    description: 'string'
    displayName: 'string'
    method: 'string'
    policies: 'string'
    request: {
      description: 'string'
      headers: [
        {
          defaultValue: 'string'
          description: 'string'
          name: 'string'
          required: bool
          type: 'string'
          values: [
            'string'
          ]
        }
      ]
      queryParameters: [
        {
          defaultValue: 'string'
          description: 'string'
          name: 'string'
          required: bool
          type: 'string'
          values: [
            'string'
          ]
        }
      ]
      representations: [
        {
          contentType: 'string'
          formParameters: [
            {
              defaultValue: 'string'
              description: 'string'
              name: 'string'
              required: bool
              type: 'string'
              values: [
                'string'
              ]
            }
          ]
          sample: 'string'
          schemaId: 'string'
          typeName: 'string'
        }
      ]
    }
    responses: [
      {
        description: 'string'
        headers: [
          {
            defaultValue: 'string'
            description: 'string'
            name: 'string'
            required: bool
            type: 'string'
            values: [
              'string'
            ]
          }
        ]
        representations: [
          {
            contentType: 'string'
            formParameters: [
              {
                defaultValue: 'string'
                description: 'string'
                name: 'string'
                required: bool
                type: 'string'
                values: [
                  'string'
                ]
              }
            ]
            sample: 'string'
            schemaId: 'string'
            typeName: 'string'
          }
        ]
        statusCode: int
      }
    ]
    templateParameters: [
      {
        defaultValue: 'string'
        description: 'string'
        name: 'string'
        required: bool
        type: 'string'
        values: [
          'string'
        ]
      }
    ]
    urlTemplate: 'string'
  }
}

プロパティ値

Microsoft.ApiManagement/service/apis/operations

名前 形容 価値
名前 リソース名 糸

制約:
最小長 = 1
最大長 = 80 (必須)
親 Bicep では、子リソースの親リソースを指定できます。 このプロパティを追加する必要があるのは、子リソースが親リソースの外部で宣言されている場合のみです。

詳細については、「親リソースの外部 子リソース」を参照してください。
種類のリソースのシンボリック名: service/apis
プロパティ 操作コントラクトのプロパティ。 OperationContractProperties

OperationContractProperties

名前 形容 価値
形容 操作の説明。 HTML 書式設定タグを含めることができます。 糸

制約:
最大長 = 1000
ディスプレイ名 操作名。 糸

制約:
最小長 = 1
最大長 = 300 (必須)
メソッド 有効な HTTP 操作メソッド。 GET、PUT、POST などの一般的な Http メソッドですが、これらに限定されません。 string (必須)
檄 操作ポリシー 文字列
要求 要求の詳細を含むエンティティ。 RequestContract
応答 操作応答の配列。 ResponseContract[]
templateParameters URL テンプレート パラメーターのコレクション。 ParameterContract[]
urlTemplate この操作のターゲット リソースを識別する相対 URL テンプレート。 パラメーターを含めることができます。 例: /customers/{cid}/orders/{oid}/?date={date} 糸

制約:
最小長 = 1
最大長 = 1000 (必須)

ParameterContract

名前 形容 価値
defaultValue 既定のパラメーター値。 文字列
形容 パラメーターの説明。 文字列
名前 パラメーター名。 string (必須)
必須 パラメーターが必要かどうかを指定します。 ブール (bool)
型 パラメーターの型。 string (必須)
価値観 パラメーター値。 string[]

RepresentationContract

名前 形容 価値
コンテンツタイプ この表現の登録済みコンテンツ タイプまたはカスタム コンテンツ タイプ (application/xml など) を指定します。 string (必須)
formParameters フォーム パラメーターのコレクション。 'contentType' 値が 'application/x-www-form-urlencoded' または 'multipart/form-data' の場合は必須です。 ParameterContract[]
サンプル 表現の例。 文字列
schemaId スキーマ識別子。 'contentType' 値が 'application/x-www-form-urlencoded' でも 'multipart/form-data' でもない場合にのみ適用されます。 文字列
typeName スキーマによって定義される型名。 'contentType' 値が 'application/x-www-form-urlencoded' でも 'multipart/form-data' でもない場合にのみ適用されます。 文字列

RequestContract

名前 形容 価値
形容 操作要求の説明。 文字列
ヘッダー 操作要求ヘッダーのコレクション。 ParameterContract[]
queryParameters 操作要求クエリ パラメーターのコレクション。 ParameterContract[]
表現 操作要求表現のコレクション。 RepresentationContract[]

ResponseContract

名前 形容 価値
形容 操作応答の説明。 文字列
ヘッダー 操作応答ヘッダーのコレクション。 ParameterContract[]
表現 操作応答表現のコレクション。 RepresentationContract[]
statusCode 操作応答 HTTP 状態コード。 int (必須)

ARM テンプレート リソース定義

サービス/apis/operations リソースの種類は、次を対象とする操作と共にデプロイできます。

使用例

リソースの形式

Microsoft.ApiManagement/service/apis/operations リソースを作成するには、次の JSON をテンプレートに追加します。

{
  "type": "Microsoft.ApiManagement/service/apis/operations",
  "apiVersion": "2019-12-01-preview",
  "name": "string",
  "properties": {
    "description": "string",
    "displayName": "string",
    "method": "string",
    "policies": "string",
    "request": {
      "description": "string",
      "headers": [
        {
          "defaultValue": "string",
          "description": "string",
          "name": "string",
          "required": "bool",
          "type": "string",
          "values": [ "string" ]
        }
      ],
      "queryParameters": [
        {
          "defaultValue": "string",
          "description": "string",
          "name": "string",
          "required": "bool",
          "type": "string",
          "values": [ "string" ]
        }
      ],
      "representations": [
        {
          "contentType": "string",
          "formParameters": [
            {
              "defaultValue": "string",
              "description": "string",
              "name": "string",
              "required": "bool",
              "type": "string",
              "values": [ "string" ]
            }
          ],
          "sample": "string",
          "schemaId": "string",
          "typeName": "string"
        }
      ]
    },
    "responses": [
      {
        "description": "string",
        "headers": [
          {
            "defaultValue": "string",
            "description": "string",
            "name": "string",
            "required": "bool",
            "type": "string",
            "values": [ "string" ]
          }
        ],
        "representations": [
          {
            "contentType": "string",
            "formParameters": [
              {
                "defaultValue": "string",
                "description": "string",
                "name": "string",
                "required": "bool",
                "type": "string",
                "values": [ "string" ]
              }
            ],
            "sample": "string",
            "schemaId": "string",
            "typeName": "string"
          }
        ],
        "statusCode": "int"
      }
    ],
    "templateParameters": [
      {
        "defaultValue": "string",
        "description": "string",
        "name": "string",
        "required": "bool",
        "type": "string",
        "values": [ "string" ]
      }
    ],
    "urlTemplate": "string"
  }
}

プロパティ値

Microsoft.ApiManagement/service/apis/operations

名前 形容 価値
apiVersion API のバージョン '2019-12-01-preview'
名前 リソース名 糸

制約:
最小長 = 1
最大長 = 80 (必須)
プロパティ 操作コントラクトのプロパティ。 OperationContractProperties
型 リソースの種類 'Microsoft.ApiManagement/service/apis/operations'

OperationContractProperties

名前 形容 価値
形容 操作の説明。 HTML 書式設定タグを含めることができます。 糸

制約:
最大長 = 1000
ディスプレイ名 操作名。 糸

制約:
最小長 = 1
最大長 = 300 (必須)
メソッド 有効な HTTP 操作メソッド。 GET、PUT、POST などの一般的な Http メソッドですが、これらに限定されません。 string (必須)
檄 操作ポリシー 文字列
要求 要求の詳細を含むエンティティ。 RequestContract
応答 操作応答の配列。 ResponseContract[]
templateParameters URL テンプレート パラメーターのコレクション。 ParameterContract[]
urlTemplate この操作のターゲット リソースを識別する相対 URL テンプレート。 パラメーターを含めることができます。 例: /customers/{cid}/orders/{oid}/?date={date} 糸

制約:
最小長 = 1
最大長 = 1000 (必須)

ParameterContract

名前 形容 価値
defaultValue 既定のパラメーター値。 文字列
形容 パラメーターの説明。 文字列
名前 パラメーター名。 string (必須)
必須 パラメーターが必要かどうかを指定します。 ブール (bool)
型 パラメーターの型。 string (必須)
価値観 パラメーター値。 string[]

RepresentationContract

名前 形容 価値
コンテンツタイプ この表現の登録済みコンテンツ タイプまたはカスタム コンテンツ タイプ (application/xml など) を指定します。 string (必須)
formParameters フォーム パラメーターのコレクション。 'contentType' 値が 'application/x-www-form-urlencoded' または 'multipart/form-data' の場合は必須です。 ParameterContract[]
サンプル 表現の例。 文字列
schemaId スキーマ識別子。 'contentType' 値が 'application/x-www-form-urlencoded' でも 'multipart/form-data' でもない場合にのみ適用されます。 文字列
typeName スキーマによって定義される型名。 'contentType' 値が 'application/x-www-form-urlencoded' でも 'multipart/form-data' でもない場合にのみ適用されます。 文字列

RequestContract

名前 形容 価値
形容 操作要求の説明。 文字列
ヘッダー 操作要求ヘッダーのコレクション。 ParameterContract[]
queryParameters 操作要求クエリ パラメーターのコレクション。 ParameterContract[]
表現 操作要求表現のコレクション。 RepresentationContract[]

ResponseContract

名前 形容 価値
形容 操作応答の説明。 文字列
ヘッダー 操作応答ヘッダーのコレクション。 ParameterContract[]
表現 操作応答表現のコレクション。 RepresentationContract[]
statusCode 操作応答 HTTP 状態コード。 int (必須)

Terraform (AzAPI プロバイダー) リソース定義

サービス/apis/operations リソースの種類は、次を対象とする操作と共にデプロイできます。

  • リソースグループ 各APIバージョンの変更プロパティ一覧については、 変更ログをご覧ください。

使用例

Terraformサンプル

API Management サービス内に API 操作をデプロイする基本的な例。

terraform {
  required_providers {
    azapi = {
      source = "Azure/azapi"
    }
  }
}

variable "resource_name" {
  type    = string
  default = "acctest0001"
}

variable "location" {
  type    = string
  default = "westus"
}

data "azapi_client_config" "current" {}

resource "azapi_resource" "resourceGroup" {
  type     = "Microsoft.Resources/resourceGroups@2020-06-01"
  name     = var.resource_name
  location = var.location
}

resource "azapi_resource" "service" {
  type      = "Microsoft.ApiManagement/service@2022-08-01"
  parent_id = azapi_resource.resourceGroup.id
  name      = "${var.resource_name}-am"
  location  = var.location
  body = {
    properties = {
      certificates = []
      customProperties = {
        "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Ssl30" = "false"
        "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10" = "false"
        "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11" = "false"
        "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10"         = "false"
        "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11"         = "false"
      }
      disableGateway      = false
      publicNetworkAccess = "Enabled"
      publisherEmail      = "pub1@email.com"
      publisherName       = "pub1"
      virtualNetworkType  = "None"
    }
    sku = {
      capacity = 0
      name     = "Consumption"
    }
  }
}

resource "azapi_resource" "api" {
  type      = "Microsoft.ApiManagement/service/apis@2022-08-01"
  parent_id = azapi_resource.service.id
  name      = "${var.resource_name}-api;rev=1"
  body = {
    properties = {
      apiRevisionDescription = ""
      apiType                = "http"
      apiVersionDescription  = ""
      authenticationSettings = {}
      description            = "What is my purpose? You parse butter."
      displayName            = "Butter Parser"
      path                   = "butter-parser"
      protocols              = ["http", "https"]
      serviceUrl             = "https://example.com/foo/bar"
      subscriptionKeyParameterNames = {
        header = "X-Butter-Robot-API-Key"
        query  = "location"
      }
      subscriptionRequired = true
      type                 = "http"
    }
  }
}

resource "azapi_resource" "operation" {
  type      = "Microsoft.ApiManagement/service/apis/operations@2022-08-01"
  parent_id = azapi_resource.api.id
  name      = "${var.resource_name}-operation"
  body = {
    properties = {
      description        = ""
      displayName        = "DELETE Resource"
      method             = "DELETE"
      responses          = []
      templateParameters = []
      urlTemplate        = "/resource"
    }
  }
}

リソースの形式

Microsoft.ApiManagement/service/apis/operations リソースを作成するには、次の Terraform をテンプレートに追加します。

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.ApiManagement/service/apis/operations@2019-12-01-preview"
  name = "string"
  parent_id = "string"
  body = {
    properties = {
      description = "string"
      displayName = "string"
      method = "string"
      policies = "string"
      request = {
        description = "string"
        headers = [
          {
            defaultValue = "string"
            description = "string"
            name = "string"
            required = bool
            type = "string"
            values = [
              "string"
            ]
          }
        ]
        queryParameters = [
          {
            defaultValue = "string"
            description = "string"
            name = "string"
            required = bool
            type = "string"
            values = [
              "string"
            ]
          }
        ]
        representations = [
          {
            contentType = "string"
            formParameters = [
              {
                defaultValue = "string"
                description = "string"
                name = "string"
                required = bool
                type = "string"
                values = [
                  "string"
                ]
              }
            ]
            sample = "string"
            schemaId = "string"
            typeName = "string"
          }
        ]
      }
      responses = [
        {
          description = "string"
          headers = [
            {
              defaultValue = "string"
              description = "string"
              name = "string"
              required = bool
              type = "string"
              values = [
                "string"
              ]
            }
          ]
          representations = [
            {
              contentType = "string"
              formParameters = [
                {
                  defaultValue = "string"
                  description = "string"
                  name = "string"
                  required = bool
                  type = "string"
                  values = [
                    "string"
                  ]
                }
              ]
              sample = "string"
              schemaId = "string"
              typeName = "string"
            }
          ]
          statusCode = int
        }
      ]
      templateParameters = [
        {
          defaultValue = "string"
          description = "string"
          name = "string"
          required = bool
          type = "string"
          values = [
            "string"
          ]
        }
      ]
      urlTemplate = "string"
    }
  }
}

プロパティ値

Microsoft.ApiManagement/service/apis/operations

名前 形容 価値
名前 リソース名 糸

制約:
最小長 = 1
最大長 = 80 (必須)
parent_id このリソースの親であるリソースの ID。 種類のリソースの ID: service/apis
プロパティ 操作コントラクトのプロパティ。 OperationContractProperties
型 リソースの種類 "Microsoft.ApiManagement/service/apis/operations@2019-12-01-preview"

OperationContractProperties

名前 形容 価値
形容 操作の説明。 HTML 書式設定タグを含めることができます。 糸

制約:
最大長 = 1000
ディスプレイ名 操作名。 糸

制約:
最小長 = 1
最大長 = 300 (必須)
メソッド 有効な HTTP 操作メソッド。 GET、PUT、POST などの一般的な Http メソッドですが、これらに限定されません。 string (必須)
檄 操作ポリシー 文字列
要求 要求の詳細を含むエンティティ。 RequestContract
応答 操作応答の配列。 ResponseContract[]
templateParameters URL テンプレート パラメーターのコレクション。 ParameterContract[]
urlTemplate この操作のターゲット リソースを識別する相対 URL テンプレート。 パラメーターを含めることができます。 例: /customers/{cid}/orders/{oid}/?date={date} 糸

制約:
最小長 = 1
最大長 = 1000 (必須)

ParameterContract

名前 形容 価値
defaultValue 既定のパラメーター値。 文字列
形容 パラメーターの説明。 文字列
名前 パラメーター名。 string (必須)
必須 パラメーターが必要かどうかを指定します。 ブール (bool)
型 パラメーターの型。 string (必須)
価値観 パラメーター値。 string[]

RepresentationContract

名前 形容 価値
コンテンツタイプ この表現の登録済みコンテンツ タイプまたはカスタム コンテンツ タイプ (application/xml など) を指定します。 string (必須)
formParameters フォーム パラメーターのコレクション。 'contentType' 値が 'application/x-www-form-urlencoded' または 'multipart/form-data' の場合は必須です。 ParameterContract[]
サンプル 表現の例。 文字列
schemaId スキーマ識別子。 'contentType' 値が 'application/x-www-form-urlencoded' でも 'multipart/form-data' でもない場合にのみ適用されます。 文字列
typeName スキーマによって定義される型名。 'contentType' 値が 'application/x-www-form-urlencoded' でも 'multipart/form-data' でもない場合にのみ適用されます。 文字列

RequestContract

名前 形容 価値
形容 操作要求の説明。 文字列
ヘッダー 操作要求ヘッダーのコレクション。 ParameterContract[]
queryParameters 操作要求クエリ パラメーターのコレクション。 ParameterContract[]
表現 操作要求表現のコレクション。 RepresentationContract[]

ResponseContract

名前 形容 価値
形容 操作応答の説明。 文字列
ヘッダー 操作応答ヘッダーのコレクション。 ParameterContract[]
表現 操作応答表現のコレクション。 RepresentationContract[]
statusCode 操作応答 HTTP 状態コード。 int (必須)