:original_name: modelarts_03_0201.html .. _modelarts_03_0201: Querying Dedicated Resource Pools ================================= Function -------- This API is used to query dedicated resource pools. URI --- GET /v1/{project_id}/clusters .. table:: **Table 1** Parameters +-----------------+-----------------+-----------------+-----------------------------------------------------------------------------------------------------------------------------+ | Parameter | Mandatory | Type | Description | +=================+=================+=================+=============================================================================================================================+ | project_id | Yes | String | Project ID. For details about how to obtain the project ID, see :ref:`Obtaining a Project ID `. | +-----------------+-----------------+-----------------+-----------------------------------------------------------------------------------------------------------------------------+ | cluster_name | No | String | Cluster name. By default, the cluster name is not filtered. | +-----------------+-----------------+-----------------+-----------------------------------------------------------------------------------------------------------------------------+ | status | No | String | Cluster status. By default, the status is not filtered. | +-----------------+-----------------+-----------------+-----------------------------------------------------------------------------------------------------------------------------+ | offset | No | integer | Start page of the paging list. Default value: **0** | +-----------------+-----------------+-----------------+-----------------------------------------------------------------------------------------------------------------------------+ | limit | No | integer | Maximum number of records returned on each page. The default value is **1000**. The recommended value ranges from 10 to 50. | +-----------------+-----------------+-----------------+-----------------------------------------------------------------------------------------------------------------------------+ | sort_by | No | String | Sorting field. The options are as follows: | | | | | | | | | | - **created_at**: default value | | | | | - **cluster_name** | +-----------------+-----------------+-----------------+-----------------------------------------------------------------------------------------------------------------------------+ | order | No | String | Sorting mode. The options are as follows: | | | | | | | | | | - **asc**: ascending order | | | | | - **desc**: descending order. The default value is **desc**. | +-----------------+-----------------+-----------------+-----------------------------------------------------------------------------------------------------------------------------+ Response Body ------------- .. table:: **Table 2** Parameters +-------------+-------------------+--------------------------------------------------------------------------------------------------------------------------------------+ | Parameter | Type | Description | +=============+===================+======================================================================================================================================+ | total_count | integer | Total number of clusters that meet the search criteria when no paging is implemented | +-------------+-------------------+--------------------------------------------------------------------------------------------------------------------------------------+ | count | integer | Number of clusters in the query result. If **offset** and **limit** are not set, the values of **count** and **total** are the same. | +-------------+-------------------+--------------------------------------------------------------------------------------------------------------------------------------+ | clusters | **cluster** array | List of queried clusters. For details, see :ref:`Table 3 `. | +-------------+-------------------+--------------------------------------------------------------------------------------------------------------------------------------+ .. _modelarts_03_0201__en-us_topic_0210524456_table3329335121912: .. table:: **Table 3** **cluster** parameters +-----------------------+---------+---------------------------------------------------------------------------------------------------------------------+ | Parameter | Type | Description | +=======================+=========+=====================================================================================================================+ | cluster_id | String | Cluster ID | +-----------------------+---------+---------------------------------------------------------------------------------------------------------------------+ | cluster_name | String | Cluster name | +-----------------------+---------+---------------------------------------------------------------------------------------------------------------------+ | description | String | Cluster remarks | +-----------------------+---------+---------------------------------------------------------------------------------------------------------------------+ | tenant | String | Tenant to which a cluster belongs | +-----------------------+---------+---------------------------------------------------------------------------------------------------------------------+ | project | String | Project to which a cluster belongs | +-----------------------+---------+---------------------------------------------------------------------------------------------------------------------+ | owner | String | User to which a cluster belongs | +-----------------------+---------+---------------------------------------------------------------------------------------------------------------------+ | created_at | integer | Time when a cluster is created, in milliseconds calculated from 1970.1.1 0:0:0 UTC | +-----------------------+---------+---------------------------------------------------------------------------------------------------------------------+ | status | String | Cluster status. The value can be **deploying**, **running**, **concerning**, or **abnormal**. | +-----------------------+---------+---------------------------------------------------------------------------------------------------------------------+ | nodes | Object | Node configuration. For details, see :ref:`Table 4 `. | +-----------------------+---------+---------------------------------------------------------------------------------------------------------------------+ | allocatable_cpu_cores | float | Number of available CPU cores | +-----------------------+---------+---------------------------------------------------------------------------------------------------------------------+ | allocatable_memory | integer | Number of available memory resources | +-----------------------+---------+---------------------------------------------------------------------------------------------------------------------+ | allocatable_gpus | float | Number of available GPU cores | +-----------------------+---------+---------------------------------------------------------------------------------------------------------------------+ | product_id | String | Product ID | +-----------------------+---------+---------------------------------------------------------------------------------------------------------------------+ | order_id | String | Order ID | +-----------------------+---------+---------------------------------------------------------------------------------------------------------------------+ | period_type | String | Subscription period type | +-----------------------+---------+---------------------------------------------------------------------------------------------------------------------+ | period_num | integer | Number of subscription periods | +-----------------------+---------+---------------------------------------------------------------------------------------------------------------------+ .. _modelarts_03_0201__en-us_topic_0210524456_table1977248142212: .. table:: **Table 4** **node** parameters =============== ======= ========================= Parameter Type Description =============== ======= ========================= specification String Node specifications count integer Number of nodes available_count integer Number of available nodes =============== ======= ========================= Samples ------- - Sample request .. code-block:: text GET https://endpoint/v1/{project_id}/clusters - Sample response .. code-block:: { "total_count": 1, "count": 1, "clusters": [ { "cluster_id": "ff808081673fbb3d01673fbb824d0000", "cluster_name": "my-cluster", "description": "", "tenant": "tenant_id", "project": "project_id", "owner": "owner_id", "created_at": 1574923077927, "status": "running", "nodes": { "specification": "modelarts.vm.cpu.8ud", "count": 1, "available_count": 1 }, "allocatable_cpu_cores": 5.5, "allocatable_memory": 4096, "allocatable_gpus": 0.5 } ] } Status Code ----------- For details about the status code, see :ref:`Table 1 `. Error Codes ----------- See :ref:`Error Codes `.