云服务器内容精选

  • 请求示例 根据作业id和作业name查询作业的执行方案列表。 POST https://{Endpoint}/v1/{project_id}/cms/template-list/{job_id} { "name" : "xxxxxx", "page_num" : 0, "page_size" : 10, "order_by_column" : "create_time", "sort_order" : "DESC" }
  • 响应示例 状态码: 200 请求响应成功,返回执行方案列表。 { "elements" : [ { "approve_info" : { "need_approve" : false }, "create_by" : "xxxxx", "create_time" : 1600073877378, "enterprise_project_id" : "0", "id" : "xxxxxx", "is_collect" : false, "is_publish" : false, "job_id" : "xxxxx", "job_version" : 1, "name" : "t1", "need_synchronize" : false, "nodes" : [ { "category" : "service", "description" : "", "id" : "xxxxx", "ignore_error" : false, "metadata" : { "configuration" : { "parameters" : { "project_id" : "{{project_id}}", "script_param" : "{xxxx}", "region_id" : "{{region_id}}", "get_instances" : "{xxxxx}" } }, "type" : "operation" }, "name" : "1", "task_name" : "CMS::ECS::runScript" }, { "category" : "service", "description" : "", "id" : "xxxxx", "ignore_error" : false, "metadata" : { "configuration" : { "parameters" : { "package" : "{xxxxxx}", "project_id" : "{{project_id}}", "region_id" : "{{region_id}}", "get_instances" : "{xxxxx}" } }, "type" : "operation" }, "name" : "xxx", "task_name" : "CMS::ECS::Package" } ], "parameters" : [ ], "project_id" : "xxxxx", "quote" : [ ], "rate_control" : { "have_rate_control" : false, "max" : 0, "time_delay" : 0 }, "share_type" : "private", "steps" : [ { "description" : "", "id" : "xxxxx", "ignore_error" : false, "input" : { "script_param" : "{xxxxx}", "get_instances" : "{xxxxx}" }, "name" : "xxxx", "type" : "script" }, { "description" : "", "id" : "xxxxx", "ignore_error" : false, "input" : { "package" : "{xxxxx}", "get_instances" : "{xxxxx}" }, "name" : "2", "type" : "package" } ], "update_by" : "xxxxx", "update_time" : 1600073877378, "version" : "v1" } ], "total_elements" : 1 } 状态码: 400 BadRequest。非法请求。建议直接修改该请求,不要重试该请求。 { "error_code" : "AOM.31001202", "error_msg" : " parameter invalid.", "http_code" : 400 } 状态码: 401 Unauthorized。在客户端提供认证信息后,返回该状态码,表明服务端指出客户端所提供的认证信息不正确或非法。 { "error_code" : "AOM.31009002", "error_message" : "auth failed.", "http_code" : "401" }
  • 请求参数 表2 请求Header参数 参数 是否必选 参数类型 描述 X-Auth-Token 是 String 从IAM服务获取的用户Token。 最小长度:1 最大长度:40960 Content-Type 是 String 指定类型为application/json。 最小长度:1 最大长度:32 表3 请求Body参数 参数 是否必选 参数类型 描述 name 否 String 方案名称 最小长度:1 最大长度:64 page_num 否 Integer page_num为正整数 最小值:1 最大值:9999999 page_size 否 Integer 每页显示的条数 最小值:1 最大值:100 order_by_column 是 String 需要排序的字段(默认为更新时间),支持字段有name,create_time,update_time。 最小长度:1 最大长度:16 sort_order 否 String 排序规则(默认降序) 传入升序或降序,升序:ASC,降序:DESC。 最小长度:1 最大长度:16