Description
You can call this operation to add host type information.
Call description
Prerequisite
You have the HOST_MANAGER permissions.
Request path
POST /api/v2/compute/hostTypes
Request parameters
| Parameter | Type | Required | Example value | Description |
|---|---|---|---|---|
| name | String | Yes | small | The name of the host type. |
| description | String | No | 2core 16gb | The description of the host type. |
Response parameters
| Parameter | Type | Description |
|---|---|---|
| data | Object | The requested host type 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 HostType
| Parameter | Type | Description |
|---|---|---|
| id | Long | The ID of the host type. |
| name | String | The name of the host type. |
| description | String | The description of the host type. |
| createTime | String | The time when the host type was created. |
| updateTime | String | The time when the host type was modified. |
Examples
Sample request
POST /api/v2/compute/hostTypes
curl --user <username>:<password> -X POST 'http://<IP>:<PORT>/api/v2/compute/hostTypes' \
-H 'Content-Type: application/json' \
--data-raw '{"name":"tiny","description":"2core 16gb"}' \
Sample response
{
"data": {
"createTime": null,
"id": 1000001,
"name": "tiny",
"updateTime": null
},
"duration": 35,
"server": "a83ad33525",
"status": 200,
"successful": true,
"timestamp": "2021-08-25T16:53:00.678+08:00",
"traceId": "33097730537744ca"
}