# 查询实例列表 - ListGaussMySqlInstancesUnifyStatus
#### 功能介绍
根据指定条件查询实例列表。
#### 调用方法
请参见[如何调用API](https://support.huaweicloud.com/api-taurusdb/taurusdb_03_0000.html)。
#### 授权信息
账号具备所有API的调用权限，如果使用账号下的IAM用户调用当前API，该IAM用户需具备调用API所需的权限。
- 如果使用角色与策略授权，具体权限要求请参见[权限和授权项](https://support.huaweicloud.com/api-taurusdb/taurusdb_06_0000.html)。
- 如果使用身份策略授权，需具备如下身份策略权限。
  
  | 授权项                           | 访问级别 | 资源类型（\*为必须） | 条件键 | 别名                    | 依赖的授权项 |
  |:---|:---|:---|:---|:---|:---|
  | gaussdbformysql:instance:list | List | -           | -   | gaussdb:instance:list | -      |
     
  
 
#### URI
GET /v3.1/{project_id}/instances
表1路径参数 
| 参数         | 是否必选 | 参数类型   | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
|:---|:---|:---|:---|
| project_id | 是    | String | **参数解释**： 租户在某一Region下的project ID。 获取方法请参见[获取项目ID](https://support.huaweicloud.com/api-taurusdb/taurusdb_10_0004.html)。 **约束限制**： 不涉及。 **取值范围**： 只能由英文字母、数字组成，且长度为32个字符。 **默认取值**： 不涉及。 |
   
表2Query参数 
| 参数                  | 是否必选 | 参数类型    | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
|:---|:---|:---|:---|
| id                  | 否    | String  | **参数解释**： 实例ID。 **约束限制**： "\*"为系统保留字符，如果id是以"\*"起始，表示按照"\*"后面的值模糊匹配，否则，按照id精确匹配查询。不能只传入"\*"。 **取值范围**： 不涉及。 **默认取值**： 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| name                | 否    | String  | **参数解释**： 实例名称。 **约束限制**： "\*"为系统保留字符，如果name是以"\*"起始，表示按照"\*"后面的值模糊匹配，否则，按照name精确匹配查询。不能只传入"\*"。 **取值范围**： 不涉及。 **默认取值**： 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| type                | 否    | String  | **参数解释**： 按照实例类型查询。 **约束限制**： 不涉及。 **取值范围**： - Cluster：集群版。   - StandSingle：单机。    **默认取值**： 不涉及。                                                                                                                                                                                           |
| datastore_type      | 否    | String  | **参数解释**： 数据库类型。 **约束限制**： 现在只支持gaussdb-mysql。 **取值范围**： gaussdb-mysql。 **默认取值**： gaussdb-mysql。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| vpc_id              | 否    | String  | **参数解释**： 虚拟私有云ID。获取方法如下： - 方法1：登录虚拟私有云服务的控制台界面，在虚拟私有云的详情页面查找VPC ID。   - 方法2：通过虚拟私有云服务的API接口查询，具体操作可参考[查询VPC列表](https://support.huaweicloud.com/api-vpc/vpc_api01_0003.html)。    **约束限制**： 不涉及。 **取值范围**： 不涉及。 **默认取值**： 不涉及。         |
| subnet_id           | 否    | String  | **参数解释**： 子网的网络ID，获取方法如下： - 方法1：登录虚拟私有云服务的控制台界面，单击VPC下的子网，进入子网详情页面，查找网络ID。   - 方法2：通过虚拟私有云服务的API接口查询，具体操作可参考[查询子网列表](https://support.huaweicloud.com/api-vpc/vpc_subnet01_0003.html)。    **约束限制**： 不涉及。 **取值范围**： 不涉及。 **默认取值**： 不涉及。 |
| private_ip          | 否    | String  | **参数解释**： 读写内网IP地址。 **约束限制**： 不涉及。 **取值范围**： 不涉及。 **默认取值**： 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| is_auto_expand      | 否    | Boolean | **参数解释**： 是否开启自动扩容。 **约束限制**： 不涉及。 **取值范围**： - true：查询已开启自动扩容的实例列表。   - false：查询未开启自动扩容的实例列表。    **默认取值**： 不涉及。                                                                                                                                                                             |
| readonly_private_ip | 否    | String  | **参数解释**： 读内网IP地址。 **约束限制**： 不涉及。 **取值范围**： 不涉及。 **默认取值**： 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| proxy_ip            | 否    | String  | **参数解释**： 读写分离IP地址。 **约束限制**： 不涉及。 **取值范围**： 不涉及。 **默认取值**： 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| offset              | 否    | Integer | **参数解释**： 索引位置，偏移量。从第一条数据偏移offset条数据后开始查询。 **约束限制**： 必须为整数，不能为负数。 **取值范围**： ≥0 **默认取值**： 0                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| limit               | 否    | Integer | **参数解释**： 查询记录数。 **约束限制**： 必须为整数，不能为负数。 **取值范围**： 1-100 **默认取值**： 100                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| tags                | 否    | String  | **参数解释**： 根据实例标签键值对进行查询。 - {key}表示标签键。   - {value}表示标签值。    **约束限制**： 如果同时使用多个标签键值对进行查询，中间使用逗号分隔开，表示查询同时包含指定标签键值对的实例。key不能重复，key之间是与的关系。 **取值范围**： 不涉及。 **默认取值**： 不涉及。                                                                |
   
#### 请求参数
表3请求Header参数 
| 参数           | 是否必选 | 参数类型   | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
|:---|:---|:---|:---|
| X-Auth-Token | 是    | String | **参数解释**： 用户Token。 通过调用IAM服务[获取用户Token](https://support.huaweicloud.com/api-iam/iam_30_0001.html)接口获取。 请求响应成功后在响应消息头中包含的"X-Subject-Token"的值即为Token值。 **约束限制**： 不涉及。 **取值范围**： 不涉及。 **默认取值**： 不涉及。                                                                                                                                                                                                                                                                                                                      |
| X-Language   | 否    | String | **参数解释**： 请求语言类型。 **约束限制**： 不涉及。 **取值范围**： - en-us：英文。   - zh-cn：中文。    **默认取值**： en-us。 |
   
#### 响应参数
**状态码：200**
表4响应Body参数 
| 参数          | 参数类型                                                                                                                                | 描述                                                                                                                                                                                               |
|:---|:---|:---|
| instances   | Array of [MysqlInstanceListInfoUnifyStatus] objects | **参数解释**： 实例列表信息。                                                                                                                          |
| total_count | Integer                                                                                                                             | **参数解释**： 总记录数。 **取值范围**： 不涉及。 |
   
 表5MysqlInstanceListInfoUnifyStatus 
| 参数                    | 参数类型                                                                                                                    | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
|:---|:---|:---|
| id                    | String                                                                                                                  | **参数解释**： 实例ID。 **取值范围**： 只能由英文字母、数字组成，后缀为in07，长度为36个字符。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| name                  | String                                                                                                                  | **参数解释**： 创建的实例名称。 **取值范围**： 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| status                | String                                                                                                                  | **参数解释**： 实例状态。 **取值范围**： - creating：表示实例正在创建。   - normal：表示实例正常。   - abnormal：表示实例异常。   - createfail：表示实例创建失败。    |
| private_ips           | Array of strings                                                                                                        | **参数解释**： 实例写内网IP地址列表。弹性云服务器创建成功后该值存在，其他情况下为空列表。 **取值范围**： 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| proxy_ips             | Array of strings                                                                                                        | **参数解释**： 实例读写分离IP地址列表。TaurusDB实例开启代理成功后该值存在，其他情况下为空列表。 **取值范围**： 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| readonly_private_ips  | Array of strings                                                                                                        | **参数解释**： 实例读内网IP地址列表。弹性云服务器创建成功后该值存在，其他情况下为空列表。 **取值范围**： 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| public_ips            | Array of strings                                                                                                        | **参数解释**： 实例外网IP地址列表。 **取值范围**： 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| port                  | String                                                                                                                  | **参数解释**： 数据库端口号。 **取值范围**： 1024-65535，不包含端口5342-5345、12017、20000、20201、20202、33062、33071。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| type                  | String                                                                                                                  | **参数解释**： 实例类型。 **取值范围**： - Cluster：集群版。   - StandSingle：单机。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| region                | String                                                                                                                  | **参数解释**： 实例所在区域。 **取值范围**： 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| datastore             | [MysqlDatastoreWithKernelVersion] object | **参数解释**： 数据库信息。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| created               | String                                                                                                                  | **参数解释**： 创建时间，格式为"yyyy-mm-ddThh:mm:ssZ"。 其中，T指某个时间的开始；Z指时区偏移量，例如偏移1个小时显示为+0100。 **取值范围**： 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| updated               | String                                                                                                                  | **参数解释**： 更新时间，格式为"yyyy-mm-ddThh:mm:ssZ"。 其中，T指某个时间的开始；Z指时区偏移量，例如偏移1个小时显示为+0100。 **取值范围**： 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| db_user_name          | String                                                                                                                  | **参数解释**： 默认用户名。 **取值范围**： 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| vpc_id                | String                                                                                                                  | **参数解释**： 虚拟私有云ID。 **取值范围**： 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| subnet_id             | String                                                                                                                  | **参数解释**： 子网的网络ID信息。 **取值范围**： 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| security_group_id     | String                                                                                                                  | **参数解释**： 安全组ID。 **取值范围**： 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| flavor_ref            | String                                                                                                                  | **参数解释**： 规格码。 **取值范围**： 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| flavor_info           | [MysqlFlavorInfo] object                                 | **参数解释**： flavor规格信息。 **取值范围**： 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| volume                | [MysqlVolumeInfo] object                                 | **参数解释**: 存储盘信息。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| backup_strategy       | [MysqlBackupStrategy] object                         | **参数解释**： 自动备份策略。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| enterprise_project_id | String                                                                                                                  | **参数解释**： 企业项目ID。 **取值范围**： 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| time_zone             | String                                                                                                                  | **参数解释**： 时区。 **取值范围**： 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| charge_info           | [MysqlChargeInfo] object                                 | **参数解释**： 计费类型信息，支持包年包月和按需计费，默认为按需计费。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| dedicated_resource_id | String                                                                                                                  | **参数解释**： 专属资源池ID，只有数据库实例属于专属资源池才会返回该参数。 **取值范围**： 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| tags                  | Array of [InstanceTagItem] objects                       | **参数解释**： 标签列表。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| eos_tag               | Boolean                                                                                                                 | **参数解释**： 当前内核版本是否EOS。 **取值范围**： - true：版本EOS。   - false：版本正常维护。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
   
 表6MysqlDatastoreWithKernelVersion 
| 参数             | 参数类型   | 描述                                                                                                                                                                                                          |
|:---|:---|:---|
| type           | String | **参数解释**： 数据库引擎。 **取值范围**： gaussdb-mysql。 |
| version        | String | **参数解释**： 数据库版本。 **取值范围**： 不涉及。           |
| kernel_version | String | **参数解释**： 数据库内核版本。 **取值范围**： 不涉及。         |
   
 表7MysqlFlavorInfo 
| 参数    | 参数类型   | 描述                                                                                                                                                                                                    |
|:---|:---|:---|
| vcpus | String | **参数解释**： CPU核数。 **取值范围**： 不涉及。     |
| ram   | String | **参数解释**： 内存大小，单位GB。 **取值范围**： 不涉及。 |
   
 表8MysqlVolumeInfo 
| 参数   | 参数类型   | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
|:---|:---|:---|
| type | String | **参数解释**: 磁盘类型。 **取值范围**： - POOL：DL6   - STANDARDPOOL：DL5    |
| size | String | **参数解释**: 已使用磁盘大小，单位GB。 **取值范围**： 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
   
 表9MysqlBackupStrategy 
| 参数         | 参数类型   | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
|:---|:---|:---|
| start_time | String | **参数解释**： 自动备份开始时间段。自动备份将在该时间一个小时内触发。 **取值范围**： 非空，格式必须为hh:mm-HH:MM且有效，当前时间指UTC时间。 1. HH取值必须比hh大1。   2. mm和MM取值必须相同，且取值必须为00。    |
| keep_days  | String | **参数解释**： 自动备份保留天数。 **取值范围**： 1-732。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
   
 表10MysqlChargeInfo 
| 参数            | 参数类型    | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
|:---|:---|:---|
| charge_mode   | String  | **参数解释**： 计费模式。 **取值范围**： - prePaid：预付费，即包年/包月。   - postPaid：后付费，即按需付费。                                    |
| period_type   | String  | **参数解释**： 包周期付费模式下的订购周期类型。 **取值范围**： - month：包月。   - year：包年。                                              |
| period_num    | Integer | **参数解释**： 包周期付费模式下的订购时间。 **取值范围**： - "period_type"为"month"时，取值为1\~9。   - "period_type"为"year"时，取值为1\~3。    |
| is_auto_renew | String  | **参数解释**： 创建包年/包月实例时可指定，表示是否自动续订，续订的周期和原周期相同，且续订时会自动支付。 **取值范围**： - true：自动续订。   - false：不自动续订。            |
| is_auto_pay   | String  | **参数解释**： 创建包年/包月实例时可指定，表示是否自动从客户的账户中支付，此字段不影响自动续订的支付方式。 **取值范围**： - true：自动支付。   - false：手动支付。            |
   
 表11InstanceTagItem 
| 参数    | 参数类型   | 描述                                                                                                                                                                                              |
|:---|:---|:---|
| key   | String | **参数解释**： 标签键。 **取值范围**： 不涉及。 |
| value | String | **参数解释**： 标签值。 **取值范围**： 不涉及。 |
   
**状态码：400**
表12响应Body参数 
| 参数         | 参数类型   | 描述    |
|:---|:---|:---|
| error_code | String | 错误码。  |
| error_msg  | String | 错误消息。 |
   
**状态码：500**
表13响应Body参数 
| 参数         | 参数类型   | 描述    |
|:---|:---|:---|
| error_code | String | 错误码。  |
| error_msg  | String | 错误消息。 |
   
#### 请求示例
查询TaurusDB实例列表，读写内网IP地址是192.168.0.142。
```
GET        https://{endpoint}/v3.1/054e292c9880d4992f02c0196d3ea468/instances?id=61a4ea66210545909d74a05c27a7179ein07&name=gaussdb-mysql-instance01&type=Cluster&datastore_type=gaussdb-mysql&vpc_id=3cedfc54-b105-4652-a4e0-847b11576b58&subnet_id=c1cfa53c-65d3-431e-8552-326bf310c7ad&private_ip=192.168.0.142&offset=0&limit=10&tags=taurusKey1=value1
```
#### 响应示例
**状态码：200**
```
{
  "total_count" : 1,
  "instances" : [ {
    "id" : "61a4ea66210545909d74a05c27a7179ein07",
    "name" : "gaussdb-mysql-instance01",
    "status" : "normal",
    "port" : "3306",
    "type" : "Cluster",
    "private_ips" : [ "192.168.0.142" ],
    "readonly_private_ips" : [ "192.168.0.228", "192.168.0.165" ],
    "proxy_ips" : [ "192.168.0.15" ],
    "db_user_name" : "root",
    "region" : "cn-north-4",
    "datastore" : {
      "type" : "gaussdb-mysql",
      "version" : "8.0",
      "kernel_version" : "2.0.29.1"
    },
    "created" : "2018-08-20T02:33:49+0800",
    "updated" : "2018-08-20T02:33:49+0800",
    "volume" : {
      "type" : "POOL",
      "size" : "100"
    },
    "vpc_id" : "3cedfc54-b105-4652-a4e0-847b11576b58",
    "subnet_id" : "c1cfa53c-65d3-431e-8552-326bf310c7ad",
    "security_group_id" : "fc577a1a-f202-424a-977f-24faec3fdd55",
    "flavor_ref" : "gaussdb.mysql.c3.small.4",
    "flavor_info" : {
      "vcpus" : "8",
      "ram" : "16"
    },
    "backup_strategy" : {
      "start_time" : "19:00-20:00",
      "keep_days" : "7"
    },
    "charge_info" : {
      "charge_mode" : "postPaid"
    },
    "enterprise_project_id" : "0",
    "time_zone" : "UTC",
    "tags" : [ {
      "key" : "taurusKey1",
      "value" : "value1"
    } ]
  } ]
}
```
#### SDK代码示例
SDK代码示例如下。
- [Java]
  ```
  package com.huaweicloud.sdk.test;
  import com.huaweicloud.sdk.core.auth.ICredential;
  import com.huaweicloud.sdk.core.auth.BasicCredentials;
  import com.huaweicloud.sdk.core.exception.ConnectionException;
  import com.huaweicloud.sdk.core.exception.RequestTimeoutException;
  import com.huaweicloud.sdk.core.exception.ServiceResponseException;
  import com.huaweicloud.sdk.gaussdb.v3.region.GaussDBRegion;
  import com.huaweicloud.sdk.gaussdb.v3.*;
  import com.huaweicloud.sdk.gaussdb.v3.model.*;
  public class ListGaussMySqlInstancesUnifyStatusSolution {
      public static void main(String[] args) {
          // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
          // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
          String ak = System.getenv("CLOUD_SDK_AK");
          String sk = System.getenv("CLOUD_SDK_SK");
          String projectId = "{project_id}";
          ICredential auth = new BasicCredentials()
                  .withProjectId(projectId)
                  .withAk(ak)
                  .withSk(sk);
          GaussDBClient client = GaussDBClient.newBuilder()
                  .withCredential(auth)
                  .withRegion(GaussDBRegion.valueOf("<YOUR REGION>"))
                  .build();
          ListGaussMySqlInstancesUnifyStatusRequest request = new ListGaussMySqlInstancesUnifyStatusRequest();
          try {
              ListGaussMySqlInstancesUnifyStatusResponse response = client.listGaussMySqlInstancesUnifyStatus(request);
              System.out.println(response.toString());
          } catch (ConnectionException e) {
              e.printStackTrace();
          } catch (RequestTimeoutException e) {
              e.printStackTrace();
          } catch (ServiceResponseException e) {
              e.printStackTrace();
              System.out.println(e.getHttpStatusCode());
              System.out.println(e.getRequestId());
              System.out.println(e.getErrorCode());
              System.out.println(e.getErrorMsg());
          }
      }
  }
  ```
- [Python]
  ```
  # coding: utf-8
  import os
  from huaweicloudsdkcore.auth.credentials import BasicCredentials
  from huaweicloudsdkgaussdb.v3.region.gaussdb_region import GaussDBRegion
  from huaweicloudsdkcore.exceptions import exceptions
  from huaweicloudsdkgaussdb.v3 import *
  if __name__ == "__main__":
      # The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
      # In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
      ak = os.environ["CLOUD_SDK_AK"]
      sk = os.environ["CLOUD_SDK_SK"]
      projectId = "{project_id}"
      credentials = BasicCredentials(ak, sk, projectId)
      client = GaussDBClient.new_builder() \
          .with_credentials(credentials) \
          .with_region(GaussDBRegion.value_of("<YOUR REGION>")) \
          .build()
      try:
          request = ListGaussMySqlInstancesUnifyStatusRequest()
          response = client.list_gauss_my_sql_instances_unify_status(request)
          print(response)
      except exceptions.ClientRequestException as e:
          print(e.status_code)
          print(e.request_id)
          print(e.error_code)
          print(e.error_msg)
  ```
- [Go]
  ```
  package main
  import (
  "fmt"
  "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic"
      gaussdb "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/gaussdb/v3"
  "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/gaussdb/v3/model"
      region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/gaussdb/v3/region"
  )
  func main() {
      // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
      // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
      ak := os.Getenv("CLOUD_SDK_AK")
      sk := os.Getenv("CLOUD_SDK_SK")
      projectId := "{project_id}"
      auth, err := basic.NewCredentialsBuilder().
          WithAk(ak).
          WithSk(sk).
          WithProjectId(projectId).
          SafeBuild()
      if err != nil {
          fmt.Println(err)
          return
      }
      hcClient, err := gaussdb.GaussDBClientBuilder().
           WithRegion(region.ValueOf("<YOUR REGION>")).
           WithCredential(auth).
           SafeBuild()
      if err != nil {
          fmt.Println(err)
          return
      }
      client := gaussdb.NewGaussDBClient(hcClient)
      request := &model.ListGaussMySqlInstancesUnifyStatusRequest{}
  response, err := client.ListGaussMySqlInstancesUnifyStatus(request)
  if err == nil {
          fmt.Printf("%+v\n", response)
      } else {
          fmt.Println(err)
      }
  }
  ```
- [更多]
  更多编程语言的SDK代码示例，请参见[API Explorer](https://console.huaweicloud.com/apiexplorer/#/openapi/GaussDB/sdk?api=ListGaussMySqlInstancesUnifyStatus)的代码示例页签，可生成自动对应的SDK代码示例。
#### 状态码
| 状态码 | 描述            |
|:---|:---|
| 200 | Success.      |
| 400 | Client error. |
| 500 | Server error. |
   
#### 错误码
请参见[错误码](https://support.huaweicloud.com/api-taurusdb/ErrorCode.html)。
