Gateway Hostname Configuration - Create Or Update

建立閘道的更新主機名組態。

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

URI 參數

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

string

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

hcId
path True

string

閘道主機名組態標識碼。 在父閘道實體的範圍內必須是唯一的。

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
If-Match

string

實體的 ETag。 建立實體時不需要,但在更新實體時則為必要專案。

要求本文

名稱 類型 Description
properties.certificateId

string

將用於 TLS 連線建立的憑證實體標識碼

properties.hostname

string

主機名值。 支援有效的功能變數名稱、部分或完整通配符

properties.http2Enabled

boolean

指定是否支援 HTTP/2.0

properties.negotiateClientCertificate

boolean

判斷閘道是否要求客戶端憑證

properties.tls10Enabled

boolean

指定是否支援TLS 1.0

properties.tls11Enabled

boolean

指定是否支援TLS 1.1

回應

名稱 類型 Description
200 OK

GatewayHostnameConfigurationContract

已成功更新閘道主機名設定詳細數據。

Headers

ETag: string

201 Created

GatewayHostnameConfigurationContract

已成功建立新的閘道主機名組態。

Headers

ETag: string

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 模擬您的用戶帳戶

範例

ApiManagementCreateGatewayHostnameConfiguration

Sample Request

PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/gateways/gw1/hostnameConfigurations/default?api-version=2022-08-01

{
  "properties": {
    "hostname": "*",
    "certificateId": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/certificates/cert1",
    "negotiateClientCertificate": false,
    "tls10Enabled": false,
    "tls11Enabled": false,
    "http2Enabled": true
  }
}

Sample Response

{
  "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/gateways/gw1/hostnameConfigurations/default",
  "type": "Microsoft.ApiManagement/service/gateways/hostnameConfigurations",
  "name": "default",
  "properties": {
    "hostname": "*",
    "certificateId": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/certificates/cert1",
    "negotiateClientCertificate": false,
    "tls10Enabled": false,
    "tls11Enabled": false,
    "http2Enabled": true
  }
}
{
  "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/gateways/gw1/hostnameConfigurations/default",
  "type": "Microsoft.ApiManagement/service/gateways/hostnameConfigurations",
  "name": "default",
  "properties": {
    "hostname": "*",
    "certificateId": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/certificates/cert1",
    "negotiateClientCertificate": false,
    "tls10Enabled": false,
    "tls11Enabled": false,
    "http2Enabled": true
  }
}

定義

名稱 Description
ErrorFieldContract

錯誤欄位合約。

ErrorResponse

錯誤回應。

GatewayHostnameConfigurationContract

閘道主機名設定詳細數據。

ErrorFieldContract

錯誤欄位合約。

名稱 類型 Description
code

string

屬性層級錯誤碼。

message

string

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

target

string

屬性名稱。

ErrorResponse

錯誤回應。

名稱 類型 Description
error.code

string

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

error.details

ErrorFieldContract[]

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

error.message

string

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

GatewayHostnameConfigurationContract

閘道主機名設定詳細數據。

名稱 類型 Description
id

string

資源的完整資源識別碼。 例如 - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}

name

string

資源的名稱

properties.certificateId

string

將用於 TLS 連線建立的憑證實體標識碼

properties.hostname

string

主機名值。 支援有效的功能變數名稱、部分或完整通配符

properties.http2Enabled

boolean

指定是否支援 HTTP/2.0

properties.negotiateClientCertificate

boolean

判斷閘道是否要求客戶端憑證

properties.tls10Enabled

boolean

指定是否支援TLS 1.0

properties.tls11Enabled

boolean

指定是否支援TLS 1.1

type

string

資源類型。 例如“Microsoft.Compute/virtualMachines” 或 “Microsoft.Storage/storageAccounts”