Export a gateway configuration

Gateway Manager 1.1.1+

Export a gateway cluster’s configuration using the Gateway Manager UI or the Platform API. Exporting retrieves all services and resources from a running gateway instance and returns them as a configuration document you can store, version, or import into another environment.

Before you begin

  • The target gateway must be connected and active in Gateway Manager.
  • You must have the gateway:read role to export configurations via the Platform API.

Export via the UI

  1. In Gateway Manager, go to the cluster list.
  2. Locate the target cluster and select the three-dots overflow menu () on the cluster row.
  3. Select Export Configuration.
  4. In the dialog, select your preferred output format: JSON or YAML.
  5. Select Export to download the configuration file.

Export via the Platform API

The Platform API exposes export functionality through Gateway Manager. Call the export endpoint from your CI/CD pipeline or automation tooling to retrieve a configuration programmatically.

API-based exports only support JSON. To export in YAML, use the Gateway Manager UI.

Endpoint

GET /v1/gateways/:clusterId/configuration/export

Response

A successful export returns the full configuration for the specified cluster as a DSL document. You can pass this response directly as the content value in a future import request.

1{
2 "decorators": [],
3 "repositories": [],
4 "services": []
5}

Error handling

The API returns error messages for the following conditions:

ConditionDescription
Gateway not activeThe target gateway isn’t connected. Connect the gateway and retry the request.
Method does not existThe connected Itential Gateway version doesn’t support this operation. Update Itential Gateway to a version compatible with your Gateway Manager version.
Permission errorYour credentials don’t have the gateway:read role. Contact your platform administrator.
Network failureThe gateway couldn’t be reached during the export. Check connectivity and retry.

Exported file format

The export returns all decorators, repositories, and services configured in the gateway cluster. The following example shows the structure of an exported configuration 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:<org>/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