Environments API Updates
Update all environments and environment groups functionality using the Environments API.
Sandbox feature
This feature is currently available in Sandboxes only.
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:
Attribute | Description | Type |
---|---|---|
environment_group_id | System-generated id of the environment group. | String |
description | User-defined description of the environment. This field appears when retrieving all environments only if a description has been assigned to the environment. | String |
roles | The full access roles associated with the environment. | Array of strings |
read_only_roles | The 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:
Action | Definition | Description |
---|---|---|
Create an Environment Group | POST /environments-groups | Creates an environment group. |
Retrieve All Environment Groups | GET /environments-groups | Retrieves all environment groups. |
Update Environment Group | PUT /environments-groups/{id} | Updates an environment group. |
Delete Environment Group | DELETE /environments-groups/{id} | Deletes an environment group. |
Updated 13 days ago