All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::PAI::WorkspaceResourceDlc

更新時間:Aug 13, 2024

ALIYUN::PAI::WorkspaceResourceDlc is used to associate Deep Learning Containers (DLC) resources with a workspace.

Syntax

{
  "Type": "ALIYUN::PAI::WorkspaceResourceDlc",
  "Properties": {
    "GroupName": String,
    "Resources": List,
    "WorkspaceId": String,
    "IsDefault": Boolean,
    "Option": String
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

GroupName

String

Yes

No

The name of the resource group.

The name of the resource group must be unique within an account.

Resources

List

Yes

No

The resources.

For more information, see Resources properties.

WorkspaceId

String

Yes

No

The workspace ID of the resources.

None.

IsDefault

Boolean

No

Yes

Specifies whether the resource is the default one. Each type of resources has a default resource.

Valid values:

  • false (default)

  • true

Option

String

No

No

The option for creating resources.

Valid values:

  • CreateAndAttach: creates resources and associates them with a workspace.

  • Attach: associates resources with a workspace.

Resources syntax

"Resources": [
  {
    "WorkspaceResourceWorkspaceId": String,
    "WorkspaceResourceName": String,
    "Spec": Map,
    "EnvType": String
  }
]

Resources properties

Property

Type

Required

Editable

Description

Constraint

EnvType

String

Yes

No

The environment type.

Valid values:

  • dev: development environment

  • prod: production environment

WorkspaceResourceWorkspaceId

String

Yes

No

The workspace ID of the resource.

None.

WorkspaceResourceName

String

Yes

No

The resource name.

None.

Spec

Map

No

No

The specifications of the resource.

Example:

{"Endpoint": "odps.alibaba-inc.com", "Project": "mignshi"}

Return values

Fn::GetAtt

  • GroupName: the name of the resource group.

  • IsDefault: indicates whether the resource is the default one.

  • CreateTime: the time when the resources were created.

  • Resources: the resources.

Examples

YAML format

ROSTemplateFormatVersion: '2015-09-01'
Parameters: {}
Resources:
  ExtensionResource:
    Type: ALIYUN::PAI::WorkspaceResourceDlc
    Properties:
      GroupName: groupName
      WorkspaceId: '45970'
      Resources:
        - WorkspaceResourceName: public-cluster1
          WorkspaceResourceWorkspaceId: '45970'
          EnvType: prod
          Spec:
            ClusterType: share
            ResourceId: ''
            ResourceName: public-cluster1
            ProductType: ECS
            ResourceType: ECS
            Key: ECS-share-public-cluster
Outputs:
  GroupName:
    Description: Resource group name. If you want to obtain a resource group name, see [ListResources].
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - GroupName
  IsDefault:
    Description: Indicates whether it is the default resource. Currently, this parameter only supports the input of true and does not support false.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - IsDefault
  CreateTime:
    Description: The creation time of the resource.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - CreateTime
  Resources:
    Description: Resource List.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Resources

JSON format

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
  },
  "Resources": {
    "ExtensionResource": {
      "Type": "ALIYUN::PAI::WorkspaceResourceDlc",
      "Properties": {
        "GroupName": "groupName",
        "WorkspaceId": "45970",
        "Resources": [
          {
            "WorkspaceResourceName": "public-cluster1",
            "WorkspaceResourceWorkspaceId": "45970",
            "EnvType": "prod",
            "Spec": {
              "ClusterType": "share",
              "ResourceId": "",
              "ResourceName": "public-cluster1",
              "ProductType": "ECS",
              "ResourceType": "ECS",
              "Key": "ECS-share-public-cluster"
            }
          }
        ]
      }
    }
  },
  "Outputs": {
    "GroupName": {
      "Description": "Resource group name. If you want to obtain a resource group name, see [ListResources].",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "GroupName"
        ]
      }
    },
    "IsDefault": {
      "Description": "Indicates whether it is the default resource. Currently, this parameter only supports the input of true and does not support false.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "IsDefault"
        ]
      }
    },
    "CreateTime": {
      "Description": "The creation time of the resource.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "CreateTime"
        ]
      }
    },
    "Resources": {
      "Description": "Resource List.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Resources"
        ]
      }
    }
  }
}