Updated on 2024-08-09 GMT+08:00

Querying Shared Storage Files

Function

This API is used to query files in a specified path of shared storage. This function is supported only by cloud phones that support shared storage.

URI

GET /v1/{project_id}/cloud-phone/servers/share-files

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Specifies the project ID.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

offset

No

Integer

If the offset is 0 (default value) or an integer greater than 0, all resources after the offset will be queried.

limit

No

Integer

Specifies the number of resources returned on each page. The value ranges from 1 to 100 (default). Generally, this parameter is set to 10, 20, or 50.

server_ids

Yes

String

Specifies the ID list of cloud phone servers. Use commas (,) to separate IDs.

path

Yes

String

Name of the directory to be queried, The value can contain uppercase letters, lowercase letters, digits, periods (.), plus signs (+), hyphens (-), underscores (_), slashes (/), and equal signs (=). The value must start with a slash (/) and cannot contain only slashes (/). The value cannot contain ../ or //. Example: /data/data

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Specifies the user token. It can be obtained by calling an Identity and Access Management (IAM) API. The value of X-Subject-Token in the response header is the user token.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

request_id

String

Specifies the unique request ID.

jobs

Array of ServerJob objects

Specifies the task list.

Table 5 ServerJob

Parameter

Type

Description

server_id

String

Specifies the unique ID of a cloud phone server. This parameter is contained in tasks related to cloud phone servers.

job_id

String

Specifies the unique ID of a task.

error_code

String

Specifies the error code.

error_msg

String

Specifies the error message.

Example Requests

Querying the content in the /data/data directory of servers

GET https://{CPH Endpoint}/v1/{project_id}/cloud-phone/servers/share-files?path=/data/data&server_ids=xxxxxxx,xxxxxxx&limit=100&offset=0

Example Responses

Status code: 200

OK

{
  "request_id" : "6837531fd3f54550927b930180a706bf",
  "jobs" : [ {
    "server_id" : "203a7243181646b190047ade6bfd882d",
    "job_id" : "1564567b8bab40f34711234cb80d0123"
  } ]
}

Status Codes

Status Code

Description

200

OK

Error Codes

See Error Codes.