Reviewed-by: Gladkov, Maksim <mgladkov@noreply.gitea.eco.tsi-dev.otc-service.com> Co-authored-by: wangdengke2 <wangdengke2@huawei.com> Co-committed-by: wangdengke2 <wangdengke2@huawei.com>
21 KiB
Creating an Instance Group (a V3 API)
Function
This API is used to create a DDM instance group.
Constraints
None
URI
Request Parameters
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
X-Auth-Token |
Yes |
String |
User token. It can be obtained by calling an IAM API. The value of X-Subject-Token in the response header is the user token. |
Content-Type |
Yes |
String |
MIME type of the request body. Value range:
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
name |
Yes |
String |
Name of a DDM instance group, which:
Minimum characters: 4 Maximum characters: 64 |
type |
Yes |
String |
Type of the instance group. rw: read/write group r: read-only group |
flavor_id |
No |
String |
Flavor ID. (Either the flavor ID or flavor code must be specified.) It can be obtained by referring to Querying DDM Node Classes Available in Each AZ (a V3 API). |
flavor_ref |
No |
String |
Flavor code. (Either the flavor ID or flavor code must be specified.) It can be obtained by referring to Querying DDM Node Classes Available in Each AZ (a V3 API). |
nodes |
Yes |
Array of Table NodeInfo objects |
Node information list. Minimum value: 1 Maximum value: 32 |
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://ddm.eu-de.otc.t-systems.com/v3/619d3e78f61b4be68bc5aa0b59edcf7b/instances/1f5c9fd6cd984056ba89c8c87cc03278in09/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/write, the number of nodes is 1, and the flavor code is ddm.large.2.
POST https://ddm.eu-de.otc.t-systems.com/v3/619d3e78f61b4be68bc5aa0b59edcf7b/instances/1f5c9fd6cd984056ba89c8c87cc03278in09/groups
{
"name": "group-1",
"type": "rw",
"flavor_ref": "ddm.large.2",
"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"
}
]
}
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
job_id
String
ID of the job for creating an instance group.
This parameter is returned only when pay-per-use instances are created.
group_id
String
Group ID.
This parameter is returned only for the creation of pay-per-use instances.
- Normal response example
{ "job_id" : "1eb697c0-1842-43a3-8671-f562d038****", "group_id": "b4153b807b1a4f83870bf868fcc4f4ea****" }
- Abnormal response
For details, see Abnormal Request Results.
Status Code
- Normal
- Abnormal
For details, see Status Codes.
Error Codes
For details, see Error Codes.