Obtaining the Resource Lists

Function

This API is used to obtain the resource lists.

URI

GET /v1/{project_id}/resources

Table 1 describes the URI parameters.
Table 1 URI parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID, which is used for resource isolation. For details about how to obtain the project ID, see Obtaining a Project ID.

Request

Table 2 describes the request parameters.

Table 2 Request parameters

Parameter

Mandatory

Type

Description

type

Yes

String

Resource type. The options are DLI and CloudTable.

resource

Yes

Object

Resource parameters:

  • type: Resource type. This parameter is mandatory. The parameter type is String.
  • resource_info: Resource information. This parameter is mandatory. The parameter type is JSON. For example: undefined: "{\"cluster_name\":\"res_cluster\"}.

Response

Table 3 describes the response parameters.

Table 3 Response parameters

Parameter

Type

Description

is_success

Boolean

Whether the request is successful

clusters

Object []

Cluster parameters:

  • id: Resource type. The parameter type is String.
  • cluster_name: Cluster name. The value contains 1 to 20 characters. The parameter type is String.
  • status: Status. The parameter type is String.
  • is_register: The parameter type is String.

error_code

String

Error code that indicates a request has failed. This parameter is unavailable when a request is successful.

error_msg

String

Error message that indicates a request has failed. This parameter is unavailable when a request is successful.

Example

  • Example request
  • Example of a successful response
  • Example of a failed response

Status Code

For details about status codes, see Status Codes.