iagctl run service executable
Executes an executable service.
Use this command to execute an executable service. The command displays the resulting stdout, stderr, return code, and execution time.
To pass arguments when running an executable service, use the --set flag with key=value syntax. If the service was created with a decorator, any variables you pass in using --set are validated against that decorator.
For more information, see Run an executable service.
Syntax
How arguments are passed
The format in which arguments are passed to your executable depends on the --arg-format specified when the service was created. The default format is --{{.Key}} {{.Value}}, which passes arguments as command-line flags.
For example, if you run:
With the default --arg-format "--{{.Key}} {{.Value}}", IAG executes:
If the service was created with --arg-format "{{.Key}}={{.Value}}", IAG executes:
Make sure your executable can parse arguments in the format specified when the service was created.
Runtime secrets
You can inject secrets at runtime using the --set-secret flag. Runtime secrets are merged with or override the secrets defined on the service at creation time. The --set-secret flag uses the same comma-separated syntax as the create command:
Examples
Run an executable service with no arguments
Runs an executable service called backup-script.
Run an executable service with arguments
Runs an executable service called network-config with device and interface arguments.
Run an executable service with a runtime secret
Runs an executable service and injects a secret at runtime as an environment variable.
Run an executable service with multiple arguments and a runtime secret
Runs an executable service with multiple arguments and a runtime secret.