DATASOURCE::EDAS::Clusters

更新时间:
复制 MD 格式

Use DATASOURCE::EDAS::Clusters to query clusters.

Syntax

{
  "Type": "DATASOURCE::EDAS::Clusters",
  "Properties": {
    "LogicalRegionId": String,
    "ResourceGroupId": String,
    "RefreshOptions": String
  }
}

Properties

Property name

Type

Required

Update allowed

Description

Constraints

LogicalRegionId

String

No

Yes

The ID of the namespace.

For more information about how to obtain the namespace ID, see Query a list of custom namespaces.

Obtain the namespace:

  • If you do not set this parameter, the system queries the clusters in the default namespace.

  • If you set this parameter, the system queries the clusters in the specified namespace.

ResourceGroupId

String

No

Yes

The ID of the resource group.

For more information about how to obtain the resource group ID, see Query resource group information.

Obtain the resource group ID:

  • If you do not set this parameter, the system queries the clusters in the default resource group.

  • If you set this parameter, the system queries the clusters in the specified resource group.

RefreshOptions

String

No

Yes

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

Valid values:

  • Never (default): The data source resource is never refreshed when the stack is updated.

  • Always: The data source resource is always refreshed when the stack is updated.

Return values (Fn::GetAtt)

  • ClusterIds: A list of cluster IDs.

  • Clusters: A list of cluster details.

Property name

Type

Description

Constraints

ClusterIds

List

A list of cluster IDs in EDAS.

None

Clusters

List

A list of cluster details in EDAS.

None

ClusterId

String

The ID of the cluster in EDAS.

None

ClusterName

String

The name of the cluster.

None

OversoldFactor

Number

The CPU oversold ratio supported by the Docker cluster.

None

NodeNum

Number

The number of instances.

None

ResourceGroupId

String

The ID of the resource group.

None

ClusterType

Number

The type of the cluster.

Valid values:

  • 0: common Docker cluster.

  • 1: Swarm cluster.

  • 2: ECS cluster.

  • 3: self-managed Kubernetes cluster in EDAS.

  • 4. Pandora automatically registers the application cluster.

  • 5: Container Service for Kubernetes cluster.

CsClusterId

String

The ID of the Kubernetes cluster created in Container Service for Kubernetes.

None

VpcId

String

The ID of the VPC.

None

RegionId

String

The ID of the region.

None

IaasProvider

String

The provider of the cluster.

None

Cpu

String

The total number of CPU cores.

None

CpuUsed

Number

The number of used CPU cores.

None

Mem

Number

The total memory.

Unit: MB.

MemUsed

Number

The used memory.

Unit: MB.

CreateTime

Number

The timestamp when the cluster was created.

Unit: milliseconds.

UpdateTime

Number

The timestamp of the last change to the cluster.

Unit: milliseconds.

Examples

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  LogicalRegionId:
    Type: String
    Description: The ID of the namespace.
Resources:
  Clusters:
    Type: DATASOURCE::EDAS::Clusters
    Properties:
      LogicalRegionId:
        Ref: LogicalRegionId
Outputs:
  Clusters:
    Description: The list of clusters.
    Value:
      Fn::GetAtt:
        - Clusters
        - Clusters
  ClusterIds:
    Description: The list of cluster IDs.
    Value:
      Fn::GetAtt:
        - Clusters
        - ClusterIds
                    
JSON format
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "LogicalRegionId": {
      "Type": "String",
      "Description": "The ID of the namespace."
    }
  },
  "Resources": {
    "Clusters": {
      "Type": "DATASOURCE::EDAS::Clusters",
      "Properties": {
        "LogicalRegionId": {
          "Ref": "LogicalRegionId"
        }
      }
    }
  },
  "Outputs": {
    "Clusters": {
      "Description": "The list of clusters.",
      "Value": {
        "Fn::GetAtt": [
          "Clusters",
          "Clusters"
        ]
      }
    },
    "ClusterIds": {
      "Description": "The list of cluster IDs.",
      "Value": {
        "Fn::GetAtt": [
          "Clusters",
          "ClusterIds"
        ]
      }
    }
  }
}