Help Center/CodeArts Deploy/API Reference (Ally Region)/Application Examples/Example 1: Querying a Host Cluster List
Updated on 2026-01-08 GMT+08:00
Example 1: Querying a Host Cluster List
Scenario
This section provides an example of using an API to query the host cluster list as a CodeArts user.
For details on how to call APIs, see Calling APIs.
Prerequisite
You have created a CodeArts project.
Approach
Query the list of all host clusters of the current user based on the user token.
Querying the Host Cluster List
- API information:
URI: GET /v2/host-groups
- Response example:
{ "total" : 1, "host_groups" : [ { "name" : "testwyk", "description" : "11122211", "os" : "linux", "nick_name" : "A/B_side_account", "id" : 200001291, "group_id" : "ab7647b0863c4e969c8949d38d591339", "project_id" : "6039d4480efc4dddb178abff98719913", "permission" : { "can_view" : true, "can_edit" : true, "can_delete" : true, "can_add_host" : true, "can_manage" : true }, "created_by" : { "user_id" : "6baa7454109d47c192f22078fe6cda20", "user_name" : "devcloud_devcloud_l00490255_01" }, "updated_by" : { "user_id" : "6baa7454109d47c192f22078fe6cda20", "user_name" : "devcloud_devcloud_l00490255_01" }, "auto_connection_test_switch" : 0, "slave_cluster_id" : "", "created_time" : "2021-04-01 17:05:53", "updated_time" : "2021-04-21 14:29:14", "host_count" : 1, "project_name" : null } ] }
Parent topic:Application Examples
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.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot
