Documentation

influx apply

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

Usage

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

# Apply a template from a file.
influx apply -f path/to/template.json

# Apply a template from a URL.
influx apply -f https://raw.githubusercontent.com/influxdata/community-templates/master/docker/docker.yml

# Apply a stack that has associated templates.
influx apply --stack-id $STACK_ID

# Apply a template associated with a stack.
# Stacks make template application idempotent.
influx apply -f path/to/template.json --stack-id $STACK_ID

# Apply multiple template files together.
influx apply \
  -f path/to/template_1.json \
  -f path/to/template_2.yml

# Apply a template from STDIN.
cat template.json | influx apply --encoding json

# Apply all templates in a directory.
influx apply -f path/to/template_directory

# Recurse through a directory and its subdirectories and apply all templates.
influx apply -R -f path/to/template_directory

# Apply templates from multiple sources – directory, file, and URL.
influx apply \
  -f path/to/template.yml
  -f path/to/templates_directory
  -u https://example.com/template.json

# Apply a template, but skip resources. The following example skips all buckets
# and the dashboard whose metadata.name field matches "example-dashboard".

# Filter format:
#	--filter=kind=Bucket
#	--filter=resource=Label:$Label_TMPL_NAME

influx apply \
	-f path/to/template.yml \
	--filter kind=Bucket \
	--filter resource=Dashboard:example-dashboard

New! Cloud or OSS?

InfluxDB OSS 2.0 now generally available!

InfluxDB OSS 2.0 is now generally available and ready for production use. See the InfluxDB OSS 2.0 release notes.

For information about upgrading to InfluxDB OSS 2.0, see: