All Products
Search
Document Center

Cloud Storage Gateway:SetGatewayADInfo

Last Updated:Aug 04, 2025

Sets or purges the AD server information for a gateway.

Operation description

When you call this operation, note the following:

  • If you want to add an AD server, ensure that the AD server information is valid and the gateway can access the AD server using its DNS. You can call the SetGatewayDNS operation to set the DNS for the Cloud Storage Gateway.

  • If you add AD server information and information for another AD server already exists, the new information overwrites the existing information.

  • To purge the AD server information, set the IsEnabled parameter to false.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that support authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

hcs-sgw:SetGatewayADInfo

update

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

GatewayId

string

Yes

The ID of the gateway.

gw-000eg44nmxbsfwbv****

Username

string

No

The username that is used to connect to the AD server. Valid values:

  • If IsEnabled is set to false, you can leave this parameter empty.

  • If IsEnabled is set to true, this parameter is required.

ale****

Password

string

No

The password that is used to connect to the AD server. Valid values:

  • If IsEnabled is set to false, you can leave this parameter empty.

  • If IsEnabled is set to true, this parameter is required.

12****

ServerIp

string

No

The IP address of the AD server. Valid values:

  • If IsEnabled is set to false, you can leave this parameter empty.

  • If IsEnabled is set to true, this parameter is required. You must enter a valid IP address that consists of digits and periods (.).

12.12.x.x

IsEnabled

boolean

No

Specifies whether to enable the AD server. Valid values:

  • true: enables the AD server.

  • false (default): purges the AD server information.

Important
  • If you want to enable the AD server, all parameters are required.

  • If you want to disable the AD server, you only need to set IsEnabled to false.

true

Response parameters

Parameter

Type

Description

Example

object

TaskId

string

The ID of the task.

t-000c6hshwukkcfn****

Message

string

The message that is returned.

successful

RequestId

string

The ID of the request.

89398CFB-4EB6-4C7E-BB3C-EF213AC8FA**

Code

string

The status code. A status code of 200 indicates that the request was successful.

200

Success

boolean

Indicates whether the request was successful.

true

Examples

Success response

JSON format

{
  "TaskId": "t-000c6hshwukkcfn****",
  "Message": "successful",
  "RequestId": "89398CFB-4EB6-4C7E-BB3C-EF213AC8FA**",
  "Code": "200",
  "Success": true
}

Error codes

HTTP status code

Error code

Error message

Description

400 EmptyADUserName You must enter a valid username. You must enter a valid username.
400 EmptyADPassword You must enter a valid password. You must enter a valid password.
400 InvalidADServerIp The specified IP address for the server is invalid. You must enter a valid IP address. The specified IP address for the server is invalid. You must enter a valid IP address.
400 EmptyGatewayId You must enter a valid ID for the gateway. You must enter a valid ID for the gateway.
400 GatewayNotExist The specified gateway does not exist. You must specify a valid parameter. The specified gateway does not exist. You must specify a valid parameter.
400 GatewayInOperation The gateway is processing requests . Try again later. The gateway is busy. Try again later.
500 InternalError Unexpected error. Try again later. If the error persists after several tries, we recommend that you submit a ticket. Unexpected error. Try again later. If the error persists after several tries, we recommend that you submit a ticket.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.