Querying Servers
Function
Queries servers.
Debugging
You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.
Authorization Information
Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.
- If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
- If you are using identity policy-based authorization, the following identity policy-based permissions are required.
Action
Access Level
Resource Type (*: required)
Condition Key
Alias
Dependencies
workspace:server:list
List
server *
-
-
-
URI
GET /v1/{project_id}/app-servers
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Unique ID of a project |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| offset | No | Integer | Query offset. The default value is 0. |
| limit | No | Integer | Number of records to be queried. The value ranges from 1 to 100. The default value is 10. |
| server_group_id | No | String | Unique ID of a server group. |
| server_name | No | String | Server name. Fuzzy match is supported. |
| machine_name | No | String | Server name. Fuzzy match is supported. |
| ip_addr | No | String | IP address. Fuzzy match is supported. |
| server_id | No | String | Unique ID of a server. |
| maintain_status | No | String | Server maintenance status. Options: true: in maintenance false: not in maintenance |
| scaling_auto_create | No | String | Whether to enable creation through auto-scaling: true: enable false: disable |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| X-Auth-Token | No | String | User token It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| count | Integer | Total number. |
| items | Array of AppServer objects | The maximum number of records in the returned server list is the maximum number of records on each page. |
| Parameter | Type | Description |
|---|---|---|
| id | String | Unique ID of an APS instance. |
| name | String | Server. |
| machine_name | String | Computer Name. |
| description | String | Description. |
| server_group_id | String | Server group ID. |
| flavor | Flavor object | Server Specifications Details. |
| status | String | Instance statuses |
| create_time | String | Time when the server is created. |
| update_time | String | Updated. |
| image_id | String | Image ID. |
| availability_zone | String | Server Availability Zone. |
| domain | String | Domain. |
| ou_name | String | Organization Name. |
| sid | String | SID of the instance. |
| instance_id | String | Instance ID. |
| os_version | String | Server System Version. |
| os_type | String | Specifies the OS type. Currently, only Windows is supported. |
| order_id | String | Order ID of a duration-based product. |
| maintain_status | Boolean | Server maintenance status. |
| scaling_auto_create | Boolean | Instance automatically created by the service when an auto scaling policy is configured. |
| job_id | String | ID of the job executed last time. |
| job_type | String | Type of the job that is executed last time. |
| job_status | String | Execution result of the last job. |
| job_time | String | Time when a job is executed last time. |
| resource_pool_id | String | Specifies the resource pool ID. |
| resource_pool_type | String | Resource pool type. Options: |
| host_id | String | Specifies the DeH ID. |
| server_group_name | String | ECS group name. |
| product_info | ProductInfo object | Product Details. |
| metadata | Map<String,String> | [ECS metadata. Cloud server billing mode. 0: pay-per-use (postpaid) 1: yearly/monthly (prepaid) 2: spot price Order ID of a yearly/monthly cloud server. Product ID of a yearly/monthly cloud server. ID of the VPC where the cloud server is located. Cloud server freezing status. NOTE: When a cloud server is frozen or unfrozen, this field is automatically added and mandatory.virtual_env_type cannot be added, deleted, or modified by users.When a cloud server is frozen or unfrozen, this field is automatically added and mandatory.virtual_env_type cannot be added, deleted, or modified by users. Image ID corresponding to the cloud server OS. Image type. Options: Resource specifications of the cloud server. Image name corresponding to the cloud server OS. OS architecture, 32-bit or 64-bit. Callback URL for checking whether ECS locking is valid. Source service of ECS. Order locking (ORDER). Source ID of an ECS lock. If lockSource is set to ORDER, lockSourceId is the order ID. ECS lock type.
Resource type of the cloud server. OS type. The value can be Linux or Windows. Extended information about VMs in the system. Whether cloud servers support Host Security Service (HSS) and host monitoring. Agency name. An agency is created by a tenant administrator on Identity and Access Management (IAM) to provide temporary credentials for ECSs to access cloud services.](tag:HW) [ECS metadata. ID of the VPC where the cloud server is located. Cloud server freezing status. Image ID corresponding to the cloud server OS. Image type. Options: Resource specifications of the cloud server. Image name corresponding to the cloud server OS. OS architecture, 32-bit or 64-bit. Callback URL for checking whether ECS locking is valid. Source service of ECS. Source ID of an ECS lock. ECS lock type.
Resource type of the cloud server. OS type. The value can be Linux or Windows. Extended information about VMs in the system. Whether cloud servers support Host Security Service (HSS) and host monitoring. Agency name. An agency is created by a tenant administrator on Identity and Access Management (IAM) to provide temporary credentials for ECSs to access cloud services.](tag:HCS) |
| session_count | Integer | Sessions. |
| vm_status | String | Indicates the server status. If the current status is unstable, the value of this field may be null when a task is in progress. |
| task_status | String | Indicates the server task status. If the current status is stable, the value of this field may be null if no task is in progress. |
| freeze | Array of CbcFreezeInfo objects | Frozen information. |
| host_address | Array of EcsNetWork objects | VPC and subnet information. |
| enterprise_project_id | String | Enterprise project ID. This parameter is returned only for enterprise projects. |
| tags | Array of TmsTag objects | Tag information. |
| Parameter | Type | Description |
|---|---|---|
| id | String | Specifies the flavor ID of the server. |
| links | Array of FlavorLink objects | Specifies the shortcut link of the server flavor. |
| Parameter | Type | Description |
|---|---|---|
| rel | String | Shortcut link marker name. |
| hrel | String | Specifies the corresponding shortcut link. |
| Parameter | Type | Description |
|---|---|---|
| addr | String | IP address. |
| version | Integer | IP address type. 4: IPV4 6: IPV6 |
| OS-EXT-IPS-MAC:mac_addr | String | MAC address. |
| OS-EXT-IPS:type | String | IP address assignment method. The value is a case-insensitive string. fixed: private IP address floating: floating IP address |
| OS-EXT-IPS:port_id | String | ID of the port bound to the IP address. |
| vpc_id | String | VPC ID. |
| subnet_id | String | Subnet ID. |
| tenant_type | String | Tenant Type: |
| Parameter | Type | Description |
|---|---|---|
| key | String | Key. The value can contain a maximum of 128 Unicode characters. |
| value | String | Value. The value can contain a maximum of 255 Unicode characters. |
Status code: 400
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code, which is returned upon failure. |
| error_msg | String | Error message. |
Status code: 401
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code, which is returned upon failure. |
| error_msg | String | Error message. |
Status code: 403
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code, which is returned upon failure. |
| error_msg | String | Error message. |
Status code: 404
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code, which is returned upon failure. |
| error_msg | String | Error message. |
Status code: 405
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code, which is returned upon failure. |
| error_msg | String | Error message. |
Status code: 500
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code, which is returned upon failure. |
| error_msg | String | Error message. |
Status code: 503
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code, which is returned upon failure. |
| error_msg | String | Error message. |
Example Requests
GET /v1/a4da8115c9d8464ead3a38309130523f/app-servers?offset=0&limit=10
Example Responses
Status code: 200
Response to a successful request.
{
"count" : 1,
"items" : [ {
"id" : "573548db-9a6f-4b31-a5cb-d7aa40975466",
"name" : "APS-20230509102837-IVTU6S27OY",
"machine_name" : "APS-PR6KRMAL00",
"description" : "",
"server_group_id" : "a0890780-7ef2-4aaf-b56d-b25fb53b717e",
"flavor" : {
"id" : "s2.large.2",
"links" : [ {
"rel" : "self"
}, {
"rel" : "bookmark"
} ]
},
"status" : "REGISTERED",
"create_time" : "2023-05-09T10:28:38.755Z",
"update_time" : "2023-05-09T10:39:03.484Z",
"image_id" : "ca8be629-112e-4865-b4fb-bbbca257f1d9",
"availability_zone" : "cn-north-7a",
"domain" : "wksapp***.huawei.com",
"ou_name" : "",
"sid" : "S-1-5-21-1213649063-4191095369-2401105760-1399",
"instance_id" : "4fa75b74-56bc-4a6b-b965-f2f139e17b5e",
"os_version" : "Windows Server 2019 Datacenter 64bit",
"os_type" : "Windows",
"order_id" : "",
"maintain_status" : false,
"scaling_auto_create" : false,
"resource_pool_id" : "10dd1a4f-ff85-4953-aa0f-2a37f28b6beb",
"resource_pool_type" : "private",
"server_group_name" : "Nas",
"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 Cloud Application General-Purpose | 2 vCPUs | 4 GB memory",
"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"
},
"metadata" : {
"charging_mode" : "0",
"metering.resourcespeccode" : "s2.large.2.win",
"metering.resourcetype" : "1"
},
"session_count" : 1,
"vm_status" : "ACTIVE",
"task_status" : "null",
"freeze" : [ ],
"host_address" : [ {
"addr" : "192.*.*.145",
"version" : 4,
"OS-EXT-IPS-MAC:mac_addr" : "fa:16:**:**:75:06",
"OS-EXT-IPS:type" : "FIXED",
"OS-EXT-IPS:port_id" : "257f2ff5-fe85-4b9a-86c2-5dacb64ac78f",
"vpc_id" : "59785ba5-e5d5-4836-b9de-19f22ac15175",
"subnet_id" : "a5842cb4-5718-4b0a-8b27-3a3e9c74f977",
"tenant_type" : "tenant"
}, {
"addr" : "10.*.*.79",
"version" : 4,
"OS-EXT-IPS-MAC:mac_addr" : "fa:16:**:**:02:88",
"OS-EXT-IPS:type" : "FIXED",
"OS-EXT-IPS:port_id" : "c6fc6fcc-c99e-4604-b0e0-04e48246c7cd",
"vpc_id" : "82f75215-9ae6-4e69-882c-fe4088324839",
"subnet_id" : "e851a83c-8696-48ea-b078-466fe9d361ae",
"tenant_type" : "resource_tenant"
} ]
} ]
} Status Codes
| Status Code | Description |
|---|---|
| 200 | Response to a successful request. |
| 400 | The request cannot be understood by the server due to malformed syntax. |
| 401 | Authentication failed. |
| 403 | Permissions required. |
| 404 | No resources found. |
| 405 | The request method is not allowed. |
| 500 | An internal service error occurred. For details, see the error code description. |
| 503 | Service unavailable. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot