Creating a Host Cluster (Recommended)
Function
This API is used to create a host cluster in a project.
URI
POST /v1/resources/host-groups
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
Content-Type |
Yes |
String |
Message body type (format). Possible values: application/json;charset=utf-8 application/json Default: application/json;charset=utf-8 Enumeration values:
|
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. Minimum: 0 Maximum: 20000 |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
name |
Yes |
String |
Host cluster name. Minimum: 3 Maximum: 128 |
project_id |
Yes |
String |
Project ID. For details, see Obtaining a Project ID. |
os |
Yes |
String |
Operating system: windows and linux. Enumeration values:
|
slave_cluster_id |
No |
String |
Slave cluster ID. If the value is null, the default slave cluster is used. If slave is user-defined, the slave cluster ID is used. |
description |
No |
String |
Description. Minimum: 0 Maximum: 500 |
is_proxy_mode |
Yes |
Integer |
Whether the host cluster is in poxy access mode. 1: yes; 0: no. Enumeration values:
|
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
id |
String |
Host cluster ID. |
status |
String |
Request status. |
Example Requests
When creating a host cluster, you need to enter basic information, including the host cluster name, description, operating system, and whether be proxy access mode.
https://{endpoint}/v1/resources/host-groups { "name" : "test123", "description" : "", "project_id" : "6039d4480efc4dddb178abff98719913", "os" : "linux", "slave_cluster_id" : "", "is_proxy_mode" : 1 }
Example Responses
Status code: 200
OK: The request is successful.
{ "status" : "success", "id" : "f3938bd63e354d2bb9d9cf7b5dc3bf95" }
Status Codes
Status Code |
Description |
---|---|
200 |
OK: The request is successful. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.