Share via


Gateway - Regenerate Key

重新產生指定的閘道金鑰,使使用它建立的任何令牌失效。

POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/regenerateKey?api-version=2022-08-01

URI 參數

名稱 位於 必要 類型 Description
gatewayId
path True

string

閘道實體標識碼。 在目前 API 管理 服務實例中必須是唯一的。 不得有值 'managed'

resourceGroupName
path True

string

資源群組的名稱。 名稱不區分大小寫。

serviceName
path True

string

API 管理 服務的名稱。

Regex pattern: ^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$

subscriptionId
path True

string

目標訂用帳戶的標識碼。

api-version
query True

string

用於此作業的 API 版本。

要求本文

名稱 必要 類型 Description
keyType True

KeyType

正在重新產生金鑰。

回應

名稱 類型 Description
204 No Content

已成功重新產生金鑰

Other Status Codes

ErrorResponse

描述作業失敗原因的錯誤回應。

安全性

azure_auth

Azure Active Directory OAuth2 Flow。

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

名稱 Description
user_impersonation 模擬您的用戶帳戶

範例

ApiManagementGatewayRegenerateKey

Sample Request

POST https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/gateways/gwId/regenerateKey?api-version=2022-08-01

{
  "keyType": "primary"
}

Sample Response

定義

名稱 Description
ErrorFieldContract

錯誤欄位合約。

ErrorResponse

錯誤回應。

GatewayKeyRegenerationRequestContract

閘道金鑰重新產生要求合約屬性。

KeyType

正在重新產生金鑰。

ErrorFieldContract

錯誤欄位合約。

名稱 類型 Description
code

string

屬性層級錯誤碼。

message

string

人類可讀取的屬性層級錯誤表示法。

target

string

屬性名稱。

ErrorResponse

錯誤回應。

名稱 類型 Description
error.code

string

服務定義的錯誤碼。 此代碼會作為回應中指定之 HTTP 錯誤碼的子狀態。

error.details

ErrorFieldContract[]

在驗證錯誤時,要求中傳送的無效欄位清單。

error.message

string

人類可閱讀的錯誤表示法。

GatewayKeyRegenerationRequestContract

閘道金鑰重新產生要求合約屬性。

名稱 類型 Description
keyType

KeyType

正在重新產生金鑰。

KeyType

正在重新產生金鑰。

名稱 類型 Description
primary

string

secondary

string