在文件网关添加一个SMB用户。
接口说明
使用该接口时,需要注意如下事项:
- 如果您的存储网关链接 AD 服务器,该接口会失败,在这种情况下,您可以在 AD 服务器上创建 SMB 用户。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
授权信息
下表是API对应的授权信息,可以在RAM权限策略语句的Action
元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:
- 操作:是指具体的权限点。
- 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。
- 资源类型:是指操作中支持授权的资源类型。具体说明如下:
- 对于必选的资源类型,用前面加 * 表示。
- 对于不支持资源级授权的操作,用
全部资源
表示。
- 条件关键字:是指云产品自身定义的条件关键字。
- 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。
操作 | 访问级别 | 资源类型 | 条件关键字 | 关联操作 |
---|---|---|---|---|
hcs-sgw:CreateGatewaySMBUser | create | *全部资源 * |
| 无 |
请求参数
名称 | 类型 | 必填 | 描述 | 示例值 |
---|---|---|---|---|
GatewayId | string | 是 | 网关 ID。 | gw-000eg44nmxbsfwbvq2** |
Username | string | 是 | SMB 用户名。长度限制 1~32 个字符,可以是英文、数字或符号中划线(-),下划线(_)。 | alex |
Password | string | 是 | SMB 密码。密码不能为空,可以是英文、数字或符号:"!","@","#","$","%","^","&","*"。 | 123*** |
返回参数
示例
正常返回示例
JSON
格式
{
"TaskId": "t-000c6hshwukkbtxrb***",
"Message": "successful",
"RequestId": "9083F167-95B1-4B40-B2CD-70DE068EC3**",
"Code": "200",
"Success": true
}
错误码
HTTP status code | 错误码 | 错误信息 | 描述 |
---|---|---|---|
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. | 网关不存在,请确认输入参数是否正确。 |
400 | GatewayInOperation | The gateway is processing requests . Try again later. | 网关正在进行操作中,请稍后再试。 |
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服务,不支持从网关创建一个SMB用户,请在AD服务器进行用户操作。 |
404 | StorageBundleNotExist | The name you specified for the gateway cluster does not exist. You must specify a valid parameter. | 网关集群不存在,请确认输入参数是否正确。 |
500 | InternalError | Unexpected error. Try again later. If the error persists after several tries, we recommend that you submit a ticket. | 内部错误,请重试。如果多次尝试失败,请提交工单。 |
访问错误中心查看更多错误码。
变更历史
变更时间 | 变更内容概要 | 操作 |
---|
暂无变更历史