Api Gateway - Create Or Update
创建或更新 API 管理网关。 这是长时间运行的作,可能需要几分钟才能完成。
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/gateways/{gatewayName}?api-version=2024-05-01
URI 参数
| 名称 | 在 | 必需 | 类型 | 说明 |
|---|---|---|---|---|
|
gateway
|
path | True |
string minLength: 1maxLength: 45 pattern: ^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$ |
API 管理网关的名称。 |
|
resource
|
path | True |
string minLength: 1maxLength: 90 |
资源组的名称。 名称不区分大小写。 |
|
subscription
|
path | True |
string (uuid) |
目标订阅的 ID。 该值必须是 UUID。 |
|
api-version
|
query | True |
string minLength: 1 |
用于此作的 API 版本。 |
请求正文
| 名称 | 必需 | 类型 | 说明 |
|---|---|---|---|
| location | True |
string |
资源位置。 |
| sku | True |
API 管理网关的 SKU 属性。 |
|
| properties.backend |
有关网关应如何与后端系统集成的信息。 |
||
| properties.configurationApi |
有关 API 管理网关的配置 API 的信息。 这仅适用于具有标准 SKU 的 API 网关。 |
||
| properties.frontend |
有关如何公开网关的信息。 |
||
| properties.virtualNetworkType |
需要在其中配置 API 管理网关的 VPN 类型。 |
||
| tags |
object |
资源标记。 |
响应
| 名称 | 类型 | 说明 |
|---|---|---|
| 200 OK |
已成功设置网关。 |
|
| 201 Created |
创建 |
|
| Other Status Codes |
描述作失败的原因的错误响应。 |
安全性
azure_auth
Azure Active Directory OAuth2 Flow。
类型:
oauth2
流向:
implicit
授权 URL:
https://login.microsoftonline.com/common/oauth2/authorize
作用域
| 名称 | 说明 |
|---|---|
| user_impersonation | 模拟用户帐户 |
示例
|
Api |
|
Api |
ApiManagementCreateStandardGateway
示例请求
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/gateways/apimGateway1?api-version=2024-05-01
{
"properties": {
"backend": {
"subnet": {
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vn1/subnets/sn1"
}
}
},
"sku": {
"name": "Standard",
"capacity": 1
},
"location": "South Central US",
"tags": {
"Name": "Contoso",
"Test": "User"
}
}
示例响应
Location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/gateways/apimGateway1/operationresults/ZWFzdHVzOmFuZHktdGVzdGluZy0yMDIyLTA0LTAxLXByZXZpZXctNF9BY3RfODQ2ZWE4Ng==?api-version=2024-05-01&asyncResponse
Azure-AsyncOperation: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/gateways/apimGateway1/operationresults/ZWFzdHVzOmFuZHktdGVzdGluZy0yMDIyLTA0LTAxLXByZXZpZXctNF9BY3RfODQ2ZWE4Ng==?api-version=2024-05-01&asyncResponse
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/gateways/apimGateway1",
"name": "apimGateway1",
"type": "Microsoft.ApiManagement/gateway",
"tags": {
"api-version": "2024-05-01"
},
"location": "East US",
"etag": "AAAAAAAmRAM=",
"properties": {
"provisioningState": "Created",
"targetProvisioningState": "Activating",
"createdAtUtc": "2022-07-11T18:41:01.2506031Z",
"backend": {
"subnet": {
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vn1/subnets/sn1"
}
}
},
"sku": {
"name": "Standard",
"capacity": 1
},
"systemData": {
"createdBy": "user@contoso.com",
"createdByType": "User",
"createdAt": "2022-07-11T18:41:00.9390609Z",
"lastModifiedBy": "user@contoso.com",
"lastModifiedByType": "User",
"lastModifiedAt": "2022-07-11T18:41:00.9390609Z"
}
}
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/gateways/apimGateway1",
"name": "apimGateway1",
"type": "Microsoft.ApiManagement/gateways",
"tags": {
"api-version": "2024-05-01"
},
"location": "East US",
"etag": "AAAAAAAmREI=",
"properties": {
"provisioningState": "Succeeded",
"targetProvisioningState": "",
"createdAtUtc": "2022-07-11T18:41:01.2506031Z",
"frontend": {
"defaultHostname": "apimGateway1.eastus.gateway.azure-api.net"
},
"backend": {
"subnet": {
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vn1/subnets/sn1"
}
},
"configurationApi": {
"hostname": "apimGateway1.eastus.configuration.gateway.azure-api.net"
}
},
"sku": {
"name": "Standard",
"capacity": 1
},
"systemData": {
"createdBy": "user@contoso.com",
"createdByType": "User",
"createdAt": "2022-07-11T18:41:00.9390609Z",
"lastModifiedBy": "user@contoso.com",
"lastModifiedByType": "User",
"lastModifiedAt": "2022-07-11T18:41:00.9390609Z"
}
}
ApiManagementCreateWorkspacePremiumGateway
示例请求
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/gateways/apimGateway1?api-version=2024-05-01
{
"properties": {
"backend": {
"subnet": {
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vn1/subnets/sn1"
}
},
"virtualNetworkType": "External"
},
"sku": {
"name": "WorkspaceGatewayPremium",
"capacity": 1
},
"location": "South Central US",
"tags": {
"Name": "Contoso",
"Test": "User"
}
}
示例响应
Location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/gateways/apimGateway1/operationresults/ZWFzdHVzOmFuZHktdGVzdGluZy0yMDIyLTA0LTAxLXByZXZpZXctNF9BY3RfODQ2ZWE4Ng==?api-version=2024-05-01&asyncResponse
Azure-AsyncOperation: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/gateways/apimGateway1/operationresults/ZWFzdHVzOmFuZHktdGVzdGluZy0yMDIyLTA0LTAxLXByZXZpZXctNF9BY3RfODQ2ZWE4Ng==?api-version=2024-05-01&asyncResponse
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/gateways/apimGateway1",
"name": "apimGateway1",
"type": "Microsoft.ApiManagement/gateway",
"tags": {
"api-version": "2024-05-01"
},
"location": "East US",
"etag": "AAAAAAAmRAM=",
"properties": {
"provisioningState": "Created",
"targetProvisioningState": "Activating",
"createdAtUtc": "2022-07-11T18:41:01.2506031Z",
"backend": {
"subnet": {
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vn1/subnets/sn1"
}
},
"virtualNetworkType": "External"
},
"sku": {
"name": "WorkspaceGatewayPremium",
"capacity": 1
},
"systemData": {
"createdBy": "user@contoso.com",
"createdByType": "User",
"createdAt": "2022-07-11T18:41:00.9390609Z",
"lastModifiedBy": "user@contoso.com",
"lastModifiedByType": "User",
"lastModifiedAt": "2022-07-11T18:41:00.9390609Z"
}
}
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/gateways/apimGateway1",
"name": "apimGateway1",
"type": "Microsoft.ApiManagement/gateways",
"tags": {
"api-version": "2024-05-01"
},
"location": "East US",
"etag": "AAAAAAAmREI=",
"properties": {
"provisioningState": "Succeeded",
"targetProvisioningState": "",
"createdAtUtc": "2022-07-11T18:41:01.2506031Z",
"backend": {
"subnet": {
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vn1/subnets/sn1"
}
},
"virtualNetworkType": "External"
},
"sku": {
"name": "WorkspaceGatewayPremium",
"capacity": 1
},
"systemData": {
"createdBy": "user@contoso.com",
"createdByType": "User",
"createdAt": "2022-07-11T18:41:00.9390609Z",
"lastModifiedBy": "user@contoso.com",
"lastModifiedByType": "User",
"lastModifiedAt": "2022-07-11T18:41:00.9390609Z"
}
}
定义
| 名称 | 说明 |
|---|---|
|
Api |
Sku 的名称。 |
|
Api |
列表或获取响应中的单个 API 管理网关资源。 |
|
Api |
API 管理网关资源 SKU 属性。 |
|
Backend |
有关网关应如何与后端系统集成的信息。 |
|
Backend |
有关如何将网关注入到的子网的信息。 |
|
created |
创建资源的标识的类型。 |
|
Error |
资源管理错误附加信息。 |
|
Error |
错误详细信息。 |
|
Error |
错误响应 |
|
Frontend |
有关如何公开网关的信息。 |
|
Gateway |
有关 API 管理网关的配置 API 的信息。 这仅适用于具有标准 SKU 的 API 网关。 |
|
system |
与创建和上次修改资源相关的元数据。 |
|
Virtual |
需要在其中配置 API 管理网关的 VPN 类型。 |
ApiGatewaySkuType
Sku 的名称。
| 值 | 说明 |
|---|---|
| Standard |
API 网关的标准 SKU。 |
| WorkspaceGatewayStandard |
要用于工作区的 API 网关的标准 SKU。 |
| WorkspaceGatewayPremium |
要用于工作区的 API 网关的高级 SKU。 |
ApiManagementGatewayResource
列表或获取响应中的单个 API 管理网关资源。
| 名称 | 类型 | 说明 |
|---|---|---|
| etag |
string |
资源的 ETag。 |
| id |
string |
资源 ID。 |
| location |
string |
资源位置。 |
| name |
string |
资源名称。 |
| properties.backend |
有关网关应如何与后端系统集成的信息。 |
|
| properties.configurationApi |
有关 API 管理网关的配置 API 的信息。 这仅适用于具有标准 SKU 的 API 网关。 |
|
| properties.createdAtUtc |
string (date-time) |
API 管理网关的创建 UTC 日期。日期符合以下格式:按 ISO 8601 标准指定的 |
| properties.frontend |
有关如何公开网关的信息。 |
|
| properties.provisioningState |
string |
API 管理网关的当前预配状态,可以是下列项之一:Created/Activating/Succeeded/Updateing/Failed/Stopped/Terminating/TerminationFailed/Deleted。 |
| properties.targetProvisioningState |
string |
API 管理网关的预配状态,该网关以在网关上启动的长时间运行作为目标。 |
| properties.virtualNetworkType |
需要在其中配置 API 管理网关的 VPN 类型。 |
|
| sku |
API 管理网关的 SKU 属性。 |
|
| systemData |
与创建和上次修改资源相关的元数据。 |
|
| tags |
object |
资源标记。 |
| type |
string |
API 管理资源的资源类型设置为 Microsoft.ApiManagement。 |
ApiManagementGatewaySkuProperties
API 管理网关资源 SKU 属性。
| 名称 | 类型 | 说明 |
|---|---|---|
| capacity |
integer (int32) |
SKU 的容量(SKU 的已部署单位数) |
| name |
Sku 的名称。 |
BackendConfiguration
有关网关应如何与后端系统集成的信息。
| 名称 | 类型 | 说明 |
|---|---|---|
| subnet |
可以向其发送请求的数据平面网关的默认主机名。 |
BackendSubnetConfiguration
有关如何将网关注入到的子网的信息。
| 名称 | 类型 | 说明 |
|---|---|---|
| id |
string |
在其中托管后端系统的子网的 ARM ID。 |
createdByType
创建资源的标识的类型。
| 值 | 说明 |
|---|---|
| User | |
| Application | |
| ManagedIdentity | |
| Key |
ErrorAdditionalInfo
资源管理错误附加信息。
| 名称 | 类型 | 说明 |
|---|---|---|
| info |
object |
其他信息。 |
| type |
string |
其他信息类型。 |
ErrorDetail
错误详细信息。
| 名称 | 类型 | 说明 |
|---|---|---|
| additionalInfo |
错误附加信息。 |
|
| code |
string |
错误代码。 |
| details |
错误详细信息。 |
|
| message |
string |
错误消息。 |
| target |
string |
错误目标。 |
ErrorResponse
错误响应
| 名称 | 类型 | 说明 |
|---|---|---|
| error |
错误对象。 |
FrontendConfiguration
有关如何公开网关的信息。
| 名称 | 类型 | 说明 |
|---|---|---|
| defaultHostname |
string |
可以向其发送请求的数据平面网关的默认主机名。 这仅适用于具有标准 SKU 的 API 网关。 |
GatewayConfigurationApi
有关 API 管理网关的配置 API 的信息。 这仅适用于具有标准 SKU 的 API 网关。
| 名称 | 类型 | 说明 |
|---|---|---|
| hostname |
string |
代理连接到的主机名将配置传播到云。 |
systemData
与创建和上次修改资源相关的元数据。
| 名称 | 类型 | 说明 |
|---|---|---|
| createdAt |
string (date-time) |
资源创建时间戳(UTC)。 |
| createdBy |
string |
创建资源的标识。 |
| createdByType |
创建资源的标识的类型。 |
|
| lastModifiedAt |
string (date-time) |
上次修改的资源时间戳(UTC) |
| lastModifiedBy |
string |
上次修改资源的标识。 |
| lastModifiedByType |
上次修改资源的标识的类型。 |
VirtualNetworkType
需要在其中配置 API 管理网关的 VPN 类型。
| 值 | 说明 |
|---|---|
| None |
API 管理网关不属于任何虚拟网络。 |
| External |
API 管理网关是虚拟网络的一部分,可从 Internet 访问。 |
| Internal |
API 管理网关是虚拟网络的一部分,只能从虚拟网络内部访问。 |