Querying Details About a Workspace
Function
This API is used to query the details about a workspace.
This API is used when you need to view the configuration, status, or other information about a workspace. Before using this API, ensure that the workspace exists and you have the permission to view the workspace. After the query, the API returns the workspace details, including the workspace name, description, creation time, and status. If the workspace does not exist or you do not have the operation permission, the API will return an error message.
Debugging
You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.
URI
GET /v1/{project_id}/workspaces/{workspace_id}
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Definition: User project ID. For details, see Obtaining a Project ID and Name. Constraints: N/A Range: N/A Default Value: N/A |
|
workspace_id |
Yes |
String |
Definition: Workspace ID. If no workspaces are available, the default value is 0. If a workspace is created and used, use the actual value. Constraints: N/A Range: N/A Default Value: N/A |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
Yes |
String |
Definition: User token. It can be obtained by calling the IAM API. The token is the value of X-Subject-Token in the response header. Constraints: N/A Range: N/A Default Value: N/A |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
grants |
Array of grants objects |
Definition: Authorization user list. By default, this parameter is left blank. This parameter must be used with auth_type and takes effect only when auth_type is set to INTERNAL. |
|
owner |
String |
Definition: Creator name. Range: N/A |
|
auth_type |
String |
Definition: Authorization type. Range:
|
|
enterprise_project_id |
String |
Definition Range: N/A Enterprise project ID. |
|
update_time |
Integer |
Definition: Last modification time (UTC). Range: N/A |
|
create_time |
Integer |
Definition: Creation time (UTC). Range: N/A |
|
enterprise_project_name |
String |
Definition: Enterprise project name. Range: N/A |
|
name |
String |
Definition: Workspace name. The value can contain 4 to 64 characters. Only letters, digits, hyphens (-), and underscores (_) are allowed. default is the name of the default workspace reserved by the system. You are not allowed to create a workspace named default. Range: N/A |
|
description |
String |
Definition: Workspace description. Range: N/A |
|
id |
String |
Definition: Workspace ID, which is a 32-bit UUID generated by the system without hyphens (-). Range: N/A |
|
status |
String |
Definition: Workspace status. Range
|
|
status_info |
String |
Definition: Status description. This parameter is left empty by default. This parameter is used to show detailed information about a status. If a deletion failed, you can use this parameter to obtain the failure cause. Range: N/A |
|
Parameter |
Type |
Description |
|---|---|---|
|
user_id |
String |
Definition: IAM user ID. Either this parameter or user_name must be configured. If both of them are available, user_id will be used preferentially. Range: N/A |
|
user_name |
String |
Definition: IAM username. Either this parameter or user_id must be configured. Range: N/A |
|
user_type |
String |
Definition Authorized user type. Constraints This parameter is mandatory for federated users or agency users. Range IAM: IAM user FEDERATE: federated user AGENCY: agency user Default value IAM |
Example Requests
GET https://{endpoint}/v1/{project_id}/workspaces/ccd05d1a553b4e188ea878e7dcb85e47
Example Responses
Status code: 200
The details about a workspace are obtained.
{
"id" : "**d05d1a553b4e188ea878e7dcb85e**",
"name" : "test-workspace",
"status" : "NORMAL",
"status_info" : "",
"description" : "",
"owner" : "testUser",
"create_time" : 1470000020000,
"update_time" : 1470000030000,
"enterprise_project_id" : "***b0091-887f-4839-9929-cbc884f1e***",
"enterprise_project_name" : "test-eps",
"auth_type" : "INTERNAL",
"grants" : [ {
"user_id" : "***55d2cd53b4x458ea878e7dcb85***",
"user_name" : "test-iam-user",
"user_type" : "IAM"
} ]
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
The details about a workspace are obtained. |
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