Queries resource information 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 resource type to query in the cluster. |
Valid values:
|
|
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 to filter results. |
None. |
|
FirstMatch |
Boolean |
No |
Yes |
Specifies whether to return only the first match from the JSONPath-filtered results. |
Valid values:
|
|
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:
|
Return values (Fn::GetAtt)
Response: the queried resource collection in the cluster.
|
Property |
Type |
Description |
Constraint |
|
metadata |
Map |
The metadata of the resource in the cluster. |
Example:
|
|
apiVersion |
String |
The API version. |
Example: v1. |
|
kind |
String |
The resource type queried in the cluster. |
Valid values:
|
|
items |
List |
Details of the resource in the cluster. |
This property is returned only when Name is not specified. Example:
|
Examples
The following examples show how to query ConfigMap resources in an ACK cluster.
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