All Products
Search
Document Center

Resource Orchestration Service:DATASOURCE::CS::ClusterApplicationResources

Last Updated:Jan 17, 2025

DATASOURCE::CS::ClusterApplicationResources is used to query the information about resources of a specified type in a Container Service for Kubernetes (ACK) cluster.

Syntax

{
  "Type": "DATASOURCE::CS::ClusterApplicationResources",
  "Properties": {
    "ApiVersion": String,
    "FirstMatch": Boolean,
    "ClusterId": String,
    "Kind": String,
    "JsonPath": String,
    "Namespace": String,
    "Name": String,
    "RefreshOptions": String
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

ClusterId

String

Yes

No

The cluster ID.

None.

Kind

String

Yes

Yes

The type of the resources that you want to query in the cluster.

Valid values:

  • ConfigMap

  • Service

  • PodTemplate

  • Namespace

  • Secret

  • Node

  • ComponentStatus

  • ReplicationController

  • LimitRange

  • ResourceQuota

  • PersistentVolumeClaim

  • ServiceAccount

  • PersistentVolume

  • Endpoints

  • Binding

  • Pod

  • Event

Name

String

No

Yes

The cluster name.

None.

Namespace

String

No

Yes

The namespace to which the cluster belongs.

None.

JsonPath

String

No

Yes

The JSONPath expression that you want to use to filter results.

None.

FirstMatch

Boolean

No

Yes

Specifies whether to return only the first matched result in the results that are filtered by using the JSONPath expression.

Valid values:

  • true

  • false (default)

ApiVersion

String

No

Yes

The API version.

None.

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)

Response: the collection of the resources that are queried in the cluster.

Property

Type

Description

Constraint

metadata

Map

The metadata of the resource in the cluster.

Example:

{"resourceVersion": "254****"}

apiVersion

String

The API version.

Example: v1.

kind

String

The type of the resources that are queried in the cluster.

Valid values:

  • ConfigmapList

  • ServiceList

  • PodTemplateList

  • Namespace

  • SecretList

  • NodeList

  • ComponentStatusList

  • ReplicationControllerList

  • LimitRangeList

  • ResourceQuotaList

  • PersistentVolumeClaimList

  • ServiceAccountList

  • PersistentVolumeList

  • EndpointsList

  • BindingList

  • PodList

  • EventList

items

List

Details of the resource in the cluster.

This property is returned only when Name is not specified.

Example:

[
  {
   "metadata": {
    "uid": "5a3d04e1-8a72-4566-b435-af56f77f****",
    "managedFields": [
     {
      "apiVersion": "v1",
      "fieldsV1": {
       "f:data": {
        "f:ca.crt": {},
        ".": {}
       },
       "f:metadata": {
        "f:annotations": {
         "f:kubernetes.io/description": {},
         ".": {}
        }
       }
      },
      "manager": "kube-controller-manager",
      "time": "2022-11-02T04:03:08Z",
      "operation": "Update",
      "fieldsType": "FieldsV1"
     }
    ],
    "resourceVersion": "254",
    "namespace": "default",
    "creationTimestamp": "2022-11-02T04:03:08Z",
    "name": "kube-root-ca.crt",
    "annotations": {
     "kubernetes.io/description": "Contains a CA bundle that can be used to verify the kube-apiserver when using internal endpoints such as the internal service IP or kubernetes.default.svc. No other usage is guaranteed across distributions of Kubernetes clusters."
    }
   },
   "apiVersion": "v1",
   "data": {
    "ca.crt": "-----BEGIN CERTIFICATE-----\nMIIDTjCCAjagAwIBAgIUZvaXvIyXCj7R1q7UgYKPmO+D4lgwDQYJKoZIhvcN****\nBQAwPjEnMA8GA1UEChMIaGFuZ3pob3UwFAYDVQQKEw1hbGliYWJhIGNsb3Vk****\nEQYDVQQDEwprdWJlcm5ldGVzMCAXDTIyMTEwMjAzNTgwMFoYDzIwNTIxMDI1****\nODAwWjA+MScwDwYDVQQKEwhoYW5nemhvdTAUBgNVBAoTDWFsaWJhYmEgY2xv****\nEzARBgNVBAMTCmt1YmVybmV0ZXMwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw****\nAoIBAQDXEuGvRudCTo7FJoyQCBvfG2Zx+F+htG8****/doyE6LjW7o2lxejs****\nz/3QO4hzVpNsicdBlNNwzPyykKDoxgAXE8HLL5P****/RyE6CiANzG6qQRPE****\nKm9G88XdXnPsaYEwRAskPmnifR04Ofqp0d4tSAEYoMgLFIjfOhFezrhDNYQw****\nAr0H77bwse5PABcHtbZ3JIZlV7ArluH4FMHAqw4YWq71EgPxooRmqWxH7nOI****\nVTCfaJ5Jtxc2iuDlmIgODrpYyweoIxs7oIgXgDJT8/RZ0DOv2WEfzeTuuBYFE+fi\nkk+5WFy0WIIZkrc7KhZdru096rD1AgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIC****\nBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBTPFeL0s4fc/uMRdLkkBpbyCYlb****\nBgkqhkiG9w0BAQsFAAOCAQEAFknCC6c7Y8aO8UEgC8e+y7oVuQokV2e+UhzM****\nryHO3XTPhE1paIaKsY70u2OgRHxqhQuuVm8pJbAXcKigXzK0tRcrS94p****\nQhNbiVsrZjws49Vy5iTigRhejiyIauS2qXwbq4Fh4miOM7cu02cXT58kdunR****\naS29Vzz9NeZXTCrUY19jkVoKIFVQpldyNJt/012SY044scejeba5/MsUPc01****\nPddEJLx5TuZb16K48qvSkGv1fJFNA/Dia61T4EDHRobcDU6ge2o6nSCy7AoX****\nDbHv5QxY7mhn1DJFJFzY13Ep/5xXUH5ZDtbY4vMyWio1****\n-----END CERTIFICATE-----\n"
   },
   "kind": "ConfigMap"
  }
 ]
                                

Examples

The following section provides examples on how to query the resources of the ConfigMap type in an ACK cluster by using DATASOURCE::CS::ClusterApplicationResources.

JSON format

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "ClusterId": {
      "Type": "String",
      "Description": "The ID of the kubernetes cluster."
    },
    "Kind": {
      "Type": "String",
      "Description": "The kind of kubernetes resources to query.",
      "Default": "ConfigMap",
      "AllowedValues": [
        "ConfigMap",
        "Service",
        "PodTemplate",
        "Namespace",
        "Secret",
        "Node",
        "ComponentStatus",
        "ReplicationController",
        "LimitRange",
        "ResourceQuota",
        "PersistentVolumeClaim",
        "ServiceAccount",
        "PersistentVolume",
        "Endpoints",
        "Binding",
        "Pod",
        "Event"
      ]
    }
  },
  "Resources": {
    "ClusterApplicationResources": {
      "Type": "DATASOURCE::CS::ClusterApplicationResources",
      "Properties": {
        "ClusterId": {
          "Ref": "ClusterId"
        },
        "Kind": {
          "Ref": "Kind"
        }
      }
    }
  },
  "Outputs": {
    "Response": {
      "Description": "Query result of kubernetes resource(s).",
      "Value": {
        "Fn::GetAtt": [
          "ClusterApplicationResources",
          "Response"
        ]
      }
    }
  }
}

YAML format

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  ClusterId:
    Type: String
    Description: The ID of the kubernetes cluster.
  Kind:
    Type: String
    Description: The kind of kubernetes resources to query.
    Default: ConfigMap
    AllowedValues:
      - ConfigMap
      - Service
      - PodTemplate
      - Namespace
      - Secret
      - Node
      - ComponentStatus
      - ReplicationController
      - LimitRange
      - ResourceQuota
      - PersistentVolumeClaim
      - ServiceAccount
      - PersistentVolume
      - Endpoints
      - Binding
      - Pod
      - Event
Resources:
  ClusterApplicationResources:
    Type: DATASOURCE::CS::ClusterApplicationResources
    Properties:
      ClusterId:
        Ref: ClusterId
      Kind:
        Ref: Kind
Outputs:
  Response:
    Description: Query result of kubernetes resource(s).
    Value:
      Fn::GetAtt:
        - ClusterApplicationResources
        - Response