Environments API Updates

Update all environments and environment groups functionality using the Environments API.

The Environments API is now fully aligned with UI capabilities. You can now create, retrieve, update, and delete environment groups, update environment descriptions, and assign and retrieve roles for environments using the API.

New Attributes

The following new attributes are available for creating and updating environments:

AttributeDescriptionType
environment_group_idSystem-generated id of the environment group.String
descriptionUser-defined description of the environment. This field appears when retrieving all environments only if a description has been assigned to the environment.String
rolesThe full access roles associated with the environment.Array of strings
read_only_rolesThe read-only roles associated with the environment.Array of strings

Sample Object

​{
    "name": "Operations Team - P0",
    "id": "63bdaf1a986dda00136de733",
    "environment_group_id": "63bdacba4fe9cf1300872833",
    "roles": [
        {
            "id": "643d421d0961d74e3c879f33",
            "name": "Operator"
        }
    ],
    "read_only_roles": [
​        {
​            "id": "821e421d0961d74w3c879h31"
​            "name": "Viewer (Read only)"
​        {
​    ],
    "description": "Environment used for the Operations team",
    "created_at": 1673375514,
    "updated_at": 1721827922,
    "updated_by": "63bda5377e77040012b285c3",
    "created_by": "63bd568977a8d60012bf3dch",
    "filter": "source_system = /.*\\..*/ AND team = 'operations' AND priority = 'P0' AND zero_impact != 'true'"
}

Create an Environment (POST) Sample Call

curl --request POST \
     --url https://api.bigpanda.io/resources/v2.0/environments \
     --header 'Authorization: Bearer <User API Key>' \
     --header 'Content-Type: application/json' \
     --data '{
        "name": "Platform Team",
        "description": "Environment is owned by the Platform team",
        "environment_group_id": "6696265c4c28e11e591e2cr36",
        "roles": [{
          "key": "768abaae85f1e3ceb4d61n45",
          "name": "Admin"
        }],
        "read_only_roles": [{
          "key": "668abaaf85f1e3ceb4d61nl7",
          "name": "Viewer (Read-only)"
        }],
        "filter": "region = AW*"
      }'
curl --request POST \
     --url https://eu-api.bigpanda.io/resources/v2.0/environments \
     --header 'Authorization: Bearer <User API Key>' \
     --header 'Content-Type: application/json' \
     --data '{
        "name": "Platform Team",
        "description": "Environment is owned by the Platform team",
        "environment_group_id": "6696265c4c28e11e591e2cr36",
        "roles": [{
          "key": "768abaae85f1e3ceb4d61n45",
          "name": "Admin"
        }],
        "read_only_roles": [{
          "key": "668abaaf85f1e3ceb4d61nl7",
          "name": "Viewer (Read-only)"
        }],
        "filter": "region = AW*"
      }'

Update an Environment (PATCH) Sample Call

curl --request PATCH \
     --url https://api.bigpanda.io/resources/v2.0/environments/${id} \
     --header 'Authorization: Bearer <User API Key>' \
     --header 'Content-Type: application/json' \
     --data '{
        "name": "UI Team",
        "description": "Environment is owned by the UI Team",
        "environment_group_id": "6696265c4c28e11e591e2mn6",
        "roles": [{
          "key": "768abaae85f1e3ceb4d61m92",
          "name": "Admin"
        }],
        "read_only_roles": [{
          "key": "668abaaf85f1e3ceb4d61mn6",
          "name": "Viewer (Read-only)"
        }],
        "filter": "region = AW*"
      }'
curl --request PATCH \
     --url https://eu-api.bigpanda.io/resources/v2.0/environments/${id} \
     --header 'Authorization: Bearer <User API Key>' \
     --header 'Content-Type: application/json' \
     --data '{
        "name": "UI Team",
        "description": "Environment is owned by the UI Team",
        "environment_group_id": "6696265c4c28e11e591e2cd4",
        "roles": [{
          "key": "768abaae85f1e3ceb4d61mn4",
          "name": "Admin"
        }],
        "read_only_roles": [{
          "key": "668abaaf85f1e3ceb4d61fc6",
          "name": "Viewer (Read-only)"
        }],
        "filter": "region = AW*"
      }'

Environment Groups Object

Environment groups can now be created, retrieved, updated, and deleted via the API.

See the Environment Groups Object documentation for more information.

The following new endpoints are available:

ActionDefinitionDescription
Create an Environment GroupPOST

/environments-groups
Creates an environment group.
Retrieve All Environment GroupsGET

/environments-groups
Retrieves all environment groups.
Update Environment GroupPUT

/environments-groups/{id}
Updates an environment group.
Delete Environment GroupDELETE

/environments-groups/{id}
Deletes an environment group.