云服务器内容精选

  • 请求示例 更新租户指定ID批量异步任务详情,任务模式为全量+增量,公网网络类型。 https://{endpoint}/v5/054ba152d480d55b2f5dc0069e7ddef0/batch-async-jobs/bd4193aa-072d-4ce6-beec-adffc7252341 { "jobs" : [ { "type" : "all", "params" : { "job_id" : "c7debc9c-8e09-4a5d-8dd6-cc44f78jb20r", "base_info" : { "name" : "DRS-1234", "job_type" : "sync", "engine_type" : "oracle-to-gaussdbv5", "job_direction" : "up", "task_type" : "FULL_INCR_TRANS", "net_type" : "eip", "charging_mode" : "on_demand", "enterprise_project_id" : "0", "description" : "", "expired_days" : "14", "tags" : [ { "key" : "test", "value" : "test" } ] }, "source_endpoint" : [ { "db_type" : "oracle", "endpoint_type" : "offline", "endpoint_role" : "so", "endpoint" : { "endpoint_name" : "oracle", "ip" : "10.154.217.239", "db_port" : "1521", "db_user" : "ORACLE_USER", "db_name" : "serviceName.orcl", "db_password" : "******" }, "ssl" : { "ssl_link" : false } } ], "target_endpoint" : [ { "db_type" : "gaussdbv5", "endpoint_type" : "cloud", "endpoint_role" : "ta", "endpoint" : { "endpoint_name" : "cloud_gaussdbv5", "instance_id" : "c2c7579bc09c490b9d8009db715aeb0ain14", "db_user" : "root", "db_password" : "******" }, "cloud" : { "region" : "cn-north-4", "project_id" : "9dc8c0f3f74c4dbb23c29cf0318ee561", "az_code" : "cn-north-4a,cn-north-4g,cn-north-4c" }, "vpc" : { "vpc_id" : "2cb5d364-ae63-4fbb-85b7-7d59f4a88f8f", "subnet_id" : "2cb54324-ae63-4fbb-85b7-7d59f4a88f8f", "security_group_id" : "039a3s89-665a-43e2-9b4f-bda7d9ee148d" } } ], "alarm_notify" : { "alarm_to_user" : true, "topic_urn" : "urn:smn:cn-north-4:f2c2468c3ee7410c862a461ca073d2f2:test", "delay_time" : 60 }, "speed_limit" : [ { "begin" : "16:00", "end" : "15:59", "speed" : "10" } ], "policy_config" : { "ddl_trans" : false }, "db_object" : { "object_scope" : "table", "target_root_db" : { "db_name" : "target_db_name", "db_encoding" : "utf8" }, "object_info" : { "source_db1" : { "name" : "source_db1", "all" : false, "tables" : { "source_tb1" : { "type" : "table", "name" : "source_tb1", "all" : true }, "source_tb2" : { "type" : "table", "name" : "source_tb2", "all" : true } } } } }, "node_info" : { "spec" : { "node_type" : "medium" } } } }, { "type" : "endpoint", "params" : { "job_id" : "dc6016cf-f3b6-4c2d-b4d7-5084b0fjb20r", "source_endpoint" : [ { "db_type" : "oracle", "endpoint_type" : "offline", "endpoint_role" : "so", "endpoint" : { "endpoint_name" : "oracle", "ip" : "10.154.227.134", "db_port" : "1521", "db_user" : "ORACLE_USER", "db_name" : "serviceName.orcl", "db_password" : "******" }, "ssl" : { "ssl_link" : false } } ], "target_endpoint" : [ { "db_type" : "gaussdbv5", "endpoint_type" : "cloud", "endpoint_role" : "ta", "endpoint" : { "id" : "f59e6118-da89-4fdb-9b98-65f56709928a", "endpoint_name" : "cloud_gaussdbv5", "instance_id" : "c2c7579bc09c490b9d8009db715aeb0ain14", "db_user" : "root", "db_password" : "******" }, "cloud" : { "region" : "cn-north-4", "project_id" : "9dc8c0f3f74c4dbb23c29cf0318ee561", "az_code" : "cn-north-4a,cn-north-4g,cn-north-4c" }, "vpc" : { "vpc_id" : "2cb5d364-ae63-4fbb-85b7-7d59f4a88f8f", "subnet_id" : "2cb54324-ae63-4fbb-85b7-7d59f4a88f8f", "security_group_id" : "039a3s89-665a-43e2-9b4f-bda7d9ee148d" }, "ssl" : { "ssl_link" : false } } ] } } ] }
  • 响应示例 状态码: 202 Accepted { "jobs" : [ { "id" : "c7debc9c-8e09-4a5d-8dd6-cc44f78jb20r", "name" : "DRS-1234", "status" : "Success" }, { "id" : "dc6016cf-f3b6-4c2d-b4d7-5084b0fjb20r", "name" : "DRS-2345", "status" : "Failed", "error_code" : "DRS.10000010", "error_msg" : "Job does not exist, please check job ID" } ] } 状态码: 400 Bad Request { "error_code" : "DRS.10000001", "error_msg" : "Failed." }
  • 响应参数 状态码: 202 表35 响应Body参数 参数 参数类型 描述 jobs Array of objects 批量更新指定ID异步任务响应体。 详情请参见表36。 表36 jobs字段数据结构说明 参数 参数类型 描述 id String 任务ID。 name String 任务名称。 status String 操作结果。 error_code String 错误码。 error_msg String 错误描述。 状态码: 400 表37 响应Body参数 参数 参数类型 描述 error_code String 错误码。 最小长度:12 最大长度:12 error_msg String 错误描述。 最小长度:1 最大长度:512
  • 响应参数 状态码: 200 表4 响应Body参数 参数 参数类型 描述 jobs Array of objects 批量删除任务响应体。 详情请参见表5。 表5 jobs字段数据结构说明 参数 参数类型 描述 error_code String 错误码。 最小长度:12 最大长度:12 error_msg String 错误描述。 最小长度:1 最大长度:512 id String 任务ID。 name String 任务名称。 status String 删除结果。 状态码: 400 表6 响应Body参数 参数 参数类型 描述 error_code String 错误码。 最小长度:12 最大长度:12 error_msg String 错误描述。 最小长度:1 最大长度:512
  • 响应示例 状态码: 200 OK { "jobs" : [ { "id" : "c7debc9c-8e09-4a5d-8dd6-cc44f78jb20r", "name" : "DRS-1234", "status" : "Success" }, { "id" : "dc6016cf-f3b6-4c2d-b4d7-5084b0fjb20r", "name" : "DRS-2345", "status" : "Failed", "error_code" : "DRS.10000010", "error_msg" : "Job does not exist, please check job ID" } ] } 状态码: 400 Bad Request { "error_code" : "DRS.10000010", "error_msg" : "Job does not exist, please check job ID." }
  • 请求参数 表2 请求Header参数 参数 是否必选 参数类型 描述 Content-Type 是 String 发送的实体的MIME类型。推荐用户默认使用application/json,如果API是对象、镜像上传等接口,媒体类型可按照流类型的不同进行确定。 缺省值:application/json X-Auth-Token 是 String 从 IAM 服务获取的用户Token。 用户Token也就是调用获取用户Token接口的响应值,该接口是唯一不需要认证的接口。 请求响应成功后在响应消息头中包含的“X-Subject-Token”的值即为Token值。 X-Language 否 String 请求语言类型。 缺省值:en-us 枚举值: en-us zh-cn 表3 请求Body参数 参数 是否必选 参数类型 描述 jobs 是 Array of strings 批量删除任务请求体。
  • 响应参数 正常响应参数说明 表5 响应Body参数 参数 参数类型 描述 nodeList String 节点列表。 needRestart Boolean 是否需要重启实例。 jobId String 任务ID。 configId String 参数组ID。 configName String 参数组名称。 正常响应示例 { "nodeList" : null, "needRestart" : "false", "jobId" : "9fe84a77-6a6b-4b03-9a3e-db910a548657", "configId" : null, "configName" : null } 异常响应 请参见异常请求结果。
  • 变更实例规格 登录新版ROMA Connect控制台。 在左侧导航栏选择“资源管理”,鼠标悬停于需要调整RCU的实例上,左下角单击“RCU调控”。 在RCU调控页面调整实例的RCU分配方案,系统会根据您配置的RCU值重新计算配置费用。 仅当“RCU分配”中首次为消息集成分配了RCU时,需参考表2配置MQS相关信息。完成后单击“下一步”。 图1 MQS配置信息 在配置确认界面确认调整后的实例配置,然后单击“RCU调控”。 实例开始重新调配RCU,扩容需要10-20分钟,缩容需要约10分钟。 在“资源管理”页面单击正在变更规格的实例,进入实例控制台。 在“实例信息”页面中,选择“后台任务”页签,可查看实例规格变更任务信息。
  • 请求示例 创建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,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", "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" } }
  • URI DELETE https://localhost.com/v1/workspaces/{workspace_id}/services/instances/{instance_id} 表1 路径参数 参数 是否必选 参数类型 描述 workspace_id 是 String 参数解释:Workspace的ID。 约束限制:不涉及。 取值范围:不涉及。 默认取值:不涉及。 instance_id 是 String 实例的Id。获取方法,请参见获取推理实例ID。
  • 响应参数 状态码: 202 表3 响应Body参数 参数 参数类型 描述 - AnyType 删除Service的响应 状态码: 400 表4 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述 solution_msg String 解决方案描述 状态码: 401 表5 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述 solution_msg String 解决方案描述 状态码: 404 表6 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述 solution_msg String 解决方案描述 状态码: 408 表7 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述 solution_msg String 解决方案描述 状态码: 500 表8 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述 solution_msg String 解决方案描述
  • 请求示例 URI样例 POST https://gaussdb-nosql.cn-north-7.myhuaweicloud.com/v3/619d3e78f61b4be68bc5aa0b59edcf7b/instances/db-upgrade 请求示例 批量升级数据库补丁版本: { "instance_ids" : [ "046287aae57843b1a7bc61b7a8812f41in13", "3d1e04f49efa473a8c7eaf07ed7ff870in13" ] }
  • 响应示例 状态码: 202 Accepted { "upgrade_results" : [ { "instance_id" : "046287aae57843b1a7bc61b7a8812f41in13", "job_id" : "e4616470-733d-41de-a9b0-a260709293d3" }, { "instance_id" : "3d1e04f49efa473a8c7eaf07ed7ff870in13", "error_code" : "DBS.200011", "error_message" : "The status of DB instance does not allow the operation." } ] }
  • 响应参数 状态码: 202 表4 响应Body参数 参数 参数类型 描述 upgrade_results Array of UpgradeResult objects 批量升级结果。 表5 UpgradeResult 参数 参数类型 描述 job_id String 任务ID。仅当补丁版本升级任务提交成功时返回该字段。 instance_id String 实例ID。 error_code String 错误码。仅当补丁版本升级任务提交失败时返回该字段。 error_message String 失败原因。仅当补丁版本升级任务提交失败时返回该字段。 状态码: 400 表6 响应Body参数 参数 参数类型 描述 error_code String 错误码。 error_msg String 错误消息。 状态码: 500 表7 响应Body参数 参数 参数类型 描述 error_code String 错误码。 error_msg String 错误消息。
  • URI GET https://{Endpoint}/v3/{project_id}/ip-num-requirement 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 租户在某一region下的project ID。获取方法请参见获取项目ID。 表2 Query参数 参数 是否必选 参数类型 描述 node_num 是 Integer 创建实例或扩容节点的个数。最大支持输入200。 engine_name 否 String 数据库接口名称。没有传入实例ID的时候该字段为必传。 取值为“cassandra”,表示GeminiDB Cassandra数据库接口。 取值为“mongodb”,表示GeminiDB Mongo数据库接口。 取值为“influxdb”,表示GeminiDB Influx数据库接口。 取值为“redis”,表示GeminiDB Redis数据库接口。 instance_mode 否 String 实例类型。没有传入实例ID的时候该字段为必传。 取值为“Cluster”,表示GeminiDB Cassandra、GeminiDB Influx、GeminiDB Redis集群实例类型。 取值为“ReplicaSet”,表示GeminiDB Mongo副本集实例类型。 instance_id 否 String 实例ID,可以调用查询实例列表和详情接口获取。如果未申请实例,可以调用创建实例接口创建。