更新使用者
適用于:Windows Azure Pack
更新使用者。
要求
以您的服務管理 API 端點位址取代 < ServiceMgmt > 。 將埠 > 取代 < 為租使用者 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 識別碼。 |
要求本文
下表說明要求主體的元素。
元素名稱 |
描述 |
---|---|
User |
使用者的新資訊。 如需詳細資訊,請參閱 使用者 (Common 物件) 。 |
回應
回應包括 HTTP 狀態碼、一組回應標頭和回應主體。
狀態碼
成功的作業會傳回狀態碼 200 (OK)。
如需狀態碼的相關資訊,請參閱狀態和錯誤碼 (Windows Azure Pack Service Management) 。
回應標頭
此作業的回應包括標準 HTTP 標頭。 所有標準標頭都符合 HTTP/1.1 通訊協定規格。
回應本文
下表描述回應主體的重要元素:
元素名稱 |
描述 |
---|---|
User |
更新的使用者。 如需詳細資訊,請參閱 使用者 (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."
}