Updated on 2025-02-14 GMT+08:00

Creating an Environment

Scenario

To use CAE, you need to create an environment and then create applications and components in the environment.

The following describes how to call the API for creating an environment. For details about how to call APIs, see 3 Calling APIs.

Prerequisites

You need to plan the region where the environment is located and determine the endpoint for calling the API based on the region. For details, see Regions and Endpoints.

Procedure

  1. Create an environment.

    Call the API for creating an environment. The following shows an example request.

    curl -k -H "Content-Type:application/json" -H "X-Auth-Token:$Token" -X POST "https://{cae_endpoint}/v1/{project_id}/cae/environments" -d '{
        "apiVersion": "v1",
        "kind": "Environment",
        "metadata": {
            "name": "env-toase",
            "annotations": {
                "type": "exclusive",
                "vpc_id": "d1f94768-0463-43c1-8eac-9faba848f5fa",
                "group_name": "demo"
            }
        }
    }'

    Information similar to the following is displayed.

    {
    "job_id": "68531a56-febe-4218-be23-97fe00454cd1"
    }

    You can obtain the creation status based on the obtained job_id.