云服务器内容精选

  • 响应示例 状态码: 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时此字段必填。
  • 响应示例 { "flavors": [ { "attachableQuantity": { "free_scsi": 60, "free_blk": 24, "free_disk": 60, "free_nic": 12 }, "id": "c3.2xlarge.2", "name": "c3.2xlarge.2", "vcpus": "8", "ram": 16384, "disk": "0", "swap": "", "links": [ { "rel": "self", "href": "https://ecs.region.xxx.com/v1.0/743b4c0428d94531b9f2add666642e6b/flavors/c3.2xlarge.2", "type": null }, { "rel": "bookmark", "href": "https://ecs.region.xxx.com/743b4c0428d94531b9f2add666642e6b/flavors/c3.2xlarge.2", "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": true, "os_extra_specs": { "ecs:virtualization_env_types": "CloudCompute", "ecs:generation": "c3", "ecs:instance_architecture":"arm64" , "ecs:performancetype": "computingv3", "resource_type": "IOoptimizedC3_2" } } ] }
  • 响应消息 响应参数如表3所示。 表3 响应参数 参数 参数类型 描述 flavors Array of objects 云服务器规格列表,详情请参见表4。 表4 flavors数据结构说明 参数 参数类型 描述 id String 云服务器规格的ID。 name String 云服务器规格的名称。 vcpus String 云服务器规格对应的CPU核数。 ram Integer 云服务器规格对应的内存大小,单位为MB。 disk String 云服务器规格对应要求系统盘大小。 当前未使用该参数,缺省值为0。 swap String 云服务器规格对应要求的交换分区大小。 当前未使用该参数,缺省值为""。 OS-FLV-EXT-DATA:ephemeral Integer 扩展属性,临时盘大小。 当前未使用该参数,缺省值为0。 OS-FLV-DISABLED:disabled Boolean 扩展属性,该云服务器规格是否禁用。 当前未使用该参数,缺省值为false。 rxtx_factor Float 云服务器可使用网络带宽与网络硬件带宽的比例。 当前未使用该参数,缺省值为1.0。 rxtx_quota String 云服务器可使用网络带宽的软限制。 当前未使用该参数,缺省值为null。 rxtx_cap String 云服务器可使用网络带宽的硬限制。 当前未使用该参数,缺省值为null。 os-flavor-access:is_public Boolean 扩展属性,flavor是否给所有租户使用。 true:表示给所有租户使用。 false:表示给指定租户使用。 缺省值为true。 links Array of objects 规格相关快捷链接地址,详情请参见表5。 os_extra_specs Object 云服务器规格的扩展字段,详情请参见表6。 attachableQuantity Object 云服务器可挂载网卡和卷数,详情参见表7。 表5 links字段数据结构说明 参数 参数类型 描述 rel String 快捷链接标记名称。 href String 对应快捷链接。 type String 快捷链接类型,当前接口未使用,缺省值为null。 表6 os_extra_specs数据结构说明(仅列举常用参数) 参数 参数类型 描述 ecs:performancetype String 云服务器规格的分类: normal:通用计算型 entry:通用入门型 cpuv1:计算I型 cpuv2:计算II型 computingv3:通用计算增强型 kunpeng_computing:鲲鹏通用计算增强型 kunpeng_highmem:鲲鹏内存优化型 kunpeng_highio:鲲鹏超高I/O型 highmem:内存优化型 saphana:超大内存型 diskintensive:磁盘增强型 highio:超高I/O型 ultracpu:超高性能计算型 gpu:GPU加速型 fpga:FPGA加速型 ascend:AI加速型 说明: 早期注册的规格该字段为hws:performancetype。 XEN实例不支持该参数。 hw:numa_nodes String 主机的物理cpu数量。(该字段是否返回根据云服务器规格而定) resource_type String 资源类型。resource_type是为了区分云服务器的物理主机类型。 hpet_support String 云服务器高精度时钟是否开启,开启为true,否则为false。(该字段是否返回根据云服务器规格而定) instance_vnic:type String 网卡类型,值固定为“enhanced”,表示使用增强型网络的资源创建云服务器。 instance_vnic:instance_bandwidth String 最大带宽,单位Mbps,最大值为10000。 instance_vnic:max_count String 最大网卡个数,最大为4。 quota:local_disk String 值格式为{type}:{count}:{size}:{safeFormat},其中: type指磁盘类型,当前只支持hdd。 count指本地磁盘数量,目前支持: d1类型:3/6/12/24 d2类型:2/4/8/12/16/24 d3类型:2/4/8/12/16/24/28。 size指单个磁盘容量,单位GB,目前只支持1675(实际磁盘大小为1800,格式化后可用大小为1675)。 safeFormat指云服务器本地磁盘是否安全格式化,目前仅支持: d1类型:FALSE d2/d3类型:True。 说明: 磁盘增强型特有字段。 quota:nvme_ssd String 值格式为{type}:{spec}:{num}:{size}:{safeFormat}:{挂载协议},其中: type指主机上配备的nvme ssd的单卡容量大小,当前只支持1.6T/3.2T。 spec指nvme ssd的规格,包括large/small。large表示大规格,small表示小规格。 目前仅支持i3和ir3类型:large。 num指磁盘划分的分区个数。 size指guest使用的盘的容量大小,单位为GB。在spec值为large的情况下,此项即为host单卡大小。在spec值为small的情况下,此为1/4规格或者1/2规格。 safeFormat指云服务器本地磁盘是否安全格式化。 目前仅支持i3和ir3类型:True。 挂载协议 目前仅支持ir3类型:blk。 说明: 超高I/O型特有字段。 extra_spec:io:persistent_grant String 是否支持持久化,值为true。 代表云服务器访问存储的方式为持久化授权。 说明: 密集存储D1型特有字段。 ecs:generation String 弹性云服务器类型的代数。 示例:s3中的3表示通用型III代,详细的规格类型和代系请参考《弹性云服务器用户指南》的“实例规格清单”。 ecs:virtualization_env_types String 虚拟化类型。 如果值为“FusionCompute”,表示弹性云服务器使用基于XEN的虚拟化技术。 如果值为“CloudCompute”,表示弹性云服务器使用基于KVM的虚拟化技术。 说明: 可选字段。 pci_passthrough:enable_gpu String 显卡是否直通。 值为“true”,表示GPU直通。 pci_passthrough:gpu_specs String G1型和G2型云服务器应用的技术,包括GPU虚拟化和GPU直通。 如果该规格的云服务器使用GPU虚拟化技术,且GPU卡的型号为M60-1Q,参数值为“m60_1q:virt:1”。 如果该规格的云服务器使用GPU直通技术,且GPU卡的型号为M60,参数值为“m60:direct_graphics:1”。 pci_passthrough:alias String PCI直通设备信息,格式为PCI设备名称:数量。多个设备信息以逗号隔开。 例如nvidia-a30:1,表示携带一张A30的GPU。 cond:operation:status String 此参数是Region级配置,某个AZ没有在cond:operation:az参数中配置时默认使用此参数的取值。不配置或无此参数时等同于“normal”。取值范围: normal:正常商用 abandon:下线(即不显示) sellout:售罄 obt:公测 obt_sellout:公测售罄 promotion:推荐(等同normal,也是商用) cond:operation:az String 此参数是AZ级配置,某个AZ没有在此参数中配置时默认使用cond:operation:status参数的取值。此参数的配置格式“az(xx)”。()内为某个AZ的flavor状态,()内必须要填有状态,不填为无效配置。状态的取值范围与cond:operation:status参数相同。 例如:flavor在某个region的az0正常商用,az1售罄,az2公测,az3正常商用,其他az显示下线,可配置为: “cond:operation:status”设置为“abandon” “cond:operation:az”设置为“az0(normal), az1(sellout), az2(obt), az3(normal)” 说明: 如果flavor在某个AZ下的状态与cond:operation:status配置状态不同,必须配置该参数。 quota:max_rate String 最大带宽 单位Mbps,显示为Gbps时除以1000 quota:min_rate String 基准带宽 单位Mbps,显示为Gbps时除以1000 quota:max_pps String 内网最大收发包能力 单位个,显示为xx万时除以10000 cond:operation:charge:stop String 关机是否收费 关机是否计费,默认免费: charge free cond:operation:charge String 计费类型 计费场景,不配置时都支持 period,包年/包月 demand,按需 cond:spot:operation:az String spot售卖信息请使用 查询规格销售策略 接口查询。 Flavor在竞价销售模式下显示的AZ。 cond:operation:roles String 允许的角色 匹配的用户标签(roles的op_gatexxx标签)。不设置时所有用户可见 cond:spot:operation:status String spot售卖信息请使用 查询规格销售策略 接口查询。 Flavor在竞价销售模式下的状态 不配置时等同abandon normal,正常商用 abandon,下线 sellout,售罄 obt,公测,未申请时提示申请(暂不支持) private,私有,只给特定用户显示(暂不支持) test,试用/免费(暂不支持) promotion,推荐 cond:network String 网络约束 支持网络特性,不配置时以控制台默认配置为准。 cond:storage String 存储约束 支持磁盘特性,不配置时以控制台默认配置为准。 scsi,支持scsi localdisk,支持本地盘 ib,支持ib cond:storage:type String 支持的磁盘类型,不配置时以控制台默认配置为准。 SATA:普通IO云硬盘(已售罄) SAS:高IO云硬盘 GPSSD:通用型SSD云硬盘 SSD:超高IO云硬盘 ESSD:极速IO云硬盘 GPSSD2:通用型SSD V2云硬盘 ESSD2:极速型SSD V2云硬盘 cond:compute:live_resizable String 计算约束 true,支持在线扩容。 false或不存在该字段,不支持在线扩容。 cond:compute String 计算约束 autorecovery,自动恢复特性。 不存在该字段,不支持自动恢复。 ecs:instance_architecture String 该规格对应的CPU架构,且仅鲲鹏实例架构规格返回该字段。 取值为arm64表示CPU架构为鲲鹏计算。 info:gpu:name String GPU显卡数量和名称。 info:cpu:name String CPU名称。 quota:gpu String GPU显卡名称。 quota:vif_max_num String 云服务器最多支持绑定的弹性网卡个数。 quota:sub_network_interface_max_num String 云服务器最多支持绑定的辅助弹性网卡个数。 network_interface:traffic_mirroring_supported String 该规格是否支持流量镜像。 security:enclave_supported String 该规格是否支持QingTian Enclave。 表7 attachableQuantity字段数据结构说明 参数 参数类型 描述 free_scsi Integer 可挂载scsi卷数。 free_blk Integer 可挂载vbd卷数。 free_disk Integer 可挂载卷数。 free_nic Integer 可挂载网卡数。
  • 响应消息 响应参数如表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" } } ] }