1. Home
  2. ...
  3. Application Command and Schemas (ssd apply)
  4. Environment

Environment

How to manage Environment resources using Sensedia CLI's declarative mode.

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.

Context

Environments are used to define API configuration data separately.

NOTE

You 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.

Environment .yaml File Structure (apply command)

TIP

Refer to the Environment's basic data documentation.

List environment

To list all available environments, use the command: ssd (api-management | apim) get environment.

Retrieve an environment

You can retrieve an environment by name, ID or content via YAML. Here are the commands to retrieve it:

  • By name: ssd (api-management | apim) get environment --name "Development-CLI"
  • By ID: ssd (api-management | apim) get environment --id 66
  • Via YAML: ssd (api-management|apim) get environment --id 66 -o yaml > environment.yaml
WARNING

Be 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.

How happy are you with this page?

We use cookies to enhance your experience on our site. By continuing to browse, you agree to our use of cookies.Learn more