你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Compute Node - Add User
将用户帐户添加到指定的计算节点。
仅当计算节点处于空闲或正在运行状态时,才能将用户帐户添加到计算节点。
POST {batchUrl}/pools/{poolId}/nodes/{nodeId}/users?api-version=2023-11-01.18.0
POST {batchUrl}/pools/{poolId}/nodes/{nodeId}/users?timeout={timeout}&api-version=2023-11-01.18.0
URI 参数
名称 | 在 | 必需 | 类型 | 说明 |
---|---|---|---|---|
batch
|
path | True |
string |
所有Azure Batch服务请求的基 URL。 |
node
|
path | True |
string |
要在其中创建用户帐户的计算机的 ID。 |
pool
|
path | True |
string |
包含计算节点的池的 ID。 |
api-version
|
query | True |
string |
客户端 API 版本。 |
timeout
|
query |
integer int32 |
服务器可以花费处理请求的最长时间(以秒为单位)。 默认为 30 秒。 |
请求头
Media Types: "application/json; odata=minimalmetadata"
名称 | 必需 | 类型 | 说明 |
---|---|---|---|
client-request-id |
string uuid |
调用方生成的请求标识,采用不带修饰(如大括号)的 GUID 形式,例如 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0。 |
|
return-client-request-id |
boolean |
服务器是否应在响应中返回 client-request-id。 |
|
ocp-date |
string date-time-rfc1123 |
发出请求的时间。 客户端库通常将此设置为当前系统时钟时间;如果直接调用 REST API,请显式设置它。 |
请求正文
Media Types: "application/json; odata=minimalmetadata"
名称 | 必需 | 类型 | 说明 |
---|---|---|---|
name | True |
string |
帐户的用户名。 |
expiryTime |
string |
帐户应过期的时间。 |
|
isAdmin |
boolean |
帐户是否应是计算节点上的管理员。 |
|
password |
string |
帐户的密码。 |
|
sshPublicKey |
string |
可用于远程登录到计算节点的 SSH 公钥。 |
响应
名称 | 类型 | 说明 |
---|---|---|
201 Created |
对 Batch 服务的请求已成功。 Headers
|
|
Other Status Codes |
Batch 服务中的错误。 |
安全性
azure_auth
Microsoft Entra OAuth 2.0 身份验证代码流
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
名称 | 说明 |
---|---|
user_impersonation | 模拟用户帐户 |
Authorization
Type:
apiKey
In:
header
示例
Node add user
Sample Request
POST account.region.batch.azure.com/pools/poolId/nodes/tvm-1695681911_1-20161121t182739z/users?api-version=2023-11-01.18.0
{
"name": "userName",
"isAdmin": false,
"expiryTime": "2017-08-01T00:00:00Z",
"password": "Password"
}
Sample Response
定义
名称 | 说明 |
---|---|
Batch |
从Azure Batch服务收到的错误响应。 |
Batch |
Azure Batch错误响应中包含的其他信息项。 |
Compute |
用于在计算节点上进行 RDP 或 SSH 访问的用户帐户。 |
Error |
Azure Batch错误响应中收到的错误消息。 |
BatchError
从Azure Batch服务收到的错误响应。
名称 | 类型 | 说明 |
---|---|---|
code |
string |
错误的标识符。 代码是固定的,旨在以编程方式使用。 |
message |
描述错误的消息,该消息适用于在用户界面中显示。 |
|
values |
包含有关错误的其他详细信息的键值对的集合。 |
BatchErrorDetail
Azure Batch错误响应中包含的其他信息项。
名称 | 类型 | 说明 |
---|---|---|
key |
string |
指定 Value 属性含义的标识符。 |
value |
string |
错误响应附带的其他信息。 |
ComputeNodeUser
用于在计算节点上进行 RDP 或 SSH 访问的用户帐户。
名称 | 类型 | 说明 |
---|---|---|
expiryTime |
string |
帐户应过期的时间。 |
isAdmin |
boolean |
帐户是否应是计算节点上的管理员。 |
name |
string |
帐户的用户名。 |
password |
string |
帐户的密码。 |
sshPublicKey |
string |
可用于远程登录到计算节点的 SSH 公钥。 |
ErrorMessage
Azure Batch错误响应中收到的错误消息。
名称 | 类型 | 说明 |
---|---|---|
lang |
string |
错误消息的语言代码 |
value |
string |
消息的文本。 |