iagctl db export

Export resources and services to a file.

The iagctl db export command exports services and resources to a file. Use this command to move services and resources from one gateway instance to another.

Syntax

$iagctl db export [flags]

Examples

Export to the terminal

The following example exports all services and resources and displays the output in the terminal:

$iagctl db export

Export in a specific format

Use the -f flag to switch between JSON and YAML output. YAML is the default format:

$iagctl db export -f json

Export to a file

Use the --file flag to save the output to a file:

$iagctl db export --file ./services.yaml

Service file format

The following example shows the structure of an exported service file:

1decorators:
2 - name: ansible-xr
3 schema:
4 $id: https://example.com/device.schema.json
5 $schema: https://json-schema.org/draft/2020-12/schema
6 properties:
7 device_type:
8 description: The type of device
9 enum:
10 - ios
11 - eos
12 - nxos
13 type: string
14 host:
15 description: The hostname or IP address of the device
16 type: string
17 title: Network Device
18 type: object
19repositories:
20 - name: xr-resources
21 description: XR Resources for testing
22 url: git@gitlab.com:jh/xr/resources.git
23 reference: main
24 tags:
25 - cisco
26 - xr
27 private-key-name: xr-gitlab-private
28services:
29 - name: Ansible-Example
30 type: ansible-playbook
31 description: An ansible playbook to say hello-world
32 playbooks:
33 - hello-world.yml
34 working-directory: ./
35 repository: xr-resources
36 decorator: ansible-xr
37 tags:
38 - xr
39 - cisco
40 runtime:
41 check: true
42 diff: true
43 skip-tags: example-tag
44 inventory:
45 - ./inventory.ini
46 verbose-level: 6
47 - name: Hello-World
48 type: python-script
49 description: A simple hello-world script
50 filename: hello-world.py
51 working-directory: python-scripts
52 repository: xr-resources
53 decorator: my-special-decorator

Options

$ --file string File path to save the exported service configuration.
$ -f, --format string Output format for the export: json or yaml. (default "yaml")
$ -h, --help Help for export

Options inherited from parent commands

$ --config string Path to the configuration file
$ --raw Display the result of the command in raw format
$ --verbose Enable verbose output