DATASOURCE::CS::ClusterApplicationResources类型用于列出Kubernetes集群中指定类型的资源信息。
语法
{
  "Type": "DATASOURCE::CS::ClusterApplicationResources",
  "Properties": {
    "ApiVersion": String,
    "FirstMatch": Boolean,
    "ClusterId": String,
    "Kind": String,
    "JsonPath": String,
    "Namespace": String,
    "Name": String,
    "RefreshOptions": String
  }
}属性
| 属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 | 
| ClusterId | String | 是 | 否 | 集群ID。 | 无 | 
| Kind | String | 是 | 是 | 要查询的Kubernetes集群的类型。 | 取值: 
 | 
| Name | String | 否 | 是 | 要查询kubernetes集群的名称。 | 无 | 
| Namespace | String | 否 | 是 | kubernetes的命名空间。 | 无 | 
| JsonPath | String | 否 | 是 | 用于筛选输出的 JsonPath表达式。 | 无 | 
| FirstMatch | Boolean | 否 | 是 | 是否仅返回JsonPath过滤结果中的第一个匹配结果。 | 取值: 
 | 
| ApiVersion | String | 否 | 是 | API版本 | 无 | 
| RefreshOptions | String | 否 | 是 | 当资源栈更新时,数据源资源的刷新策略。 | 取值: 
 | 
返回数据(Fn::GetAtt)
Response:要查询的Kubernetes资源集合。
| 属性名称 | 类型 | 描述 | 约束 | 
| metadata | Map | 资源的元数据。 | 例如: 
 | 
| apiVersion | String | API版本。 | 例如:v1。 | 
| kind | String | Kubernetes资源的类型。 | 取值: 
 | 
| items | List | Kubernetes资源详情列表。 | 仅在不指定Name时返回该信息。 例如:  | 
示例
本示例为您介绍如何使用DATASOURCE::CS::ClusterApplicationResources资源获取Kubernetes集群的ConfigMap。
JSON格式
{
  "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格式
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