更新用户

 

适用于:Windows Azure Pack

更新用户。

请求

将 <ServiceMgmt> 替换为服务管理 API 终结点地址。 将端口>替换为<租户 API 的 30005 或管理员 API 的 30004。 将端口>替换为租户 API 的 30005,或者将端口替换为<管理员 API 的 30004。 将 UserName> 替换为<要更新的用户的用户名。

方法

请求 URI

HTTP 版本

PUT

<https:// ServiceMgmt>:<Port>/users/<UserName>

HTTP/1.1

URI 参数

无。

请求标头

下表介绍必需的和可选的请求标头。

请求标头

说明

授权:持有者

必需。 授权持有者令牌。

x-ms-principal-id

必需。 主体标识符。

x-ms-client-request-id

可选。 客户端请求标识符。

x-ms-client-session-id

可选。 客户端会话标识符。

x-ms-principal-liveid

可选。 主体 Live 标识符。

请求正文

下表说明了请求正文的元素。

元素名称

说明

用户

用户的新信息。 有关详细信息,请参阅 用户 (Common 对象)

响应

响应包括 HTTP 状态代码、一组响应标头和响应正文。

状态代码

此操作成功后返回状态代码 200(正常)。

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

响应标头

此操作的响应包括标准 HTTP 标头。 所有标准标头都符合 HTTP/1.1 协议规范

响应正文

下表介绍了响应正文中的主要元素:

元素名称

说明

用户

已更新的用户。 有关详细信息,请参阅 用户 (Common 对象)

示例

下面的代码示例演示 了更新用户 请求。

PUT https://<Computer>:30004/users/aaa@bbb.com HTTP/1.1
Authorization: Bearer <Token>
x-ms-client-request-id: 2028eab5-37c8-4e7a-84a9-558e7e33b3df-2013-06-27 21:32:23Z
x-ms-client-session-id: 9ff600b4-0c8b-4110-9eab-4228ce92aa4d
x-ms-principal-id: <COMPUTER>\Administrator
Accept-Language: en-US
x-ms-principal-liveid: <COMPUTER>\Administrator
Content-Type: application/json; charset=utf-8
Host: <Computer>:30004
Content-Length: 346
Expect: 100-continue

{
  "Name": "aaa@bbb.com",
  "Email": "aaa@bbb.com",
  "State": 1,
  "CreatedTime": "2013-06-27T21:15:30.787Z",
  "SubscriptionCount": 1,
  "ActivationSyncState": 0,
  "LastErrorMessage": "One or more errors occurred while contacting the underlying resource providers. The operation may be partially completed. Details: The request to the underlying service has timed out."
}

下面的代码示例演示 了更新用户 响应。

{
  "Name": "aaa@bbb.com",
  "Email": "aaa@bbb.com",
  "State": 1,
  "CreatedTime": "2013-06-27T21:15:30.787",
  "SubscriptionCount": 1,
  "ActivationSyncState": 0,
  "LastErrorMessage": "One or more errors occurred while contacting the underlying resource providers. The operation may be partially completed. Details: The request to the underlying service has timed out."
}

另请参阅

常见用户界面