:original_name: ddm_api_01_0018.html .. _ddm_api_01_0018: Querying DDM Instances ====================== Function -------- This API is used to query DDM instances. Constraints ----------- None URI --- GET /v1/{project_id}/instances?offset={offset}&limit={limit} .. table:: **Table 1** Path parameters ========== ========= ====== ================================== Parameter Mandatory Type Description ========== ========= ====== ================================== project_id Yes String Project ID of a tenant in a region ========== ========= ====== ================================== .. table:: **Table 2** Query parameters +-----------------+-----------------+-----------------+--------------------------------------------------------------------------------------------------------+ | Parameter | Mandatory | Type | Description | +=================+=================+=================+========================================================================================================+ | offset | No | Integer | Index offset. | | | | | | | | | | The query starts from the next piece of data indexed by this parameter. The value is **0** by default. | | | | | | | | | | The value must be a positive integer. | +-----------------+-----------------+-----------------+--------------------------------------------------------------------------------------------------------+ | limit | No | Integer | A maximum of instances to be queried. | | | | | | | | | | Value range: 1 to 128. | | | | | | | | | | If the parameter value is not specified, 10 DDM instances are queried by default. | +-----------------+-----------------+-----------------+--------------------------------------------------------------------------------------------------------+ Request Parameters ------------------ .. table:: **Table 3** Request header parameters +-----------------+-----------------+-----------------+----------------------------------------------------------------------------------------------------------------------+ | Parameter | Mandatory | Type | Description | +=================+=================+=================+======================================================================================================================+ | 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. | +-----------------+-----------------+-----------------+----------------------------------------------------------------------------------------------------------------------+ Response Parameters ------------------- **Status code: 200** .. table:: **Table 4** Response body parameters +--------------+-------------------------------------------------------------------------------------------------------+-------------------------------------+ | Parameter | Type | Description | +==============+=======================================================================================================+=====================================+ | instances | Array of :ref:`ShowInstanceBeanResponse ` objects | DDM instance information | +--------------+-------------------------------------------------------------------------------------------------------+-------------------------------------+ | instance_num | Integer | Number of DDM instances of a tenant | +--------------+-------------------------------------------------------------------------------------------------------+-------------------------------------+ | page_no | Integer | Current page | +--------------+-------------------------------------------------------------------------------------------------------+-------------------------------------+ | page_size | Integer | Data records on the current page | +--------------+-------------------------------------------------------------------------------------------------------+-------------------------------------+ | total_record | Integer | Total records | +--------------+-------------------------------------------------------------------------------------------------------+-------------------------------------+ | total_page | Integer | Total pages | +--------------+-------------------------------------------------------------------------------------------------------+-------------------------------------+ .. _ddm_api_01_0018__response_showinstancebeanresponse: .. table:: **Table 5** ShowInstanceBeanResponse +-----------------------+-----------------------+---------------------------------------------------------------------------------------------------------------------------------------+ | Parameter | Type | Description | +=======================+=======================+=======================================================================================================================================+ | id | String | DDM instance ID | +-----------------------+-----------------------+---------------------------------------------------------------------------------------------------------------------------------------+ | status | String | DDM instance status. For details about this parameter value, see :ref:`Status Description `. | +-----------------------+-----------------------+---------------------------------------------------------------------------------------------------------------------------------------+ | name | String | Name of the created DDM instance | +-----------------------+-----------------------+---------------------------------------------------------------------------------------------------------------------------------------+ | created | String | Time when the DDM instance is created. The time must be in the format of yyyy-mm-dd Thh:mm:ssZ. | | | | | | | | **T** indicates the separator between the calendar and the hourly notation of time. **Z** indicates Coordinated Universal Time (UTC). | +-----------------------+-----------------------+---------------------------------------------------------------------------------------------------------------------------------------+ | updated | String | Time when the DDM instance is last updated, which is in the same format as **created**. | +-----------------------+-----------------------+---------------------------------------------------------------------------------------------------------------------------------------+ | available_zone | String | AZ name | +-----------------------+-----------------------+---------------------------------------------------------------------------------------------------------------------------------------+ | vpc_id | String | VPC ID | +-----------------------+-----------------------+---------------------------------------------------------------------------------------------------------------------------------------+ | subnet_id | String | Subnet ID | +-----------------------+-----------------------+---------------------------------------------------------------------------------------------------------------------------------------+ | security_group_id | String | Security group ID | +-----------------------+-----------------------+---------------------------------------------------------------------------------------------------------------------------------------+ | node_count | Integer | Number of nodes | +-----------------------+-----------------------+---------------------------------------------------------------------------------------------------------------------------------------+ | access_ip | String | Address for accessing the DDM instance | +-----------------------+-----------------------+---------------------------------------------------------------------------------------------------------------------------------------+ | access_port | String | Port for accessing the DDM instance | +-----------------------+-----------------------+---------------------------------------------------------------------------------------------------------------------------------------+ | core_count | String | Number of CPUs | +-----------------------+-----------------------+---------------------------------------------------------------------------------------------------------------------------------------+ | ram_capacity | String | Memory size in GB | +-----------------------+-----------------------+---------------------------------------------------------------------------------------------------------------------------------------+ | error_msg | String | Response message. This parameter is not returned if no abnormality occurs. | +-----------------------+-----------------------+---------------------------------------------------------------------------------------------------------------------------------------+ | node_status | String | Node status For details, see :ref:`Status Description `. | +-----------------------+-----------------------+---------------------------------------------------------------------------------------------------------------------------------------+ | project_id | String | Project ID of a tenant in a region | +-----------------------+-----------------------+---------------------------------------------------------------------------------------------------------------------------------------+ | engine_version | String | Engine version (core instance version) | +-----------------------+-----------------------+---------------------------------------------------------------------------------------------------------------------------------------+ **Status code: 400** .. table:: **Table 6** Response body parameters =============== ====== ================== Parameter Type Description =============== ====== ================== errCode String Service error code externalMessage String Error message =============== ====== ================== **Status code: 500** .. table:: **Table 7** Response body parameters =============== ====== ================== Parameter Type Description =============== ====== ================== errCode String Service error code externalMessage String Error message =============== ====== ================== Example Request --------------- .. code-block:: text GET https://{endpoint}/v1/{project_id}/instances?offset={offset}&limit={limit} Example Response ---------------- **Status code: 200** OK .. code-block:: { "instance_num" : 26, "instances" : [ { "id" : "73f27bb0b26d4a79a9b0c58a4c700c4fin09", "status" : "RUNNING", "name" : "ddm-36c7", "created" : "2021-12-14T07:46:22+0000", "updated" : "2021-12-14T10:11:22+0000", "available_zone" : "az1", "vpc_id" : "1d9441c5-1a4b-431d-9edb-bf3564a83e74", "subnet_id" : "20c2d83c-755b-42a2-846a-4688eb35d1a7", "security_group_id" : "fbdff89d-32fe-45a4-832b-115ac4bfaac9", "node_count" : 1, "access_ip" : "192.168.23.143", "access_port" : "5066", "core_count" : "2", "ram_capacity" : "4", "node_status" : "RUNNING", "project_id" : "055d9f4ee780d4d42f96c01c1bc3c50c", "engine_version" : "3.0.8" } ], "page_size" : 1, "total_record" : 26, "total_page" : 26, "page_no" : 3 } **Status code: 400** bad request .. code-block:: { "externalMessage" : "Parameter error.", "errCode" : "DBS.280001" } **Status code: 500** server error .. code-block:: { "externalMessage" : "Server failure.", "errCode" : "DBS.200412" } Status Codes ------------ =========== ============ Status Code Description =========== ============ 200 OK 400 bad request 500 server error =========== ============ Error Codes ----------- For details, see :ref:`Error Codes `.