华为云用户手册

  • 请求示例 自定义消息接入请求体示例 https://{Endpoint}/v1/event/huawei/custom/{integration_key} { "alarmId" : "18cfxxxxxxxxxx0f8", "alarmName" : "Cpu 使用超额预警", "alarmLevel" : "Critical", "time" : 1709118444540, "nameSpace" : "shanghai", "regionId" : "cn-north-4", "applicationId" : "18cfa0a5ef8d", "resourceName" : "machine-1", "resourceId" : "18cxxxxxxxxxxxxff68625", "alarmDesc" : "string", "URL" : "https://xxx.com", "alarmStatus" : "alarm", "alarmSource" : "coc", "additional" : { } }
  • 响应示例 状态码:200 请求成功 { "error_code" : "COC.00000000", "error_msg" : "success", "data" : null, "provider_code" : "049" } 状态码:400 请求体有误 { "error_code" : "COC.00000001", "error_msg" : "alarmName must not be null | alarmId must not be null", "data" : null, "provider_code" : "049" } 状态码:401 鉴权有误 { "error_code" : "common.01010001", "error_msg" : "Token missing or invalid.", "data" : null, "provider_code" : "049" }
  • 响应参数 状态码:200 表3 响应Body参数 参数 参数类型 描述 provider_code String 服务标识 error_code String 请求响应代码,范围:0000~9999,正常时取值:0 error_msg String 请求响应描述 状态码:400 表4 响应Body参数 参数 参数类型 描述 provider_code String 服务标识 error_code String 请求响应代码,范围:0000~9999,正常时取值:0 error_msg String 请求响应描述 状态码:401 表5 响应Body参数 参数 参数类型 描述 provider_code String 服务标识 error_code String 请求响应代码,范围:0000~9999,正常时取值:0 error_msg String 请求响应描述
  • 请求参数 表2 请求Body参数 参数 是否必选 参数类型 描述 alarmId 是 String 告警id alarmName 是 String 告警名称 alarmLevel 是 String 告警级别。取值为: Critical(紧急) Major(重要) inor(次要) Info(提示) time 是 Long 告警发生时间 nameSpace 是 String 服务的命名空间 regionId 否 String 告警发生区域 applicationId 是 String 应用id resourceName 否 String 资源名称 resourceId 否 String 资源ID alarmDesc 是 String 告警描述 URL 否 String 原始告警URL alarmStatus 否 String 告警状态。一般取值为alarm(告警中)和ok(已恢复) alarmSource 是 String 告警源 additional 否 Object 告警附加信息
  • 响应示例 状态码:200 查询成功响应 { "error_code" : "COC.00080000", "error_msg" : "success", "data" : { "total" : 1, "total_num" : null, "running_num" : null, "list" : [ { "id" : "warroom_id", "title" : "warroom_title", "admin" : "admin_user_id", "recover_member" : [ ], "recover_leader" : [ ], "incident" : { "id" : "incident_id", "incident_id" : "IM202504101040150000000000", "alarm_id" : null, "is_change_event" : null, "source_id" : null, "failure_level" : "level_50", "incident_url" : null }, "source" : null, "regions" : [ { "code" : "region_code1", "name" : null } ], "change_num" : null, "occur_time" : 1742027787527, "recover_time" : null, "fault_cause" : null, "create_time" : 1742027787528, "first_report_time" : null, "recovery_notification_time" : null, "fault_impact" : null, "description" : "", "circular_level" : "level_50", "war_room_status" : { "id" : "1", "name_zh" : "启动 warroom", "name_en" : "Start WarRoom", "type" : "WAR_ROOM_STATUS" }, "impacted_application" : [ { "name" : null, "id" : "application_id1" } ], "processing_duration" : null, "restoration_duration" : null, "war_room_num" : "war_room_num", "enterprise_project_id" : "0" } ] }, "provider_code" : "049" } 状态码:400 查询失败 { "error_code" : "common.01010001", "error_msg" : "Token missing or invalid.", "data" : null, "provider_code" : "049" }
  • 请求示例 https://{endpoint}/v1/external/warrooms/list { "offset" : 0, "limit" : 10, "incident_num" : "IM202504101040150000000000", "title" : "warroom名称", "region_code_list" : [ "region_code1", "region_code2" ], "incident_levels" : [ "level_40", "level_50" ], "impacted_application_ids" : [ "service_id1", "service_id2" ], "admin" : [ "user_id1", "user_id2" ], "status" : [ 0 ], "triggered_start_time" : 1743350400000, "triggered_end_time" : 1745942400000, "occur_start_time" : 1743350400000, "occur_end_time" : 1745942400000, "recover_start_time" : 1743350400000, "recover_end_time" : 1745942400000, "notification_level" : [ "level_40", "level_50" ], "enterprise_project_ids" : [ "project_id1", "project_id2" ], "war_room_num" : "war_room_num", "statistic_flag" : false, "current_users" : [ "user_id1", "user_id2" ], "war_room_nums" : [ "war_room_num1", "war_room_num2" ] }
  • 响应参数 状态码:200 表2 响应Body参数 参数 参数类型 描述 provider_code String 服务标识。 缺省值:4 最小长度:3 最大长度:3 error_code String 请求响应代码,为8位数字组成,前四位标记当前服务为warroom服务,后四位标记错误类型。 最小长度:8 最大长度:8 error_msg String 请求响应描述。 最小长度:0 最大长度:10240 data data object 响应数据 表3 data 参数 参数类型 描述 list Array of WarRoomTenantInfo objects warroom信息。 数组长度:0 - 1000 total Long 当前查询条件下查到的warroom总数。 最小值:0 最大值:9223372036854775807 running_num Long 进行中warroom总数。 最小值:0 最大值:9223372036854775807 closed_num Long 已关闭warroom总数。 最小值:0 最大值:9223372036854775807 total_num Long warroom总数。 最小值:0 最大值:9223372036854775807 表4 WarRoomTenantInfo 参数 参数类型 描述 id String warroom存在后台数据库的主键ID。 最小长度:0 最大长度:100 title String warroom名称 最小长度:0 最大长度:255 admin String warroom管理员。 最小长度:0 最大长度:255 recover_member Array of strings 恢复成员。 最小长度:0 最大长度:255 数组长度:0 - 1000 recover_leader Array of strings 主恢复责任人。 最小长度:0 最大长度:255 数组长度:0 - 1000 incident WarRoomIncident object 事件单信息。 source String 事件来源。 最小长度:0 最大长度:255 regions Array of regions objects 影响的Region。 数组长度:0 - 1000 change_num String 变更单号。 最小长度:0 最大长度:255 occur_time Long 开始时间,值为13位时间戳。 最小值:0 最大值:9223372036854775807 recover_time Long 故障恢复时间,值为13位时间戳。 最小值:0 最大值:9223372036854775807 fault_cause String 故障原因。 最小长度:0 最大长度:255 create_time Long 添加时间,值为13位时间戳。 最小值:0 最大值:9223372036854775807 first_report_time Long 首次通报时间,值为13位时间戳。 最小值:0 最大值:9223372036854775807 recovery_notification_time Long 恢复通报时间,值为13位时间戳。 最小值:0 最大值:9223372036854775807 fault_impact String 故障影响。 最小长度:0 最大长度:255 description String warRoom描述。 最小长度:0 最大长度:255 circular_level String 通报级别,同事件级别。 最小长度:0 最大长度:32 war_room_status WarRoomEnumeration object warroom状态信息。 impacted_application Array of impacted_application objects 影响应用信息。 数组长度:0 - 1000 processing_duration Long 处理时长(分钟)。 最小值:0 最大值:9223372036854775807 restoration_duration Long 恢复时长(分钟)。 最小值:0 最大值:9223372036854775807 war_room_num String warroom单号。 最小长度:0 最大长度:255 enterprise_project_id String 企业项目id。 最小长度:0 最大长度:64 表5 WarRoomIncident 参数 参数类型 描述 id String 后台数据库存储的主键ID。 最小长度:0 最大长度:100 incident_id String 事件单单号ID。 最小长度:0 最大长度:32 is_change_event Boolean 是否变更事件。 failure_level String 事件级别。 最小长度:0 最大长度:32 incident_url String 事件单号链接。 最小长度:0 最大长度:20000 表6 regions 参数 参数类型 描述 code String 主键ID。 最小长度:0 最大长度:100 name String region名称。 最小长度:0 最大长度:255 表7 WarRoomEnumeration 参数 参数类型 描述 id String 枚举值ID。 最小长度:0 最大长度:255 name_zh String 枚举值中文名。 最小长度:0 最大长度:255 name_en String 枚举值英文名。 最小长度:0 最大长度:255 type String 枚举类型。 最小长度:0 最大长度:255 表8 impacted_application 参数 参数类型 描述 id String 受影响服务对应的唯一ID。 最小长度:0 最大长度:100 name String 受影响服务的名字,比如CloudMonitorAlarm。 最小长度:0 最大长度:255 状态码:400 表9 响应Body参数 参数 参数类型 描述 provider_code String 服务标识。 缺省值:049 最小长度:3 最大长度:3 error_code String 请求响应代码,为8位数字组成,前四位标记当前服务为warroom服务,后四位标记错误类型。 最小长度:8 最大长度:8 error_msg String 请求响应异常时报错信息。 最小长度:0 最大长度:10240 data Object 响应数据。
  • 功能介绍 该接口可分页查询到warroom信息,分页参数为limit与offset。同时可对warroom关联的事件单单号incident_num、标题title、状态status等进行过滤,更多过滤参数详见请求参数说明。查询结果包含warroom名称、warroom状态、关联事件单信息等。同时该接口也可以只返回当前warroom的统计结果,当statistic_flag参数为true时,返回当前租户下共多少warroom(total_num),已关闭(closed_num)和未关闭(running_num)的数量。
  • 请求参数 表1 请求Body参数 参数 是否必选 参数类型 描述 limit 否 Integer 列表查询接口分页参数,表示一页查询多少条数据,该值需大于等于1且为整数,表示分页查询时每一页最多查到的数量。 最小值:0 最大值:1000 缺省值:0 offset 否 Integer 列表查询接口分页参数,表示当前查询第几页,0表示查询第一页。 最小值:0 最大值:2147483647 缺省值:0 incident_num 否 String 事件单号,对单号进行搜索时为精确查询,需要填写准确的事件单号。 最小长度:0 最大长度:64 title 否 String warroom名称,对warroom名称进行搜索时为模糊查询。 最小长度:0 最大长度:1000 region_code_list 否 Array of strings 对区域进行过滤,传值为region_id,可同时传递多个region_id,例如:["cn-north-4"]表示过滤北京四下的warroom。 最小长度:0 最大长度:200 数组长度:0 - 1000 incident_levels 否 Array of strings 对事件级别进行过滤,可同时传递多个值,可传递的值范围为:level_10、level_20、level_30、level_40和level_50,分别对应P1、P2、P3、P4和P5。 最小长度:0 最大长度:32 数组长度:0 - 1000 impacted_application_ids 否 Array of strings 对影响应用进行过滤,传值为应用ID。 最小长度:0 最大长度:200 数组长度:0 - 1000 admin 否 Array of strings warroom管理员,传值为用户ID。 最小长度:0 最大长度:200 数组长度:0 - 1000 status 否 Array of strings warroom状态,过滤场景下需要传递状态ID。当前warroom状态分别为启动 warroom(状态ID:1)、故障界定(状态ID:3)、故障已恢复(状态ID:7)、warroom关闭(状态ID:20)。 最小长度:0 最大长度:10 数组长度:0 - 100 triggered_start_time 否 Long warroom拉起时间,值为13位时间戳,默认前30天。 最小值:0 最大值:9223372036854775807 triggered_end_time 否 Long warroom结束时间,默认为当前时间,值为13位时间戳。 最小值:0 最大值:9223372036854775807 occur_start_time 否 Long 故障发生时间,值为13位时间戳。 最小值:0 最大值:9223372036854775807 occur_end_time 否 Long 故障结束时间,值为13位时间戳。 最小值:0 最大值:9223372036854775807 recover_start_time 否 Long 故障恢复开始时间,值为13位时间戳。 最小值:0 最大值:9223372036854775807 recover_end_time 否 Long 故障恢复结束时间,值为13位时间戳。 最小值:0 最大值:9223372036854775807 notification_level 否 Array of strings 通报级别,可同时传递多个值,可传递的值范围为:level_10、level_20、level_30、level_40和level_50,分别对应P1、P2、P3、P4和P5。 最小长度:0 最大长度:32 数组长度:0 - 1000 enterprise_project_ids 否 Array of strings 企业项目id,可多选。 最小长度:0 最大长度:64 数组长度:0 - 500 war_room_num 否 String warroom单号。 最小长度:0 最大长度:255 statistic_flag 否 Boolean 是否只返回统计数据,当值为false返回基本信息,值为true接口只返回统计结果:total_num,running_num,closed_num。 缺省值:false current_users 否 Array of strings 当前用户ID。 最小长度:0 最大长度:200 数组长度:0 - 1000 war_room_nums 否 Array of strings warroom单号,当有这个筛选条件时,其他筛选条件忽略。 最小长度:0 最大长度:255 数组长度:0 - 1000
  • 响应参数 状态码:200 表3 响应Body参数 参数 参数类型 描述 data Array of JobScriptBatchListModel objects 展示批次列表。 表4 JobScriptBatchListModel 参数 参数类型 描述 batch_index Integer 批次索引,从1开始。 total_instances Integer 批次内实例节点数量。 rotation_strategy String 暂停继续策略。 CONTINUE:继续。 PAUSE:暂停。 properties String 批次标签。
  • 响应参数 状态码:200 表3 响应Body参数 参数 参数类型 描述 data JobScriptOrderListPage object 展示工单列表返回结果。 表4 JobScriptOrderListPage 参数 参数类型 描述 total Long 总条数。 data Array of JobScriptOrderListModel objects 单页数据列表。 表5 JobScriptOrderListModel 参数 参数类型 描述 order_id Long 主键id,对应job_order_do的主键。 order_name String 工单名称。 execute_uuid String 列表跳转到详情时,用这个uuid,对应execute_data_do的execute_uuid。 gmt_created Long 创建时间。 gmt_finished Long 完成时间。 execute_costs Long 执行耗时,单位:秒。 creator String 创建人。 status String 工单状态。 READY:准备。 PRO CES SING:处理。 ABNORMAL:异常。 PAUSED:中断。 CANCELED:取消。 FINISHED:完成。 properties JobScriptOrderListProp object 标签:区域信息等。 表6 JobScriptOrderListProp 参数 参数类型 描述 region_ids String CMDB服务实例区域id,可能有多个。
  • 响应示例 状态码:200 执行分页数据。 更多状态码请参考状态码。 { "data": { "total": 222, "data": [ { "order_id": 74, "order_name": "071201", "execute_uuid": "SCT20230724201xxxxxxxxxxxx", "gmt_created": 1690200829451, "gmt_finished": 1690200850293, "execute_costs": 20842, "creator": "xxxxxxxxxxxcontainer1", "status": "CANCELED", "properties": { "region_ids": "***" } }, { "order_id": 73, "order_name": "071201", "execute_uuid": "SCT2023072411xxxxxxxxxxxxx", "gmt_created": 1690168434460, "gmt_finished": 1690168443277, "execute_costs": 8817, "creator": "xxxxxxxxxxxcontainer1", "status": "FINISHED", "properties": { "region_ids": "***" } }, { "order_id": xx, "order_name": "xxx", "execute_uuid": "SCT2023072217181xxxxxxxxxx", "gmt_created": 1690017490247, "gmt_finished": null, "execute_costs": null, "creator": "xxxxxxxxxxxcontainer1", "status": "ABNORMAL", "properties": { "region_ids": "***" } }, { "order_id": 71, "order_name": "patch_730", "execute_uuid": "SCT2023071915xxxxxxxxxxxxx", "gmt_created": 1689753553241, "gmt_finished": 1689753579363, "execute_costs": 26122, "creator": "xxxxxxxxxxxcontainer1", "status": "FINISHED", "properties": { "region_ids": "***" } }, { "order_id": 70, "order_name": "111", "execute_uuid": "SCT2023071915xxxxxxxxxxxxx", "gmt_created": 1689751168547, "gmt_finished": null, "execute_costs": null, "creator": "xxxxxxxxxxxcontainer1", "status": "ABNORMAL", "properties": { "region_ids": "***" } } ] } }
  • URI GET /v1/job/script/orders 表1 Query参数 参数 是否必选 参数类型 描述 limit 否 Integer 分页参数。 marker 否 Long 分页参数。 start_time 否 Long 创建时间开始。 end_time 否 Long 创建时间结束。 creator 否 String 创建人。 status 否 String 工单状态。 PROCESSING:执行中。 ABNORMAL:异常。 PAUSED:暂停。 CANCELED:已取消。 FINISHED:成功。 name_like 否 String 工单名称。
  • 响应示例 状态码:200 脚本分页数据。 更多状态码请参考状态码。 { "data" : { "total" : 70, "data" : [ { "id" : 6229, "name" : "测试111", "type" : "SHELL", "creator" : "runbook_notif", "creator_id" : "e56462d17f334b8789ff0b5b9cca3bb9", "operator" : null, "gmt_created" : 1701314214271, "gmt_modified" : null, "status" : "APPROVED", "script_uuid" : "SC20231130111654023511657", "usage_count" : 0, "properties" : { "risk_level" : "HIGH", "reviewers" : [ ], "version" : "1.0.0", "protocol" : null }, "enterprise_project_id" : 0 }, { "id" : 6228, "name" : "测试11", "type" : "SHELL", "creator" : "runbook_notif", "creator_id" : "e56462d17f334b8789ff0b5b9cca3bb9", "operator" : null, "gmt_created" : 1701314090063, "gmt_modified" : null, "status" : "APPROVED", "script_uuid" : "SC20231130111450026f7f8b2", "usage_count" : 0, "properties" : { "risk_level" : "LOW", "reviewers" : [ ], "version" : "1.0.0", "protocol" : null }, "enterprise_project_id" : 0 } ] } } 状态码:400 包含错误信息。 更多状态码请参考状态码。 { "error_code" : "COC.00040701", "error_msg" : "error_msg" }
  • 响应参数 状态码:200 表3 响应Body参数 参数 参数类型 描述 data ScriptListPage object 脚本列表返回体。 表4 ScriptListPage 参数 参数类型 描述 total Long 总条数。 data Array of ScriptListModel objects 单页数据列表。 表5 ScriptListModel 参数 参数类型 描述 id Long 脚本自增id。 script_uuid String 脚本uuid。 enterprise_project_id String 企业项目ID,默认为:0。 name String 脚本名称。 type String 脚本类型 SHELL:shell脚本。 PYTHON:python脚本。 BAT:bat脚本。 status String 脚本状态。 PENDING_APPROVE:待审批。 APPROVED:正常(审批通过)。 REJECTED:驳回(审批人,驳回该脚本)。 gmt_created Long 创建时间。 gmt_modified Long 修改时间。 creator String 创建人。 creator_id String 创建人Id。 operator String 修改人。 properties ScriptPropertiesModel object 脚本标签:风险等级risk_level(取值范围:LOW/MEDIUM/HIGH)、审批人reviewer。 表6 ScriptPropertiesModel 参数 参数类型 描述 risk_level String 风险等级。 LOW:低风险。 MEDIUM:中风险。 HIGH:高风险。 version String 脚本版本号。 reviewers Array of ReviewerInfo objects 审批人,不填写不需要审批。 protocol String 审批 消息通知 协议,用于通知审批人。 DEFAULT:默认。 SMS :短信。 EMAIL:邮件。 DING_TALK:钉钉。 WE_LINK:welink。 WECHAT:微信。 CALLNOTIFY:语言。 NOT_TO_NOTIFY:不通知。 表7 ReviewerInfo 参数 参数类型 描述 reviewer_name String 审批人名称( IAM 用户名)。 reviewer_id String 审批人ID(IAM用户Id)。 状态码:400 表8 响应Body参数 参数 参数类型 描述 error_code String 错误码。 error_msg String 错误描述。
  • URI GET /v1/job/scripts 表1 Query参数 参数 是否必选 参数类型 描述 limit 是 Integer 分页参数:每页返回记录个数限制。 marker 否 Long 分页参数:上一页最后一个记录id。 name_like 否 String 脚本名(模糊)。 creator 否 String 创建人。 risk_level 否 String 风险等级 LOW:低风险。 MEDIUM:中风险。 HIGH:高风险。 type 否 String 脚本类型 SHELL:shell脚本。 PYTHON:python脚本。 BAT:Bat脚本。 enterprise_project_id 否 String 企业项目id。
  • URI GET /v1/resources 表1 Query参数 参数 是否必选 参数类型 描述 name 否 String 云资源名称。 ep_id 否 String 企业项目ID,租户设置。 project_id 否 String 参数解释: 项目ID。 获取方式请参考获取项目ID。 约束限制: 一个项目对应一个region。 取值范围: 不涉及。 默认值: 不涉及。 region_id 否 String 区域ID。 az_id 否 String 可用区ID。 ip_type 否 String IP类型。 fixed:内网IP。 floating:弹性公网IP。 ip 否 String IPv4地址过滤结果,匹配规则为模糊匹配。此处IP为云资源IP。 ip_list 否 Array of strings 云资源IP列表,最大长度:100。 resource_id_list 否 Array of strings 云资源ID列表,最大长度:100。 provider 是 String 云服务名称。 status 否 String 云资源状态。 agent_state 否 String uniagent状态。 运行中。 异常。 安装中。 安装失败。 已卸载。 未安装。agent状态 image_name 否 String 镜像名称,模糊匹配。 os_type 否 String 云资源操作系统类型。 tag 否 String 云资源的标签。 标签的格式为“key.value”。其中,key的长度不超过36个字符,value的长度不超过43个字符。 标签命名时,需满足如下要求: 标签的key值只能包含大写字母(A~Z)、小写字母(a~z)、数字(0-9)、下划线()、中划线(-)以及中文字符。 标签的value值只能包含大写字母(A~Z)、小写字母(a~z)、数字(0-9)、下划线()、中划线(-)、小数点(.)以及中文字符。 tag_key 否 String 云资源的标签key。 group_id 否 String 云资源下的分组ID。 component_id 否 String 云资源下组件ID。 application_id 否 String 云资源下应用ID。 cce_cluster_id 否 String cce集群ID,资源属于的cce的ID。 vpc_id 否 String 待创建云资源所属虚拟私有云(简称VPC),需要指定已创建VPC的ID,UUID格式。 is_delegated 否 Boolean 是否已托管。 operable 否 String 用户定义资源是否可运维实例。 enable:启用。 不存在当前字段:不启用。 is_collected 否 Boolean 是否已收藏。 flavor_name 否 String 云资源规格名称。 charging_mode 否 String 云服务器的计费类型。 取值范围: spot:竞价类型。 prepaid:包年/包月类型。 postpaid:按需类型。 type 是 String 资源类型名称,非空。 limit 是 Integer 最小返回数量:1,最大返回数量:500,非空。 marker 否 String 分页参数,通过上一个请求中返回的marker信息(云资源ID)作为输入,获取当前页。
  • 功能介绍 查询租户所有资源: 查询租户所有资源等相关信息,便于租户详细了解资源总体情况。 请求参数provider(云服务名称),type(云资源类型),limit(查询条数)必填,单次最大查询条数:500。 返回信息包括:资源ID,资源名称,云服务名称,资源类型,项目ID,租户ID,区域ID,企业项目ID,资源标签,资源详细属性,资源ingest属性,uniagentID,uniagent状态,是否托管,是否可运维。
  • 响应参数 状态码:200 表3 响应Body参数 参数 参数类型 描述 data PublicScriptListPage object 获取公共脚本列表返回结果。 表4 PublicScriptListPage 参数 参数类型 描述 total Long 总条数。 data Array of PublicScriptListModel objects 单页数据列表。 表5 PublicScriptListModel 参数 参数类型 描述 id Long 脚本自增id。 script_uuid String 脚本uuid。 name String 脚本名称。 type String 脚本类型 SHELL:shell脚本 PYTHON:python脚本 BAT:bat脚本 gmt_created Long 创建时间。 description String 脚本描述。 properties PublicScriptPropertiesModel object 脚本附加属性。 表6 PublicScriptPropertiesModel 参数 参数类型 描述 risk_level String 风险等级 LOW:低风险 MEDIUM:中风险 HIGH:高风险 version String 脚本版本号。
  • 响应示例 状态码:200 请求成功。 更多状态码请参考状态码。 { "data" : { "total" : 2, "data" : [ { "id" : 1422704, "name" : "HWC.E CS .OSOps-switch-linux-ssh.sh", "type" : "SHELL", "gmt_created" : 1745294950699, "status" : "APPROVED", "script_uuid" : "SC2024052200000006dd50344", "description" : "启动或关闭linux操作系统ssh", "properties" : { "risk_level" : "HIGH", "version" : "1.0.0" } }, { "id" : 1422703, "name" : "HWC.ECS.OSOps-switch-linux-firewall.sh", "type" : "SHELL", "gmt_created" : 1745294950689, "status" : "APPROVED", "script_uuid" : "SC2024052200000005dd50344", "description" : "启动或关闭linux操作系统防火墙", "properties" : { "risk_level" : "HIGH", "version" : "1.0.0" } } ] } }
  • URI GET /v1/job/public-scripts 表1 Query参数 参数 是否必选 参数类型 描述 limit 否 Integer 分页参数:每页返回记录个数限制。 marker 否 Long 分页参数:上一页最后一个记录id。 name_like 否 String 脚本名(只支持右模糊搜索)。 name 否 String 脚本名(精确搜索)。 risk_level 否 String 风险等级 LOW:低风险。 MEDIUM:中风险。 HIGH:高风险。 type 否 String 脚本类型 SHELL:shell脚本。 PYTHON:python脚本。 BAT:bat脚本。
  • 响应示例 状态码:200 节点合规性报告信息 { "count" : 1, "instance_compliant" : [ { "baseline_id" : "JX-f2d85e2554f7385cbbf2c23a01f41", "baseline_name" : "COC-EulerOSDefaultPatchBaseline", "cce_info_id" : null, "compliant_summary" : { "compliant_count" : 264, "severity_summary" : { "critical_count" : 0, "high_count" : 0, "informational_count" : 0, "low_count" : 0, "medium_count" : 0, "unspecified_count" : 264 } }, "eip" : null, "enterprise_project_id" : "string", "execution_summary" : { "job_id" : "string", "order_id" : "string", "report_time" : 1715308575000 }, "group" : null, "id" : "string", "instance_id" : "string", "ip" : "string", "name" : "string", "node_id" : "", "non_compliant_summary" : { "non_compliant_count" : 204, "severity_summary" : { "critical_count" : 0, "high_count" : 0, "informational_count" : 0, "low_count" : 0, "medium_count" : 0, "unspecified_count" : 0 } }, "operating_system" : "EulerOS", "region" : "string", "report_scene" : "ECS", "rule_type" : "standard", "status" : "non_compliant" } ] } 状态码:500 错误信息返回 { "error_code" : "string", "error_msg" : "string" }
  • URI GET /v1/patch/instance/compliant 表1 Query参数 参数 是否必选 参数类型 描述 enterprise_project_id 否 String 企业项目id name 否 String 名称 instance_id 否 String ECS实例id ip 否 String 内网ip eip 否 String 弹性公网ip operating_system 否 String 操作系统 HuaweiCloudEulerOS CentOS EulerOS region 否 String 区域 group 否 String 分组 compliant_status 否 String 合规性状态 non_compliant:不合规 compliant:合规 order_id 否 String 工单id offset 否 Integer 偏移量 limit 否 Integer 每页数量 sort_dir 否 String 排序 asc:升序 desc:降序 sort_key 否 String 排序字段 report_time:报告时间 report_scene 否 String 报告场景 CCE ECS cce_info_id 否 String cce 集群信息id
  • 响应参数 状态码:200 表2 响应Body参数 参数 参数类型 描述 count Long 总条数 instance_compliant Array of InstanceCompliant objects 节点合规报告 表3 InstanceCompliant 参数 参数类型 描述 compliant_summary CompliantSummary object 合规补丁信息 non_compliant_summary NonCompliantSummary object 不合规补丁信息 execution_summary ExecutionSummary object 执行信息 id String id enterprise_project_id String 企业项目id name String 节点名称 instance_id String 节点ID node_id String cce集群节点ID ip String 节点IP eip String 弹性公网ip region String 区域 group String 分组 report_scene String 报告场景(CCE,ECS) cce_info_id String cce 集群信息id status String 合规性状态 baseline_id String 基线id baseline_name String 基线名称 rule_type String 基线规则类型 operating_system String 操作系统 表4 CompliantSummary 参数 参数类型 描述 compliant_count Integer 合规补丁数量 severity_summary SeveritySummary object 合规总结 表5 NonCompliantSummary 参数 参数类型 描述 non_compliant_count Integer 不合规补丁数量 severity_summary SeveritySummary object 合规总结 表6 SeveritySummary 参数 参数类型 描述 critical_count Integer 重大合规性报告数量 high_count Integer 高合规性报告数量 informational_count Integer 信息性合规性报告数量 low_count Integer 低合规性报告数量 medium_count Integer 中级合规性报告数量 unspecified_count Integer 未指定合规性报告数量 表7 ExecutionSummary 参数 参数类型 描述 order_id String 工单Id job_id String 脚本执行Id report_time Long 报告时间 状态码:500 表8 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述
  • URI GET /v1/applications 表1 Query参数 参数 是否必选 参数类型 描述 id_list 否 Array of strings 资源ID列表,可填多个。 parent_id 否 String 父节点ID。 code 否 String 应用代码。 name_like 否 String 应用名称,模糊查询。 marker 否 String 分页参数,通过上一个请求中返回的marker信息(应用ID)作为输入,获取当前页。 limit 是 Integer 返回数量限制。最小返回数量:1,最大返回数量:500。
  • 响应参数 状态码:200 表2 响应Body参数 参数 参数类型 描述 data Array of data objects 应用列表。 表3 data 参数 参数类型 描述 id String 应用ID。 name String 应用名称。 code String 应用代码。 domain_Id String IAM租户的账号ID。 parent_Id String 应用父节点ID。 description String 应用描述信息。 path String 应用层级路径,由ID拼接。 is_collection Boolean 是否为收藏应用。 createtime String 创建时间。 updatetime String 修改时间。 状态码:400 表4 响应Body参数 参数 参数类型 描述 error_code String 错误码,最小长度:8,最大长度:36。 error_msg String 错误描述,最小长度:2,最大长度:512。
  • 响应示例 状态码:200 请求成功。 更多状态码请参考状态码。 { "error_code" : "GOM.00000000", "error_msg" : null, "provider_code" : "049", "data" : null } 状态码:400 服务器未能处理请求。 更多状态码请参考状态码。 { "error_code" : "GOM.00007256", "error_msg" : "参数错误", "provider_code" : "049", "data" : null }
  • 请求示例 受理事件单。 https://{Endpoint}/v1/external/incident/handle { "incident_num" : "IM202403221515060171753781", "operator" : "7da46971b7e24eed90cf777cc2ff8b91", "operate_key" : "acceptedIncident1", "parameter" : { } } 提交事件单解决方案。 https://{Endpoint}/v1/external/incident/handle { "incident_num" : "IM202403221515060171753781", "operator" : "7da46971b7e24eed90cf777cc2ff8b91", "operate_key" : "commitSolution1", "parameter" : { "mtm_type" : "inc_type_p_config_issues", "is_service_interrupt" : true, "cause" : "100001", "solution" : "20001" } } 验证事件处理结果。 https://{Endpoint}/v1/external/incident/handle { "incident_num" : "IM202403221515060171753781", "operator" : "7da46971b7e24eed90cf777cc2ff8b91", "operate_key" : "confirm", "parameter" : { "virtual_confirm_result" : false, "virtual_confirm_comment" : "13" } }
  • 响应参数 状态码:200 表2 响应Body参数 参数 参数类型 描述 provider_code String 服务标识。 缺省值:049 最小长度:3 最大长度:100000000 error_code String 请求响应代码,范围:GOM.00000000~GOM.00009999999,正常时取值:GOM.00000000。 缺省值:GOM.00000000 最小长度:1 最大长度:15 error_msg String 请求响应描述。 最小长度:0 最大长度:100000000 data Object 执行不同动作后返回信息,当前固定为null 状态码:400 表3 响应Body参数 参数 参数类型 描述 provider_code String 服务标识。 缺省值:049 最小长度:3 最大长度:100000000 error_code String 请求响应代码,范围:GOM.00000000~GOM.00009999999,正常时取值:GOM.00000000。 缺省值:GOM.00000000 最小长度:1 最大长度:15 error_msg String 请求响应描述。 最小长度:0 最大长度:100000000
  • 请求示例 https://{endpoint}/v1/external/warrooms { "war_room_name" : "测试001", "description" : "描述001", "region_code_list" : [ "region_code1", "region_code2" ], "application_id_list" : [ "CS10004308" ], "incident_number" : "IM202504101040150000000000", "participant" : "user_id", "war_room_admin" : "user_id", "schedule_group" : [ { "role_id" : "role_id1", "scene_id" : "scene_id1" } ], "application_names" : [ "COC" ], "region_names" : [ "华北-北京四" ], "enterprise_project_id" : 0, "notification_type" : "WECHAT" }
共100000条
提示

您即将访问非华为云网站,请注意账号财产安全