创建资源提供程序

 

适用于:Windows Azure Pack

创建资源提供程序。

请求

将 <ServiceMgmt> 替换为服务管理 API 终结点地址。

方法

请求 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(正常)。

有关状态代码的信息,请参阅“状态”和“错误代码” (Windows Azure Pack 服务管理)

响应标头

此操作的响应包括标准 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": [

  ]
}

另请参阅

管理员资源提供程序接口