Help Center/ Distributed Database Middleware/ API Reference/ APIs (Recommended)/ DDM Instances/ Changing the Security Group of an Instance (a V3 API)
Updated on 2026-05-30 GMT+08:00

Changing the Security Group of an Instance (a V3 API)

Function

This API is used to change the security group of an instance.

Constraints

None

API Calling

For details, see Calling APIs.

Authorization Information

Each account has permissions to call all APIs, but IAM users must have the required permissions specifically assigned.

  • If you are using role/policy-based authorization, see the required permissions in Permissions Policies and Supported Actions.
  • If you are using identity policy-based authorization, the following identity policy-based permissions are required.

    Action

    Access Level

    Resource Type (*: required)

    Condition Key

    Alias

    Dependencies

    ddm:instance:updateSecurityGroup

    Write

    instance *

    • g:EnterpriseProjectId

    • g:ResourceTag/<tag-key>

    ddm:instance:modify

    -

URI

PUT /v3/{project_id}/instances/{instance_id}/security-group

Table 1 URI parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition

Project ID of a tenant in a region.

For details about how to obtain the project ID, see Obtaining a Project ID.

Constraints

N/A

Range

The value contains 32 characters. Only letters and digits are allowed.

Default Value

N/A

instance_id

Yes

String

Definition

Instance ID, which uniquely identifies an instance.

Constraints

N/A

Range

The value contains 36 characters with a suffix of in09. Only letters and digits are allowed.

Default Value

N/A

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition

User token.

Constraints

N/A

Range

N/A

Default Value

N/A

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

security_group_id

Yes

String

Definition

Security group ID

Constraints

N/A

Range

N/A

Default Value

N/A

Example Request

Changing the security group of an instance

PUT https://{endpoint}/v3/619d3e78f61b4be68bc5aa0b59edcf7b/instances/61a4ea66210545909d74a05c27a7179ein09/security-group

{
  "security_group_id" : "035b70ed-319b-4086-9fd7-62a2e8548b2e"
}

Response Parameters

None

Example Response

  • Normal response example
    { }

Status Code

Error Codes

For details, see Error Codes.