Esta página ainda não está disponível no idioma selecionado. Estamos trabalhando para adicionar mais opções de idiomas. Agradecemos sua compreensão.

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Querying DB Instances

Updated on 2022-02-22 GMT+08:00

Function

This API is used to query DB instances based on specified conditions.

URI

  • URI format

    GET /v3/{project_id}/instances?id={id}&name={name}&mode={mode}&datastore_type={datastore_type}&vpc_id={vpc_id}&subnet_id={subnet_id}&offset={offset}&limit={limit}

  • Parameter description
    Table 1 Parameter description

    Name

    Mandatory

    Type

    Description

    project_id

    Yes

    String

    Specifies the project ID of a tenant in a region.

    id

    No

    String

    Specifies the DB instance ID.

    name

    No

    String

    Specifies the DB instance name.

    If you use asterisk (*) at the beginning of the name, fuzzy search results are returned. Otherwise, the exact results are returned.

    NOTE:

    The asterisk (*) is a reserved character in the system and cannot be used alone.

    mode

    No

    String

    Specifies the instance type.

    • Sharding indicates the cluster instance.
    • ReplicaSet indicate the replica set instance.

    datastore_type

    No

    String

    Specifies the database type. The value is DDS-Community.

    vpc_id

    No

    String

    Specifies the VPC ID. To obtain this parameter value, use either of the following methods:

    • Method 1: Log in to VPC console and view the VPC ID on the VPC details page.
    • Method 2: See the "Querying VPCs" section in the Virtual Private Cloud API Reference.

    subnet_id

    No

    String

    Specifies the network ID of the subnet. To obtain this parameter value, use either of the following methods:

    • Method 1: Log in to VPC console and click the target subnet on the Subnets page. You can view the network ID on the displayed page.
    • Method 2: See the "Querying Subnets" section in the Virtual Private Cloud API Reference.

    offset

    No

    Integer

    Specifies the index position. The query starts from the next instance creation time indexed by this parameter under a specified project. If offset is set to N, the resource query starts from the N+1 piece of data

    The value must be greater than or equal to 0. If this parameter is not transferred, offset is set to 0 by default, indicating that the query starts from the latest created DB instance.

    limit

    No

    Integer

    Specifies the maximum allowed number of DB instances.

    The value ranges from 1 to 100. If this parameter is not transferred, the first 100 DB instances are queried by default.

Requests

  • Request header
    Query all DB instances.
    GET https://DDS endpoint/v3/0483b6b16e954cb88930a360d2c4e663/instances
    Query DB instances based on specified conditions.
    GET https://DDS endpoint/v3/0483b6b16e954cb88930a360d2c4e663/instances?offset=0&limit=10&id=ed7cc6166ec24360a5ed5c5c9c2ed726in02&name=hy&mode=ReplicaSet&datastore_type=DDS-Community&vpc_id=19e5d45d-70fd-4a91-87e9-b27e71c9891f&subnet_id=bd51fb45-2dcb-4296-8783-8623bfe89bb7
  • Request body

    N/A

