Import a gateway configuration
Import a configuration into a gateway cluster using the Gateway Manager UI or the Platform API. Importing pushes services and resources from a configuration file into a running gateway instance.
Before you begin
- The target gateway must be connected, enabled, and not set to read-only before you can import.
- Your configuration file must be in JSON format if you’re importing through the Platform API. The UI also accepts YAML.
- You must have the
gateway:updaterole to import configurations via the Platform API.
Import via the UI
- In Gateway Manager, go to the cluster list.
- Locate the target cluster and select the three-dots overflow menu (⋯) on the cluster row.
- Select Import Configuration.
- In the dialog, upload your configuration file or provide the path to the file you want to import.
- Select Import to apply the configuration.
Gateway Manager confirms a successful import or surfaces an error message if the import fails.
If you’re importing a configuration that contains resources that already exist in the cluster, the import won’t override them by default. Use the Force option to overwrite existing resources.
Import via the Platform API
The Platform API exposes import functionality through Gateway Manager. Call the import endpoint from your CI/CD pipeline or automation tooling to import a configuration programmatically.
API-based imports only support JSON. To import in YAML, use the Gateway Manager UI.
Endpoint
Import from inline content
Supply the configuration document directly in the request body using the content source.
Import from a Git repository
Supply a Git source instead of inline content. The gateway clones the repository and imports the specified file.
For HTTPS repositories, use username and password instead of privateKey. The password field supports $GATEWAYSECRET_<alias> references, which the gateway resolves at runtime.
Import options
You can include the following optional flags in the options object:
Response
A successful import returns lists and counts of added, replaced, and skipped resources.
When you use the check option, the response returns a dry-run diff instead of the standard result.
Error handling
The API returns error messages for the following conditions:
Configuration file format
The following example shows the structure of a valid import file. The file can contain decorators, repositories, and services in any combination.