共用方式為


建立資源提供者

 

適用于:Windows Azure Pack

建立資源提供者。

要求

以您的服務管理 API 端點位址取代 < ServiceMgmt > 。

方法

要求 URI

HTTP 版本

POST

<HTTPs:// ServiceMgmt > :30004/resourceproviders

HTTP/1.1

URI 參數

無。

要求標頭

下表描述必要的和選用的要求標頭。

要求標頭

描述

授權:持有人

必要。 授權持有人權杖。

x-ms-principal-id

必要。 主體識別碼。

x-ms-client-request-id

選擇性。 用戶端要求識別碼。

x-ms-client-session-id

選擇性。 用戶端會話識別碼。

x-ms-principal-liveid

選擇性。 主體 Live 識別碼。

要求本文

下表說明要求主體的元素。

元素名稱

描述

ResourceProvider

要建立的資源提供者。 如需詳細資訊,請參閱 ResourceProvider (Administrator 物件)

回應

回應包括 HTTP 狀態碼、一組回應標頭和回應主體。

狀態碼

成功的作業會傳回狀態碼 200 (OK)。

如需狀態碼的相關資訊,請參閱狀態和錯誤碼 (Windows Azure Pack Service Management)

回應標頭

此作業的回應包含標準 HTTP 標頭。 所有標準標頭都符合 HTTP/1.1 通訊協定規格

回應本文

下表描述回應主體的重要元素:

元素名稱

描述

ResourceProvider

新的資源提供者。 如需詳細資訊,請參閱 ResourceProvider (Administrator 物件)

範例

下列程式碼範例示範 建立資源提供者 要求。

POST https://<computer>:30004/resourceproviders 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: 1027
Expect: 100-continue

{
  "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": [

  ]
}

下列程式碼範例顯示 建立資源提供者 回應。

{
  "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": "4A941E8A-FEE6-4CA4-A1F1-B3BA30AF49F9",
  "InstanceDisplayName": "Virtual Machine Clouds",
  "MaxQuotaUpdateBatchSize": 1,
  "SubscriptionStatusPollingInterval": "00:00:10",
  "Type": 0,
  "Settings": [

  ]
}

另請參閱

系統管理員資源提供者介面