Help Center> ModelArts> API Reference> Workspace Management> Querying the Details About a Workspace

Querying the Details About a Workspace

Function

This API is used to query the details about a workspace.

URI

GET /v1/{project_id}/workspaces/{workspace_id}

Table 1 describes the required parameters.

Table 1 Parameter description

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details about how to obtain the project ID, see Obtaining a Project ID.

workspace_id

Yes

String

Workspace ID

Request Body

None

Response Body

Table 2 describes the response parameters.

Table 2 Parameter description

Parameter

Type

Description

error_msg

String

Error message of a failed API call.

This parameter is not included when the API call succeeds.

error_code

String

Error code of a failed API call. For details, see Error Code.

This parameter is not included when the API call succeeds.

request_id

String

request_id information of a failed API call.

This parameter is not included when the API call succeeds.

id

String

Workspace ID, which is a 32-bit UUID generated by the system without hyphens (-).

The ID of the default workspace is 0.

name

String

Workspace name

description

String

Workspace description

owner

String

Name of the user who creates a workspace

create_time

Long

Time when a workspace is created, in UTC format

update_time

Long

Last modification time, in UTC format

enterprise_project_id

String

Enterprise project ID. The value can be 0 or a UUID.

enterprise_project_name

String

Name of an enterprise project

status

String

Workspace status. Possible values are as follows:

  • CREATE_FAILED: The workspace failed to be created.
  • NORMAL: The workspace is normal.
  • DELETING: The workspace is being deleted.
  • DELETE_FAILED: The workspace failed to be deleted.

auth_type

String

Authorization type. Possible values are PUBLIC, PRIVATE, and INTERNAL.

  • PUBLIC: public access of tenants
  • PRIVATE: accessible only to the creator and primary account
  • INTERNAL: accessible to some IAM users. This parameter must be used together with grants.

grants

grant array

List of authorized users

Table 3 grant parameters

Parameter

Type

Description

user_id

String

IAM user ID

user_name

String

IAM username

Samples

  • Sample request
    GET https://{endpoint}/v1/{project_id}/workspaces/ccd05d1a553b4e188ea878e7dcb85e47
  • Successful sample response
    {
      "id": "ccd05d1a553b4e188ea878e7dcb85e47",
      "name": "test-workspace",
      "status": "NORMAL",
      "description": "",
      "owner": "testUser",
      "create_time": 1470000020000,
      "update_time": 1470000030000,
      "enterprise_project_id":"10eb0091-887f-4839-9929-cbc884f1e20e",
      "enterprise_project_name": "test-eps",
      "auth_type":"INTERNAL",
      "grants":[
         {
           "user_id": "d0155d2cd53b4x458ea878e7dcb85e6c",
           "user_name": "test-iam-user"
         }
       ]
    }
  • Failed sample response
    {
      "error_msg": "Error message.",
      "error_code": "ModelArts.0104",
      "request_id": "0220c4318e5c4d499da7b7872207f8ee"
    }

Status Code

For details about the status code, see Table 1.