Workspace Api - Update
更新 API 管理服务实例中工作区的指定 API。
PATCH https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/apis/{apiId}?api-version=2024-05-01
URI 参数
| 名称 | 在 | 必需 | 类型 | 说明 |
|---|---|---|---|---|
|
api
|
path | True |
string minLength: 1maxLength: 256 pattern: ^[^*#&+:<>?]+$ |
API 修订标识符。 当前 API 管理服务实例中必须是唯一的。 非当前修订有;rev=n 作为后缀,其中 n 是修订号。 |
|
resource
|
path | True |
string minLength: 1maxLength: 90 |
资源组的名称。 名称不区分大小写。 |
|
service
|
path | True |
string minLength: 1maxLength: 50 pattern: ^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$ |
API 管理服务的名称。 |
|
subscription
|
path | True |
string (uuid) |
目标订阅的 ID。 该值必须是 UUID。 |
|
workspace
|
path | True |
string minLength: 1maxLength: 80 pattern: ^[^*#&+:<>?]+$ |
工作区标识符。 当前 API 管理服务实例中必须是唯一的。 |
|
api-version
|
query | True |
string minLength: 1 |
用于此作的 API 版本。 |
请求头
| 名称 | 必需 | 类型 | 说明 |
|---|---|---|---|
| If-Match | True |
string |
实体的 ETag。 ETag 应与 GET 请求的标头响应中的当前实体状态匹配,或者它应为 * 进行无条件更新。 |
请求正文
| 名称 | 类型 | 说明 |
|---|---|---|
| properties.apiRevision |
string minLength: 1maxLength: 100 |
描述 API 的修订。 如果未提供任何值,则会创建默认修订版 1 |
| properties.apiRevisionDescription |
string maxLength: 256 |
API 修订的说明。 |
| properties.apiVersion |
string maxLength: 100 |
指示 API 的版本标识符(如果 API 已进行版本控制) |
| properties.apiVersionDescription |
string maxLength: 256 |
API 版本的说明。 |
| properties.apiVersionSetId |
string |
相关 ApiVersionSet 的资源标识符。 |
| properties.authenticationSettings |
此 API 中包含的身份验证设置的集合。 |
|
| properties.contact |
API 的联系信息。 |
|
| properties.description |
string |
API 的说明。 可能包括 HTML 格式标记。 |
| properties.displayName |
string minLength: 1maxLength: 300 |
API 名称。 |
| properties.isCurrent |
boolean |
指示 API 修订是否为当前 API 修订版。 |
| properties.license |
API 的许可证信息。 |
|
| properties.path |
string minLength: 0maxLength: 400 |
相对 URL 唯一标识此 API 及其所有资源路径在 API 管理服务实例中。 它追加到服务实例创建期间指定的 API 终结点基 URL,以形成此 API 的公共 URL。 |
| properties.protocols |
Protocol[] |
描述可以调用此 API 中的作的协议。 |
| properties.serviceUrl |
string minLength: 1maxLength: 2000 |
实现此 API 的后端服务的绝对 URL。 |
| properties.subscriptionKeyParameterNames |
提供 API 的协议。 |
|
| properties.subscriptionRequired |
boolean |
指定访问 API 是否需要 API 或产品订阅。 |
| properties.termsOfServiceUrl |
string |
API 服务条款的 URL。 必须采用 URL 格式。 |
| properties.type |
API 的类型。 |
响应
| 名称 | 类型 | 说明 |
|---|---|---|
| 200 OK |
API 已成功更新。 标头 ETag: string |
|
| Other Status Codes |
描述作失败的原因的错误响应。 |
安全性
azure_auth
Azure Active Directory OAuth2 Flow。
类型:
oauth2
流向:
implicit
授权 URL:
https://login.microsoftonline.com/common/oauth2/authorize
作用域
| 名称 | 说明 |
|---|---|
| user_impersonation | 模拟用户帐户 |
示例
ApiManagementUpdateWorkspaceApi
示例请求
PATCH https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/workspaces/wks1/apis/echo-api?api-version=2024-05-01
{
"properties": {
"displayName": "Echo API New",
"serviceUrl": "http://echoapi.cloudapp.net/api2",
"path": "newecho"
}
}
示例响应
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/workspaces/wks1/apis/echo-api",
"type": "Microsoft.ApiManagement/service/workspaces/pis",
"name": "echo-api",
"properties": {
"displayName": "Echo API New",
"apiRevision": "1",
"serviceUrl": "http://echoapi.cloudapp.net/api2",
"path": "newecho",
"protocols": [
"https"
],
"subscriptionKeyParameterNames": {
"header": "Ocp-Apim-Subscription-Key",
"query": "subscription-key"
},
"isCurrent": true,
"isOnline": true
}
}
定义
| 名称 | 说明 |
|---|---|
|
Api |
API 联系信息 |
|
Api |
API 详细信息。 |
|
Api |
API 许可证信息 |
|
Api |
API 的类型。 |
|
Api |
API 更新合同详细信息。 |
|
Api |
API 版本集包含一组与 API 版本相关的常见配置 |
|
Authentication |
API 身份验证设置。 |
|
bearer |
如何将令牌发送到服务器。 |
|
Error |
资源管理错误附加信息。 |
|
Error |
错误详细信息。 |
|
Error |
错误响应 |
|
OAuth2Authentication |
API OAuth2 身份验证设置详细信息。 |
|
Open |
API OAuth2 身份验证设置详细信息。 |
| Protocol |
描述可以调用此 API 中的作的协议。 |
|
Subscription |
订阅密钥参数名称详细信息。 |
|
versioning |
一个值,该值确定 API 版本标识符将位于 HTTP 请求中的位置。 |
ApiContactInformation
API 联系信息
| 名称 | 类型 | 说明 |
|---|---|---|
|
string |
联系人/组织的电子邮件地址。 必须采用电子邮件地址格式 |
|
| name |
string |
联系人/组织的标识名称 |
| url |
string |
指向联系信息的 URL。 必须采用 URL 格式 |
ApiContract
API 详细信息。
| 名称 | 类型 | 说明 |
|---|---|---|
| id |
string |
资源的完全限定资源 ID。 示例 - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} |
| name |
string |
资源的名称 |
| properties.apiRevision |
string minLength: 1maxLength: 100 |
描述 API 的修订。 如果未提供任何值,则会创建默认修订版 1 |
| properties.apiRevisionDescription |
string maxLength: 256 |
API 修订的说明。 |
| properties.apiVersion |
string maxLength: 100 |
指示 API 的版本标识符(如果 API 已进行版本控制) |
| properties.apiVersionDescription |
string maxLength: 256 |
API 版本的说明。 |
| properties.apiVersionSet |
版本集详细信息 |
|
| properties.apiVersionSetId |
string |
相关 ApiVersionSet 的资源标识符。 |
| properties.authenticationSettings |
此 API 中包含的身份验证设置的集合。 |
|
| properties.contact |
API 的联系信息。 |
|
| properties.description |
string |
API 的说明。 可能包括 HTML 格式标记。 |
| properties.displayName |
string minLength: 1maxLength: 300 |
API 名称。 长度必须为 1 到 300 个字符。 |
| properties.isCurrent |
boolean |
指示 API 修订是否为当前 API 修订版。 |
| properties.isOnline |
boolean |
指示是否可通过网关访问 API 修订。 |
| properties.license |
API 的许可证信息。 |
|
| properties.path |
string minLength: 0maxLength: 400 |
相对 URL 唯一标识此 API 及其所有资源路径在 API 管理服务实例中。 它追加到服务实例创建期间指定的 API 终结点基 URL,以形成此 API 的公共 URL。 |
| properties.protocols |
Protocol[] |
描述可以调用此 API 中的作的协议。 |
| properties.provisioningState |
string |
预配状态 |
| properties.serviceUrl |
string minLength: 0maxLength: 2000 |
实现此 API 的后端服务的绝对 URL。 长度不能超过 2000 个字符。 |
| properties.sourceApiId |
string |
源 API 的 API 标识符。 |
| properties.subscriptionKeyParameterNames |
提供 API 的协议。 |
|
| properties.subscriptionRequired |
boolean |
指定访问 API 是否需要 API 或产品订阅。 |
| properties.termsOfServiceUrl |
string |
API 服务条款的 URL。 必须采用 URL 格式。 |
| properties.type |
API 的类型。 |
|
| type |
string |
资源的类型。 例如“Microsoft.Compute/virtualMachines”或“Microsoft.Storage/storageAccounts” |
ApiLicenseInformation
API 许可证信息
| 名称 | 类型 | 说明 |
|---|---|---|
| name |
string |
用于 API 的许可证名称 |
| url |
string |
用于 API 的许可证的 URL。 必须采用 URL 格式 |
ApiType
API 的类型。
| 值 | 说明 |
|---|---|
| http | |
| soap | |
| websocket | |
| graphql | |
| odata | |
| grpc |
ApiUpdateContract
API 更新合同详细信息。
| 名称 | 类型 | 说明 |
|---|---|---|
| properties.apiRevision |
string minLength: 1maxLength: 100 |
描述 API 的修订。 如果未提供任何值,则会创建默认修订版 1 |
| properties.apiRevisionDescription |
string maxLength: 256 |
API 修订的说明。 |
| properties.apiVersion |
string maxLength: 100 |
指示 API 的版本标识符(如果 API 已进行版本控制) |
| properties.apiVersionDescription |
string maxLength: 256 |
API 版本的说明。 |
| properties.apiVersionSetId |
string |
相关 ApiVersionSet 的资源标识符。 |
| properties.authenticationSettings |
此 API 中包含的身份验证设置的集合。 |
|
| properties.contact |
API 的联系信息。 |
|
| properties.description |
string |
API 的说明。 可能包括 HTML 格式标记。 |
| properties.displayName |
string minLength: 1maxLength: 300 |
API 名称。 |
| properties.isCurrent |
boolean |
指示 API 修订是否为当前 API 修订版。 |
| properties.isOnline |
boolean |
指示是否可通过网关访问 API 修订。 |
| properties.license |
API 的许可证信息。 |
|
| properties.path |
string minLength: 0maxLength: 400 |
相对 URL 唯一标识此 API 及其所有资源路径在 API 管理服务实例中。 它追加到服务实例创建期间指定的 API 终结点基 URL,以形成此 API 的公共 URL。 |
| properties.protocols |
Protocol[] |
描述可以调用此 API 中的作的协议。 |
| properties.serviceUrl |
string minLength: 1maxLength: 2000 |
实现此 API 的后端服务的绝对 URL。 |
| properties.subscriptionKeyParameterNames |
提供 API 的协议。 |
|
| properties.subscriptionRequired |
boolean |
指定访问 API 是否需要 API 或产品订阅。 |
| properties.termsOfServiceUrl |
string |
API 服务条款的 URL。 必须采用 URL 格式。 |
| properties.type |
API 的类型。 |
ApiVersionSetContractDetails
API 版本集包含一组与 API 版本相关的常见配置
| 名称 | 类型 | 说明 |
|---|---|---|
| description |
string |
API 版本集的说明。 |
| id |
string |
现有 API 版本集的标识符。 省略此值以创建新的版本集。 |
| name |
string |
API 版本集的显示名称。 |
| versionHeaderName |
string |
如果 versioningScheme 设置为 |
| versionQueryName |
string |
如果 versioningScheme 设置为 |
| versioningScheme |
一个值,该值确定 API 版本标识符将位于 HTTP 请求中的位置。 |
AuthenticationSettingsContract
API 身份验证设置。
| 名称 | 类型 | 说明 |
|---|---|---|
| oAuth2 |
OAuth2 身份验证设置 |
|
| oAuth2AuthenticationSettings |
包含在此 API 中的 OAuth2 身份验证设置的集合。 |
|
| openid |
OpenID Connect 身份验证设置 |
|
| openidAuthenticationSettings |
此 API 中包含的 Open ID Connect 身份验证设置的集合。 |
bearerTokenSendingMethods
如何将令牌发送到服务器。
| 值 | 说明 |
|---|---|
| authorizationHeader |
使用持有者架构在授权标头中传输访问令牌 |
| query |
访问令牌将作为查询参数传输。 |
ErrorAdditionalInfo
资源管理错误附加信息。
| 名称 | 类型 | 说明 |
|---|---|---|
| info |
object |
其他信息。 |
| type |
string |
其他信息类型。 |
ErrorDetail
错误详细信息。
| 名称 | 类型 | 说明 |
|---|---|---|
| additionalInfo |
错误附加信息。 |
|
| code |
string |
错误代码。 |
| details |
错误详细信息。 |
|
| message |
string |
错误消息。 |
| target |
string |
错误目标。 |
ErrorResponse
错误响应
| 名称 | 类型 | 说明 |
|---|---|---|
| error |
错误对象。 |
OAuth2AuthenticationSettingsContract
API OAuth2 身份验证设置详细信息。
| 名称 | 类型 | 说明 |
|---|---|---|
| authorizationServerId |
string |
OAuth 授权服务器标识符。 |
| scope |
string |
作范围。 |
OpenIdAuthenticationSettingsContract
API OAuth2 身份验证设置详细信息。
| 名称 | 类型 | 说明 |
|---|---|---|
| bearerTokenSendingMethods |
如何将令牌发送到服务器。 |
|
| openidProviderId |
string |
OAuth 授权服务器标识符。 |
Protocol
描述可以调用此 API 中的作的协议。
| 值 | 说明 |
|---|---|
| http | |
| https | |
| ws | |
| wss |
SubscriptionKeyParameterNamesContract
订阅密钥参数名称详细信息。
| 名称 | 类型 | 说明 |
|---|---|---|
| header |
string |
订阅密钥标头名称。 |
| query |
string |
订阅密钥查询字符串参数名称。 |
versioningScheme
一个值,该值确定 API 版本标识符将位于 HTTP 请求中的位置。
| 值 | 说明 |
|---|---|
| Segment |
API 版本在路径段中传递。 |
| Query |
API 版本在查询参数中传递。 |
| Header |
API 版本在 HTTP 标头中传递。 |