云数据库 RDS-恢复到新实例:请求示例

时间:2024-04-11 11:38:41

请求示例

  • 将MySQL备份文件恢复到新实例。
    POST https://{endpoint}/v3/0483b6b16e954cb88930a360d2c4e663/instances
    {
    	"name": "targetInst",
    	"availability_zone": "bbb,ccc",
    	"ha": {
    		"mode": "ha",
    		"replication_mode": "async"
    	},
    	"flavor_ref": "rds.mysql.s1.large",
    	"volume": {
    		"type": "ULTRAHIGH",
    		"size": 40
    	},
            "region": "aaa",
    	"disk_encryption_id": "2gfdsh-844a-4023-a776-fc5c5fb71fb4",
    	"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",
    	"backup_strategy": {
    		"keep_days": 2,
    		"start_time": "19:00-20:00"
    	},
    	"password": "Demo@12345678",
    	"configuration_id": "52e86e87445847a79bf807ceda213165pr01",
    	"enterprise_project_id": "ba1f7fc8-3307-42a7-aa6f-42c8b9b8f85c",
    	"time_zone": "UTC+04:00",
    	"restore_point": {
    		"instance_id": "d8e6ca5a624745bcb546a227aa3ae1cfin01",
    		"type": "backup",
    		"backup_id": "2f4ddb93-b901-4b08-93d8-1d2e472f30fe"
    	}
    }
  • 将SQL Server备份文件中的部分数据库恢复到新实例。
    {
    	"name": "targetInst",
            "datastore": {
    		"type": "SQLServer",
    		"version": "2014_SE"
    	},
    	"availability_zone": "bbb,ccc",
    	"ha": {
    		"mode": "ha",
    		"replication_mode": "sync"
    	},
    	"flavor_ref": "rds.mssql.2014.se.s3.xlarge.2.ha",
    	"volume": {
    		"type": "ULTRAHIGH",
    		"size": 40
    	},
    	"disk_encryption_id": "2gfdsh-844a-4023-a776-fc5c5fb71fb4",
    	"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",
    	"backup_strategy": {
    		"keep_days": 2,
    		"start_time": "19:00-20:00"
    	},
           "charge_info": {
    	       "charge_mode": "prePaid",		
                   "period_type": "month",
                   "period_num": 1,
                   "is_auto_renew": false,
                   "is_auto_pay": true
           },
    	"password": "Demo@12345678",
    	"configuration_id": "52e86e87445847a79bf807ceda213165pr04",
    	"enterprise_project_id": "ba1f7fc8-3307-42a7-aa6f-42c8b9b8f85c",
    	"time_zone": "UTC+04:00",
            "collation": "Cyrillic_General_CI_AS",
    	"restore_point": {
    		"instance_id": "d8e6ca5a624745bcb546a227aa3ae1cfin04",
    		"type": "backup",
    		"backup_id": "2f4ddb93-b901-4b08-93d8-1d2e472f30fe",
    		"database_name": {
    			"db1": "dbtest1,dbtest2",
    			"db2": "db2,db002",
                            "db3": ""
    		}
    	}
    }
  • 将MySQL实例的数据恢复到指定时间点。
    {
    	"name": "targetInst",
    	"availability_zone": "bbb,ccc",
    	"ha": {
    		"mode": "ha",
    		"replication_mode": "async"
    	},
    	"flavor_ref": "rds.mysql.s1.large",
    	"volume": {
    		"type": "ULTRAHIGH",
    		"size": 40
    	},
    	"disk_encryption_id": "2gfdsh-844a-4023-a776-fc5c5fb71fb4",
    	"vpc_id": "490a4a08-ef4b-44c5-94be-3051ef9e4fce",
    	"subnet_id": "0e2eda62-1d42-4d64-a9d1-4e9aa9cd994f",
    	"security_group_id": "2a1f7fc8-3307-42a7-aa6f-42c8b9b8f8c5",
    	"data_vip": "192.168.0.147",
    	"backup_strategy": {
    		"keep_days": 2,
    		"start_time": "19:00-20:00"
    	},
    	"password": "Demo@12345678",
    	"configuration_id": "52e86e87445847a79bf807ceda213165pr01",
    	"enterprise_project_id": "ba1f7fc8-3307-42a7-aa6f-42c8b9b8f85c",
    	"time_zone": "UTC+04:00",
    	"restore_point": {
    		"instance_id": "d8e6ca5a624745bcb546a227aa3ae1cfin01",
    		"type": "timestamp",
    		"restore_time": 1532001446987
    	}
    }
  • 将SQL Server实例的部分数据库恢复到指定时间点。
    {
    	"name": "targetInst",
            "datastore": {
    		"type": "SQLServer",
    		"version": "2014_SE"
    	},
    	"availability_zone": "bbb,ccc",
    	"ha": {
    		"mode": "ha",
    		"replication_mode": "sync"
    	},
    	"flavor_ref": "rds.mssql.2014.se.s3.xlarge.2.ha",
    	"volume": {
    		"type": "ULTRAHIGH",
    		"size": 40
    	},
    	"disk_encryption_id": "2gfdsh-844a-4023-a776-fc5c5fb71fb4",
    	"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",
    	"backup_strategy": {
    		"keep_days": 2,
    		"start_time": "19:00-20:00"
    	},
            "charge_info": {
    	       "charge_mode": "prePaid",		
                   "period_type": "month",
                   "period_num": 1,
                   "is_auto_renew": false,
                   "is_auto_pay": true
           },
    	"password": "Demo@12345678",
    	"configuration_id": "52e86e87445847a79bf807ceda213165pr04",
    	"enterprise_project_id": "ba1f7fc8-3307-42a7-aa6f-42c8b9b8f85c",
    	"time_zone": "UTC+04:00",
            "collation": "Cyrillic_General_CI_AS",
    	"restore_point": {
    		"instance_id": "d8e6ca5a624745bcb546a227aa3ae1cfin04",
    		"type": "timestamp",
    		"restore_time": 1532001446987,
    		"database_name": {
    			"db1": "dbtest1,dbtest2",
    			"db2": "db2,db02",
                            "db3": ""
    		}
    	}
    }
  • 将Serverless型MySQL备份文件恢复到新实例。
    {
    	"name": "serverless",
    	"datastore": {
    		"type": "MySQL",
    		"version": "5.7"
    	},
    	"ha": {
    		"mode": "ha",
    		"replication_mode": "semisync"
    	},
    	"flavor_ref": "rds.mysql.serverless.ha",
    	"volume": {
    		"type": "CLOUDSSD",
    		"size": 100
    	},
    	"region": "aaa",
    	"availability_zone": "bbb,ccc",
    	"vpc_id": "bd3e4c67-74da-459d-820f-9fecd4ea9ca4",
    	"subnet_id": "53cdf568-6f56-4944-a996-4afcaffe994e",
    	"security_group_id": "89f258c5-4b81-4ef0-be30-34f2ee07dd1c",
    	"port": 3307,
    	"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,
        "serverless_info": {
            "min_cap": "0.5",
            "max_cap": "1"
        },
        "restore_point": {
    		"instance_id": "aceb1e359a444660bb8fe0696afc76e1in01",
    		"type": "backup",
    		"backup_id": "0db0b4b93e5d40afbd65ede29153dc46br01"
    	}
    }
support.huaweicloud.com/api-rds/rds_09_0008.html