Replacement Parameter
The command executor might require values from command arguments, flags, or from the selected resource.
The following example shows the command execution configured to call an HTTP endpoint on the selected service with a flag passed in:
command:
name: query
description: Call a REST Endpoint deployed in the same namespace
flags:
- name: name
shortName: n
type: string
mandatory: true
defaultValue: 1
description: The value of the HTTP Service app label
arguments:
- name: size
type: int
mandatory: false
defaultValue: 10
description: The number of results to return
resourceSelector:
kind: services
labels:
app: ${command.flag.name}
executor:
httpEndpoint:
url: http://${resource.name}.${resource.namespace}/api/query?noOfRecords=${command.argument.size}
Replacement Parameter describes the available parameter replacement placeholders.
Name | Description |
---|---|
command.flag.name | The command flag, where name is the name of the flag. |
command.argument.name | The command argument, where name is the name of the argument. |
resource.name | The selected resource, where name is the name of the selected resource. |
resource.kind | The selected resource, where kind is the kind of resource. |
resource.apiVersion | The Kubernetes API version of the selected resource. |
resource.namespace | The namespace of the selected resource. |
clusterId | The ID of the cluster of the selected resource. |
command.execution.id | The ID of the command execution that identified this run. |