Updated on 2024-11-12 GMT+08:00

Obtaining the CBH Instance List

Function

This API is used to obtain the CBH instance list of the current account.

URI

GET /v2/{project_id}/cbs/instance/list

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID

For details about how to obtain the project ID, see "Obtaining a Project ID".

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

instance_id

No

Number

CBH instance ID. This parameter is mandatory only when you want to query details of a single instance.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token

It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token.

For details, see "Obtaining the Token of an IAM User."

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

total

Integer

The total number of CBH instances.

instance

Array of InstanceDetail objects

CBH instance list.

Table 5 InstanceDetail

Parameter

Type

Description

name

String

CBH instance name.

server_id

String

ID of the server where the CBH instance is deployed..

instance_id

String

CBH instance ID.

alter_permit

Boolean

Whether the CBH instance can be expanded.

  • true: Yes

  • false: No

enterprise_project_id

String

Project ID.

period_num

String

Number of subscription periods of a CBH instance.

start_time

String

Start time of the CBH instance, in timestamp format.

end_time

String

End time of the CBH instance, in timestamp format.

created_time

String

Time when the CBH instance was created, in UTC format.

upgrade_time

Long

Upgrade schedule of the CBH instance, in the format of timestamp.

update

String

Whether the CBH instance can be upgraded.

  • OLD: The current version is the latest one.

  • NEW: Can be upgraded.

  • CROSS_OS: Can be upgraded to any later versions.

  • ROLLBACK: Can be rolled back.

Enumeration values:

  • OLD

  • NEW

  • CROSS_OS

  • ROLLBACK

bastion_version

String

Current version of the CBH instance.

az_info

az_info object

AZ information.

status_info

status_info object

Status information.

resource_info

resource_info object

Resource information.

network

network object

Network information.

ha_info

ha_info object

Active and standby node information.

Table 6 az_info

Parameter

Type

Description

region

String

ID of the AZ where the CBH instance locates.

zone

String

ID of the AZ where the CBH instance locates. (In primary/standby mode, the ID of the AZ where the primary instance locates is required.)

availability_zone_display

String

AZ where the CBH instance locates. (In primary/standby mode, the ID of the AZ where the primary instance locates is required. Name)

slave_zone

String

AZ where the standby CBH instance locates.

slave_zone_display

String

AZ where the standby CBH instance locates.

Table 7 status_info

Parameter

Type

Description

status

String

CBH instance status

  • SHOUTOFF: Closed

  • ACTIVE: Running

  • DELETING: Deleting

  • BUILD: Creating

  • DELETED: Deleting

  • ERROR: Faulty

  • HAWAIT: Waiting for the standby node to be created

  • FROZEN: Frozen

  • UPGRADING: Upgrading

  • UNPAID: Pending Payment

  • RESIZE: Changing specifications

  • DILATATION: Expanding capacity

  • HA: Configuring HA

task_status

String

CBH instance status.

  • powering-on: Started

  • powering-off: Stopped

  • rebooting: Rebooting

  • delete_wait: Deleting

  • frozen: Frozen

  • NO_TASK: Running

  • unfrozen: Unfrozen

  • alter: Changing

  • updating: Upgrading

  • configuring-ha: Configuring HA

  • data-migrating: Migrating data

  • rollback: Rolling back to the previous version.

  • traffic-switchover: Traffic switching

create_instance_status

String

Status of a CBH instance during instance creation.

  • Waiting for payment: Waiting for payment

  • creating-network: Creating a network.

  • creating-server: Creating the service.

  • tranfering-horizontal-network: Establishing network connections.

  • adding-policy-route: Adding a routing policy.

  • configing-dns: Configuring DNS.

  • starting-cbs-service: The service is running.

  • setting-init-conf: Initializing

  • buying-EIP: Buying an EIP.

instance_status

String

CBH instance status.

  • building: Creating

  • deleting: Deleting

  • deleted: Deleted

  • unpaid: Unpaid

  • upgrading: Upgrading

  • resizing: Resizing

  • abnormal: Abnormal

  • error: Faulty

  • ok: Normal

instance_description

String

CBH instance description.

