调用CreateGatewaySMBUser可以给云存储网关添加一个SMB的用户和密码。
使用该接口时,需要注意如下事项:
- 如果您的存储网关链接AD服务器或者LDAP服务器,该接口会失败,在这种情况下,您可以在AD服务器或LDAP服务器上创建SMB用户。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | CreateGatewaySMBUser |
系统规定参数。取值:CreateGatewaySMBUser。 |
GatewayId | String | 是 | gw-000eg44nmxbsfwbvq2** |
网关ID。 |
Password | String | 是 | 123*** |
SMB密码。密码不能为空,可以是英文、数字或符号:"!","@","#","$","%","^","&","*"。 |
Username | String | 是 | alex |
SMB用户名。长度限制1~32个字符,可以是英文、数字或符号中划线(-),下划线(_)。 |
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
Code | String | 200 |
状态码。状态码为200表示请求成功。 |
Message | String | successful |
请求结果描述。 |
RequestId | String | 9083F167-95B1-4B40-B2CD-70DE068EC3** |
请求ID。 |
Success | Boolean | true |
请求是否成功。 |
TaskId | String | t-000c6hshwukkbtxrb*** |
任务ID。 |
示例
请求示例
http(s)://[Endpoint]/?Action=CreateGatewaySMBUser
&GatewayId=gw-000eg44nmxbsfwbvq2**
&Password=123***
&Username=alex
&<公共请求参数>
正常返回示例
XML
格式
<CreateGatewaySMBUserResponse>
<TaskId>t-000c6hshwukkbtxrb***</TaskId>
<Message>successful</Message>
<RequestId>9083F167-95B1-4B40-B2CD-70DE068EC3**</RequestId>
<Code>200</Code>
<Success>true</Success>
</CreateGatewaySMBUserResponse>
JSON
格式
{
"TaskId": "t-000c6hshwukkbtxrb***",
"Message": "successful",
"RequestId": "9083F167-95B1-4B40-B2CD-70DE068EC3**",
"Code": 200,
"Success": true
}
错误码
HttpCode | 错误码 | 错误信息 | 描述 |
---|---|---|---|
400 | InvalidSMBUserName | You must enter a valid SMB username. | SMB用户名不合法,请输入一个合法值。 |
400 | EmptySMBPassword | You must enter a valid SMB password. | SMB密码不能为空,请输入一个有效值。 |
400 | GatewayNotExist | The specified gateway does not exist. You must specify a valid parameter. | 网关不存在,请确认输入参数是否正确。 |
404 | StorageBundleNotExist | The name you specified for the gateway cluster does not exist. You must specify a valid parameter. | 网关集群不存在,请确认输入参数是否正确。 |
400 | GatewayInOperation | The gateway is processing requests . Try again later. | 网关正在进行操作中,请稍后再试。 |
500 | InternalError | Unexpected error. Try again later. If the error persists after several tries, we recommend that you submit a ticket. | 内部错误,请重试。如果多次尝试失败,请提交工单。 |
400 | EmptySMBUserName | You must enter a valid SMB username. | SMB用户名不能为空,请输入一个有效值。 |
400 | InvalidSMBPassword | The specified SMB password is invalid. You must enter a valid password. | SMB密码不合法,请输入一个合法值。 |
400 | CouldNotCreateSMBUser | The gateway has linked an AD or LDAP service. You cannot create an SMB user on the gateway. We recommend that you create an SMB user in the AD or LDAP service. | 网关已经配置链接了一个AD或LDAP服务,不支持从网关创建一个SMB用户,请在AD或LDAP服务器进行用户操作。 |
访问错误中心查看更多错误码。