驗證資源提供者
適用于:Windows Azure Pack
使用指定的資源提供者驗證測試來驗證資源提供者。
要求
以您的服務管理 API 端點位址取代 < ServiceMgmt > 。
方法 |
要求 URI |
HTTP 版本 |
---|---|---|
POST |
<HTTPs:// ServiceMgmt > :30004/resourceproviderverification |
HTTP/1.1 |
URI 參數
無。
要求標頭
下表描述必要的和選用的要求標頭。
要求標頭 |
描述 |
---|---|
授權:持有人 |
必要。 授權持有人權杖。 |
x-ms-principal-id |
必要。 主體識別碼。 |
x-ms-client-request-id |
選擇性。 用戶端要求識別碼。 |
x-ms-client-session-id |
選擇性。 用戶端會話識別碼。 |
x-ms-principal-liveid |
選擇性。 主體 Live 識別碼。 |
要求本文
下表說明要求主體的元素。
元素名稱 |
描述 |
---|---|
ResourceProvider |
要驗證的資源提供者。 |
測試 |
驗證測試的清單。 如需詳細資訊,請參閱 ResourceProviderVerificationTest (Administrator 物件) 。 |
回應
回應包括 HTTP 狀態碼、一組回應標頭和回應主體。
狀態碼
成功的作業會傳回狀態碼 200 (OK)。
如需狀態碼的相關資訊,請參閱狀態和錯誤碼 (Windows Azure Pack Service Management) 。
回應標頭
此作業的回應包括標準 HTTP 標頭。 所有標準標頭都符合 HTTP/1.1 通訊協定規格。
回應本文
下表描述回應主體的重要元素:
元素名稱 |
描述 |
---|---|
HasFailures |
如果 驗證有一或多個失敗,則為 True。 |
DetailedResults |
驗證結果的清單。 如需詳細資訊,請參閱 ResourceProviderVerificationTestResult (Administrator 物件) 。 |
範例
下列程式碼範例顯示 驗證資源提供者 要求。
POST https://<computer>:30004/resourceproviderverification HTTP/1.1
Authorization: Bearer <Token>
x-ms-client-request-id: 99baf1fe-1f90-4a3f-942f-4b88c9cbeed5-2013-07-12 20:30:35Z
x-ms-client-session-id: e29feff7-fa09-483a-b786-a90c62020cef
x-ms-principal-id: %e5%b8%83%e6%b4%be
Accept-Language: en-US
Content-Type: application/json; charset=utf-8
Host: <computer>:30004
Content-Length: 1182
Expect: 100-continue
{
"ResourceProvider": {
"Name": "systemcenter",
"DisplayName": "Virtual Machine Clouds",
"Description": null,
"Enabled": true,
"PassThroughEnabled": true,
"AllowAnonymousAccess": false,
"AllowMultipleInstances": false,
"AdminEndpoint": {
"ForwardingAddress": "https:\/\/spfn-059:8090\/",
"AuthenticationMode": 1,
"AuthenticationUsername": "spfuser",
"AuthenticationPassword": "123Abcde"
},
"TenantEndpoint": {
"ForwardingAddress": "https:\/\/spfn-059:8090\/SC2012R2\/VMM\/",
"AuthenticationMode": 1,
"AuthenticationUsername": "spfuser",
"AuthenticationPassword": "123Abcde",
"SourceUriTemplate": "{subid}\/services\/systemcenter\/vmm\/{*path}",
"TargetUriTemplate": "{subid}\/Microsoft.Management.Odata.svc\/{*path}"
},
"UsageEndpoint": null,
"HealthCheckEndpoint": null,
"NotificationEndpoint": {
"ForwardingAddress": "https:\/\/spfn-059:8090\/provider\/",
"AuthenticationMode": 1,
"AuthenticationUsername": "spfuser",
"AuthenticationPassword": "123Abcde"
},
"InstanceId": null,
"InstanceDisplayName": "Virtual Machine Clouds",
"MaxQuotaUpdateBatchSize": 1,
"SubscriptionStatusPollingInterval": "00:00:10",
"Type": 0,
"Settings": [
]
},
"Tests": [
{
"TestUri": "https:\/\/<computer>:30004\/\/services\/systemcenter\/SC2012R2\/Admin\/Microsoft.Management.Odata.svc\/",
"IsAdmin": true
}
]
}
下列程式碼範例顯示 驗證資源提供者 回應。
{
"HasFailures": false,
"DetailedResults": [
{
"TestUri": "https:\/\/<computer>:30004\/\/services\/systemcenter\/SC2012R2\/Admin\/Microsoft.Management.Odata.svc\/",
"ResponseStatusCode": "OK"
}
]
}