All Products
Search
Document Center

Resource Orchestration Service:DATASOURCE::PAI::Workspaces

Last Updated:Dec 02, 2024

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

Syntax

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

Properties

Property

Type

Required

Editable

Description

Constraint

WorkspaceId

String

No

Yes

The workspace ID.

None.

WorkspaceName

String

No

Yes

The workspace name.

The format of the name must meet the following requirements:

  • The name 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 in the current region.

RefreshOptions

String

No

Yes

The refresh policy for data source resources when the stack is updated.

Valid values:

  • Never (default): does not refresh data source resources when the stack is updated.

  • Always: refreshes data source resources when the stack is updated.

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 workspace name.

None.

WorkspaceId

String

The workspace ID.

None.

DisplayName

String

The display name.

None.

EnvTypes

String

The environments in the workspace.

None.

Description

String

The description of the workspace.

The description can be up to 80 characters in length.

Examples

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
{
  "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"
        ]
      }
    }
  }
}