The inso generate config
command generates a configuration from an API specification by using openapi-2-kong. The command works similarly to generating a declarative configuration file or Kubernetes manifest from within Insomnia.
For more in-depth information on working with other Kong products, see:
inso generate config [identifier]
identifier
is a specification name, or id, or a file path.
Option | Alias | Description |
---|---|---|
--type <type> |
-t |
type of configuration to generate, options are kubernetes and declarative (default: declarative ) |
--output <path> |
-o |
save the generated config to a file in the working directory. When not specified, will write the config to /dev/stdout without logging extraneous usage information. |
--format |
-f |
output format, either yaml or json . This option only applies to type declarative , and will be ignored for type kubernetes (default: yaml ) |
--kongVersion <value> |
-k |
version of target Kong instance, options are [legacy, 3] (default: legacy) |
--tags <tags> |
comma-separated list of tags to apply to each entity |
Option | Alias | Description |
---|---|---|
--output <path> |
-o | Save the specification to a file in the working directory. |
--workingDir <path> |
Specify a working directory. | |
--src <path> |
Specify the V4 export file or the Insomnia app data directory. You can use this option to set a Git data directory. If not specified, inso-cli looks for an .insomnia folder in the working directory by default. |
The following commands work when running in the example git-repo directory.
When you don’t specify any arguments, you’ll be prompted with:
inso generate config
Scope configuration generation by the Document name or ID:
inso generate config spc_46c5a4
inso generate config "Sample Specification"
Scope configuration generation by a file on the filesystem:
inso generate config spec.yaml
inso generate config spec.yaml --workingDir another/dir
Save the configuration output to a file:
inso generate config spc_46c5a4 --output output.yaml
inso generate config spc_46c5a4 > output.yaml
Save the configuration output to a file with json output:
inso generate config spc_46c5a4 --output output.json --format json
Add tags to your generated configuration:
inso generate config spec.yaml --workingDir another/dir
inso generate config spec.yaml --tags first
inso generate config spec.yaml --tags "first,second"
Change the generated configuration output type to either declarative
or kubernetes
:
inso generate config spc_46c5a4 --type declarative
inso generate config "Sample Specification" --type kubernetes