更新时间:2024-01-24 GMT+08:00
分享

查询服务器组列表

功能介绍

查询服务器组列表。

调试

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

URI

GET /v1/{project_id}/app-server-groups

表1 路径参数

参数

是否必选

参数类型

描述

project_id

String

项目唯一标识。

表2 Query参数

参数

是否必选

参数类型

描述

offset

Integer

查询的偏移量。

limit

Integer

查询的数量,值区间[1-100]。

server_group_name

String

服务器组名称。

server_group_id

String

服务器组唯一标识。

app_type

String

应用组类型:

  • SESSION_DESKTOP_APP - 会话桌面app

  • COMMON_APP - 普通app

请求参数

表3 请求Header参数

参数

是否必选

参数类型

描述

X-Auth-Token

String

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

响应参数

状态码: 200

表4 响应Body参数

参数

参数类型

描述

count

Integer

总数。

items

Array of ServerGroup objects

服务器组列表,返回列表条目数量上限为分页的最大上限值。

表5 ServerGroup

参数

参数类型

描述

id

String

服务器组的唯一标识。

name

String

服务器组名称。

description

String

服务器组描述。

image_id

String

服务器组关联的镜像ID,用于创建对应组下的云服务器。

os_type

String

系统类型,当前仅支持Windows。

  • Linux -

  • Windows -

  • Other -

product_id

String

产品id。

subnet_id

String

网卡对应的子网ID。

system_disk_type

String

磁盘类型,获取可用磁盘类型详见接口磁盘管理ListVolumeType。

  • ESSD - 极速型SSD

  • SSD - 超高IO

  • GPSSD - 通用型SSD

  • SAS - 高IO

  • SATA - 普通IO

system_disk_size

Integer

磁盘容量,单位GB。

is_vdi

Boolean

是否为vdi单会话模式。

extra_session_type

String

付费会话类型:

  • GPU - GPU规格会话。

  • CPU - 普通CPU规格会话。

extra_session_size

Integer

付费会话个数。

app_type

String

服务器组应用类型:

  • SESSION_DESKTOP_APP - 会话桌面app

  • COMMON_APP - 普通app

create_time

String

服务器组创建时间

update_time

String

服务器组更新时间

storage_mount_policy

String

用户访问APS的应用时,对应NAS存储目录在APS上的挂载策略。

  • USER - 仅挂载个人目录。

  • SHARE - 仅挂载共享目录。

  • ANY - 挂载目录不做限制(个人和共享NAS存储目录都会自动挂载)。

app_server_flavor_count

Integer

服务器配置总数量。

app_server_count

Integer

服务器总数量。

app_group_count

Integer

关联应用组的总数量。

image_name

String

镜像名称。

product_info

ProductInfo object

产品规格信息。

subnet_name

String

子网名称。

scaling_policy

ScalingPolicy object

弹性伸缩策略。

ou_name

String

默认组织名称。

表6 ProductInfo

参数

参数类型

描述

product_id

String

产品id。

flavor_id

String

规格ID。

type

String

产品类型:

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

  • ADVANCED:表示产品高级套餐,套餐镜像中包括了一些商业软件。

architecture

String

产品架构,当前仅支持x86。

  • x86

  • arm

cpu

String

CPU。

cpu_desc

String

CPU描述。

memory

String

内存大小,单位兆:M。

is_gpu

Boolean

是否是GPU类型的规格。

system_disk_type

String

系统盘类型。

system_disk_size

String

系统盘大小。

gpu_desc

String

GPU描述。

descriptions

String

产品描述。

charge_mode

String

套餐标识。

  • 1:表示包周期。

  • 0:表示按需。

contain_data_disk

Boolean

套餐计费是否包含了数据盘。

resource_type

String

资源类型。

cloud_service_type

String

云服务类型。

volume_product_type

String

磁盘产品类型。

sessions

Integer

套餐默认支持的最大会话数。

status

String

产品套餐在销售模式下的状态,取值自ECS的cond:operation:status。 不配置时等同于normal在售状态。

  • normal - 正常商用

  • abandon - 下线(即不显示)

  • sellout - 售罄

  • obt - 公测

  • obt_sellout - 公测售罄

  • promotion - 推荐(等同normal,也是商用)

cond_operation_az

String

产品套餐在可用区的状态,配套status使用。

说明:
  • 此参数是AZ级配置,优选取此参数的值,某个AZ没有在此参数中配置时默认使用status参数的取值。

  • 配置格式“az(xx)”。()内为某个AZ的flavor状态,()内必须要填有状态,不填为无效配置。

  • 例如:套餐在某个region的az0正常商用,az1售罄,az2公测,az3正常商用,其他az显示下线,可配置为:

    • “status”设置为:“abandon” 。

    • “cond_operation_az”设置为:“az0(normal), az1(sellout), az2(obt), az3(normal)”。

  • 说明:如果flavor在某个AZ下的状态与status配置状态不同,必须配置该参数。

