Modifying a Host Group
Function
Modify a host group.
Calling Method
For details, see Calling APIs.
URI
PUT /v3/{project_id}/lts/host-group
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID. For details about how to obtain a project ID, see Obtaining the Project ID, Account ID, Log Group ID, and Log Stream ID. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
User token obtained from IAM. For details about how to obtain a user token, see Obtaining a User Token. |
Content-Type |
Yes |
String |
Set this parameter to application/json;charset=UTF-8. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
host_group_id |
Yes |
String |
Host group ID. |
host_group_name |
No |
String |
Host group name. This parameter cannot be passed if the host group name is not changed. |
host_id_list |
No |
Array of strings |
Host ID list. The host type must be the same as the host group type. |
host_group_tag |
No |
Array of HostGroupTag objects |
Host group tags. The tag key must be unique. |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
host_group_id |
String |
Host group ID. |
host_group_name |
String |
Host group name. |
host_group_type |
String |
Host group type. Linux and Windows. |
host_id_list |
Array of strings |
Host ID list. |
host_group_tag |
Array of HostGroupTag objects |
Tag information. You can add up to 20 tags. |
create_time |
Long |
Creation time. |
update_time |
Long |
Update time. |
Status code: 400
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code |
error_msg |
String |
Error description |
Status code: 500
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code |
error_msg |
String |
Error description |
Example Requests
Update a host group. Parameter host_group_id is mandatory.
PUT https://{endpoint}/v3/{project_id}/lts/host-group { "host_group_id" : "xxxxxx", "host_group_name" : "qweqwe", "host_id_list" : [ "host_id_1", "host_id_2" ], "host_group_tag" : [ { "key" : "xxx", "value" : "xxx" } ] }
Example Responses
Status code: 200
The host group is modified.
{ "host_group_id" : "598c77aa-c69b-42f0-8cb8-983178b38", "host_group_name" : "devspore_app_dzhou1", "host_group_type" : "linux", "host_id_list" : [ "dc1dab7e-b045-4e77-bda4-914d3f7", "xxxxx" ], "host_group_tag" : [ { "key" : "xxx", "value" : "xxx" }, { "key" : "xxx", "value" : "xxx" } ], "create_time" : 16351494332, "update_time" : 16351494332 }
Status code: 400
Invalid request. Modify the request based on the description in error_msg before a retry.
{ "error_code" : "LTS.1807", "error_msg" : "Invalid host group id" }
Status code: 500
The server has received the request but encountered an internal error.
{ "error_code" : "LTS.0010", "error_msg" : "Internal Server Error" }
Status Codes
Status Code |
Description |
---|---|
200 |
The host group is modified. |
400 |
Invalid request. Modify the request based on the description in error_msg before a retry. |
500 |
The server has received the request but encountered an internal error. |
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.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot