Description
You can call this operation to add IDC information.
Call description
Prerequisite
You have the HOST_MANAGER permissions.
Request path
POST /api/v2/compute/idcs
Request parameters
| Parameter | Type | Required | Example value | Description |
|---|---|---|---|---|
| name | String | Yes | idc-bj | The name of the IDC. |
| description | String | No | The Beijing IDC. | The description of the IDC. |
| regionId | Long | Yes | 100 | The ID of the region. |
Response parameters
| Parameter | Type | Description |
|---|---|---|
| data | Object | The requested IDC data. |
| successful | Boolean | Indicates whether the request was successful. |
| timestamp | Datetime | The timestamp when the server completed the request. |
| duration | Integer | The time taken by the server to process the request, in milliseconds. |
| status | Integer | An HTTP status code. |
| traceId | String | The trace ID of the request. This trace ID is used for troubleshooting. |
| server | String | The address of the application server that responded to the request. |
Data structure of the IDC information
| Parameter | Type | Description |
|---|---|---|
| id | Integer | The ID of the region. |
| name | String | The name of the region. |
| description | String | The description of the region. |
| regionId | Integer | The ID of the region associated with the IDC. |
| regionName | String | The name of the region associated with the IDC. |
| createTime | String | The time when the IDC was created. |
| updateTime | String | The time when the IDC was modified. |
Examples
Sample request
POST /api/v2/compute/idcs
curl --user <username>:<password> -X POST 'http://<IP>:<PORT>/api/v2/compute/idcs' \
-H 'Content-Type: application/json' \
--data-raw '{"name":"idc-bj","description":"The Beijing IDC.","regionId":100}'
Sample response
{
"data": {
"createTime": "2021-07-22T20:04:15+08:00",
"description": null,
"id": 1000002,
"name": "test-idc",
"regionId": 1000002,
"regionName": "testregion",
"updateTime": "2021-07-22T20:04:15+08:00"
},
"duration": 41,
"server": "a83ad33525",
"status": 200,
"successful": true,
"timestamp": "2021-08-25T16:00:19.895+08:00",
"traceId": "c8e610e3b33a4b17"
}