华为云用户手册

  • 响应参数 状态码: 200 表2 响应Body参数 参数 参数类型 描述 configurations Array of ConfigurationParameter objects 集群使用的参数配置信息。 表3 ConfigurationParameter 参数 参数类型 描述 name String 参数名称。 values Array of ConfigurationParameterUnit objects 参数值。 unit String 参数单位。 type String 参数类型,包括: boolean string integer float list readonly Boolean 是否只读。 value_range String 参数值范围。 restart_required Boolean 是否需要重启。 description String 参数描述。 表4 ConfigurationParameterUnit 参数 参数类型 描述 type String 参数类型,包括:cn、dn。 value String 参数值。 default_value String 参数默认值。
  • 请求示例 创建集群操作前检查是否具备创建条件,比如在cn-north-7c可用区下是否有dws.m3.xlarge规格、3节点、公网IP、安全组、虚拟私有云等创建条件: https://{Endpoint}/v2/4cf650fd46704908aa071b4df2453e1e/cluster-precheck{ "cluster" : { "flavor" : "dws.m3.xlarge", "num_node" : 3, "availability_zones" : [ "cn-north-7c" ], "vpc_id" : "c9f1171e-dc90-4ae9-bf22-f9736983ce2d", "subnet_id" : "ad9ef23f-1d03-4e52-af80-69604645e109", "security_group_id" : "f54a4572-d5d2-40b6-823a-79049bd5b71c", "public_ip" : { "public_bind_type" : "bind_existing", "eip_id" : "1923e8b0-cd40-4469-8cb1-64546c7b530c" }, "datastore_version" : "8.2.0" }}
  • 请求参数 表2 请求Body参数 参数 是否必选 参数类型 描述 cluster 是 ClusterCheckBody object 集群校验对象。 表3 ClusterCheckBody 参数 是否必选 参数类型 描述 enterprise_project_id 否 String 企业项目ID。 flavor 是 String 集群规格名称。 availability_zones 是 Array of strings 可用区列表。 num_node 是 Integer 实例节点个数。 security_group_id 否 String 集群安全组ID。 datastore_version 是 String 集群版本。 vpc_id 是 String 集群虚拟私有云ID。 subnet_id 是 String 集群子网ID。 public_ip 否 OpenPublicIp object 弹性IP对象。 cross_spec_restore 否 String 跨规格恢复。 volume 否 Volume object 磁盘。 old_cluster_hostname 否 String 旧主机名。 restore_point 否 RestorePoint object 恢复指针。 tag_list 否 Array of Tag objects 标签列表。 dss_pool_id 否 String 存储池ID。 db_port 否 String 数据库端口。 db_password 否 String 管理员密码。 db_name 否 String 管理员用户。 num_cn 否 Integer cn节点数量。 name 否 String 集群名称。 表4 OpenPublicIp 参数 是否必选 参数类型 描述 public_bind_type 否 String 弹性IP绑定类型,取值如下: auto_assign:现在购买 not_use:暂未使用 bind_existing :使用已有 eip_id 否 String 弹性IP的ID。 表5 Volume 参数 是否必选 参数类型 描述 volume 否 String 磁盘名称,取值范围为: SSD(超高IO) 高IO(SAS) 普通IO(SATA) capacity 否 Integer 磁盘容量。 表6 RestorePoint 参数 是否必选 参数类型 描述 back_ref 否 String 快照ID。 restore_time 否 Long 恢复时间。 cluster_id 否 String 集群ID。 表7 Tag 参数 是否必选 参数类型 描述 key 否 String 标签key。 value 否 String 标签值。
  • 请求参数 表2 请求Body参数 参数 是否必选 参数类型 描述 configurations 是 Array of ConfigurationParameterValue objects 集群参数配置列表。 表3 ConfigurationParameterValue 参数 是否必选 参数类型 描述 type 是 String 参数类型,包括:cn、dn。 name 是 String 参数名称。 value 是 String 参数值。
  • 请求示例 集群中“enable_constraint_optimization”参数cn和dn类型修改为off: PUT https://{Endpoint}/v2/89cd04f168b84af6be287f71730fdb4b/clusters/4ca46bf1-5c61-48ff-b4f3-0ad4e5e3ba90/configurations/2846d355-cd2a-4239-ae54-a7aef0b7963d{ "configurations" : [ { "type" : "cn", "name" : "enable_constraint_optimization", "value" : "off" }, { "type" : "dn", "name" : "enable_constraint_optimization", "value" : "off" } ]}
  • URI 1 PUT /v2/{project_id}/clusters/{cluster_id}/configurations/{configuration_id} 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 项目ID。获取方法,请参见获取项目ID。 cluster_id 是 String 集群的ID。获取方法,请参见获取集群ID。 configuration_id 是 String 参数组ID。
  • 响应参数 状态码: 200 表2 响应Body参数 参数 参数类型 描述 min_num Integer 允许的最小CN节点数量。 max_num Integer 允许的最大CN节点数量。 instances Array of CoordinatorNode objects CN节点列表。 表3 CoordinatorNode 参数 参数类型 描述 id String 节点ID。 name String 节点名称。 private_ip String 内网IP。
  • 响应示例 状态码: 200 查询集群CN节点成功。 { "min_num" : 2, "max_num" : 3, "instances" : [ { "id" : "e07d1bfb-6eac-4827-96e0-d10b8ca29c41", "name" : "demo-dws-cn-cn-1-1", "private_ip" : "172.16.69.106" } ]}
  • 请求示例 批量删除ID为“b6ad3dc3-d2de-4d2c-a5df-fdde58eca8f0”的CN节点: POST https://{Endpoint}/v1.0/89cd04f168b84af6be287f71730fdb4b/clusters/b5c45780-1006-49e3-b2d5-b3229975bbc7/cns/batch-delete{ "instances" : [ "b6ad3dc3-d2de-4d2c-a5df-fdde58eca8f0" ]}
  • 请求参数 表2 请求Body参数 参数 是否必选 参数类型 描述 shrink_number 是 Integer 缩容数。 集群按照环的方式配置,比如3个或4个主机组成一个环,这些主机上的DN主节点、备节点和从节点都部署在这个环里, 缩容的最小单元是一个环。 缩容数应按扩容顺序逆向选择,如:先扩容3个节点,再扩容4个节点,本次缩容可选择缩容4个节点,或缩容7个节点。 online 是 Boolean 在线缩容。 type 是 String 数据库类型。 dws:标准数仓 stream:IoT数仓 hybrid:实时数仓 retry 否 Boolean 重试。 force_backup 是 Boolean 执行备份。 need_agency 是 Boolean 是否需要委托。缩容长时间执行需要用户授权委托,未授权委托可能缩容失败。
  • 请求示例 离线缩容ID为“4ca46bf1-5c61-48ff-b4f3-0ad4e5e3ba90”的标准数仓集群3个节点,并执行备份,不执行委托: 12345678 POST https://{Endpoint} /v1.0/89cd04f168b84af6be287f71730fdb4b/clusters/4ca46bf1-5c61-48ff-b4f3-0ad4e5e3ba90/cluster-shrink{ "shrink_number": 3, "online": false, "type": "dws", "force_backup": true, "need_agency": false}
  • URI DELETE /v1.0/{project_id}/clusters/{cluster_id}/snapshot-policies/{id} 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 项目ID。获取方法,请参见获取项目ID。 cluster_id 是 String 集群ID。获取方法,请参见获取集群ID。 id 是 String 快照策略ID。
  • 响应参数 状态码: 200 表2 响应Body参数 参数 参数类型 描述 keep_day String 保留天数。 backup_strategies Array of BackupStrategyDetail objects 备份策略。 device_name String 备份设备。 server_ips Array of strings 服务IP。 server_port String 服务端口。 backup_param String 备份参数。 表3 BackupStrategyDetail 参数 参数类型 描述 policy_id String 策略ID。 policy_name String 策略名称。 backup_strategy String 执行策略。 backup_type String 备份类型。 backup_level String 备份级别。 next_fire_time String 下次触发时间。 update_time String 更新时间。
  • 响应示例 { "keep_day": 3, "backup_strategies": [ { "policy_id": "20c8ab14-9201-4d79-bb7c-5c42d1af84b1", "policy_name": "test_1031_02-default-full-strategy", "backup_strategy": "0 0 2 ? * 1", "backup_type": "full", "backup_level": "cluster", "next_fire_time": "1667700000000", "update_time": "2022-10-31T02:54:54" }, { "policy_id": "a3c9e2fc-37aa-4088-b0d0-c49dcbb0d2c2", "policy_name": "test_1031_02-default-increment-strategy", "backup_strategy": "0 56 2/8 ? * 2,3,4,5,6,7", "backup_type": "increment", "backup_level": "cluster", "next_fire_time": "1667213760000", "update_time": "2022-10-31T02:54:54" } ], "device_name": "obs", "server_ips": null, "server_port": null, "backup_param": ""}
  • 请求示例 添加集群级别的全量快照策略,名为test,快照策略设置为每周一到每周天每天凌晨3点触发: PUT https://{Endpoint} /v2/89cd04f168b84af6be287f71730fdb4b/clusters/4ca46bf1-5c61-48ff-b4f3-0ad4e5e3ba90/snapshot-policies{ "backup_strategies": [ { "policy_name": "test", "backup_level": "cluster", "backup_type": "full", "backup_strategy": "0 0 3 ? * 1,2,3,4,5,6,7" } ]}
  • 请求参数 表2 请求Body参数 参数 是否必选 参数类型 描述 keep_day 否 Integer 保留天数。 backup_strategies 否 BackupStrategyDetail object 策略名称。当需要添加策略时该参数为为必选。 device_name 否 String 备份设备。 server_port 否 String 端口。 backup_param 否 String 备份参数。 server_ips 否 Array of strings 备份介质服务IP。 表3 BackupStrategyDetail 参数 是否必选 参数类型 描述 policy_id 否 String 策略ID。 policy_name 否 String 策略名称。添加备份策略时为必选字段。 策略名称在4位到92位之间,必须以字母开头,不区分大小写,可以包含字母、数字、中划线或者下划线,不能包含其他特殊字符,并且名称唯一。 backup_strategy 否 String 执行策略。添加备份策略时为必选字段。 backup_type 否 String 备份类型。添加备份策略时为必选字段。 increment 增量 full 全量 backup_level 否 String 备份级别。添加备份策略时为必选字段。 cluster next_fire_time 否 String 下次触发时间。 update_time 否 String 更新时间。
  • 响应示例 状态码: 200 查询快照列表成功。 { "snapshots": [ { "datastore": { "type": "dws", "version": "8.1.3.200" }, "description": "", "id": "02413539-6556-434c-a795-a44e9db7262d", "cluster_id": "1446b166-b73f-4096-b9bd-9a30afe3071f", "cluster_name": "ysj-1101-0917", "name": "kz-001", "size": 206400, "status": "COMPLETED", "updated": "2022-11-01T02:15:26", "type":"AUTO", "backup_key": "20221101_021217", "prior_backup_key": "FULL", "base_backup_key": "20221101_021217", "backup_device": "OBS", "total_backup_size": 206400, "base_backup_name": "kz-001", "support_inplace_restore": true, "fine_grained_backup": false, "fine_grained_backup_detail": {}, "guest_agent_version": "8.2.0.1", "cluster_status": "AVAILABLE", "bak_expected_start_time": "1667295060000", "bak_keep_day": 3, "bak_period": "0 31 1/8 ? * 2,3,4,5,6,7", "db_user": "dbadmin" } ], "project_id": "4cf650fd46704908aa071b4df2453e1e", "cluster_id": "1446b166-b73f-4096-b9bd-9a30afe3071f", "count": 1}
  • URI GET /v1.0/{project_id}/clusters/{cluster_id}/snapshots 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 项目ID。获取方法,请参见获取项目ID。 cluster_id 是 String 集群ID。获取方法,请参见获取集群ID。 表2 Query参数 参数 是否必选 参数类型 描述 sort_key 否 String 排序字段,排序字段需与排序规则一一对应。 可选字段:name、clusterName、startTime sort_dir 否 String 排序规则: ASC DESC offset 否 Integer 偏移量,从第几条开始查询。 limit 否 Integer 查询条数。
  • 响应参数 状态码: 200 表3 响应Body参数 参数 参数类型 描述 snapshots Array of Snapshots objects 快照对象列表。 count Integer 快照对象列表总数 project_id String 项目ID。 cluster_id String 集群ID。 表4 Snapshots 参数 参数类型 描述 id String 快照ID。 name String 快照名称。 description String 快照描述。 started String 快照创建的日期时间,格式为 ISO8601: YYYY-MM-DDThh:mm:ssZ。 updated String 快照记录更新时间,格式为 ISO8601: YYYY-MM-DDThh:mm:ssZ。 size Double 快照大小,单位 GB。 status String 快照状态: CREATING:创建中。 AVAILABLE:可用。 UNAVAILABLE:不可用,备份失败。 RESTORING: 恢复中。 type String 快照创建类型。其中: MANUAL为手动快照。 AUTO为自动快照。 cluster_id String 快照对应的集群ID。 cluster_name String 快照对应的集群名称。 backup_key String 备份产生的Key。 prior_backup_key String 增量快照使用前一个快照的BakupKey。当取值为FULL时表示这是一个全量快照。 base_backup_key String 对应全量快照的BackupKey。 backup_device String 备份介质。 total_backup_size Long 快照累计大小,表示从全量开始到当前增量的累计大小。单位KB base_backup_name String 对应全量快照名称。 support_inplace_restore Boolean 是否支持恢复至原集群。 fine_grained_backup Boolean 是否是细粒度备份。 fine_grained_backup_detail FineGrainedSnapshotDetail object 细粒度备份信息。 guest_agent_version String 集群guestAgent版本号。 cluster_status String 集群状态 AVAILABLE:可用 UNAVAILABLE:不可用 FROZEN:已冻结 bak_expected_start_time String 预计快照开始时间。 bak_keep_day Integer 备份保留天数。 bak_period String 集群策略。 db_user String 备份用户。 datastore DataStore object 数据库版本 progress String 备份进度。 backup_level String 备份级别 cluster schema 表5 FineGrainedSnapshotDetail 参数 参数类型 描述 database String 备份数据库。 schema_list Array of String 备份模式集合。 table_list Array of String 备份表集合。 表6 DataStore 参数 参数类型 描述 type String 数据库类型。 version String 数据库版本。
  • 响应示例 查询事件列表成功。 { "events" : [ { "category" : "management", "description" : "集群%s删除成功", "name" : "deleteClusterSuccess", "severity" : "normal", "status" : 2, "subject" : "DWS服务事件通知", "context" : "集群test-ty-820-1006删除成功", "event_id" : "f63ccf96-e3e0-474a-835a-fd1a779f68bd", "display_name" : "集群删除成功", "name_space" : "dws", "source_type" : "cluster", "occur_time" : 1664331248330, "project_id" : "4cf650fd46704908aa071b4df2453e1e", "source_id" : "9defa0ce-b11c-47b2-abbc-5cad09ced772", "source_name" : "test-ty-820-1006" } ], "count" : 1}
  • 响应参数 状态码: 200 表3 响应Body参数 参数 参数类型 描述 events Array of EventResponse objects 事件详情列表。 count Integer 事件总数。 表4 EventResponse 参数 参数类型 描述 category String 事件类别。 description String 事件描述。 event_id String 事件ID。 name String 事件定义名称。 display_name String 事件显示名称。 name_space String 所属服务。 severity String 事件级别。 source_type String 事件源类别。 occur_time Long 时间。 project_id String 项目ID。 source_id String 事件源ID。 source_name String 事件源名称。 status Integer 状态。 subject String 事件主题。 context String 事件信息。
  • URI GET /v2/{project_id}/event-specs 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 项目ID。获取方法,请参见获取项目ID。 表2 Query参数 参数 是否必选 参数类型 描述 spec_name 否 String 事件配置名称。 category 否 String 事件类别。 severity 否 String 事件级别。 source_type 否 String 事件源类别。 tag 否 String 事件标签。 offset 否 String 当前页。默认取值为1,最大支持10000。 limit 否 String 显示条数。最大支持1000。
  • 响应参数 表3 响应Body参数 参数 参数类型 描述 count Integer 事件配置总数。 event_specs Array of EventSpecResponse objects 事件配置列表。 表4 EventSpecResponse 参数 参数类型 描述 id String 事件配置ID。 name String 事件配置定义名称。 display_name String 事件配置显示名称。 description String 事件配置描述。 subject String 事件主题。 category String 事件类别。 severity String 事件级别。 source_type String 事件源类型。 name_space String 所属服务。
  • 响应示例 状态码: 200 集群查询事件配置成功。 { "event_specs" : [ { "id" : "fa6e1502-9d08-48c7-900c-26d3b5bd6078", "name" : "configure MRS ExtDataSourcesSuccess", "description" : "配置集群%s的MRS外部数据源成功", "subject" : "DWS服务事件通知", "category" : "management", "severity" : "normal", "display_name" : "配置集群的MRS外部数据源成功", "source_type" : "cluster", "name_space" : "dws" } ], "count" : 1}
  • 响应参数 状态码: 200 表3 响应Body参数 参数 参数类型 描述 count Integer 事件订阅总数。 event_subscriptions Array of EventSubscriptionResponse objects 事件订阅详情列表。 表4 EventSubscriptionResponse 参数 参数类型 描述 id String 订阅ID。 name String 订阅名称。 source_type String 事件源类型。 source_id String 事件源ID。 category String 事件类别。 severity String 事件级别。 tag String 事件标签。 enable Integer 是否开启订阅 : 1为开启 0为关闭 project_id String 项目ID。 name_space String 所属服务。 notification_target String 消息通知 主题地址。 notification_target_name String 消息通知主题名称。 notification_target_type String 消息通知类型。 language String 语言。 time_zone String 时区。
  • 响应示例 状态码: 200 集群查询事件配置成功。 { "event_subscriptions" : [ { "id" : "4d62f33b-b9ee-41d3-b1bc-67e54b2239f9", "name" : "00", "category" : "", "severity" : "", "tag" : "", "enable" : 1, "language" : "zh-cn", "source_type" : "", "source_id" : "", "project_id" : "4cf650fd46704908aa071b4df2453e1e", "name_space" : "DWS", "notification_target" : "urn:smn:cn-north-7:4cf650fd46704908aa071b4df2453e1e:CGS", "notification_target_name" : "CGS", "notification_target_type" : " SMN ", "time_zone" : "GMT+08:00" } ], "count" : 1}
  • 请求参数 表2 请求Body参数 参数 是否必选 参数类型 描述 name 是 String 事件订阅名称。 source_type 否 String 事件源类型支持: cluster backup disaster-recovery source_id 否 String 事件源ID。 category 否 String 事件类别支持: management monitor security system alarm 枚举值:多个枚举值使用 “, ”分隔。 severity 否 String 事件级别支持normal,warning。 tag 否 String 事件标签。 enable 否 Integer 是否开启订阅: 1为开启。 0为关闭。 notification_target 是 String 消息通知地址。 notification_target_name 是 String 消息主题名称。 notification_target_type 是 String 消息通知类型只支持SMN。 time_zone 否 String 时区。
  • 响应参数 状态码: 200 表3 响应Body参数 参数 参数类型 描述 id String 订阅ID。 name String 订阅名称。 source_type String 事件源类型。 source_id String 事件源ID。 category String 事件类别。 severity String 事件级别。 tag String 事件标签。 enable Integer 是否开启订阅 : 1为开启 0为关闭 project_id String 项目ID。 name_space String 所属服务。 notification_target String 消息通知主题地址。 notification_target_name String 消息通知主题名称。 notification_target_type String 消息通知类型。 language String 语言。 time_zone String 时区。
  • 请求示例 开启名为zrf-test-66的正常和警告事件订阅,并选择地址为“urn:smn:cn-north-7:4cf650fd46704908aa071b4df2453e1e:dws-test-nodelete”的SMN消息主题“dws-test-nodelete”: https://{Endpoint}/v2/4cf650fd46704908aa071b4df2453e1e/event-subs{ "severity" : "normal,warning", "source_id" : "", "source_type" : "", "tag" : "", "category" : "", "enable" : 1, "name" : "zrf-test-66", "notification_target" : "urn:smn:cn-north-7:4cf650fd46704908aa071b4df2453e1e:dws-test-nodelete", "notification_target_name" : "dws-test-nodelete", "notification_target_type" : "SMN", "time_zone" : "GMT+08:00"}
  • 响应示例 状态码: 200 { "id" : "41eb162b-cd3b-4c66-88d0-0c2c17fdfc2b", "name" : "zrf-test-66", "category" : "", "severity" : "normal,warning", "tag" : "", "enable" : 1, "language" : "zh-cn", "source_type" : "", "source_id" : "", "project_id" : "4cf650fd46704908aa071b4df2453e1e", "name_space" : "DWS", "notification_target" : "urn:smn:cn-north-7:4cf650fd46704908aa071b4df2453e1e:dws-test-nodelete", "notification_target_name" : "dws-test-nodelete", "notification_target_type" : "SMN", "time_zone" : "GMT+08:00"}
共100000条