sub_product_list

Array of strings

专属主机的子产品。

domain_ids

Array of strings

产品属于专有的domainId。

package_type

String

套餐类型:

  • general:表示产品通用套餐。

  • dedicated:表示产品专属主机套餐。

expire_time

String

产品套餐过期时间,产品将在改时间点后逐步下架。

support_gpu_type

String

产品套餐支持的GPU类型。

表7 ScalingPolicy

参数

参数类型

描述

enable

Boolean

是否启用策略,默认启用: 'true': 启用 'false': 禁用

max_scaling_amount

Integer

最大扩容数量。

single_expansion_count

Integer

单次扩容数量。

scaling_policy_by_session

ScalingPolicyBySession object

基于会话的弹性策略。

表8 ScalingPolicyBySession

参数

参数类型

描述

session_usage_threshold

Integer

分组的总会话使用率(达到改阈值后扩容)。

shrink_after_session_idle_minutes

Integer

给定时间内无会话连接的的实例进行释放。

状态码: 400

表9 响应Body参数

参数

参数类型

描述

error_code

String

错误码,失败时返回。

error_msg

String

错误描述。

状态码: 401

表10 响应Body参数

参数

参数类型

描述

error_code

String

错误码,失败时返回。

error_msg

String

错误描述。

状态码: 403

表11 响应Body参数

参数

参数类型

描述

error_code

String

错误码,失败时返回。

error_msg

String

错误描述。

状态码: 404

表12 响应Body参数

参数

参数类型

描述

error_code

String

错误码,失败时返回。

error_msg

String

错误描述。

状态码: 405

表13 响应Body参数

参数

参数类型

描述

error_code

String

错误码,失败时返回。

error_msg

String

错误描述。

状态码: 500

表14 响应Body参数

参数

参数类型

描述

error_code

String

错误码,失败时返回。

error_msg

String

错误描述。

状态码: 503

表15 响应Body参数

参数

参数类型

描述

error_code

String

错误码,失败时返回。

error_msg

String

错误描述。

请求示例

GET /v1/a4da8115c9d8464ead3a38309130523f/app-server-groups?limit=10&server_group_id=bc05da52-89df-45ba-8146-13fe3ce7c45a&server_group_name=&offset=0

响应示例

状态码: 200

成功响应。

{
  "count" : 1,
  "items" : [ {
    "id" : "bc05da52-89df-45ba-8146-13fe3ce7c45a",
    "name" : "ApiExpirezSr5_1HgOfh56",
    "description" : "",
    "image_id" : "6579b42e-f345-4452-ae3a-fa0687564943",
    "os_type" : "Windows",
    "product_id" : "workspace.appstream.general.xlarge.2",
    "subnet_id" : "a5842cb4-5718-4b0a-8b27-3a3e9c74f977",
    "system_disk_type" : "SATA",
    "system_disk_size" : 60,
    "is_vdi" : false,
    "app_type" : "COMMON_APP",
    "create_time" : "2023-06-06T14:14:36.416Z",
    "update_time" : "2023-06-06T14:14:38.127Z",
    "app_server_flavor_count" : 0,
    "app_server_count" : 0,
    "app_group_count" : 0,
    "image_name" : "ApiExplore_Image_01",
    "product_info" : {
      "product_id" : "workspace.appstream.general.xlarge.2",
      "flavor_id" : "s2.large.2",
      "type" : "BASE",
      "architecture" : "x86",
      "cpu" : "2",
      "memory" : "4096",
      "is_gpu" : false,
      "system_disk_type" : "SAS",
      "system_disk_size" : "80",
      "descriptions" : "s2.large.2 云应用通用型|2核|4GB内存",
      "charge_mode" : "0",
      "contain_data_disk" : false,
      "resource_type" : "hws.resource.type.workspace.appstream",
      "cloud_service_type" : "hws.service.type.vdi",
      "volume_product_type" : "workspace",
      "sessions" : 1,
      "status" : "abandon",
      "cond_operation_az" : "cn-north-7c(abandon),cn-north-7b(abandon),cn-north-7a(normal)",
      "domain_ids" : [ ]
    },
    "subnet_name" : "subnet-config",
    "ou_name" : ""
  } ]
}

状态码

状态码

描述

200

成功响应。

400

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

401

鉴权失败。

403

没有操作权限。

404

找不到资源。

405

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

500

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

503

服务不可用。

错误码

请参见错误码

相关文档