fail_reason

String

Instance creation failure causes.

Table 8 resource_info

Parameter

Type

Description

specification

String

CBH instance specifications.

order_id

String

Order ID.

resource_id

String

CBH instance ID, in the UUID format.

data_disk_size

Number

Size of the data disk for the CBH instance, in TB.

disk_resource_id

Array of strings

ID of the data disk for the CBH instance.

Table 9 network

Parameter

Type

Description

vip

String

Floating IP address of the CBH instance (This field is returned when the instance is deployed in primary/standby mode.)

web_port

String

Port used for accessing the CBH instance with a web browser.

public_ip

String

EIP bound to the CBH instance.

public_id

String

ID of the EIP bound to the CBH instance, in the UUID format.

private_ip

String

Private IP address of the CBH instance

vpc_id

String

ID of the VPC where the CBH instance locates.

subnet_id

String

ID of the subnet where the CBH instance locates.

security_group_id

String

ID of the Security group where the CBH instance locates.

Table 10 ha_info

Parameter

Type

Description

ha_id

String

IDs of the primary and standby instances.

instance_type

String

Instance type. The value can be:

  • master: Primary instance

  • slave: Standby instance

Status code: 400

Table 11 Response body parameters

Parameter

Type

Description

error_code

String

Error code

error_description

String

Incorrect request parameters.

Status code: 401

Table 12 Response body parameters

Parameter

Type

Description

error_code

String

Error code

error_description

String

Failed to verify the token.

Status code: 403

Table 13 Response body parameters

Parameter

Type

Description

error_code

String

Error code

error_description

String

Permissions required.

Status code: 404

Table 14 Response body parameters

Parameter

Type

Description

error_code

String

Error code

error_description

String

Not CBH instances found.

Example Requests

None

Example Responses

Status code: 200

Cbh List Instance Success

{
  "total" : 1,
  "instance" : [ {
    "name" : "CBH-e2b4",
    "server_id" : "760aeee4-9916-436a-8854-837a9ae94b2b",
    "instance_id" : "5473",
    "alter_permit" : false,
    "enterprise_project_id" : "0",
    "period_num" : "1,2",
    "start_time" : 1692245215000,
    "end_time" : 1694966399000,
    "created_time" : "2023-08-17 12:05:02.0",
    "update" : false,
    "bastion_version" : "3.3.49.0",
    "az_info" : {
      "region" : "cn-north-7",
      "zone" : "cn-north-7a",
      "availability_zone_display" : "AZ 1",
      "slave_zone" : "cn-north-7b",
      "slave_zone_display" : "AZ 2"
    },
    "status_info" : {
      "status" : "ACTIVE",
      "task_status" : "NO_TASK",
      "create_instance_status" : "NO_TASK",
      "fail_reason" : "No FailReason Now",
      "instance_status" : "ok",
      "instance_description" : ",2023-08-21 15:19:07,{\"d_usage\":\"0.30\",\"m_usage\":\"43.66\",\"c_usage\":\"1.00\",\"session_count\":\"0\""
    },
    "resource_info" : {
      "specification" : "cbh.basic.5",
      "order_id" : "CS2308171141G8C14",
      "resource_id" : "c7a07a7f-e5ee-49cf-8355-aee46c5a4fcf",
      "data_disk_size" : 200,
      "disk_resource_id" : [ ]
    },
    "network" : {
      "vip" : "192.168.0.228",
      "web_port" : "443",
      "public_ip" : "100.xx.xx.1",
      "public_id" : "56220ed7-0f75-4d42-85c4-013d5414c81c",
      "private_ip" : "192.168.0.190",
      "vpc_id" : "03211ecf-697e-4306-a7a0-6e939bf948de",
      "subnet_id" : "dd08a6a9-ced7-484b-ace6-1b821854a772",
      "security_group_id" : "02dcf62d-b84d-4a14-aad3-c310f2ceea55"
    },
    "ha_info" : {
      "ha_id" : "332",
      "instance_type" : "master"
    }
  } ]
}

Status Codes

Status Code

Description

200

Cbh List Instance Success

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

Error Codes

See Error Codes.