云服务器内容精选

  • 响应消息 响应参数如表4所示。 表3 响应参数 参数 参数类型 描述 flavors Array of objects 云服务器规格列表,详情请参见表4。 flavors_links Array of objects 分页查询时,查询下一页数据链接 ,详情请参见表5 flavors_links字段数据结构说明。 表4 flavors数据结构说明 参数 参数类型 描述 id String 规格ID。 links Array of objects 规格相关快捷链接地址。 详情请参见表5。 name String 规格名称。 表5 links字段数据结构说明 参数 参数类型 描述 rel String 快捷链接标记名称。 href String 对应快捷链接。
  • 响应示例 { "flavors": [ { "id": "s3.xlarge.1", "links": [ { "href": "https://compute.region.xxx.com/v2.1/743b4c0428d94531b9f2add666642e6b/flavors/s3.xlarge.1", "rel": "self" }, { "href": "https://compute.region.xxx.com/743b4c0428d94531b9f2add666642e6b/flavors/s3.xlarge.1", "rel": "bookmark" } ], "name": "s3.xlarge.1" }, { "id": "s3.xlarge.2", "links": [ { "href": "https://compute.region.xxx.com/v2.1/743b4c0428d94531b9f2add666642e6b/flavors/s3.xlarge.2", "rel": "self" }, { "href": "https://compute.region.x.com/743b4c0428d94531b9f2add666642e6b/flavors/s3.xlarge.2", "rel": "bookmark" } ], "name": "s3.xlarge.2" } ] }
  • 响应示例 状态码: 200 Search Spec Info Successs [ { "data_disk_size" : 1, "ecs_system_data_size" : 10, "cpu" : 4, "connection" : 10, "resource_spec_code" : "cbh.basic.xxx", "asset" : 10, "type" : "basic", "ram" : 8 } ]
  • 响应参数 状态码: 200 表4 响应Body参数 参数 参数类型 描述 [数组元素] Array of CbsGetSpecInfo objects Search Spec Info Successs 表5 CbsGetSpecInfo 参数 参数类型 描述 resource_spec_code String 云堡垒机规格名称。 ecs_system_data_size Integer 云堡垒机系统盘磁盘大小,单位GB。 cpu Integer 云堡垒机CPU核心数。 ram Integer 云堡垒机内存大小,单位GB。 asset Integer 云堡垒机资产数量。 connection Integer 云堡垒机最大连接数。 type String 云堡垒机规格类型。 basic:标准版 enhance:专业版 data_disk_size Number 云堡垒机数据盘大小,单位TB。 状态码: 400 表6 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_description String 请求参数错误。 状态码: 401 表7 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_description String 校验TOKEN失败。 状态码: 403 表8 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_description String 租户无权限操作。 状态码: 404 表9 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_description String 没有找到CBH资源。
  • URI GET /v2/{project_id}/cbs/instance/specification 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 项目ID。 获取方法详见API参考,附录获取项目ID。 表2 Query参数 参数 是否必选 参数类型 描述 action 是 String 查询云堡垒机规格当前动作。 create:查询可创建云堡垒机规格信息 update:查询可变更云堡垒机规格信息 spec_code 否 String 云堡垒机规格信息,当action为update时此字段必填。
  • 响应示例 状态码: 200 规格列表 { "total" : 1, "spec_codes" : [ { "spec_code" : "hws.resource.type.lakeformation.qps", "resource_type" : "hws.resource.type.lakeformation.metadata", "stride" : 2000, "unit" : "qps", "min_stride_num" : 1, "max_stride_num" : 100, "usage_measure_id" : 6, "usage_factor" : "Duration", "usage_value" : 1, "free_usage_value" : 1, "stride_num_whitelist" : [ 1, 2 ] } ] } 状态码: 400 Bad Request { "error_code" : "common.01000001", "error_msg" : "failed to read http request, please check your input, code: 400, reason: Type mismatch., cause: TypeMismatchException" } 状态码: 401 Unauthorized { "error_code": 'APIG.1002', "error_msg": 'Incorrect token or token resolution failed' } 状态码: 403 Forbidden { "error" : { "code" : "403", "message" : "X-Auth-Token is invalid in the request", "error_code" : null, "error_msg" : null, "title" : "Forbidden" }, "error_code" : "403", "error_msg" : "X-Auth-Token is invalid in the request", "title" : "Forbidden" } 状态码: 404 Not Found { "error_code" : "common.01000001", "error_msg" : "response status exception, code: 404" } 状态码: 408 Request Timeout { "error_code" : "common.00000408", "error_msg" : "timeout exception occurred" } 状态码: 500 Internal Server Error { "error_code" : "common.00000500", "error_msg" : "internal error" }
  • URI GET /v1/{project_id}/specs 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 项目编号。获取方法,请参见获取项目ID。 表2 Query参数 参数 是否必选 参数类型 描述 spec_code 否 String 规格编码。由系统自动生成,例如lakeformation.unit.basic.qps。 offset 否 Integer 偏移量。取值在0-100之间,默认值为0。 limit 否 Integer 单次查询个数。取值在1-100之间,默认值为10。
  • 响应参数 状态码: 200 表3 响应Body参数 参数 参数类型 描述 total Integer 总数。 spec_codes Array of Spec objects 规格编码列表。 表4 Spec 参数 参数类型 描述 spec_code String 规格编码。lakeformation.unit.basic.qps:每秒查询率(QPS)产品。 resource_type String 资源编码。 stride Integer 步长。 unit String 单位。 min_stride_num Integer 最小步数。 max_stride_num Integer 最大步数。 usage_measure_id Integer 使用量单位标识。 usage_factor String 使用量因子。 usage_value Integer 使用量,包含免费额度和单位额度,例如api调用次数,单位是次,前100万次调用免费,计费标准是5元每100万次,这里返回200万,元数据个数,单位是万个,前100万个免费,计费标准是5元每10万个,这里返回110。 free_usage_value Integer 免费使用额度,例如api调用次数,单位是次,前100万次调用免费,这里返回100万,元数据个数,单位是万个,前100万个免费,这里返回100。 stride_num_whitelist Array of integers 步数白名单,返回时,步数必须是白名单中的值。 状态码: 204 表5 响应Header参数 参数 参数类型 描述 X-request-id String 请求ID,定位辅助信息。 状态码: 400 表6 响应Body参数 参数 参数类型 描述 error_code String 错误码。 error_msg String 错误描述。 common_error_code String CBC公共错误码。 solution_msg String 解决方案描述。 状态码: 404 表7 响应Body参数 参数 参数类型 描述 error_code String 错误码。 error_msg String 错误描述。 common_error_code String CBC公共错误码。 solution_msg String 解决方案描述。 状态码: 500 表8 响应Body参数 参数 参数类型 描述 error_code String 错误码。 error_msg String 错误描述。 common_error_code String CBC公共错误码。 solution_msg String 解决方案描述。
  • 响应消息 响应参数如表3所示。 表3 响应参数 参数 参数类型 描述 count Integer 云服务器规格销售策略数量。 sell_policies Array of objects 云服务器规格销售策略,请参考表4。 表4 sell_policies字段数据结构说明 参数 参数类型 描述 id Integer 云服务器规格的索引。 flavor_id String 云服务器规格的ID。 sell_status String 云服务器规格的售卖状态。 sellout:售罄 available:可用 availability_zone_id String 云服务器规格的可用区。 sell_mode String 云服务器规格的付费模式。 postPaid:按需计费 prePaid:包年/包月计费 spot:竞价实例 ri:预留实例 spot_options object 云服务器规格竞价实例的销售策略详情。请参考表5。 表5 spot_options字段数据结构说明 参数 参数类型 描述 longest_spot_duration_hours Integer 购买的竞价实例时长。 largest_spot_duration_count Integer 购买的“竞价实例时长”的个数。 interruption_policy String 竞价实例中断策略。 immediate:立即释放 delay:延迟释放
  • 响应示例 { "count":2, "sell_policies":[ { "id":1, "flavor_id":"s3.small.1", "sell_status":"available", "availability_zone_id":"az1", "sell_mode":"spot", "spot_options":{ "longest_spot_duration_hours":6, "largest_spot_duration_count":1, "interruption_policy":"immediate" } }, { "id":2, "flavor_id":"s3.small.1", "sell_status":"available", "availability_zone_id":"az1", "sell_mode":"spot", "spot_options":{ "longest_spot_duration_hours":6, "largest_spot_duration_count":1, "interruption_policy":"immediate" } } ] }
  • 响应示例 状态码: 200 Search Spec Info Successs [ { "data_disk_size" : 1, "ecs_system_data_size" : 10, "cpu" : 4, "connection" : 10, "resource_spec_code" : "cbh.basic.xxx", "asset" : 10, "type" : "basic", "ram" : 8 } ]
  • URI GET /v2/{project_id}/cbs/instance/specification 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 项目ID。 获取方法详见API参考,附录获取项目ID。 表2 Query参数 参数 是否必选 参数类型 描述 action 是 String 查询云堡垒机规格当前动作。 create:查询可创建云堡垒机规格信息 update:查询可变更云堡垒机规格信息 spec_code 否 String 云堡垒机规格信息,当action为update时此字段必填。
  • 响应参数 状态码: 200 表4 响应Body参数 参数 参数类型 描述 [数组元素] Array of CbsGetSpecInfo objects Search Spec Info Successs 表5 CbsGetSpecInfo 参数 参数类型 描述 resource_spec_code String 云堡垒机规格名称。 ecs_system_data_size Integer 云堡垒机系统盘磁盘大小,单位GB。 cpu Integer 云堡垒机CPU核心数。 ram Integer 云堡垒机内存大小,单位GB。 asset Integer 云堡垒机资产数量。 connection Integer 云堡垒机最大连接数。 type String 云堡垒机规格类型。 basic:标准版 enhance:专业版 data_disk_size Number 云堡垒机数据盘大小,单位TB。 状态码: 400 表6 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_description String 请求参数错误。 状态码: 401 表7 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_description String 校验TOKEN失败。 状态码: 403 表8 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_description String 租户无权限操作。 状态码: 404 表9 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_description String 没有找到CBH资源。
  • 响应示例 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 { "flavors": [ { "id": "physical.kl1.3xlarge", "name": "physical.kl1.3xlarge", "vcpus": "24", "ram": 321729, "disk": "6707", "swap": "", "links": [ { "rel": "self", "href": "https://compute.Region.dc1.domainname.com/v2/bbf1946d374b44a0a2a95533562ba954/flavors/physical.kl1.3xlarge", "type": null }, { "rel": "bookmark", "href": "https://compute.Region.dc1.domainname.com/bbf1946d374b44a0a2a95533562ba954/flavors/physical.kl1.3xlarge", "type": null } ], "OS-FLV-EXT-DATA:ephemeral": 0, "rxtx_factor": 1, "OS-FLV-DISABLED:disabled": false, "rxtx_quota": null, "rxtx_cap": null, "os-flavor-access:is_public": false, "os_extra_specs": { "capabilities:cpu_arch": "x86_64", "baremetal:disk_detail": "SAS SSD:2*800G Raid 1 + NVMe SSD Card1.6T", "capabilities:hypervisor_type": "ironic", "baremetal:__support_evs": "true", "baremetal:extBootType": "LocalDisk", "capabilities:board_type": "o2m", "baremetal:net_num": "2", "baremetal:netcard_detail": "2 x 2*10GE", "baremetal:cpu_detail": "Intel Xeon E5-2667 V4 (2*8core* 3.2 GHz)", "resource_type": "ironic", "baremetal:memory_detail": "256GB DDR4 RAM(GB)" } } ] }
  • URI GET /v1/{project_id}/baremetalservers/flavors?availability_zone={availability_zone} 参数说明请参见表1。 表1 参数说明 参数 是否必选 描述 project_id 是 项目ID。 获取方式请参见获取项目ID。 表2 查询参数 参数 是否必选 参数类型 描述 availability_zone 否 String 可用区,需要指定可用区(AZ)的名称。 请参考地区和终端节点获取。