Updated on 2022-02-22 GMT+08:00

Modifying DB Instance Specifications

Function

This API is used to modify DB instance specifications.

Services will be interrupted for 5 to 10 minutes when you modify DB instance specifications. Exercise caution when performing this operation.

Constraints

  • The new specifications cannot be the same as the original specifications.
  • Specifications can be modified only when the DB instance status is normal.
  • This API can only be used to modify specifications within the same series.

URI

  • URI format

    POST /v3/{project_id}/instances/{instance_id}/resize

  • Parameter description
    Table 1 Parameter description

    Name

    Mandatory

    Description

    project_id

    Yes

    Specifies the project ID of a tenant in a region.

    instance_id

    Yes

    Specifies the DB instance ID.

Requests

  • Parameter description
    Table 2 Parameter description

    Name

    Mandatory

    Type

    Description

    resize

    Yes

    Object

    Specifies the specification information. For more information, see Table 3.

    Table 3 resize field data structure description

    Name

    Mandatory

    Type

    Description

    target_type

    No

    String

    Specifies the object type:

    • This parameter is mandatory for a cluster instance. When the mongos node specifications are to be modified, the value is mongos. When the shard nodes specifications are to be modified, the value is shard.
    • This parameter is not transferred for replica set instances.

    target_id

    Yes

    String

    Specifies the ID of the DB instance or node whose specifications are to be modified.

    • If the mongos node specifications are to be modified, the value is mongos node ID. If the shard nodes specifications are to be modified, the value is shard node ID.
    • For a replica set instance, the value is the DB instance ID.

    target_spec_code

    Yes

    String

    Specifies the resource specification code of the new specification. For details about how to obtain the value, see the response values of flavors.spec_code in Querying All DB Instance Specifications.

  • Request header
    POST https://DDS endpoint/v3/{project_id}/instances/{instance_id}/resize
  • Example request
    Modify the mongos specifications in a cluster instance.
    {
      "resize": {
        "target_type": "mongos",
        "target_id": "a742c13a284949adad177672e8a0f01cno02",
        "target_spec_code": "dds.c3.large.4.mongos"
      }
    }
    Modify the shard specifications in a cluster instance.
    {
      "resize": {
        "target_type": "shard",
        "target_id": "aeeb40a704904977ad78993d138ec942gr02",
        "target_spec_code": "dds.c3.large.4.shard"
      }
    }
    Modify specifications of a replica set instance.
    {
      "resize": {
        "target_id": "aeeb40a704904977ad78993d138ec942in02",
        "target_spec_code": "dds.c3.medium.4.repset"
      }
    }

Responses

  • Parameter description
    Table 4 Parameter description

    Name

    Type

    Description

    job_id

    String

    Indicates the task ID.

  • Response example
    {
        "job_id": "3711e2ad-5787-49bc-a47f-3f0b066af9f5"
    }

Status Code

For more information, see Status Code.

Error Code

For more information, see Error Code.