Responses

  • Parameter description
    Table 2 Parameter description

    Name

    Type

    Description

    instances

    Array of objects

    Indicates the DB instance information. For more information, see Table 3.

    total_count

    Integer

    Indicates the total number of queried records.

    Table 3 instances field data structure description

    Name

    Type

    Description

    id

    String

    Indicates the DB instance ID.

    name

    String

    Indicates the DB instance name.

    status

    String

    Indicates the DB instance status.

    Valid value:

    • normal: indicates that the instance is running properly.
    • abnormal: indicates that the instance is abnormal.
    • creating: indicates that the instance is being created.
    • data_disk_full: indicates that the instance disk is full.
    • createfail: indicates that the instance failed to be created.
    • enlargefail: indicates that nodes failed to be added to the instance.

    port

    Integer

    Indicates the database port number. The port range is 2100 to 9500.

    mode

    String

    Indicates the instance type, which is the same as the request parameter.

    region

    String

    Indicates the region where the DB instance is deployed.

    datastore

    Object

    Indicates the database information. For more information, see Table 4.

    engine

    String

    Indicates the storage engine. The value is wiredTiger.

    created

    String

    Indicates the DB instance creation time.

    updated

    String

    Indicates the time when a DB instance is updated.

    db_user_name

    String

    Indicates the default username. The value is rwuser.

    ssl

    Integer

    Indicates that SSL is enabled or not.

    • 1: indicate that SSL is enabled.
    • 0: indicate that SSL is disabled.

    vpc_id

    String

    Indicates the VPC ID.

    subnet_id

    String

    Indicates the network ID of the subnet.

    security_group_id

    String

    Indicates the security group ID.

    backup_strategy

    Object

    Indicates the backup policy. For more information, see Table 5.

    pay_mode

    String

    The value is set to "0".

    maintenance_window

    String

    Indicates the maintenance time window.

    groups

    Array of objects

    Indicates group information. For more information, see Table 6.

    time_zone

    String

    Indicates the time zone.

    actions

    Array of strings

    Indicates the operation that is executed on the DB instance.

    Table 4 datastore field data structure description

    Name

    Type

    Description

    type

    String

    Indicates the DB engine.

    version

    String

    Indicates the database version.

    Table 5 backup_strategy field data structure description

    Name

    Type

    Description

    start_time

    String

    Indicates the backup time window. Automated backups will be triggered during the backup time window. The current time is the UTC time.

    keep_days

    Integer

    Indicates the number of days to retain the generated backup files. The value range is from 0 to 732.

    Table 6 groups field data structure description

    Name

    Type

    Description

    type

    String

    Indicates the node type.

    Valid value:

    • shard
    • config
    • mongos
    • replica

    id

    String

    Indicates the group ID. This parameter is valid only when the node type is shard or config.

    name

    String

    Indicates the group name. This parameter is valid only when the node type is shard or config.

    status

    String

    Indicates the group status. This parameter is valid only when the node type is shard or config.

    volume

    Object

    Indicates the volume information. For more information, see Table 7. This parameter is valid only when the node type is shard, config, or replica.

    nodes

    Array of objects

    Indicates node information. For more information, see Table 8.

    Table 7 volume field data structure description

    Name

    Type

    Description

    size

    String

    Indicates the disk size. Unit: GB

    used

    String

    Indicates the disk usage. Unit: GB

    Table 8 nodes field data structure description

    Name

    Type

    Description

    id

    String

    Indicates the node ID.

    name

    String

    Indicates the node name.

    status

    String

    Indicates the node status.

    role

    String

    Indicates the node role.

    Valid value:
    • master: This value is returned for the mongos node.
    • Primary: This value is returned for the primary shard and config nodes, and the primary node of a replica set.
    • Secondary: This value is returned for the secondary shard and config nodes, and the secondary node of a replica set.
    • Hidden: This value is returned for the hidden shard and config nodes, and the hidden node of a replica set.
    • unknown. This value is returned when the node is abnormal.

    private_ip

    String

    Indicates the private IP address of a node. This parameter is valid only for mongos nodes and replica set instances. The value exists after the ECS is created successfully. Otherwise, the value is "".

    public_ip

    String

    Indicates the EIP that has been bound. This parameter is valid only for mongos nodes of cluster instances and the primary and secondary nodes of replica set instances.

    spec_code

    String

    Indicates the resource specification code. For details about the instance specifications, see the value of the flavors.spec_code parameter in Querying All DB Instance Specifications.

    availability_zone

    String

    Indicates the AZ.

    NOTE:

    The values of region and availability_zone are used as examples.

  • Response example

Status Code

For more information, see Status Code.

Error Code

For more information, see Error Code.

Usamos cookies para aprimorar nosso site e sua experiência. Ao continuar a navegar em nosso site, você aceita nossa política de cookies. Saiba mais

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback