This API is used to create a resource group. You can use resource groups to manage resources by service, and view monitoring and alarm information by group to ease O&M.
POST /V1.0/{project_id}/resource-groups
Parameter |
Type |
Mandatory |
Description |
|---|---|---|---|
project_id |
String |
Yes |
Specifies the project ID. For details about how to obtain the project ID, see Obtaining a Project ID. Minimum: 1 Maximum: 64 Regular expression matching: ^[a-zA-Z0-9-]{1,64}$ |
POST https://{Cloud Eye endpoint}/V1.0/{project_id}/resource-groups
Parameter |
Type |
Mandatory |
Description |
|---|---|---|---|
group_name |
String |
Yes |
Specifies the resource group name. Enter 1 to 128 characters. Only letters, digits, underscores (_), and hyphens (-) are allowed. Example: ResourceGroup-Test01 |
resources |
Array of objects |
Yes |
Select one or more resources for the resource group to be created. For details, see Table 3. |
Parameter |
Type |
Mandatory |
Description |
|---|---|---|---|
namespace |
String |
Yes |
Specifies the resource namespace. For example, the ECS namespace is SYS.ECS. To view the namespace of each service, see Services Interconnected with Cloud Eye. |
dimensions |
Array of objects |
Yes |
Specifies one or more resource dimensions. For details, see Table 4. |
Parameter |
Type |
Mandatory |
Description |
|---|---|---|---|
name |
String |
Yes |
Specifies the resource dimension. For example, the ECS dimension is instance_id. To view the dimension of each resource, see Services Interconnected with Cloud Eye. |
value |
String |
Yes |
Specifies the resource dimension value, which is the instance ID. Example: 4270ff17-aba3-4138-89fa-820594c39755 |
{
"group_name" : "Resource-Group-Test01",
"resources" : [ {
"namespace" : "SYS.ECS",
"dimensions" : [ {
"name" : "instance_id",
"value" : "063a83da-a2b5-4630-ab6b-9b4fcfc261ea"
} ]
}, {
"namespace" : "SYS.ECS",
"dimensions" : [ {
"name" : "instance_id",
"value" : "518ace88-abde-46bf-829b-0d1f0f2fb2e9"
} ]
} ]
}
Parameter |
Type |
Description |
|---|---|---|
group_id |
String |
Specifies the resource group ID, for example, rg1603786526428bWbVmk4rP. |
Status code: 201
OK
{
"group_id" : "rg1606377637506DmVOENVyL"
}
Returned Value |
Description |
|---|---|
400 Bad Request |
Request error. |
401 Unauthorized |
The authentication information is not provided or is incorrect. |
403 Forbidden |
Access to the requested page is forbidden. |
408 Request Timeout |
The request timed out. |
429 Too Many Requests |
Concurrent requests are excessive. |
500 Internal Server Error |
Failed to complete the request because of an internal service error. |
503 Service Unavailable |
The service is currently unavailable. |
See Error Codes.