云服务器内容精选

  • 响应示例 { "is_success": true, "message": "", "count": 2, "elastic_resource_pools": [ { "owner": "ei_dlics_d00352221", "id": 1026, "elastic_resource_pool_name": "elastic_pool_0622_10", "description": "", "max_cu": 0, "min_cu": 0, "actual_cu": 0, "cidr_in_vpc": "172.16.0.0/12", "create_time": 1624366266826, "current_cu": 64, "status": "AVAILABLE", "resource_id": "ecc98d89-3fd1-4dec-b572-aa6e2ef82391", "fail_reason": "", "enterprise_project_id": "0", "prepay_cu": 0, "charging_mode": 1 }, { "owner": "ei_dlics_d00352221", "id": 1002, "elastic_resource_pool_name": "elastic_pool_0622_0", "description": "test", "max_cu": 684, "min_cu": 0, "actual_cu": 0, "cidr_in_vpc": "172.16.0.0/12", "create_time": 1624353878084, "status": "AVAILABLE", "resource_id": "ecc98d89-3fd1-4dec-b572-aa6e2ef82391", "fail_reason": "", "enterprise_project_id": "0", "prepay_cu": 0, "charging_mode": 1 } ] }
  • URI URI格式 GET /v3/{project_id}/elastic-resource-pools 参数说明 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 项目编号,用于资源隔离。获取方式请参考获取项目ID。 表2 Query参数 参数 是否必选 参数类型 描述 limit 否 Integer 每页的数量。默认为100。 name 否 String 通过弹性资源池名称进行模糊匹配。 offset 否 Integer 偏移量。默认为0。 status 否 String 弹性资源池状态。具体参数范围如下: AVAILABLE:可使用 SCALING:规格变更中 CREATING:创建中 FAILED:已失败 tags 否 String 查询根据标签进行过滤。
  • 请求示例 修改弹性资源池关联队列的扩缩容策略。 { "queue_scaling_policies" : [ { "priority" : 100, "impact_start_time" : "10:00", "impact_stop_time" : "22:00", "min_cu":"64", "max_cu":"752" }, { "priority" : 50, "impact_start_time" : "22:00", "impact_stop_time" : "10:00", "min_cu":"64", "max_cu":"752" } ] }
  • 请求消息 表2 请求参数说明 参数 是否必选 参数类型 描述 queue_scaling_policies 是 Array of objects 该队列在该弹性资源池下的扩缩容策略信息。单条策略信息包含时间段、优先级和CU范围。每个队列至少要配置一条时间段为[00:00, 24:00]的默认扩缩容策略。详细参数说明请参考表3。 表3 queue_scaling_policies 参数 是否必选 参数类型 描述 impact_start_time 是 String 生效开始时间。 impact_stop_time 是 String 生效结束时间。 priority 是 Integer 优先级。 min_cu 是 Integer 最小CU数量。 max_cu 是 Integer 最大CU数量。
  • URI URI格式 PUT /v3/{project_id}/elastic-resource-pools/{elastic_resource_pool_name}/queues/{queue_name} 参数说明 表1 路径参数 参数 是否必选 参数类型 描述 elastic_resource_pool_name 是 String 弹性资源池名称。 project_id 是 String 项目编号,用于资源隔离。获取方式请参考获取项目ID。 queue_name 是 String 绑定的队列名称。
  • URI GET /v3/{project_id}/elastic-resource-pools/{elastic_resource_pool_name}/scale-records 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 项目编号,用于资源隔离。获取方式请参考获取项目ID。 elastic_resource_pool_name 是 String 弹性资源池名称。 长度限制:1~128个字符。 表2 Query参数 参数 是否必选 参数类型 描述 start_time 否 Long start_time用于查询扩缩容历史的开始时间,该时间点需大于当前时间点减30天,必须小于end_time 。时间格式为unix时间戳,单位:毫秒。 若start_time为空,则查询end_time前七天到end_time的数据(end_time最大不能大于当前时间30天)。 查询当前时间点前15天到当前时间点的数据(start_time和end_time同时为空)。 end_time 否 Long end_time用于查询扩缩容历史的结束时间,该时间点不能小于开始时间,不能大于当前时间。时间格式为unix时间戳,单位:毫秒。 若end_time为空,则查询start_time到当前时间点的数据。 查询当前时间点前15天到当前时间的数据(start_time和end_time同时为空)。 status 否 String 弹性资源池扩缩容的状态。 枚举值: success fail offset 否 Integer 偏移量。 最小值:0 limit 否 Integer 当前分页条数。 最小值:0 最大值:100
  • 响应参数 表3 响应Body参数 参数 参数类型 描述 count Integer 返回数组长度。 items Array of arrays 数组中返回的数据。详细说明请参考表4。 表4 items参数 参数 参数类型 描述 max_cu Integer 最大CU。 min_cu Integer 最小CU。 current_cu Integer 扩缩容后CU。 origin_cu Integer 扩缩容前CU。 target_cu Integer 扩缩容预期CU record_time Long 操作完成时间。 status String 扩缩容成功或者失败的状态。 fail_reason String 失败原因。
  • 响应示例 扩缩容历史记录查询接口查询成功 { "count" : 1, "items" : [ { "max_cu" : 64, "min_cu" : 16, "current_cu" : 16, "target_cu" : 16, "origin_cu" : 16, "record_time" : 1650784624000, "status" : "fail", "fail_reason" : "Internal error, please contact technical support." } ] }