influx export stack

  • influx CLI 2.0.0+
  • InfluxDB 2.0.0+

This page documents an earlier version of InfluxDB. InfluxDB v2.7 is the latest stable version. View this page in the v2.7 documentation.

The influx export stack command exports all resources associated with a stack as a template. All metadata.name fields remain the same.

To export resources as a template, you must use the Operator token created for the initial InfluxDB user or an All-Access token. For information about creating an All-Access API token, see Create an API token.

Usage

  1. influx export stack <stack_id> [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
-f—fileTemplate output file. Defaults to stdout. Use .yml or .json file extensions.string
-h—helpHelp for the export stack command
—hostHTTP address of InfluxDB (default http://localhost:8086)stringINFLUX_HOST
—http-debugInspect communication with InfluxDB servers.string
-o—orgOrganization name that owns the resources (mutually exclusive with —org-id)stringINFLUX_ORG
—org-idOrganization ID that owns the resources (mutually exclusive with —org)stringINFLUX_ORG_ID
—skip-verifySkip TLS certificate verificationINFLUX_SKIP_VERIFY
-t—tokenAPI tokenstringINFLUX_TOKEN

Examples

Authentication credentials

The examples below assume your InfluxDB host, organization, and token are provided by either the active influx CLI configuration or by environment variables (INFLUX_HOST, INFLUX_ORG, and INFLUX_TOKEN). If you do not have a CLI configuration set up or the environment variables set, include these required credentials for each command with the following flags:

  • --host: InfluxDB host
  • -o, --org or --org-id: InfluxDB organization name or ID
  • -t, --token: InfluxDB API token
Export a stack as a template
  1. influx export stack $STACK_ID