influx apply

The influx apply command applies InfluxDB templates. For information about finding and using InfluxDB templates, see Use InfluxDB templates.

Usage

  1. influx apply [flags]

Flags

FlagDescriptionInput TypeMaps to ?
-c—active-configCLI configuration to use for commandstring
—configs-pathPath to influx CLI configurations (default ~/.influxdbv2/configs)stringINFLUX_CONFIGS_PATH
—disable-colorDisable color in output
—disable-table-bordersDisable table borders
-e—encodingEncoding of the input streamstring
—env-refEnvironment references to provide with the template (format: —env-ref=REF_KEY=REF_VALUE)string
-f—filePath to template file (supports HTTP(S) URLs or file paths)string
—filterResources to skip when applying the template (filter by kind or resource)string
—forceIgnore warnings about destructive changes
-h—helpHelp for the apply command
—hostHTTP address of InfluxDB (default http://localhost:8086)stringINFLUX_HOST
—jsonOutput data as JSONINFLUX_OUTPUT_JSON
-o—orgOrganization name that owns the bucketstringINFLUX_ORG
—org-idOrganization ID that owns the bucketstringINFLUX_ORG_ID
-q—quietDisable output printing
-R—recurseRecurse through files in the directory specified in -f, —file
—secretSecrets to provide with the template (format: —secret=SECRET_KEY=SECRET_VALUE)string
—skip-verifySkip TLS certificate verification
—stack-idStack ID to associate when applying the templatestring
-t—tokenAuthentication tokenstringINFLUX_TOKEN

Examples

  1. # Apply a template from a file.
  2. influx apply -f path/to/template.json
  3. # Apply a template from a URL.
  4. influx apply -f https://raw.githubusercontent.com/influxdata/community-templates/master/docker/docker.yml
  5. # Apply a stack that has associated templates.
  6. influx apply --stack-id $STACK_ID
  7. # Apply a template associated with a stack.
  8. # Stacks make template application idempotent.
  9. influx apply -f path/to/template.json --stack-id $STACK_ID
  10. # Apply multiple template files together.
  11. influx apply \
  12. -f path/to/template_1.json \
  13. -f path/to/template_2.yml
  14. # Apply a template from STDIN.
  15. cat template.json | influx apply --encoding json
  16. # Apply all templates in a directory.
  17. influx apply -f path/to/template_directory
  18. # Recurse through a directory and its subdirectories and apply all templates.
  19. influx apply -R -f path/to/template_directory
  20. # Apply templates from multiple sources – directory, file, and URL.
  21. influx apply \
  22. -f path/to/template.yml
  23. -f path/to/templates_directory
  24. -u https://example.com/template.json
  25. # Apply a template, but skip resources. The following example skips all buckets
  26. # and the dashboard whose metadata.name field matches "example-dashboard".
  27. # Filter format:
  28. # --filter=kind=Bucket
  29. # --filter=resource=Label:$Label_TMPL_NAME
  30. influx apply \
  31. -f path/to/template.yml \
  32. --filter kind=Bucket \
  33. --filter resource=Dashboard:example-dashboard

templates