更新时间:2024-02-23 GMT+08:00
分享

查询产品套餐列表

功能介绍

该接口用于查询云桌面支持的产品套餐列表。

调试

您可以在API Explorer中调试该接口,支持自动认证鉴权。API Explorer可以自动生成SDK代码示例,并提供SDK代码示例调试功能。

URI

GET /v2/{project_id}/products

表1 路径参数

参数

是否必选

参数类型

描述

project_id

String

项目id。

表2 Query参数

参数

是否必选

参数类型

描述

product_id

String

产品ID。

availability_zone

String

可用分区。

os_type

String

产品套餐的操作系统类型,当前支持:Windows、Linux。

charge_mode

String

周期套餐标识。0表示包周期,1表示按需。

architecture

String

架构类型,当前支持:arm、x86。

package_type

String

套餐系列。

limit

Integer

每页数量,范围0-100,默认100。

offset

Integer

偏移量,默认0。

请求参数

表3 请求Header参数

参数

是否必选

参数类型

描述

X-Auth-Token

String

用户Token。

通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。

Content-Type

String

发送的实体的MIME类型,如:application/json。

响应参数

状态码: 200

表4 响应Body参数

参数

参数类型

描述

os_type

String

套餐所支持操作系统类型。请求参数有os_type时,才有此参数。

architecture

String

产品架构。请求参数有package_type=agile时,才有此参数。

availability_zone

String

可用分区。请求参数有availability_zone时,才有此参数。

products

Array of ProductInfo objects

产品列表。

total_count

Integer

对象总数。

表5 ProductInfo

参数

参数类型

描述

product_id

String

产品id。

flavor_id

String

规格ID。

type

String

产品类型。取值为: BASE:表示产品基础套餐,套餐镜像中不包括除操作系统之外的其他商业软件,私有镜像场景只能使用此类套餐。

architecture

String

产品架构,当前支持:arm、x86。

cpu

String

cpu。

cpu_desc

String

cpu描述。

memory

String

内存。

is_gpu

Boolean

是否是GPU类型的规格。

system_disk_type

String

系统盘类型。

system_disk_size

String

系统盘大小,单位GB。

data_disk_size

String

数据盘大小,单位GB。

gpu_desc

String

GPU描述。

bill_switch

String

话单开关,默认on,on-出话单模式,off-关话单模式,只支持反序列化,不支持序列化,不在接口中展示。

descriptions

String

产品描述。

charge_mode

String

周期套餐标识。0表示包周期,1表示按需。

contain_data_disk

Boolean

套餐计费是否包含了数据盘,off-不包含。

resource_type

String

资源规格。

cloud_service_type

String

云服务编码。

volume_product_type

String

磁盘产品类型。

domain_ids

Array of strings

该产品套餐支持的专有域id(domainId)。

status

String

产品状态,normal:正常、sellout:售空、abandon:下线。

sub_product_list

Array of strings

专属主机的子产品。

default_desktop_num

Integer

专享主机套餐默认的桌面数。

max_apply_desktop_num

Integer

专享主机支持创建的最大桌面数。

状态码: 400

表6 响应Body参数

参数

参数类型

描述

error_code

String

错误码

error_msg

String

错误描述

状态码: 401

表7 响应Body参数

参数

参数类型

描述

error_code

String

错误码

error_msg

String

错误描述

状态码: 403

表8 响应Body参数

参数

参数类型

描述

error_code

String

错误码

error_msg

String

错误描述

状态码: 404

表9 响应Body参数

参数

参数类型

描述

error_code

String

错误码

error_msg

String

错误描述

状态码: 405

表10 响应Body参数

参数

参数类型

描述

error_code

String

错误码

error_msg

String

错误描述

状态码: 500

表11 响应Body参数

参数

参数类型

描述

error_code

String

错误码

error_msg

String

错误描述

状态码: 503

表12 响应Body参数

参数

参数类型

描述

error_code

String

错误码

error_msg

String

错误描述

请求示例

响应示例

状态码: 200

查询产品列表响应。

{
  "os_type" : "Linux",
  "availability_zone" : "cn-north-4c",
  "total_count" : 1,
  "products" : {
    "product_id" : "workspace.k.xlarge.2.linux",
    "flavor_id" : "kc1.xlarge.2",
    "type" : "BASE",
    "cpu" : "4",
    "memory" : "8192",
    "system_disk_type" : "SAS",
    "system_disk_size" : "80",
    "descriptions" : "CPU:4vCPUs,Memory:8GB",
    "architecture" : "arm",
    "is_gpu" : false,
    "charge_mode" : "0",
    "contain_data_disk" : false,
    "resource_type" : "hws.resource.type.vdi.vm",
    "cloud_service_type" : "hws.service.type.vdi",
    "volume_product_type" : "workspace",
    "status" : "normal",
    "package_type" : "enterprise"
  }
}

状态码

状态码

描述

200

查询产品列表响应。

400

由于包含语法错误,当前请求无法被服务器理解。

401

鉴权失败。

403

没有操作权限。

404

找不到资源。

405

请求中指定的方法不被允许。

500

服务内部错误,具体返回错误码请参见错误码说明。

503

服务不可用。

错误码

请参见错误码

分享:

    相关文档

    相关产品