db export
  • 29 Oct 2024
  • Dark
    Light
  • PDF

db export

  • Dark
    Light
  • PDF

Article summary

iagctl db export

Export resources/services to a service file

Synopsis

This command exports services and resources to a file. This command is useful in cases where services and resources need to move from one gateway instance to another.

Examples

Service File

example.yml

decorators:
  - name: ansible-xr
    schema:
      $id: https://example.com/device.schema.json
      $schema: https://json-schema.org/draft/2020-12/schema
      properties:
        device_type:
          description: The type of device
          enum:
            - ios
            - eos
            - nxos
          type: string
        host:
          description: The hostname or IP address of the device
          type: string
      title: Network Device
      type: object
repositories:
  - name: xr-resources
    description: XR Resources for testing
    url: git@gitlab.com:jh/xr/resources.git
    reference: main
    tags:
      - cisco
      - xr
    private-key-name: xr-gitlab-private
services:
  - name: Ansible-Example
    type: ansible-playbook
    description: An ansible playbook to say hello-world
    playbooks:
      - hello-world.yml
    working-directory: ./
    repository: xr-resources
    decorator: ansible-xr
    tags:
      - xr
      - cisco
    runtime:
      check: true
      diff: true
      skip-tags: example-tag
      inventory:
        - ./inventory.ini
      verbose-level: 6
  - name: Hello-World
    type: python-script
    description: A simple hello-world playbook
    filename: hello-world.yml
    working-directory: ansibleplaybooks
    repository: xr-resources
    decorator: my-special-decorator

iagctl db export [flags]

Export Services and Resources

To view directly on the CLI type:

iagctl db export

If a particular format needs to be viewed you can switch formats between JSON and YAML by using the -f flag. YAML is the default format.

iagctl db export -f json

To save the output to a file use the --file flag.

iagctl db export --file ./services.yaml

Options

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

Options Inherited from Parent Commands

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

CLI References

See related db commands:

For all CLI commands see → Command References Index


Was this article helpful?

What's Next
Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.