# 创建数据库实例 - CreateGaussMySqlInstance
#### 功能介绍
创建云数据库TaurusDB实例。
#### 调用方法
请参见[如何调用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:create | Write | -           | - g:EnterpriseProjectId   - g:RequestTag/\<tag-key\>   - g:TagKeys   - gaussdbformysql:FlavorType   - gaussdbformysql:SubnetId   - gaussdbformysql:VpcId   - gaussdbformysql:TDESwitch    | - gaussdb:instance:create  - gaussdb:instance:modify   | -      |
     
  
 
#### URI
POST /v3/{project_id}/instances
表1路径参数 
| 参数         | 是否必选 | 参数类型   | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
|:---|:---|:---|:---|
| project_id | 是    | String | **参数解释**： 租户在某一Region下的project ID。 获取方法请参见[获取项目ID](https://support.huaweicloud.com/api-taurusdb/taurusdb_10_0004.html)。 **约束限制**： 不涉及。 **取值范围**： 只能由英文字母、数字组成，且长度为32个字符。 **默认取值**： 不涉及。 |
   
#### 请求参数
表2请求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。 |
   
表3请求Body参数 
| 参数                       | 是否必选 | 参数类型                                                                                                 | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
|:---|:---|:---|:---|
| region                   | 是    | String                                                                                               | **参数解释**： 区域ID。 获取方法请参见[地区和终端节点](https://console.huaweicloud.com/apiexplorer/#/endpoint)。 **约束限制**： 不涉及。 **取值范围**： 不涉及。 **默认取值**： 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| name                     | 是    | String                                                                                               | **参数解释**： 实例名称。 **约束限制**： 同一租户下，同类型的实例名可重名。 **取值范围**： 最小为4个字符，最大为64个字符且不超过64个字节（注意：一个中文字符占用3个字节），必须以字母或中文开头，区分大小写，可以包含字母、数字、中划线、下划线或中文，不能包含其他特殊字符。 **默认取值**： 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| datastore                | 是    | [MysqlDatastoreInReq] object                 | **参数解释**： 数据库信息。 **约束限制**： 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| mode                     | 是    | String                                                                                               | **参数解释**： 实例模式。 **约束限制**： 不涉及。 **取值范围**： - Cluster：集群版。   - StandSingle：单机版。    **默认取值**： 不涉及。                                                                                                                                                                                                                        |
| flavor_ref               | 是    | String                                                                                               | **参数解释**： 规格码。 使用可参考[查询数据库规格](https://support.huaweicloud.com/api-taurusdb/ShowGaussMySqlFlavors.html)响应消息表5中的"spec_code"。 **约束限制**： 不涉及。 **取值范围**： 不涉及。 **默认取值**： 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| 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)。    **约束限制**： 不涉及。 **取值范围**： 不涉及。 **默认取值**： 不涉及。                                     |
| password                 | 是    | String                                                                                               | **参数解释**： 数据库密码。 **约束限制**： 建议您输入高强度密码，以提高安全性，防止出现密码被暴力破解等安全风险。如果您输入弱密码，系统会自动判定密码非法。 **取值范围**： 至少包含以下字符的四种：大小写字母、数字和特殊符号\|.\~!@#$%\^\*-_=+?,()\&，长度8\~32个字符。 **默认取值**： 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| availability_zone_mode   | 是    | String                                                                                               | **参数解释**： 可用区类型。 **约束限制**： 不涉及。 **取值范围**： - single：单可用区。   - multi：多可用区。    **默认取值**： 不涉及。                                                                                                                                                                                                                            |
| slave_count              | 是    | Integer                                                                                              | **参数解释**： 只读节点个数。 **约束限制**： 单次接口调用最多支持创建9个只读节点。实例模式取值为StandSingle时取值必须为0。 **取值范围**： 0-9。 **默认取值**： 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| charge_info              | 是    | [MysqlChargeInfo] object                         | **参数解释**： 计费类型信息，支持包年包月和按需计费，默认为按需计费。 **约束限制**： DeC专属云账号不支持创建包年/包月实例。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| security_group_id        | 否    | String                                                                                               | **参数解释**： 安全组ID。获取方法如下： - 方法1：登录虚拟私有云服务的控制台界面，在安全组的详情页面查找安全组ID。   - 方法2：通过虚拟私有云服务的API接口查询，具体操作可参考[查询安全组列表](https://support.huaweicloud.com/api-vpc/vpc_sg01_0003.html)。    **约束限制**： 如果实例所选用的子网开启网络ACL进行访问控制，则该参数非必选。如果未开启ACL进行访问控制，则该参数必选。 **取值范围**： 不涉及。 **默认取值**： 不涉及。 |
| configuration_id         | 否    | String                                                                                               | **参数解释**： 参数模板ID。使用可参考[查询参数模板](https://support.huaweicloud.com/api-taurusdb/ListGaussMySqlConfigurations.html)中响应消息表5的"id"。 **约束限制**： 不涉及。 **取值范围**： 不涉及。 **默认取值**： 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| backup_strategy          | 是    | [MysqlBackupStrategy] object                 | **参数解释**： 自动备份策略。 **约束限制**： 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| time_zone                | 否    | String                                                                                               | **参数解释**： 时区信息。 **约束限制**： 不涉及。 **取值范围**： UTC-11:00\~+12:00内的所有整点时间。 **默认取值**： UTC。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| master_availability_zone | 否    | String                                                                                               | **参数解释**： 主可用区ID。 **约束限制**： 创建单可用区实例选填，多可用区实例必填。 **取值范围**： 调用[查询数据库规格](https://support.huaweicloud.com/api-taurusdb/ShowGaussMySqlFlavors.html)接口，可在返回信息中找的可用区ID。 **默认取值**： 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| volume                   | 否    | [MysqlVolume] object                                 | **参数解释**： volume信息。 **约束限制**： 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| tags                     | 否    | Array of [MysqlTags] objects                           | **参数解释**： 标签列表，根据标签键值对创建实例。 **约束限制**： - {key}表示标签键，不可以为空或重复。   - {value}表示标签值，可以为空。    如果创建实例时同时使用多个标签键值对，中间使用逗号分隔开，最多包含20组。                                                                                                                                                                                                                                                                                                                              |
| lower_case_table_names   | 否    | Integer                                                                                              | **参数解释**： 表名大小写是否敏感。 **约束限制**： 创建完成后不支持修改。 **取值范围**： - 0：表名被存储成固定且表名称大小写敏感。   - 1：表名将被存储成小写且表名称大小写不敏感。    **默认取值**： 1。                                                                                                                                                                                                |
| enterprise_project_id    | 否    | String                                                                                               | **参数解释**： 企业项目ID。 使用请参考《企业管理 API参考》的"[查询企业项目列表](https://support.huaweicloud.com/api-em/zh-cn_topic_0121230880.html)"响应消息表"enterprise_project字段数据结构说明"的"id"。 **约束限制**： 如果账户开通企业项目服务则该参数必选，未开启该参数不可选。 **取值范围**： 不涉及。 **默认取值**： 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| dedicated_resource_id    | 否    | String                                                                                               | **参数解释**： 专属资源池ID。 通过调用[查询专属资源池列表](https://support.huaweicloud.com/api-taurusdb/ListGaussMySqlDedicatedResources.html)接口可获取。 **约束限制**： 只有开通专属资源池后才支持此参数。 **取值范围**： 不涉及。 **默认取值**： 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| restore_point            | 否    | [MysqlRestorePoint] object                     | **参数解释**： 备份恢复信息。 **约束限制**： 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| tde_info                 | 否    | [MysqlTdeInfo] object                               | **参数解释**： 透明数据加密配置信息，支持AES256、SM4加密算法。 **约束限制**： 透明加密功能目前处于公测阶段，如需使用，请提交工单联系客服人员申请权限。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| enable_binlog            | 否    | Boolean                                                                                              | **参数解释**： 是否打开本地Binlog日志。 **约束限制**： 不涉及。 **取值范围**： - true: 打开。   - false: 关闭。    **默认取值**： false。                                                                                                                                                                                                                     |
| volume_auto_expand       | 否    | [MysqlVolumeAutoExpandPolicy] object | **参数解释**： 包年/包月实例存储空间自动扩容开关。 **约束限制**： 仅支持包年/包月实例。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
   
 表4MysqlDatastoreInReq 
| 参数             | 是否必选 | 参数类型   | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
|:---|:---|:---|:---|
| type           | 是    | String | **参数解释**： 数据库引擎名称。 **约束限制**： 现在只支持gaussdb-mysql。 **取值范围**： gaussdb-mysql。 **默认取值**： 不涉及。                                                                                                                                 |
| version        | 是    | String | **参数解释**： 数据库版本。 **约束限制**： 不涉及。 **取值范围**： 两位数的大版本号，获取方法请参见[查询数据库引擎的版本](https://support.huaweicloud.com/api-taurusdb/ShowGaussMySqlEngineVersion.html)返回的name字段。 **默认取值**： 不涉及。                                           |
| kernel_version | 否    | String | **参数解释**： 内核数据库版本。如果需要指定具体的内核版本，请联系客服人员添加白名单。 **约束限制**： 不涉及。 **取值范围** 完整的四位内核数据库版本，获取方法请参见[查询数据库引擎的版本](https://support.huaweicloud.com/api-taurusdb/ShowGaussMySqlEngineVersion.html)返回的kernel_version字段。 **默认取值**： 不涉及。 |
   
 表5MysqlChargeInfo 
| 参数            | 是否必选 | 参数类型    | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
|:---|:---|:---|:---|
| charge_mode   | 是    | String  | **参数解释**： 计费模式。 **约束限制**： 不涉及。 **取值范围**： - prePaid：预付费，即包年/包月。   - postPaid：后付费，即按需付费。    **默认取值**： postPaid。                                                     |
| period_type   | 否    | String  | **参数解释**： 包周期付费模式下的订购周期类型。 **约束限制**： charge_mode为prePaid时生效，且为必选值。 **取值范围**： - month：包月。   - year：包年。    **默认取值**： 不涉及。                                           |
| period_num    | 否    | Integer | **参数解释**： 包周期付费模式下的订购时间。 **约束限制**： charge_mode为prePaid时生效，且为必选值。 **取值范围**： - "period_type"为"month"时，取值为1\~9。   - "period_type"为"year"时，取值为1\~3。    **默认取值**： 不涉及。 |
| is_auto_renew | 否    | String  | **参数解释**： 创建包年/包月实例时可指定，表示是否自动续订，续订的周期和原周期相同，且续订时会自动支付。 **约束限制**： charge_mode为prePaid时生效。 **取值范围**： - true：自动续订。   - false：不自动续订。    **默认取值**： false。             |
| is_auto_pay   | 否    | String  | **参数解释**： 创建包年/包月实例时可指定，表示是否自动从客户的账户中支付，此字段不影响自动续订的支付方式。 **约束限制**： charge_mode为prePaid时生效。 **取值范围**： - true：自动支付。   - false：手动支付。    **默认取值**： true。              |
   
 表6MysqlBackupStrategy 
| 参数         | 是否必选 | 参数类型   | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
|:---|:---|:---|:---|
| start_time | 是    | String | **参数解释**： 自动备份开始时间段。自动备份将在该时间一个小时内触发。 **约束限制**： 不涉及。 **取值范围**： 非空，格式必须为hh:mm-HH:MM且有效，当前时间指UTC时间。 1. HH取值必须比hh大1。   2. mm和MM取值必须相同，且取值必须为00。    **默认取值**： 不涉及。 |
| keep_days  | 否    | String | **参数解释**： 自动备份保留天数。 **约束限制**： 值为正整数。 **取值范围**： 1-732。 **默认取值**： 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
   
 表7MysqlVolume 
| 参数   | 是否必选 | 参数类型   | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
|:---|:---|:---|:---|
| size | 否    | String | **参数解释**： 磁盘大小，单位GB。 **约束限制**： 必须为10的整数倍。创建按需实例时不可选。 **取值范围**： 10-128000。 **默认取值**： 10。                                                                                                                                                                                                                                                                                                                                                                                                          |
| type | 否    | String | **参数解释**： 磁盘存储类型。 **约束限制**： 不涉及。 **取值范围**： - DL6：DL6存储类型。   - DL5：DL5存储类型。    **默认取值**： DL6。 |
   
 表8MysqlTags 
| 参数    | 是否必选 | 参数类型   | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
|:---|:---|:---|:---|
| key   | 是    | String | **参数解释**: 标签键。 **约束限制**： key不能为空或者空字符串，不能为空格。 **取值范围**： 1-128个unicode字符。字符集：A-Z，a-z ，0-9，'-'，'_'，UNICODE字符（\\u4E00-\\u9FFF）。 **默认取值**： 不涉及。 |
| value | 是    | String | **参数解释**: 标签值。 **约束限制**： 可以为空字符串。 **取值范围**： 0-255个unicode字符。字符集：A-Z，a-z ，0-9，'-'，'_'，UNICODE字符（\\u4E00-\\u9FFF）。 **默认取值**： 不涉及。             |
   
 表9MysqlRestorePoint 
| 参数                 | 是否必选 | 参数类型   | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
|:---|:---|:---|:---|
| source_instance_id | 是    | String | **参数解释**： 源实例ID。 **约束限制**： 不涉及。 **取值范围**： 只能由英文字母、数字组成，后缀为in07，长度为36个字符。 **默认取值**： 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| restore_time       | 否    | Long   | **参数解释**： 需要恢复的备份时间点。 **约束限制**： 格式为UNIX时间戳，单位是毫秒，时区为UTC标准时区。传参时需要将对应时区的时间转为标准时区对应的时间戳，比如，北京时区的时间点需要-8h后再转为时间戳。 **取值范围**： 通过[查询可恢复时间段](https://support.huaweicloud.com/api-taurusdb/ShowBackupRestoreTime.html)获取。 **默认取值**： 不涉及。                                                                                                                                                                                                                                                                                                                                                                |
| backup_id          | 否    | String | **参数解释**： 备份文件ID。 **约束限制**： 不涉及。 **取值范围**： 不涉及。 **默认取值**： 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| type               | 否    | String | **参数解释**： 备份类型。 **约束限制**： 当参数为空时，backup_id不能为空，即默认按备份文件恢复 **取值范围**： 当参数不为空时，取值范围： - backup：表示按备份文件恢复。   - timestamp：表示按时间点恢复。    **默认取值**： 不涉及。 |
   
 表10MysqlTdeInfo 
| 参数              | 是否必选 | 参数类型    | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
|:---|:---|:---|:---|
| enable_tde      | 是    | Boolean | **参数解释**： 是否打开透明加密功能。 **约束限制**： 不涉及。 **取值范围**： - true: 打开。   - false: 关闭。    **默认取值**： 不涉及。 |
| encryption_type | 是    | String  | **参数解释**: 透明加密算法。 **约束限制**： 不涉及。 **取值范围**： - AES256。   - SM4。    **默认取值**： 不涉及。             |
   
 表11MysqlVolumeAutoExpandPolicy 
| 参数                        | 是否必选 | 参数类型    | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
|:---|:---|:---|:---|
| limit_size                | 否    | Integer | **参数解释**： 存储自动扩容上限，需要为10的倍数，单位GB。 **约束限制**： 不涉及。 **取值范围**： 10-128000。 **默认取值**： 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| trigger_available_percent | 否    | Integer | **参数解释**： 可用存储空间率。 **约束限制**： 不涉及。 **取值范围**： - 1   - 5   - 10   - 15   - 20    **默认取值**： 不涉及。 |
| step_percent              | 否    | Integer | **参数解释**： 扩容步长百分比。 **约束限制**： 不涉及。 **取值范围**： 5-50。 **默认取值**： 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
   
#### 响应参数
**状态码：201**
表12响应Body参数 
| 参数       | 参数类型                                                                                      | 描述                                                                                                                                                                                                                                 |
|:---|:---|:---|
| instance | [MysqlInstanceResponse] object | **参数解释**： 实例信息。 **取值范围**： 不涉及                                                                  |
| job_id   | String                                                                                    | **参数解释** 实例创建的任务ID。 仅创建按需实例时会返回该参数。 **取值范围**： 不涉及。 |
| order_id | String                                                                                    | **参数解释**： 订单号，创建包年包月时返回该参数。 **取值范围**： 不涉及。                                                     |
   
 表13MysqlInstanceResponse 
| 参数                       | 参数类型                                                                                  | 描述                                                                                                                                                                                           |
|:---|:---|:---|
| id                       | String                                                                                | **参数解释**： 实例ID。 **取值范围**： 只能由英文字母、数字组成，后缀为in07，长度为36个字符。 |
| name                     | String                                                                                | **参数解释**： 实例名称。 **取值范围**： 与请求参数中的实例名称一致。                 |
| status                   | String                                                                                | **参数解释**： 实例状态。 **取值范围**： BUILD：实例创建中。                   |
| datastore                | [MysqlDatastoreInRes] object | **参数解释**： 数据库信息。                                                                                                                                 |
| mode                     | String                                                                                | **参数解释**： 实例模式。 **取值范围**： 与请求参数中的实例模式一致。                 |
| configuration_id         | String                                                                                | **参数解释**： 参数组ID。 **取值范围**： 不涉及。                          |
| port                     | String                                                                                | **参数解释**： 数据库端口信息。 **取值范围**： 不涉及。                        |
| backup_strategy          | [MysqlBackupStrategy] object | **参数解释**： 自动备份策略。                                                                                                                                |
| enterprise_project_id    | String                                                                                | **参数解释**： 企业项目ID。 **取值范围**： 和请求参数中的企业项目ID保持一致。           |
| region                   | String                                                                                | **参数解释**： 区域ID。 **取值范围**： 与请求参数中的区域ID一致。                 |
| availability_zone_mode   | String                                                                                | **参数解释**： 可用区模式。 **取值范围**： 与请求参数中的可用区模式一致。               |
| master_availability_zone | String                                                                                | **参数解释**： 主可用区ID。 **取值范围**： 与请求参数中的主可用区ID一致。             |
| vpc_id                   | String                                                                                | **参数解释**： 虚拟私有云ID，与请求参数相同。 **取值范围**： 与请求参数中的虚拟私有云ID一致。   |
| security_group_id        | String                                                                                | **参数解释**： 安全组ID，与请求参数相同。 **取值范围**： 与请求参数中的安全组ID一致。       |
| subnet_id                | String                                                                                | **参数解释**： 子网ID，与请求参数相同。 **取值范围**： 与请求参数中的子网ID一致。         |
| flavor_ref               | String                                                                                | **参数解释**： 规格码。 **取值范围**： 与请求参数中的规格码一致。                   |
| charge_info              | [MysqlChargeInfo] object         | **参数解释**： 计费类型信息，支持包年包月和按需计费，默认为按需计费。                                                                                                            |
| volume                   | [MysqlVolumeResp] object         | **参数解释**： volume信息。创建包年/包月实例有返回。                                                                                                                 |
   
 表14MysqlDatastoreInRes 
| 参数             | 参数类型   | 描述                                                                                                                                                                            |
|:---|:---|:---|
| type           | String | **参数解释**： 数据库引擎。 **取值范围**： gaussdb-mysql。 |
| version        | String | **参数解释**： 数据库版本。 **取值范围**： 不涉及。           |
| kernel_version | String | **参数解释**： 内核数据库版本。 **取值范围**： 不涉及。         |
   
 表15MysqlBackupStrategy 
| 参数         | 参数类型   | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
|:---|:---|:---|
| start_time | String | **参数解释**： 自动备份开始时间段。自动备份将在该时间一个小时内触发。 **取值范围**： 非空，格式必须为hh:mm-HH:MM且有效，当前时间指UTC时间。 1. HH取值必须比hh大1。   2. mm和MM取值必须相同，且取值必须为00。    |
| keep_days  | String | **参数解释**： 自动备份保留天数。 **取值范围**： 1-732。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
   
 表16MysqlChargeInfo 
| 参数            | 参数类型    | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
|:---|:---|:---|
| 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：手动支付。            |
   
 表17MysqlVolumeResp 
| 参数   | 参数类型    | 描述                                                                                                                                                                                     |
|:---|:---|:---|
| size | Integer | **参数解释** 磁盘大小, 单位GB。 **取值范围**： 10\~128000，为10的整数倍。 |
   
**状态码：400**
表18响应Body参数 
| 参数         | 参数类型   | 描述    |
|:---|:---|:---|
| error_code | String | 错误码。  |
| error_msg  | String | 错误消息。 |
   
**状态码：500**
表19响应Body参数 
| 参数         | 参数类型   | 描述    |
|:---|:---|:---|
| error_code | String | 错误码。  |
| error_msg  | String | 错误消息。 |
   
#### 请求示例
- 创建计费模式为按需计费，自动备份开始时间是08:00-09:00的实例。
  ```
  POST https://{endpoint}/v3/054e292c9880d4992f02c0196d3ea468/instances
  {
    "name" : "gaussdb-mysql-instance1",
    "region" : "cn-north-4",
    "charge_info" : {
      "charge_mode" : "postPaid"
    },
    "datastore" : {
      "type" : "gaussdb-mysql",
      "version" : "8.0"
    },
    "mode" : "Cluster",
    "flavor_ref" : "gaussdb.mysql.xlarge.arm.4",
    "vpc_id" : "3cedfc54-b105-4652-a4e0-847b11576b58",
    "subnet_id" : "c1cfa53c-65d3-431e-8552-326bf310c7ad",
    "security_group_id" : "fc577a1a-f202-424a-977f-24faec3fdd55",
    "configuration_id" : "43570e0de32e40c5a15f831aa5ce4176pr07",
    "password" : "***",
    "backup_strategy" : {
      "start_time" : "08:00-09:00"
    },
    "availability_zone_mode" : "single",
    "slave_count" : 1,
    "enterprise_project_id" : "0"
  }
  ```
  
- 将备份文件恢复到按需计费的新实例。
  ```
  POST https://{endpoint}/v3/054e292c9880d4992f02c0196d3ea468/instances
  {
    "name" : "gaussdb-mysql-instance2",
    "region" : "cn-north-4",
    "charge_info" : {
      "charge_mode" : "postPaid"
    },
    "datastore" : {
      "type" : "gaussdb-mysql",
      "version" : "8.0"
    },
    "mode" : "Cluster",
    "flavor_ref" : "gaussdb.mysql.xlarge.arm.4",
    "vpc_id" : "3cedfc54-b105-4652-a4e0-847b11576b58",
    "subnet_id" : "c1cfa53c-65d3-431e-8552-326bf310c7ad",
    "security_group_id" : "fc577a1a-f202-424a-977f-24faec3fdd55",
    "configuration_id" : "43570e0de32e40c5a15f831aa5ce4176pr07",
    "password" : "***",
    "backup_strategy" : {
      "start_time" : "08:00-09:00"
    },
    "availability_zone_mode" : "single",
    "slave_count" : 1,
    "enterprise_project_id" : "0",
    "restore_point" : {
      "source_instance_id" : "7033e7c3cf93438797d44ad7ae0a7d95in07",
      "backup_id" : "7ffbf305376b4cbea0ae491257b6aaf9br07",
      "type" : "backup"
    }
  }
  ```
  
- 按时间点恢复到按需计费的新实例。
  ```
  POST https://{endpoint}/v3/054e292c9880d4992f02c0196d3ea468/instances
  {
    "name" : "gaussdb-mysql-instance3",
    "region" : "cn-north-4",
    "charge_info" : {
      "charge_mode" : "postPaid"
    },
    "datastore" : {
      "type" : "gaussdb-mysql",
      "version" : "8.0"
    },
    "mode" : "Cluster",
    "flavor_ref" : "gaussdb.mysql.xlarge.arm.4",
    "vpc_id" : "3cedfc54-b105-4652-a4e0-847b11576b58",
    "subnet_id" : "c1cfa53c-65d3-431e-8552-326bf310c7ad",
    "security_group_id" : "fc577a1a-f202-424a-977f-24faec3fdd55",
    "configuration_id" : "43570e0de32e40c5a15f831aa5ce4176pr07",
    "password" : "***",
    "backup_strategy" : {
      "start_time" : "08:00-09:00"
    },
    "availability_zone_mode" : "single",
    "slave_count" : 1,
    "enterprise_project_id" : "0",
    "restore_point" : {
      "source_instance_id" : "7033e7c3cf93438797d44ad7ae0a7d95in07",
      "restore_time" : 1673852043000,
      "type" : "timestamp"
    }
  }
  ```
  
- 创建周期为一个月的包年/包月实例。
  ```
  POST https://{endpoint}/v3/054e292c9880d4992f02c0196d3ea468/instances
  {
    "name" : "gaussdb-mysql-instance4",
    "region" : "cn-north-4",
    "charge_info" : {
      "charge_mode" : "prePaid",
      "period_type" : "month",
      "period_num" : 1,
      "is_auto_renew" : "false",
      "is_auto_pay" : "true"
    },
    "volume" : {
      "size" : "10"
    },
    "datastore" : {
      "type" : "gaussdb-mysql",
      "version" : "8.0"
    },
    "mode" : "Cluster",
    "flavor_ref" : "gaussdb.mysql.xlarge.arm.4",
    "vpc_id" : "3cedfc54-b105-4652-a4e0-847b11576b58",
    "subnet_id" : "c1cfa53c-65d3-431e-8552-326bf310c7ad",
    "security_group_id" : "fc577a1a-f202-424a-977f-24faec3fdd55",
    "configuration_id" : "43570e0de32e40c5a15f831aa5ce4176pr07",
    "password" : "***",
    "backup_strategy" : {
      "start_time" : "08:00-09:00"
    },
    "availability_zone_mode" : "single",
    "slave_count" : 1,
    "enterprise_project_id" : "0",
    "restore_point" : {
      "source_instance_id" : "7033e7c3cf93438797d44ad7ae0a7d95in07",
      "restore_time" : 1673852043000,
      "type" : "timestamp"
    }
  }
  ```
  
 
#### 响应示例
**状态码：201**
- 创建按需实例。
  ```
  {
    "instance" : {
      "id" : "5eebbb4c0f9f4a99b42ed1b6334569aain07",
      "name" : "gaussdb-mysql-instance1",
      "status" : "BUILD",
      "region" : "cn-north-4",
      "charge_info" : {
        "charge_mode" : "postPaid"
      },
      "datastore" : {
        "type" : "gaussdb-mysql",
        "version" : "8.0",
        "kernel_version" : "2.0.28.18"
      },
      "mode" : "Cluster",
      "port" : "3306",
      "enterprise_project_id" : "0",
      "flavor_ref" : "gaussdb.mysql.xlarge.arm.4",
      "vpc_id" : "3cedfc54-b105-4652-a4e0-847b11576b58",
      "subnet_id" : "c1cfa53c-65d3-431e-8552-326bf310c7ad",
      "security_group_id" : "fc577a1a-f202-424a-977f-24faec3fdd55",
      "configuration_id" : "43570e0de32e40c5a15f831aa5ce4176pr07",
      "backup_strategy" : {
        "start_time" : "08:00-09:00",
        "keep_days" : "7"
      },
      "availability_zone_mode" : "single"
    },
    "job_id" : "dff1d289-4d03-4942-8b9f-463ea07c000d"
  }
  ```
  
- 创建周期为一个月的包年/包月实例。
  ```
  {
    "instance" : {
      "id" : "945419c2208e4a5d828b8dddc00223e1in07",
      "name" : "gaussdb-mysql-instance4",
      "status" : "BUILD",
      "region" : "cn-north-4",
      "charge_info" : {
        "charge_mode" : "prePaid",
        "period_type" : "month",
        "period_num" : 1,
        "is_auto_renew" : "false",
        "is_auto_pay" : "true"
      },
      "volume" : {
        "size" : 10
      },
      "datastore" : {
        "type" : "gaussdb-mysql",
        "version" : "8.0",
        "kernel_version" : "2.0.28.18"
      },
      "mode" : "Cluster",
      "port" : "3306",
      "enterprise_project_id" : "0",
      "flavor_ref" : "gaussdb.mysql.xlarge.arm.4",
      "vpc_id" : "3cedfc54-b105-4652-a4e0-847b11576b58",
      "subnet_id" : "c1cfa53c-65d3-431e-8552-326bf310c7ad",
      "security_group_id" : "fc577a1a-f202-424a-977f-24faec3fdd55",
      "configuration_id" : "43570e0de32e40c5a15f831aa5ce4176pr07",
      "backup_strategy" : {
        "start_time" : "08:00-09:00",
        "keep_days" : "7"
      },
      "availability_zone_mode" : "single"
    },
    "order_id" : "CS2308241236EEXVF"
  }
  ```
  
 
#### SDK代码示例
SDK代码示例如下。
- [Java]
  - 创建计费模式为按需计费，自动备份开始时间是08:00-09:00的实例。
    ```
    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 CreateGaussMySqlInstanceSolution {
        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();
            CreateGaussMySqlInstanceRequest request = new CreateGaussMySqlInstanceRequest();
            MysqlInstanceRequest body = new MysqlInstanceRequest();
            MysqlBackupStrategy backupStrategybody = new MysqlBackupStrategy();
            backupStrategybody.withStartTime("08:00-09:00");
            MysqlDatastoreInReq datastorebody = new MysqlDatastoreInReq();
            datastorebody.withType("gaussdb-mysql")
                .withVersion("8.0");
            MysqlChargeInfo chargeInfobody = new MysqlChargeInfo();
            chargeInfobody.withChargeMode(MysqlChargeInfo.ChargeModeEnum.fromValue("postPaid"));
            body.withEnterpriseProjectId("0");
            body.withSlaveCount(1);
            body.withAvailabilityZoneMode("single");
            body.withBackupStrategy(backupStrategybody);
            body.withPassword("***");
            body.withConfigurationId("43570e0de32e40c5a15f831aa5ce4176pr07");
            body.withSecurityGroupId("fc577a1a-f202-424a-977f-24faec3fdd55");
            body.withSubnetId("c1cfa53c-65d3-431e-8552-326bf310c7ad");
            body.withVpcId("3cedfc54-b105-4652-a4e0-847b11576b58");
            body.withFlavorRef("gaussdb.mysql.xlarge.arm.4");
            body.withMode("Cluster");
            body.withDatastore(datastorebody);
            body.withName("gaussdb-mysql-instance1");
            body.withRegion("cn-north-4");
            body.withChargeInfo(chargeInfobody);
            request.withBody(body);
            try {
                CreateGaussMySqlInstanceResponse response = client.createGaussMySqlInstance(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());
            }
        }
    }
    ```
    
  
  - 将备份文件恢复到按需计费的新实例。
    ```
    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 CreateGaussMySqlInstanceSolution {
        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();
            CreateGaussMySqlInstanceRequest request = new CreateGaussMySqlInstanceRequest();
            MysqlInstanceRequest body = new MysqlInstanceRequest();
            MysqlRestorePoint restorePointbody = new MysqlRestorePoint();
            restorePointbody.withSourceInstanceId("7033e7c3cf93438797d44ad7ae0a7d95in07")
                .withBackupId("7ffbf305376b4cbea0ae491257b6aaf9br07")
                .withType("backup");
            MysqlBackupStrategy backupStrategybody = new MysqlBackupStrategy();
            backupStrategybody.withStartTime("08:00-09:00");
            MysqlDatastoreInReq datastorebody = new MysqlDatastoreInReq();
            datastorebody.withType("gaussdb-mysql")
                .withVersion("8.0");
            MysqlChargeInfo chargeInfobody = new MysqlChargeInfo();
            chargeInfobody.withChargeMode(MysqlChargeInfo.ChargeModeEnum.fromValue("postPaid"));
            body.withRestorePoint(restorePointbody);
            body.withEnterpriseProjectId("0");
            body.withSlaveCount(1);
            body.withAvailabilityZoneMode("single");
            body.withBackupStrategy(backupStrategybody);
            body.withPassword("***");
            body.withConfigurationId("43570e0de32e40c5a15f831aa5ce4176pr07");
            body.withSecurityGroupId("fc577a1a-f202-424a-977f-24faec3fdd55");
            body.withSubnetId("c1cfa53c-65d3-431e-8552-326bf310c7ad");
            body.withVpcId("3cedfc54-b105-4652-a4e0-847b11576b58");
            body.withFlavorRef("gaussdb.mysql.xlarge.arm.4");
            body.withMode("Cluster");
            body.withDatastore(datastorebody);
            body.withName("gaussdb-mysql-instance2");
            body.withRegion("cn-north-4");
            body.withChargeInfo(chargeInfobody);
            request.withBody(body);
            try {
                CreateGaussMySqlInstanceResponse response = client.createGaussMySqlInstance(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());
            }
        }
    }
    ```
    
  
  - 按时间点恢复到按需计费的新实例。
    ```
    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 CreateGaussMySqlInstanceSolution {
        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();
            CreateGaussMySqlInstanceRequest request = new CreateGaussMySqlInstanceRequest();
            MysqlInstanceRequest body = new MysqlInstanceRequest();
            MysqlRestorePoint restorePointbody = new MysqlRestorePoint();
            restorePointbody.withRestoreTime(1673852043000L)
                .withSourceInstanceId("7033e7c3cf93438797d44ad7ae0a7d95in07")
                .withType("timestamp");
            MysqlBackupStrategy backupStrategybody = new MysqlBackupStrategy();
            backupStrategybody.withStartTime("08:00-09:00");
            MysqlDatastoreInReq datastorebody = new MysqlDatastoreInReq();
            datastorebody.withType("gaussdb-mysql")
                .withVersion("8.0");
            MysqlChargeInfo chargeInfobody = new MysqlChargeInfo();
            chargeInfobody.withChargeMode(MysqlChargeInfo.ChargeModeEnum.fromValue("postPaid"));
            body.withRestorePoint(restorePointbody);
            body.withEnterpriseProjectId("0");
            body.withSlaveCount(1);
            body.withAvailabilityZoneMode("single");
            body.withBackupStrategy(backupStrategybody);
            body.withPassword("***");
            body.withConfigurationId("43570e0de32e40c5a15f831aa5ce4176pr07");
            body.withSecurityGroupId("fc577a1a-f202-424a-977f-24faec3fdd55");
            body.withSubnetId("c1cfa53c-65d3-431e-8552-326bf310c7ad");
            body.withVpcId("3cedfc54-b105-4652-a4e0-847b11576b58");
            body.withFlavorRef("gaussdb.mysql.xlarge.arm.4");
            body.withMode("Cluster");
            body.withDatastore(datastorebody);
            body.withName("gaussdb-mysql-instance3");
            body.withRegion("cn-north-4");
            body.withChargeInfo(chargeInfobody);
            request.withBody(body);
            try {
                CreateGaussMySqlInstanceResponse response = client.createGaussMySqlInstance(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());
            }
        }
    }
    ```
    
  
  - 创建周期为一个月的包年/包月实例。
    ```
    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 CreateGaussMySqlInstanceSolution {
        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();
            CreateGaussMySqlInstanceRequest request = new CreateGaussMySqlInstanceRequest();
            MysqlInstanceRequest body = new MysqlInstanceRequest();
            MysqlRestorePoint restorePointbody = new MysqlRestorePoint();
            restorePointbody.withRestoreTime(1673852043000L)
                .withSourceInstanceId("7033e7c3cf93438797d44ad7ae0a7d95in07")
                .withType("timestamp");
            MysqlVolume volumebody = new MysqlVolume();
            volumebody.withSize("10");
            MysqlBackupStrategy backupStrategybody = new MysqlBackupStrategy();
            backupStrategybody.withStartTime("08:00-09:00");
            MysqlDatastoreInReq datastorebody = new MysqlDatastoreInReq();
            datastorebody.withType("gaussdb-mysql")
                .withVersion("8.0");
            MysqlChargeInfo chargeInfobody = new MysqlChargeInfo();
            chargeInfobody.withChargeMode(MysqlChargeInfo.ChargeModeEnum.fromValue("prePaid"))
                .withPeriodType(MysqlChargeInfo.PeriodTypeEnum.fromValue("month"))
                .withPeriodNum(1)
                .withIsAutoRenew("false")
                .withIsAutoPay("true");
            body.withRestorePoint(restorePointbody);
            body.withEnterpriseProjectId("0");
            body.withVolume(volumebody);
            body.withSlaveCount(1);
            body.withAvailabilityZoneMode("single");
            body.withBackupStrategy(backupStrategybody);
            body.withPassword("***");
            body.withConfigurationId("43570e0de32e40c5a15f831aa5ce4176pr07");
            body.withSecurityGroupId("fc577a1a-f202-424a-977f-24faec3fdd55");
            body.withSubnetId("c1cfa53c-65d3-431e-8552-326bf310c7ad");
            body.withVpcId("3cedfc54-b105-4652-a4e0-847b11576b58");
            body.withFlavorRef("gaussdb.mysql.xlarge.arm.4");
            body.withMode("Cluster");
            body.withDatastore(datastorebody);
            body.withName("gaussdb-mysql-instance4");
            body.withRegion("cn-north-4");
            body.withChargeInfo(chargeInfobody);
            request.withBody(body);
            try {
                CreateGaussMySqlInstanceResponse response = client.createGaussMySqlInstance(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]
  - 创建计费模式为按需计费，自动备份开始时间是08:00-09:00的实例。
    ```
    # 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 = CreateGaussMySqlInstanceRequest()
            backupStrategybody = MysqlBackupStrategy(
                start_time="08:00-09:00"
            )
            datastorebody = MysqlDatastoreInReq(
                type="gaussdb-mysql",
                version="8.0"
            )
            chargeInfobody = MysqlChargeInfo(
                charge_mode="postPaid"
            )
            request.body = MysqlInstanceRequest(
                enterprise_project_id="0",
                slave_count=1,
                availability_zone_mode="single",
                backup_strategy=backupStrategybody,
                password="***",
                configuration_id="43570e0de32e40c5a15f831aa5ce4176pr07",
                security_group_id="fc577a1a-f202-424a-977f-24faec3fdd55",
                subnet_id="c1cfa53c-65d3-431e-8552-326bf310c7ad",
                vpc_id="3cedfc54-b105-4652-a4e0-847b11576b58",
                flavor_ref="gaussdb.mysql.xlarge.arm.4",
                mode="Cluster",
                datastore=datastorebody,
                name="gaussdb-mysql-instance1",
                region="cn-north-4",
                charge_info=chargeInfobody
            )
            response = client.create_gauss_my_sql_instance(request)
            print(response)
        except exceptions.ClientRequestException as e:
            print(e.status_code)
            print(e.request_id)
            print(e.error_code)
            print(e.error_msg)
    ```
    
  
  - 将备份文件恢复到按需计费的新实例。
    ```
    # 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 = CreateGaussMySqlInstanceRequest()
            restorePointbody = MysqlRestorePoint(
                source_instance_id="7033e7c3cf93438797d44ad7ae0a7d95in07",
                backup_id="7ffbf305376b4cbea0ae491257b6aaf9br07",
                type="backup"
            )
            backupStrategybody = MysqlBackupStrategy(
                start_time="08:00-09:00"
            )
            datastorebody = MysqlDatastoreInReq(
                type="gaussdb-mysql",
                version="8.0"
            )
            chargeInfobody = MysqlChargeInfo(
                charge_mode="postPaid"
            )
            request.body = MysqlInstanceRequest(
                restore_point=restorePointbody,
                enterprise_project_id="0",
                slave_count=1,
                availability_zone_mode="single",
                backup_strategy=backupStrategybody,
                password="***",
                configuration_id="43570e0de32e40c5a15f831aa5ce4176pr07",
                security_group_id="fc577a1a-f202-424a-977f-24faec3fdd55",
                subnet_id="c1cfa53c-65d3-431e-8552-326bf310c7ad",
                vpc_id="3cedfc54-b105-4652-a4e0-847b11576b58",
                flavor_ref="gaussdb.mysql.xlarge.arm.4",
                mode="Cluster",
                datastore=datastorebody,
                name="gaussdb-mysql-instance2",
                region="cn-north-4",
                charge_info=chargeInfobody
            )
            response = client.create_gauss_my_sql_instance(request)
            print(response)
        except exceptions.ClientRequestException as e:
            print(e.status_code)
            print(e.request_id)
            print(e.error_code)
            print(e.error_msg)
    ```
    
  
  - 按时间点恢复到按需计费的新实例。
    ```
    # 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 = CreateGaussMySqlInstanceRequest()
            restorePointbody = MysqlRestorePoint(
                restore_time=1673852043000,
                source_instance_id="7033e7c3cf93438797d44ad7ae0a7d95in07",
                type="timestamp"
            )
            backupStrategybody = MysqlBackupStrategy(
                start_time="08:00-09:00"
            )
            datastorebody = MysqlDatastoreInReq(
                type="gaussdb-mysql",
                version="8.0"
            )
            chargeInfobody = MysqlChargeInfo(
                charge_mode="postPaid"
            )
            request.body = MysqlInstanceRequest(
                restore_point=restorePointbody,
                enterprise_project_id="0",
                slave_count=1,
                availability_zone_mode="single",
                backup_strategy=backupStrategybody,
                password="***",
                configuration_id="43570e0de32e40c5a15f831aa5ce4176pr07",
                security_group_id="fc577a1a-f202-424a-977f-24faec3fdd55",
                subnet_id="c1cfa53c-65d3-431e-8552-326bf310c7ad",
                vpc_id="3cedfc54-b105-4652-a4e0-847b11576b58",
                flavor_ref="gaussdb.mysql.xlarge.arm.4",
                mode="Cluster",
                datastore=datastorebody,
                name="gaussdb-mysql-instance3",
                region="cn-north-4",
                charge_info=chargeInfobody
            )
            response = client.create_gauss_my_sql_instance(request)
            print(response)
        except exceptions.ClientRequestException as e:
            print(e.status_code)
            print(e.request_id)
            print(e.error_code)
            print(e.error_msg)
    ```
    
  
  - 创建周期为一个月的包年/包月实例。
    ```
    # 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 = CreateGaussMySqlInstanceRequest()
            restorePointbody = MysqlRestorePoint(
                restore_time=1673852043000,
                source_instance_id="7033e7c3cf93438797d44ad7ae0a7d95in07",
                type="timestamp"
            )
            volumebody = MysqlVolume(
                size="10"
            )
            backupStrategybody = MysqlBackupStrategy(
                start_time="08:00-09:00"
            )
            datastorebody = MysqlDatastoreInReq(
                type="gaussdb-mysql",
                version="8.0"
            )
            chargeInfobody = MysqlChargeInfo(
                charge_mode="prePaid",
                period_type="month",
                period_num=1,
                is_auto_renew="false",
                is_auto_pay="true"
            )
            request.body = MysqlInstanceRequest(
                restore_point=restorePointbody,
                enterprise_project_id="0",
                volume=volumebody,
                slave_count=1,
                availability_zone_mode="single",
                backup_strategy=backupStrategybody,
                password="***",
                configuration_id="43570e0de32e40c5a15f831aa5ce4176pr07",
                security_group_id="fc577a1a-f202-424a-977f-24faec3fdd55",
                subnet_id="c1cfa53c-65d3-431e-8552-326bf310c7ad",
                vpc_id="3cedfc54-b105-4652-a4e0-847b11576b58",
                flavor_ref="gaussdb.mysql.xlarge.arm.4",
                mode="Cluster",
                datastore=datastorebody,
                name="gaussdb-mysql-instance4",
                region="cn-north-4",
                charge_info=chargeInfobody
            )
            response = client.create_gauss_my_sql_instance(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]
  - 创建计费模式为按需计费，自动备份开始时间是08:00-09:00的实例。
    ```
    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.CreateGaussMySqlInstanceRequest{}
    backupStrategybody := &model.MysqlBackupStrategy{
    StartTime: "08:00-09:00",
    }
    datastorebody := &model.MysqlDatastoreInReq{
    Type: "gaussdb-mysql",
    Version: "8.0",
    }
    chargeInfobody := &model.MysqlChargeInfo{
    ChargeMode: model.GetMysqlChargeInfoChargeModeEnum().POST_PAID,
    }
    enterpriseProjectIdMysqlInstanceRequest:= "0"
    configurationIdMysqlInstanceRequest:= "43570e0de32e40c5a15f831aa5ce4176pr07"
    securityGroupIdMysqlInstanceRequest:= "fc577a1a-f202-424a-977f-24faec3fdd55"
    request.Body = &model.MysqlInstanceRequest{
    EnterpriseProjectId: &enterpriseProjectIdMysqlInstanceRequest,
    SlaveCount: int32(1),
    AvailabilityZoneMode: "single",
    BackupStrategy: backupStrategybody,
    Password: "***",
    ConfigurationId: &configurationIdMysqlInstanceRequest,
    SecurityGroupId: &securityGroupIdMysqlInstanceRequest,
    SubnetId: "c1cfa53c-65d3-431e-8552-326bf310c7ad",
    VpcId: "3cedfc54-b105-4652-a4e0-847b11576b58",
    FlavorRef: "gaussdb.mysql.xlarge.arm.4",
    Mode: "Cluster",
    Datastore: datastorebody,
    Name: "gaussdb-mysql-instance1",
    Region: "cn-north-4",
    ChargeInfo: chargeInfobody,
    }
    response, err := client.CreateGaussMySqlInstance(request)
    if err == nil {
            fmt.Printf("%+v\n", response)
        } else {
            fmt.Println(err)
        }
    }
    ```
    
  
  - 将备份文件恢复到按需计费的新实例。
    ```
    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.CreateGaussMySqlInstanceRequest{}
    backupIdRestorePoint:= "7ffbf305376b4cbea0ae491257b6aaf9br07"
    typeRestorePoint:= "backup"
    restorePointbody := &model.MysqlRestorePoint{
    SourceInstanceId: "7033e7c3cf93438797d44ad7ae0a7d95in07",
    BackupId: &backupIdRestorePoint,
    Type: &typeRestorePoint,
    }
    backupStrategybody := &model.MysqlBackupStrategy{
    StartTime: "08:00-09:00",
    }
    datastorebody := &model.MysqlDatastoreInReq{
    Type: "gaussdb-mysql",
    Version: "8.0",
    }
    chargeInfobody := &model.MysqlChargeInfo{
    ChargeMode: model.GetMysqlChargeInfoChargeModeEnum().POST_PAID,
    }
    enterpriseProjectIdMysqlInstanceRequest:= "0"
    configurationIdMysqlInstanceRequest:= "43570e0de32e40c5a15f831aa5ce4176pr07"
    securityGroupIdMysqlInstanceRequest:= "fc577a1a-f202-424a-977f-24faec3fdd55"
    request.Body = &model.MysqlInstanceRequest{
    RestorePoint: restorePointbody,
    EnterpriseProjectId: &enterpriseProjectIdMysqlInstanceRequest,
    SlaveCount: int32(1),
    AvailabilityZoneMode: "single",
    BackupStrategy: backupStrategybody,
    Password: "***",
    ConfigurationId: &configurationIdMysqlInstanceRequest,
    SecurityGroupId: &securityGroupIdMysqlInstanceRequest,
    SubnetId: "c1cfa53c-65d3-431e-8552-326bf310c7ad",
    VpcId: "3cedfc54-b105-4652-a4e0-847b11576b58",
    FlavorRef: "gaussdb.mysql.xlarge.arm.4",
    Mode: "Cluster",
    Datastore: datastorebody,
    Name: "gaussdb-mysql-instance2",
    Region: "cn-north-4",
    ChargeInfo: chargeInfobody,
    }
    response, err := client.CreateGaussMySqlInstance(request)
    if err == nil {
            fmt.Printf("%+v\n", response)
        } else {
            fmt.Println(err)
        }
    }
    ```
    
  
  - 按时间点恢复到按需计费的新实例。
    ```
    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.CreateGaussMySqlInstanceRequest{}
    restoreTimeRestorePoint:= int64(1673852043000)
    typeRestorePoint:= "timestamp"
    restorePointbody := &model.MysqlRestorePoint{
    RestoreTime: &restoreTimeRestorePoint,
    SourceInstanceId: "7033e7c3cf93438797d44ad7ae0a7d95in07",
    Type: &typeRestorePoint,
    }
    backupStrategybody := &model.MysqlBackupStrategy{
    StartTime: "08:00-09:00",
    }
    datastorebody := &model.MysqlDatastoreInReq{
    Type: "gaussdb-mysql",
    Version: "8.0",
    }
    chargeInfobody := &model.MysqlChargeInfo{
    ChargeMode: model.GetMysqlChargeInfoChargeModeEnum().POST_PAID,
    }
    enterpriseProjectIdMysqlInstanceRequest:= "0"
    configurationIdMysqlInstanceRequest:= "43570e0de32e40c5a15f831aa5ce4176pr07"
    securityGroupIdMysqlInstanceRequest:= "fc577a1a-f202-424a-977f-24faec3fdd55"
    request.Body = &model.MysqlInstanceRequest{
    RestorePoint: restorePointbody,
    EnterpriseProjectId: &enterpriseProjectIdMysqlInstanceRequest,
    SlaveCount: int32(1),
    AvailabilityZoneMode: "single",
    BackupStrategy: backupStrategybody,
    Password: "***",
    ConfigurationId: &configurationIdMysqlInstanceRequest,
    SecurityGroupId: &securityGroupIdMysqlInstanceRequest,
    SubnetId: "c1cfa53c-65d3-431e-8552-326bf310c7ad",
    VpcId: "3cedfc54-b105-4652-a4e0-847b11576b58",
    FlavorRef: "gaussdb.mysql.xlarge.arm.4",
    Mode: "Cluster",
    Datastore: datastorebody,
    Name: "gaussdb-mysql-instance3",
    Region: "cn-north-4",
    ChargeInfo: chargeInfobody,
    }
    response, err := client.CreateGaussMySqlInstance(request)
    if err == nil {
            fmt.Printf("%+v\n", response)
        } else {
            fmt.Println(err)
        }
    }
    ```
    
  
  - 创建周期为一个月的包年/包月实例。
    ```
    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.CreateGaussMySqlInstanceRequest{}
    restoreTimeRestorePoint:= int64(1673852043000)
    typeRestorePoint:= "timestamp"
    restorePointbody := &model.MysqlRestorePoint{
    RestoreTime: &restoreTimeRestorePoint,
    SourceInstanceId: "7033e7c3cf93438797d44ad7ae0a7d95in07",
    Type: &typeRestorePoint,
    }
    sizeVolume:= "10"
    volumebody := &model.MysqlVolume{
    Size: &sizeVolume,
    }
    backupStrategybody := &model.MysqlBackupStrategy{
    StartTime: "08:00-09:00",
    }
    datastorebody := &model.MysqlDatastoreInReq{
    Type: "gaussdb-mysql",
    Version: "8.0",
    }
    periodTypeChargeInfo:= model.GetMysqlChargeInfoPeriodTypeEnum().MONTH
    periodNumChargeInfo:= int32(1)
    isAutoRenewChargeInfo:= "false"
    isAutoPayChargeInfo:= "true"
    chargeInfobody := &model.MysqlChargeInfo{
    ChargeMode: model.GetMysqlChargeInfoChargeModeEnum().PRE_PAID,
    PeriodType: &periodTypeChargeInfo,
    PeriodNum: &periodNumChargeInfo,
    IsAutoRenew: &isAutoRenewChargeInfo,
    IsAutoPay: &isAutoPayChargeInfo,
    }
    enterpriseProjectIdMysqlInstanceRequest:= "0"
    configurationIdMysqlInstanceRequest:= "43570e0de32e40c5a15f831aa5ce4176pr07"
    securityGroupIdMysqlInstanceRequest:= "fc577a1a-f202-424a-977f-24faec3fdd55"
    request.Body = &model.MysqlInstanceRequest{
    RestorePoint: restorePointbody,
    EnterpriseProjectId: &enterpriseProjectIdMysqlInstanceRequest,
    Volume: volumebody,
    SlaveCount: int32(1),
    AvailabilityZoneMode: "single",
    BackupStrategy: backupStrategybody,
    Password: "***",
    ConfigurationId: &configurationIdMysqlInstanceRequest,
    SecurityGroupId: &securityGroupIdMysqlInstanceRequest,
    SubnetId: "c1cfa53c-65d3-431e-8552-326bf310c7ad",
    VpcId: "3cedfc54-b105-4652-a4e0-847b11576b58",
    FlavorRef: "gaussdb.mysql.xlarge.arm.4",
    Mode: "Cluster",
    Datastore: datastorebody,
    Name: "gaussdb-mysql-instance4",
    Region: "cn-north-4",
    ChargeInfo: chargeInfobody,
    }
    response, err := client.CreateGaussMySqlInstance(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=CreateGaussMySqlInstance)的代码示例页签，可生成自动对应的SDK代码示例。
#### 状态码
| 状态码 | 描述            |
|:---|:---|
| 201 | Success.      |
| 400 | Client error. |
| 500 | Server error. |
   
#### 错误码
请参见[错误码](https://support.huaweicloud.com/api-taurusdb/ErrorCode.html)。
