An environment is an object used to store data for an environment. APIs can consume environments as environment variables, command line arguments, or file configurations through the API Platform console. This helps to separate environment configuration, making your applications more portable.
Environments are used to define API configuration data separately.
NOTEYou are developing an API to run in the development environment and need to test it. In this context, you:
- Write code to search for an environment variable called
url-backend.- Define the sandbox environment variable as https://dev-my-internal-backend.company/v1.
- Configure the production environment variable to point to a service that exposes the backend directly to the API Platform.
This allows you to fetch a container image running in the cloud and debug the same code locally if necessary.
.yaml File Structure (apply command)TIPRefer to the Environment's basic data documentation.
To list all available environments, use the command: ssd (api-management | apim) get environment.
You can retrieve an environment by name, ID or content via YAML. Here are the commands to retrieve it:
ssd (api-management | apim) get environment --name "Development-CLI"ssd (api-management | apim) get environment --id 66ssd (api-management|apim) get environment --id 66 -o yaml > environment.yamlWARNINGBe careful when applying an Environment, as it will replace the settings in the file. Also, if you use a value in an environment where there is active traffic, it may be impacted.
We use cookies to enhance your experience on our site. By continuing to browse, you agree to our use of cookies.Learn more