All Products
Search
Document Center

Resource Orchestration Service:DATASOURCE::PAI::Workspaces

Last Updated:Jul 03, 2023

DATASOURCE::PAI::Workspaces is used to query the basic information about workspaces.

Syntax

{
  "Type": "DATASOURCE::PAI::Workspaces",
  "Properties": {
    "WorkspaceId": String,
    "WorkspaceName": String
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

WorkspaceId

String

No

Yes

The ID of the workspace.

None.

WorkspaceName

String

No

Yes

The name of the workspace.

The name must meet the following format requirements:

  • It must be 3 to 23 characters in length, and can contain letters, underscores (_), and digits.

  • It must start with a letter.

  • It must be unique within the region that you specify.

Return values

Fn::GetAtt

  • WorkspaceIds: the IDs of the workspaces.

  • Workspaces: details of the workspaces.

Property

Type

Description

Constraint

WorkspaceIds

List

The IDs of the workspaces.

None.

Workspaces

List

Details of the workspaces.

None.

WorkspaceName

String

The name of the workspace.

None.

WorkspaceId

String

The ID of the workspace.

None.

DisplayName

String

The display name of the workspace.

None.

EnvTypes

String

The environments of the workspace.

None.

Description

String

The description of the workspace.

The description can be up to 80 characters in length.

Examples

YAML format

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  WorkspaceName:
    Description: 'The workspace name. The format is as follows:

      - 3 to 23 characters in length and can contain letters, underscores, or numbers.

      - Must start with a large or small letter.

      - Unique in the current region.'
    Type: String
Resources:
  ExtensionDataSource:
    Properties:
      WorkspaceName:
        Ref: WorkspaceName
    Type: DATASOURCE::PAI::Workspaces
Outputs:
  WorkspaceIds:
    Description: The list of workspace IDs.
    Value:
      Fn::GetAtt:
      - ExtensionDataSource
      - WorkspaceIds
  Workspaces:
    Description: The list of workspaces.
    Value:
      Fn::GetAtt:
      - ExtensionDataSource
      - Workspaces

JSON format

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "WorkspaceName": {
      "Type": "String",
      "Description": "The workspace name. The format is as follows:\n- 3 to 23 characters in length and can contain letters, underscores, or numbers.\n- Must start with a large or small letter.\n- Unique in the current region."
    }
  },
  "Resources": {
    "ExtensionDataSource": {
      "Type": "DATASOURCE::PAI::Workspaces",
      "Properties": {
        "WorkspaceName": {
          "Ref": "WorkspaceName"
        }
      }
    }
  },
  "Outputs": {
    "WorkspaceIds": {
      "Description": "The list of workspace IDs.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "WorkspaceIds"
        ]
      }
    },
    "Workspaces": {
      "Description": "The list of workspaces.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "Workspaces"
        ]
      }
    }
  }
}