云数据库 RDS-创建数据库实例:请求示例

时间:2024-12-20 17:08:11

请求示例

  • 创建MySQL单机实例。
    POST https://{endpoint}/v3/0483b6b16e954cb88930a360d2c4e663/instances
    {
    	"name": "rds-instance-rep2",
    	"datastore": {
    		"type": "MySQL",
    		"version": "5.7"
    	},
    	"flavor_ref": "rds.mysql.s1.large",
    	"volume": {
    		"type": "ULTRAHIGH",
    		"size": 100
    	},
    	"disk_encryption_id": "2gfdsh-844a-4023-a776-fc5c5fb71fb4",
    	"region": "cn-north-4",	"availability_zone": "cn-north-4a",	"vpc_id": "490a4a08-ef4b-44c5-94be-3051ef9e4fce",
    	"subnet_id": "0e2eda62-1d42-4d64-a9d1-4e9aa9cd994f",
    	"data_vip": "192.168.0.1",
    	"security_group_id": "2a1f7fc8-3307-42a7-aa6f-42c8b9b8f8c5",
    	"port": 8635,
    	"backup_strategy": {
    		"start_time": "08:15-09:15",
    		"keep_days": 12
    	},
    	"charge_info": {
    		"charge_mode": "postPaid"
    	},
    	"password": "****",
    	"configuration_id": "452408-ef4b-44c5-94be-305145fg",
    	"enterprise_project_id": "fdsa-3rds",
    	"time_zone": "UTC+04:00",
    	"tags": [
    		{
    			"key": "key1",
    			"value": "value1"
    		},
    		{
    			"key": "key2",
    			"value": "value2"
    		}
    	],
            "dry_run": false,
            "count": 12
    }
  • 创建PostgreSQL单机实例。
    {
    	"name": "rds-instance-rep2",
    	"datastore": {
    		"type": "PostgreSQL",
    		"version": "10"
    	},
    	"flavor_ref": "rds.pg.s1.large",
    	"volume": {
    		"type": "ULTRAHIGH",
    		"size": 100
    	},
    	"disk_encryption_id": "2gfdsh-844a-4023-a776-fc5c5fb71fb4",
    	"region": "cn-north-4",	"availability_zone": "cn-north-4a",	"vpc_id": "490a4a08-ef4b-44c5-94be-3051ef9e4fce",
    	"subnet_id": "0e2eda62-1d42-4d64-a9d1-4e9aa9cd994f",
    	"data_vip": "192.168.0.147",
    	"security_group_id": "2a1f7fc8-3307-42a7-aa6f-42c8b9b8f8c5",
    	"port": 8635,
    	"backup_strategy": {
    		"start_time": "08:15-09:15",
    		"keep_days": 12
    	},
    	"charge_info": {
    		"charge_mode": "postPaid"
    	},
    	"password": "Test@12345678",
    	"configuration_id": "452408-ef4b-44c5-94be-305145fg",
    	"enterprise_project_id": "fdsa-3rds",
    	"time_zone": "UTC+04:00",
    	"tags": [
    		{
    			"key": "key1",
    			"value": "value1"
    		},
    		{
    			"key": "key2",
    			"value": "value2"
    		}
    	]
    }
  • 创建MySQL 8.0单机实例指定初始化参数。
    {
    	"name": "rds-instance-rep2",
    	"datastore": {
    		"type": "MySQL",
    		"version": "8.0"
    	},
    	"flavor_ref": "rds.mysql.s1.large",
    	"volume": {
    		"type": "ULTRAHIGH",
    		"size": 100
    	},
    	"disk_encryption_id": "2gfdsh-844a-4023-a776-fc5c5fb71fb4",
    	"region": "cn-north-4",	"availability_zone": "cn-north-4a",	"vpc_id": "490a4a08-ef4b-44c5-94be-3051ef9e4fce",
    	"subnet_id": "0e2eda62-1d42-4d64-a9d1-4e9aa9cd994f",
    	"data_vip": "192.168.0.1",
    	"security_group_id": "2a1f7fc8-3307-42a7-aa6f-42c8b9b8f8c5",
    	"port": 8635,
    	"backup_strategy": {
    		"start_time": "08:15-09:15",
    		"keep_days": 12
    	},
    	"charge_info": {
    		"charge_mode": "postPaid"
    	},
    	"password": "****",
    	"configuration_id": "452408-ef4b-44c5-94be-305145fg",
    	"enterprise_project_id": "fdsa-3rds",
    	"time_zone": "UTC+04:00",
    	"tags": [
    		{
    			"key": "key1",
    			"value": "value1"
    		},
    		{
    			"key": "key2",
    			"value": "value2"
    		}
    	],
    	"unchangeable_param": {
    		"lower_case_table_names": "1"
    	},
            "dry_run": false,
            "count": 12
    }
  • 创建SQL Server单机实例支持指定字符集。
    {
    	"name": "rds-instance-rep2",
    	"datastore": {
    		"type": "SQLServer",
    		"version": "2014_SE"
    	},
    	"flavor_ref": "rds.mssql.se.m3.large.8",
    	"volume": {
    		"type": "ULTRAHIGH",
    		"size": 100
    	},
    	"disk_encryption_id": "2gfdsh-844a-4023-a776-fc5c5fb71fb4",
    	"region": "cn-north-4",	"availability_zone": "cn-north-4a",	"vpc_id": "490a4a08-ef4b-44c5-94be-3051ef9e4fce",
    	"subnet_id": "0e2eda62-1d42-4d64-a9d1-4e9aa9cd994f",
    	"data_vip": "192.168.0.1",
    	"security_group_id": "2a1f7fc8-3307-42a7-aa6f-42c8b9b8f8c5",
    	"port": 8635,
    	"backup_strategy": {
    		"start_time": "08:15-09:15",
    		"keep_days": 12
    	},
    	"charge_info": {
    		"charge_mode": "postPaid"
    	},
            "collation": "Cyrillic_General_CI_AS",
    	"password": "****",
    	"configuration_id": "452408-ef4b-44c5-94be-305145fg",
    	"enterprise_project_id": "fdsa-3rds",
    	"time_zone": "UTC+04:00",
    	"tags": [
    		{
    			"key": "key1",
    			"value": "value1"
    		},
    		{
    			"key": "key2",
    			"value": "value2"
    		}
    	],
    }
  • DeC用户创建MySQL单机实例。
    {
    	"name": "rds-instance-rep2",
    	"datastore": {
    		"type": "MySQL",
    		"version": "5.7"
    	},
    	"flavor_ref": "rds.mysql.s1.large",
    	"volume": {
    		"type": "ULTRAHIGH",
    		"size": 100
    	},
    	"disk_encryption_id": "2gfdsh-844a-4023-a776-fc5c5fb71fb4",
    	"region": "cn-north-4",	"availability_zone": "cn-north-4a",	"vpc_id": "490a4a08-ef4b-44c5-94be-3051ef9e4fce",
    	"subnet_id": "0e2eda62-1d42-4d64-a9d1-4e9aa9cd994f",
    	"data_vip": "192.168.0.1",
    	"security_group_id": "2a1f7fc8-3307-42a7-aa6f-42c8b9b8f8c5",
    	"port": 8635,
    	"backup_strategy": {
    		"start_time": "08:15-09:15",
    		"keep_days": 12
    	},
    	"charge_info": {
    		"charge_mode": "postPaid"
    	},
    	"password": "****",
    	"configuration_id": "452408-ef4b-44c5-94be-305145fg",
    	"enterprise_project_id": "fdsa-3rds",
    	"time_zone": "UTC+04:00",
           "dsspool_id":"3278327382738217382173872183721837213",
    	"tags": [
    		{
    			"key": "key1",
    			"value": "value1"
    		},
    		{
    			"key": "key2",
    			"value": "value2"
    		}
    	],
            "dry_run": false,
            "count": 12
    }
  • 创建主备实例。
    {
    	"name": "rds-instance-rep2",
    	"datastore": {
    		"type": "MySQL",
    		"version": "5.7"
    	},
    	"ha": {
    		"mode": "ha",
    		"replication_mode": "semisync"
    	},
    	"flavor_ref": "rds.mysql.s1.large.ha",
    	"volume": {
    		"type": "ULTRAHIGH",
    		"size": 100
    	},
    	"disk_encryption_id": "2gfdsh-844a-4023-a776-fc5c5fb71fb4",
    	"region": "cn-north-4",	"availability_zone": "cn-north-4a",	"vpc_id": "490a4a08-ef4b-44c5-94be-3051ef9e4fce",
    	"subnet_id": "0e2eda62-1d42-4d64-a9d1-4e9aa9cd994f",
    	"data_vip": "192.168.0.1",
    	"security_group_id": "2a1f7fc8-3307-42a7-aa6f-42c8b9b8f8c5",
    	"port": 8635,
    	"backup_strategy": {
    		"start_time": "08:15-09:15",
    		"keep_days": 12
    	},
    	"charge_info": {
    		"charge_mode": "postPaid"
    	},
    	"password": "****",
    	"configuration_id": "452408-ef4b-44c5-94be-305145fg",
    	"enterprise_project_id": "fdsa-3rds",
    	"time_zone": "UTC+04:00",
    	"tags": [
    		{
    			"key": "key1",
    			"value": "value1"
    		},
    		{
    			"key": "key2",
    			"value": "value2"
    		}
    	],
            "dry_run": false,
            "count": 12
    }
  • DeC用户创建MySQL主备实例。
    {
    	"name": "rds-instance-rep2",
    	"datastore": {
    		"type": "MySQL",
    		"version": "5.7"
    	},
    	"ha": {
    		"mode": "ha",
    		"replication_mode": "semisync"
    	},
    	"flavor_ref": "rds.mysql.s1.large.ha",
    	"volume": {
    		"type": "ULTRAHIGH",
    		"size": 100
    	},
    	"disk_encryption_id": "2gfdsh-844a-4023-a776-fc5c5fb71fb4",
    	"region": "cn-north-4",
    	"availability_zone": "cn-north-4a,cn-north-4b",
    	"vpc_id": "490a4a08-ef4b-44c5-94be-3051ef9e4fce",
    	"subnet_id": "0e2eda62-1d42-4d64-a9d1-4e9aa9cd994f",
    	"data_vip": "192.168.0.1",
    	"security_group_id": "2a1f7fc8-3307-42a7-aa6f-42c8b9b8f8c5",
    	"port": 8635,
    	"backup_strategy": {
    		"start_time": "08:15-09:15",
    		"keep_days": 12
    	},
    	"charge_info": {
    		"charge_mode": "postPaid"
    	},
    	"password": "****",
    	"configuration_id": "452408-ef4b-44c5-94be-305145fg",
    	"enterprise_project_id": "fdsa-3rds",
    	"time_zone": "UTC+04:00",
           "dsspool_id":"327832738273821772133432,21489938273821772133432",
    	"tags": [
    		{
    			"key": "key1",
    			"value": "value1"
    		},
    		{
    			"key": "key2",
    			"value": "value2"
    		}
    	],
            "dry_run": false,
            "count": 12
    }
  • 创建只读实例。
    {
    	"name": "rds-instance-rep2",
    	"replica_of_id": "afdsad-fds-fdsagin01",
    	"flavor_ref": "rds.mysql.s1.large.rr",
    	"volume": {
    		"type": "ULTRAHIGH",
    		"size": 100
    	},
    	"disk_encryption_id": "2gfdsh-844a-4023-a776-fc5c5fb71fb4",
            "region": "cn-north-4",
    	"availability_zone": "cn-north-4a",
    	"enterprise_project_id": "fdsa-3rds",
    	"tags": [
    		{
    			"key": "key1",
    			"value": "value1"
    		},
    		{
    			"key": "key2",
    			"value": "value2"
    		}
    	]
    }
  • DeC用户创建只读实例。
    {
    	"name": "rds-instance-rep2",
    	"replica_of_id": "afdsad-fds-fdsagin01",
    	"flavor_ref": "rds.mysql.s1.large.rr",
    	"volume": {
    		"type": "ULTRAHIGH"
    	},
    	"disk_encryption_id": "2gfdsh-844a-4023-a776-fc5c5fb71fb4",
            "region": "cn-north-4",
    	"availability_zone": "cn-north-4a",
    	"enterprise_project_id": "fdsa-3rds"
            "dsspool_id":"3278327382738217382173872183721837213",
    	"tags": [
    		{
    			"key": "key1",
    			"value": "value1"
    		},
    		{
    			"key": "key2",
    			"value": "value2"
    		}
    	]
  • 创建MySQL Serverless型单机实例。
    {
            "name": "rds-instance-serverless1",
            "datastore": {
                   "type": "MySQL",
                   "version": "5.7"
            },
            "flavor_ref": "rds.mysql.serverless",
            "volume": {
                   "type": "CLOUDSSD",
                   "size": 40
            },
            "region": "cn-north-4",
    	"availability_zone": "cn-north-4a",
            "vpc_id": "490a4a08-ef4b-44c5-94be-3051ef9e4fce",
            "subnet_id": "0e2eda62-1d42-4d64-a9d1-4e9aa9cd994f",
            "security_group_id": "2a1f7fc8-3307-42a7-aa6f-42c8b9b8f8c5",
            "port": 3306,
            "backup_strategy": {
                   "start_time": "08:15-09:15",
                   "keep_days": 12
            },
            "password": "****",
            "time_zone": "UTC+04:00",
            "tags": [
                   {
                           "key": "key1",
                           "value": "value1"
                   },
                   {
                           "key": "key2",
                           "value": "value2"
                   }
            ],
            "dry_run": false,
            "count": 1,
            "serverless_info": {
                  "min_cap": "0.5",
                  "max_cap": "1"
            }
    }
  • 创建MySQL Serverless型主备实例。
    {
            "name": "rds-instance-serverless2",
            "datastore": {
                   "type": "MySQL",
                   "version": "5.7"
            },
            "ha": {
                   "mode": "ha",
                   "replication_mode": "semisync"
            },
            "flavor_ref": "rds.mysql.serverless.ha",
            "volume": {
                   "type": "CLOUDSSD",
                   "size": 40
            },
    	"region": "cn-north-4",
    	"availability_zone": "cn-north-4a,cn-north-4b",
            "vpc_id": "490a4a08-ef4b-44c5-94be-3051ef9e4fce",
            "subnet_id": "0e2eda62-1d42-4d64-a9d1-4e9aa9cd994f",
            "security_group_id": "2a1f7fc8-3307-42a7-aa6f-42c8b9b8f8c5",
            "port":3306,
            "backup_strategy": {
                   "start_time": "08:15-09:15",
                   "keep_days": 12
            },
            "password": "****",
            "time_zone": "UTC+08:00",
            "tags": [
                   {
                           "key": "key1",
                           "value": "value1"
                   },
                   {
                           "key": "key2",
                           "value": "value2"
                   }
            ],
            "dry_run": false,
            "count": 1,
            "serverless_info": {
                   "min_cap": "0.5",
                   "max_cap": "1"
            }
    }
support.huaweicloud.com/api-rds/rds_01_0002.html