Updated on 2024-08-02 GMT+08:00

Creating an Instance Group

Function

This API is used to create DDM instances.

Constraints

None

URI

  • URL format

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

  • Parameter description
    Table 1 Path parameters

    Parameter

    Mandatory

    Type

    Description

    project_id

    Yes

    String

    Project ID of a tenant in a region.

    To obtain this value, see Obtaining a Project ID.

    instance_id

    Yes

    String

    DDM instance ID.

Request

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token.

You can obtain the token by calling the IAM API used to obtain a user token.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

name

Yes

String

Name of a DDM instance group, which:

  • Can include 4 to 64 characters.
  • Must start with a letter.
  • Can contain only letters, digits, underscores (_), and hyphens (-).

Minimum characters: 4

Maximum characters: 64

type

Yes

String

Type of the instance group.

rw: read/write group

r: read-only group

flavor_id

Yes

String

Specification ID.

nodes

Yes

Array of Table NodeInfo objects

Node information list.

Minimum value: 1

Maximum value: 32

Table 4 NodeInfo

Parameter

Mandatory

Type

Description

available_zone

Yes

String

AZ where the node is located. The value cannot be empty. For details, see Regions and Endpoints.

subnet_id

Yes

String

Subnet ID.

Example Request

Create a DDM instance group. The group type is read/write and the number of nodes is 1.

POST https://{endpoint}/v3/{project_id}/instances/{instance_id}/groups
{
    "name": "group-1",
    "type": "rw",
    "flavor_id": "a615922f-0ed8-3691-aad4-a595185febba",
     "nodes": [
        {
            "available_zone": "az1", 
            "subnet_id": "ead1e945-ca89-45dd-bcce-4a30b2054c22"
        }
    ]
}

Create a DDM instance group. The group type is read-only and the number of nodes is 1.

POST https://{endpoint}/v3/{project_id}/instances/{instance_id}/groups
{
    "name": "group-2",
    "type": "r",
    "flavor_id": "a615922f-0ed8-3691-aad4-a595185febba",
     "nodes": [
        {
            "available_zone": "az1", 
            "subnet_id": "ead1e945-ca89-45dd-bcce-4a30b2054c22"
        }
    ]
}
Create a DDM instance group. The group type is read/write and the number of nodes is 2.
POST https://{endpoint}/v3/{project_id}/instances/{instance_id}/groups
{
    "name": "group-3",
    "type": "rw",
    "flavor_id": "a615922f-0ed8-3691-aad4-a595185febba",
     "nodes": [
        {
            "available_zone": "az1", 
            "subnet_id": "ead1e945-ca89-45dd-bcce-4a30b2054c22"
        },
        {
            "available_zone": "az2", 
            "subnet_id": "ead1e945-ca89-45dd-bcce-4a30b2054c22"
        }
    ]
}

Response

  • Normal response
    Table 5 Response body parameters

    Parameter

    Type

    Description

    instance_id

    String

    Instance ID.

    job_id

    String

    ID of the job for creating an instance group.

    This parameter is returned only when pay-per-use instances are created.

    order_id

    String

    Order ID. This parameter is returned only when yearly/monthly instances are created.

  • Normal response example
    { 
      "instance_id" : "28e8841d0b9c4f6a9a30742ee60e1055****", 
      "job_id" : "1eb697c0-1842-43a3-8671-f562d038****"
    }
  • Abnormal response

    For details, see Abnormal Request Results.

Status Code

Error Codes

For details, see Error Codes.