All Products
Search
Document Center

DataWorks:ListProjects

Last Updated:Nov 21, 2024

Queries a list of DataWorks workspaces of the tenant to which a user belongs.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
dataworks:ListProjectsget
*Project
acs:dataworks:{#regionId}:{#accountId}:workspace/*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
PageNumberintegerYes

The page number. Valid values: 1 to 100.

1
PageSizeintegerNo

The number of entries per page. Default value: 10. Maximum value: 100.

10
ResourceManagerResourceGroupIdstringNo

The resource group ID.

rg-acfmzbn7pti3zfa
Tagsarray<object>No

The tags to add to the workspace.

objectNo
KeystringNo

The key of tag N to add to the workspace.

Env
ValuestringNo

The value of tag N to add to the workspace.

Test

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

RequestIdstring

The request ID.

20658801***
PageResultobject

The results that are returned.

PageNumberinteger

The page number.

1
PageSizeinteger

The number of entries per page. Default value: 10. Maximum value: 100.

10
TotalCountinteger

The total number of entries returned.

123
ProjectListarray<object>

The DataWorks workspaces.

Projectobject
ProjectStatusCodestring

The status code of the workspace. Valid values:

  • AVAILABLE: 0, which indicates that the workspace is running as expected.
  • DELETED: 1, which indicates that the workspace is deleted.
  • INITIALIZING: 2, which indicates that the workspace is being initialized.
  • INIT_FAILED: 3, which indicates that the workspace fails to be initialized.
  • FORBIDDEN: 4, which indicates that the workspace is manually disabled.
  • DELETING: 5, which indicates that the workspace is being deleted.
  • DEL_FAILED: 6, which indicates that the workspace fails to be deleted.
  • FROZEN: 7, which indicates that the workspace is frozen due to overdue payments.
  • UPDATING: 8, which indicates that the workspace is being updated. After you associate a compute engine with the workspace, the system initializes the compute engine and updates the workspace.
  • UPDATE_FAILED: 9, which indicates that the workspace fails to be updated.
AVAILABLE
ProjectStatusinteger

The status of the workspace. Valid values:

  • 0: AVAILABLE, which indicates that the workspace is running as expected.
  • 1: DELETED, which indicates that the workspace is deleted.
  • 2: INITIALIZING, which indicates that the workspace is being initialized.
  • 3: INIT_FAILED, which indicates that the workspace fails to be initialized.
  • 4: FORBIDDEN, which indicates that the workspace is manually disabled.
  • 5: DELETING, which indicates that the workspace is being deleted.
  • 6: DEL_FAILED, which indicates that the workspace fails to be deleted.
  • 7: FROZEN, which indicates that the workspace is frozen due to overdue payments.
  • 8: UPDATING, which indicates that the workspace is being updated. After you associate a compute engine with the workspace, the system initializes the compute engine and updates the workspace.
  • 9: UPDATE_FAILED, which indicates that the workspace fails to be updated.
0
ProjectNamestring

The display name of the workspace.

test_project
ProjectIdentifierstring

The name of the workspace.

test
ProjectIdlong

The workspace ID.

1212
ProjectDescriptionstring

The description of the workspace.

test_describe
ProjectOwnerBaseIdstring

The ID of the user used by the workspace owner.

122222
ResourceManagerResourceGroupIdstring

The resource group ID.

rg-acfmzbn7pti3zfa
Tagsarray<object>

The tags added to the workspace.

Tagobject
Keystring

The key of tag N added to the workspace.

Env
Valuestring

The value of tag N added to the workspace.

Test
DisableDevelopmentboolean

Indicates whether the Development role is disabled. Valid values:

  • false: enabled
  • true: disabled
true
UseProxyOdpsAccountboolean

Indicates whether a proxy account is used to access the MaxCompute compute engine associated with the workspace. Valid values:

  • false
  • true
true
TablePrivacyModeinteger

Indicates whether the MaxCompute tables in the workspace are visible to the users within a tenant. Valid values:

  • 0: invisible
  • 1: visible
1
IsDefaultinteger

Indicates whether the workspace is a default workspace. Valid values:

  • 1: The workspace is a default workspace.
  • 0: The workspace is not a default workspace.
1

Examples

Sample success responses

JSONformat

{
  "RequestId": "20658801***",
  "PageResult": {
    "PageNumber": 1,
    "PageSize": 10,
    "TotalCount": 123,
    "ProjectList": [
      {
        "ProjectStatusCode": "AVAILABLE",
        "ProjectStatus": 0,
        "ProjectName": "test_project",
        "ProjectIdentifier": "test",
        "ProjectId": 1212,
        "ProjectDescription": "test_describe",
        "ProjectOwnerBaseId": "122222",
        "ResourceManagerResourceGroupId": "rg-acfmzbn7pti3zfa",
        "Tags": [
          {
            "Key": "Env",
            "Value": "Test"
          }
        ],
        "DisableDevelopment": true,
        "UseProxyOdpsAccount": true,
        "TablePrivacyMode": 1,
        "IsDefault": 1
      }
    ]
  }
}

Error codes

HTTP status codeError codeError messageDescription
400Invalid.Tenant.ConnectionNotExistsThe connection does not exist.The connection does not exist.
400Invalid.Tenant.ProjectNotExistsThe project does not exist.The project does not exist.
400Invalid.Tenant.UserAlreadyInProjectThe user already exists in the project.The user has already existed in project.
400Invalid.Tenant.UserNotInProjectThe user is not in the project.The user is not in the project.
403Invalid.Tenant.UserIsNotProjectOwnerOrAdminThe user is not a project administrator or owner.The user is not a project administrator or owner.
403Invalid.Tenant.UserNotInTenantThe user is not in tenant.The user is not in tenant.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2022-10-31API Description Update. The Error code has changed. The request parameters of the API has changed. The response structure of the API has changedView Change Details