db export
Export resources/services to a service file
Synopsis
Export
This command exports services and resources to a file. This is useful in cases where services and resources need to move from one torero instance to another.
Example 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: [email protected]: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
torero db export [flags]
Examples
Export Services And Resources
To view directly on the CLI type:
>_ torero 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.
>_ torero db export -f json
To save the output to a file use the --file
flag.
>_ torero 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
SEE ALSO
- torero db - Manage resources of the database/store