你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Microsoft.ApiManagement service/apis/operations
Bicep 资源定义
服务/apis/operations 资源类型可以使用面向以下对象的操作进行部署:
- 资源组 - 请参阅 资源组部署命令
有关每个 API 版本中已更改属性的列表,请参阅 更改日志。
资源格式
若要创建 Microsoft.ApiManagement/service/apis/operations 资源,请将以下 Bicep 添加到模板。
resource symbolicname 'Microsoft.ApiManagement/service/apis/operations@2023-05-01-preview' = {
name: 'string'
parent: resourceSymbolicName
properties: {
description: 'string'
displayName: 'string'
method: 'string'
policies: 'string'
request: {
description: 'string'
headers: [
{
defaultValue: 'string'
description: 'string'
examples: {
{customized property}: {
description: 'string'
externalValue: 'string'
summary: 'string'
value: any()
}
{customized property}: {
description: 'string'
externalValue: 'string'
summary: 'string'
value: any()
}
}
name: 'string'
required: bool
schemaId: 'string'
type: 'string'
typeName: 'string'
values: [
'string'
]
}
]
queryParameters: [
{
defaultValue: 'string'
description: 'string'
examples: {
{customized property}: {
description: 'string'
externalValue: 'string'
summary: 'string'
value: any()
}
{customized property}: {
description: 'string'
externalValue: 'string'
summary: 'string'
value: any()
}
}
name: 'string'
required: bool
schemaId: 'string'
type: 'string'
typeName: 'string'
values: [
'string'
]
}
]
representations: [
{
contentType: 'string'
examples: {
{customized property}: {
description: 'string'
externalValue: 'string'
summary: 'string'
value: any()
}
{customized property}: {
description: 'string'
externalValue: 'string'
summary: 'string'
value: any()
}
}
formParameters: [
{
defaultValue: 'string'
description: 'string'
examples: {
{customized property}: {
description: 'string'
externalValue: 'string'
summary: 'string'
value: any()
}
{customized property}: {
description: 'string'
externalValue: 'string'
summary: 'string'
value: any()
}
}
name: 'string'
required: bool
schemaId: 'string'
type: 'string'
typeName: 'string'
values: [
'string'
]
}
]
schemaId: 'string'
typeName: 'string'
}
]
}
responses: [
{
description: 'string'
headers: [
{
defaultValue: 'string'
description: 'string'
examples: {
{customized property}: {
description: 'string'
externalValue: 'string'
summary: 'string'
value: any()
}
{customized property}: {
description: 'string'
externalValue: 'string'
summary: 'string'
value: any()
}
}
name: 'string'
required: bool
schemaId: 'string'
type: 'string'
typeName: 'string'
values: [
'string'
]
}
]
representations: [
{
contentType: 'string'
examples: {
{customized property}: {
description: 'string'
externalValue: 'string'
summary: 'string'
value: any()
}
{customized property}: {
description: 'string'
externalValue: 'string'
summary: 'string'
value: any()
}
}
formParameters: [
{
defaultValue: 'string'
description: 'string'
examples: {
{customized property}: {
description: 'string'
externalValue: 'string'
summary: 'string'
value: any()
}
{customized property}: {
description: 'string'
externalValue: 'string'
summary: 'string'
value: any()
}
}
name: 'string'
required: bool
schemaId: 'string'
type: 'string'
typeName: 'string'
values: [
'string'
]
}
]
schemaId: 'string'
typeName: 'string'
}
]
statusCode: int
}
]
templateParameters: [
{
defaultValue: 'string'
description: 'string'
examples: {
{customized property}: {
description: 'string'
externalValue: 'string'
summary: 'string'
value: any()
}
{customized property}: {
description: 'string'
externalValue: 'string'
summary: 'string'
value: any()
}
}
name: 'string'
required: bool
schemaId: 'string'
type: 'string'
typeName: 'string'
values: [
'string'
]
}
]
urlTemplate: 'string'
}
}
属性值
service/apis/operations
名称 | 说明 | 值 |
---|---|---|
name | 资源名称 了解如何在 Bicep 中设置子资源的名称和类型。 |
字符串 (必需) 字符限制:1-80 有效字符: 字母数字和连字符。 以字母开头且以字母数字结尾。 |
父级 (parent) | 在 Bicep 中,可以为子资源指定父资源。 仅当子资源在父资源外部声明时,才需要添加此属性。 有关详细信息,请参阅 父资源之外的子资源。 |
类型为 的资源的符号名称: apis |
properties | 操作协定的属性。 | OperationContractProperties |
OperationContractProperties
名称 | 说明 | 值 |
---|---|---|
description | 操作说明。 可以包含 HTML 格式标记。 | 字符串 |
displayName | 操作名称。 | 字符串 (必需) |
method | 有效的 HTTP 操作方法。 典型的 Http 方法(如 GET、PUT、POST),但不仅限于它们。 | 字符串 (必需) |
策略 | 操作策略 | 字符串 |
request | 一个实体,包含请求详细信息。 | RequestContract |
responses | 操作响应的数组。 | ResponseContract[] |
templateParameters | URL 模板参数的集合。 | ParameterContract[] |
urlTemplate | 相对 URL 模板,标识此操作的目标资源。 可以包括参数。 示例:/customers/{cid}/orders/{oid}/?date={date} | 字符串 (必需) |
RequestContract
名称 | 说明 | 值 |
---|---|---|
description | 操作请求说明。 | 字符串 |
headers | 操作请求标头的集合。 | ParameterContract[] |
queryParameters | 操作请求查询参数的集合。 | ParameterContract[] |
representations | 操作请求表示形式的集合。 | RepresentationContract[] |
ParameterContract
名称 | 说明 | 值 |
---|---|---|
defaultValue | 默认参数值。 | 字符串 |
description | 参数说明。 | 字符串 |
示例 | 为 参数定义的示例。 | ParameterExamplesContract |
name | 参数名称。 | 字符串 (必需) |
必需 | 指定参数是否为必需。 | bool |
schemaId | 架构标识符。 | 字符串 |
type | 参数类型。 | 字符串 (必需) |
typeName | 由架构定义的类型名称。 | 字符串 |
值 | 参数值。 | string[] |
ParameterExamplesContract
名称 | 说明 | 值 |
---|---|---|
{customized property} | ParameterExampleContract | |
{customized property} | ParameterExampleContract |
ParameterExampleContract
名称 | 说明 | 值 |
---|---|---|
description | 示例的长说明 | 字符串 |
externalValue | 指向文本示例的 URL | 字符串 |
摘要 | 示例的简短说明 | string |
value | 示例值。 可以是基元值,也可以是 对象。 | 对于 Bicep,可以使用 any () 函数。 |
RepresentationContract
名称 | 说明 | 值 |
---|---|---|
contentType | 指定此表示形式的已注册或自定义内容类型,例如 application/xml。 | 字符串 (必需) |
示例 | 为表示形式定义的示例。 | ParameterExamplesContract |
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”时适用。 | 字符串 |
ResponseContract
名称 | 说明 | 值 |
---|---|---|
description | 操作响应说明。 | 字符串 |
headers | 操作响应标头的集合。 | ParameterContract[] |
representations | 操作响应表示形式的集合。 | RepresentationContract[] |
statusCode | 操作响应 HTTP 状态代码。 | int (必需) |
ARM 模板资源定义
服务/apis/operations 资源类型可以使用目标操作进行部署:
- 资源组 - 请参阅 资源组部署命令
有关每个 API 版本中更改的属性的列表,请参阅 更改日志。
资源格式
若要创建 Microsoft.ApiManagement/service/apis/operations 资源,请将以下 JSON 添加到模板。
{
"type": "Microsoft.ApiManagement/service/apis/operations",
"apiVersion": "2023-05-01-preview",
"name": "string",
"properties": {
"description": "string",
"displayName": "string",
"method": "string",
"policies": "string",
"request": {
"description": "string",
"headers": [
{
"defaultValue": "string",
"description": "string",
"examples": {
"{customized property}": {
"description": "string",
"externalValue": "string",
"summary": "string",
"value": {}
},
"{customized property}": {
"description": "string",
"externalValue": "string",
"summary": "string",
"value": {}
}
},
"name": "string",
"required": "bool",
"schemaId": "string",
"type": "string",
"typeName": "string",
"values": [ "string" ]
}
],
"queryParameters": [
{
"defaultValue": "string",
"description": "string",
"examples": {
"{customized property}": {
"description": "string",
"externalValue": "string",
"summary": "string",
"value": {}
},
"{customized property}": {
"description": "string",
"externalValue": "string",
"summary": "string",
"value": {}
}
},
"name": "string",
"required": "bool",
"schemaId": "string",
"type": "string",
"typeName": "string",
"values": [ "string" ]
}
],
"representations": [
{
"contentType": "string",
"examples": {
"{customized property}": {
"description": "string",
"externalValue": "string",
"summary": "string",
"value": {}
},
"{customized property}": {
"description": "string",
"externalValue": "string",
"summary": "string",
"value": {}
}
},
"formParameters": [
{
"defaultValue": "string",
"description": "string",
"examples": {
"{customized property}": {
"description": "string",
"externalValue": "string",
"summary": "string",
"value": {}
},
"{customized property}": {
"description": "string",
"externalValue": "string",
"summary": "string",
"value": {}
}
},
"name": "string",
"required": "bool",
"schemaId": "string",
"type": "string",
"typeName": "string",
"values": [ "string" ]
}
],
"schemaId": "string",
"typeName": "string"
}
]
},
"responses": [
{
"description": "string",
"headers": [
{
"defaultValue": "string",
"description": "string",
"examples": {
"{customized property}": {
"description": "string",
"externalValue": "string",
"summary": "string",
"value": {}
},
"{customized property}": {
"description": "string",
"externalValue": "string",
"summary": "string",
"value": {}
}
},
"name": "string",
"required": "bool",
"schemaId": "string",
"type": "string",
"typeName": "string",
"values": [ "string" ]
}
],
"representations": [
{
"contentType": "string",
"examples": {
"{customized property}": {
"description": "string",
"externalValue": "string",
"summary": "string",
"value": {}
},
"{customized property}": {
"description": "string",
"externalValue": "string",
"summary": "string",
"value": {}
}
},
"formParameters": [
{
"defaultValue": "string",
"description": "string",
"examples": {
"{customized property}": {
"description": "string",
"externalValue": "string",
"summary": "string",
"value": {}
},
"{customized property}": {
"description": "string",
"externalValue": "string",
"summary": "string",
"value": {}
}
},
"name": "string",
"required": "bool",
"schemaId": "string",
"type": "string",
"typeName": "string",
"values": [ "string" ]
}
],
"schemaId": "string",
"typeName": "string"
}
],
"statusCode": "int"
}
],
"templateParameters": [
{
"defaultValue": "string",
"description": "string",
"examples": {
"{customized property}": {
"description": "string",
"externalValue": "string",
"summary": "string",
"value": {}
},
"{customized property}": {
"description": "string",
"externalValue": "string",
"summary": "string",
"value": {}
}
},
"name": "string",
"required": "bool",
"schemaId": "string",
"type": "string",
"typeName": "string",
"values": [ "string" ]
}
],
"urlTemplate": "string"
}
}
属性值
service/apis/operations
名称 | 说明 | Value |
---|---|---|
type | 资源类型 | “Microsoft.ApiManagement/service/apis/operations” |
apiVersion | 资源 API 版本 | “2023-05-01-preview” |
name | 资源名称 了解如何在 JSON ARM 模板中设置子资源的名称和类型。 |
字符串 (必需) 字符限制:1-80 有效字符: 字母数字和连字符。 以字母开头且以字母数字结尾。 |
properties | 操作协定的属性。 | OperationContractProperties |
OperationContractProperties
名称 | 说明 | 值 |
---|---|---|
description | 操作说明。 可以包含 HTML 格式标记。 | 字符串 |
displayName | 操作名称。 | 字符串 (必需) |
method | 有效的 HTTP 操作方法。 典型的 Http 方法(如 GET、PUT、POST),但不仅限于它们。 | 字符串 (必需) |
策略 | 操作策略 | 字符串 |
request | 一个实体,包含请求详细信息。 | RequestContract |
responses | 操作响应的数组。 | ResponseContract[] |
templateParameters | URL 模板参数的集合。 | ParameterContract[] |
urlTemplate | 相对 URL 模板,标识此操作的目标资源。 可以包括参数。 示例:/customers/{cid}/orders/{oid}/?date={date} | 字符串 (必需) |
RequestContract
名称 | 说明 | 值 |
---|---|---|
description | 操作请求说明。 | 字符串 |
headers | 操作请求标头的集合。 | ParameterContract[] |
queryParameters | 操作请求查询参数的集合。 | ParameterContract[] |
representations | 操作请求表示形式的集合。 | RepresentationContract[] |
ParameterContract
名称 | 说明 | 值 |
---|---|---|
defaultValue | 默认参数值。 | 字符串 |
description | 参数说明。 | 字符串 |
示例 | 为 参数定义的示例。 | ParameterExamplesContract |
name | 参数名称。 | 字符串 (必需) |
必需 | 指定参数是否为必需。 | bool |
schemaId | 架构标识符。 | 字符串 |
type | 参数类型。 | 字符串 (必需) |
typeName | 由架构定义的类型名称。 | 字符串 |
值 | 参数值。 | string[] |
ParameterExamplesContract
名称 | 说明 | 值 |
---|---|---|
{customized property} | ParameterExampleContract | |
{customized property} | ParameterExampleContract |
ParameterExampleContract
名称 | 说明 | 值 |
---|---|---|
description | 示例的长说明 | 字符串 |
externalValue | 指向文本示例的 URL | 字符串 |
摘要 | 示例的简短说明 | string |
value | 示例值。 可以是基元值,也可以是 对象。 |
RepresentationContract
名称 | 说明 | 值 |
---|---|---|
contentType | 指定此表示形式的已注册或自定义内容类型,例如 application/xml。 | 字符串 (必需) |
示例 | 为表示形式定义的示例。 | ParameterExamplesContract |
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”时适用。 | 字符串 |
ResponseContract
名称 | 说明 | 值 |
---|---|---|
description | 操作响应说明。 | 字符串 |
headers | 操作响应标头的集合。 | ParameterContract[] |
representations | 操作响应表示形式的集合。 | RepresentationContract[] |
statusCode | 操作响应 HTTP 状态代码。 | int (必需) |
Terraform (AzAPI 提供程序) 资源定义
服务/apis/operations 资源类型可以使用目标操作进行部署:
- 资源组
有关每个 API 版本中更改的属性的列表,请参阅 更改日志。
资源格式
若要创建 Microsoft.ApiManagement/service/apis/operations 资源,请将以下 Terraform 添加到模板。
resource "azapi_resource" "symbolicname" {
type = "Microsoft.ApiManagement/service/apis/operations@2023-05-01-preview"
name = "string"
parent_id = "string"
body = jsonencode({
properties = {
description = "string"
displayName = "string"
method = "string"
policies = "string"
request = {
description = "string"
headers = [
{
defaultValue = "string"
description = "string"
examples = {
{customized property} = {
description = "string"
externalValue = "string"
summary = "string"
}
{customized property} = {
description = "string"
externalValue = "string"
summary = "string"
}
}
name = "string"
required = bool
schemaId = "string"
type = "string"
typeName = "string"
values = [
"string"
]
}
]
queryParameters = [
{
defaultValue = "string"
description = "string"
examples = {
{customized property} = {
description = "string"
externalValue = "string"
summary = "string"
}
{customized property} = {
description = "string"
externalValue = "string"
summary = "string"
}
}
name = "string"
required = bool
schemaId = "string"
type = "string"
typeName = "string"
values = [
"string"
]
}
]
representations = [
{
contentType = "string"
examples = {
{customized property} = {
description = "string"
externalValue = "string"
summary = "string"
}
{customized property} = {
description = "string"
externalValue = "string"
summary = "string"
}
}
formParameters = [
{
defaultValue = "string"
description = "string"
examples = {
{customized property} = {
description = "string"
externalValue = "string"
summary = "string"
}
{customized property} = {
description = "string"
externalValue = "string"
summary = "string"
}
}
name = "string"
required = bool
schemaId = "string"
type = "string"
typeName = "string"
values = [
"string"
]
}
]
schemaId = "string"
typeName = "string"
}
]
}
responses = [
{
description = "string"
headers = [
{
defaultValue = "string"
description = "string"
examples = {
{customized property} = {
description = "string"
externalValue = "string"
summary = "string"
}
{customized property} = {
description = "string"
externalValue = "string"
summary = "string"
}
}
name = "string"
required = bool
schemaId = "string"
type = "string"
typeName = "string"
values = [
"string"
]
}
]
representations = [
{
contentType = "string"
examples = {
{customized property} = {
description = "string"
externalValue = "string"
summary = "string"
}
{customized property} = {
description = "string"
externalValue = "string"
summary = "string"
}
}
formParameters = [
{
defaultValue = "string"
description = "string"
examples = {
{customized property} = {
description = "string"
externalValue = "string"
summary = "string"
}
{customized property} = {
description = "string"
externalValue = "string"
summary = "string"
}
}
name = "string"
required = bool
schemaId = "string"
type = "string"
typeName = "string"
values = [
"string"
]
}
]
schemaId = "string"
typeName = "string"
}
]
statusCode = int
}
]
templateParameters = [
{
defaultValue = "string"
description = "string"
examples = {
{customized property} = {
description = "string"
externalValue = "string"
summary = "string"
}
{customized property} = {
description = "string"
externalValue = "string"
summary = "string"
}
}
name = "string"
required = bool
schemaId = "string"
type = "string"
typeName = "string"
values = [
"string"
]
}
]
urlTemplate = "string"
}
})
}
属性值
service/apis/operations
名称 | 说明 | Value |
---|---|---|
type | 资源类型 | “Microsoft.ApiManagement/service/apis/operations@2023-05-01-preview” |
name | 资源名称 | 字符串 (必需) 字符限制:1-80 有效字符: 字母数字和连字符。 以字母开头且以字母数字结尾。 |
parent_id | 此资源的父资源 ID。 | 类型为资源的 ID: api |
properties | 操作协定的属性。 | OperationContractProperties |
OperationContractProperties
名称 | 说明 | 值 |
---|---|---|
description | 操作说明。 可以包含 HTML 格式标记。 | 字符串 |
displayName | 操作名称。 | 字符串 (必需) |
method | 有效的 HTTP 操作方法。 典型的 Http 方法(如 GET、PUT、POST),但不仅限于它们。 | 字符串 (必需) |
策略 | 操作策略 | 字符串 |
request | 一个实体,包含请求详细信息。 | RequestContract |
responses | 操作响应数组。 | ResponseContract[] |
templateParameters | URL 模板参数的集合。 | ParameterContract[] |
urlTemplate | 相对 URL 模板,标识此操作的目标资源。 可以包括参数。 示例:/customers/{cid}/orders/{oid}/?date={date} | 字符串 (必需) |
RequestContract
名称 | 说明 | 值 |
---|---|---|
description | 操作请求说明。 | 字符串 |
headers | 操作请求标头的集合。 | ParameterContract[] |
queryParameters | 操作请求查询参数的集合。 | ParameterContract[] |
representations | 操作请求表示形式的集合。 | RepresentationContract[] |
ParameterContract
名称 | 说明 | 值 |
---|---|---|
defaultValue | 默认参数值。 | 字符串 |
description | 参数说明。 | 字符串 |
示例 | 为 参数定义的示例。 | ParameterExamplesContract |
name | 参数名称。 | 字符串 (必需) |
必需 | 指定参数是否为必需。 | bool |
schemaId | 架构标识符。 | 字符串 |
type | 参数类型。 | 字符串 (必需) |
typeName | 由架构定义的类型名称。 | 字符串 |
值 | 参数值。 | string[] |
ParameterExamplesContract
名称 | 说明 | 值 |
---|---|---|
{customized property} | ParameterExampleContract | |
{customized property} | ParameterExampleContract |
ParameterExampleContract
名称 | 说明 | 值 |
---|---|---|
description | 示例的长说明 | 字符串 |
externalValue | 指向文本示例的 URL | 字符串 |
摘要 | 示例的简短说明 | string |
value | 示例值。 可以是基元值,也可以是 对象。 |
RepresentationContract
名称 | 说明 | 值 |
---|---|---|
contentType | 指定此表示形式的已注册或自定义内容类型,例如 application/xml。 | 字符串 (必需) |
示例 | 为表示形式定义的示例。 | ParameterExamplesContract |
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”时适用。 | 字符串 |
ResponseContract
名称 | 说明 | 值 |
---|---|---|
description | 操作响应说明。 | 字符串 |
headers | 操作响应标头的集合。 | ParameterContract[] |
representations | 操作响应表示形式的集合。 | RepresentationContract[] |
statusCode | 操作响应 HTTP 状态代码。 | int (必需) |
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