Adds an SMB user and password to a gateway.

When you call the operation, take note of the following information:

  • If you configure Active Directory (AD) or Lightweight Directory Access Protocol (LDAP) for the gateway, the API call may fail. In this case, you can create an SMB user on the AD server or the LDAP server.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes CreateGatewaySMBUser

The operation that you want to perform. Set the value to CreateGatewaySMBUser.

GatewayId String Yes gw-000eg44nmxbsfwbvq2**

The ID of the gateway.

Password String Yes 123***

The password of the SMB user. The password cannot be empty. It can contain letters, digits, and the following characters: !, @, #, $, %, ^, &, and *.

Username String Yes alex

The name of the SMB user. The name must be 1 to 32 characters in length and can contain letters, digits, hyphens (-), and underscores (_).

Response parameters

Parameter Type Example Description
Code String 200

The HTTP status code. If the request is successful, 200 is returned.

Message String successful

The description of the status code.

RequestId String 9083F167-95B1-4B40-B2CD-70DE068EC3**

The ID of the request.

Success Boolean true

Indicates whether the request is successful.

TaskId String t-000c6hshwukkbtxrb***

The ID of the task.

Examples

Sample requests

http(s)://[Endpoint]/?Action=CreateGatewaySMBUser
&GatewayId=gw-000eg44nmxbsfwbvq2**
&Password=123***
&Username=alex
&<Common request parameters>

Sample success responses

XML format

<CreateGatewaySMBUserResponse>
      <TaskId>t-000c6hshwukkbtxrb***</TaskId>
      <Message>successful</Message>
      <RequestId>9083F167-95B1-4B40-B2CD-70DE068EC3**</RequestId>
      <Code>200</Code>
      <Success>true</Success>
</CreateGatewaySMBUserResponse>

JSON format

{
    "TaskId": "t-000c6hshwukkbtxrb***",
    "Message": "successful",
    "RequestId": "9083F167-95B1-4B40-B2CD-70DE068EC3**",
    "Code": 200,
    "Success": true
}

Error codes

HttpCode Error code Error message Description
400 InvalidSMBUserName You must enter a valid SMB username. The error message returned because the name of the SMB user is invalid.
400 EmptySMBPassword You must enter a valid SMB password. The error message returned because the password of the SMB user is not specified.
400 GatewayNotExist The specified gateway does not exist. You must specify a valid parameter. The error message returned because the specified gateway does not exist. Check whether the parameters are valid.
404 StorageBundleNotExist The name you specified for the gateway cluster does not exist. You must specify a valid parameter. The error message returned because the specified gateway cluster does not exist. Check whether the parameters are valid.
400 GatewayInOperation The gateway is processing requests . Try again later. The error message returned because another operation is in progress. Try again later.
500 InternalError Unexpected error. Try again later. If the error persists after several tries, we recommend that you submit a ticket. The error message returned because an internal error has occurred. Try again later. If the problem persists, submit a ticket.
400 EmptySMBUserName You must enter a valid SMB username. The error message returned because the name of the SMB user is not specified.
400 InvalidSMBPassword The specified SMB password is invalid. You must enter a valid password. The error message returned because the password of the SMB user is invalid.
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. The error message returned because AD or LDAP is configured for the gateway. Create an SMB user on the AD server or the LDAP server.

For a list of error codes, visit the API Error Center.