# Environments

## GET /api/environments/

> List Environments

OpenAPI:

```json
{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"security":[{"HTTPBearer":[]}],"components":{"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}},"paths":{"/api/environments/":{"get":{"tags":["environments"],"summary":"List Environments","operationId":"list_environments_api_environments__get","parameters":[{"name":"source","in":"query","required":true,"schema":{"enum":["aws","azure","gcp","k8s"],"type":"string","title":"Source"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"properties":{"name":{"type":"string","enum":["Corporate","Development","Disaster Recovery","Production","Sandbox","Staging","Test","Unassigned"],"title":"Name"},"source":{"type":"string","enum":["aws","azure","gcp","k8s"],"title":"Source"},"organizational_units":{"type":"integer","title":"Organizational Units"},"accounts":{"type":"integer","title":"Accounts"},"tags":{"type":"integer","title":"Tags"}},"type":"object","required":["name","source","organizational_units","accounts","tags"],"title":"Environment"},"title":"Response List Environments Api Environments  Get"}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"properties":{"detail":{"items":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"}}}}}}}}}
```

## GET /api/environments/linked\_accounts

> List Linked Accounts

OpenAPI:

```json
{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"security":[{"HTTPBearer":[]}],"components":{"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}},"paths":{"/api/environments/linked_accounts":{"get":{"tags":["environments"],"summary":"List Linked Accounts","operationId":"list_linked_accounts_api_environments_linked_accounts_get","parameters":[{"name":"source","in":"query","required":true,"schema":{"enum":["aws","azure","gcp","k8s"],"type":"string","title":"Source"}},{"name":"name","in":"query","required":true,"schema":{"enum":["Corporate","Development","Disaster Recovery","Production","Sandbox","Staging","Test","Unassigned"],"type":"string","title":"Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"properties":{"name":{"type":"string","enum":["Corporate","Development","Disaster Recovery","Production","Sandbox","Staging","Test","Unassigned"],"title":"Name"},"source":{"type":"string","enum":["aws","azure","gcp","k8s"],"title":"Source"},"account_id":{"type":"string","title":"Account Id"},"account_name":{"type":"string","title":"Account Name"},"date_added":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Date Added"},"system_managed":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"System Managed","default":false},"tag_managed":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Tag Managed","default":false}},"type":"object","required":["name","source","account_id","account_name"],"title":"EnvironmentAccount"},"title":"Response List Linked Accounts Api Environments Linked Accounts Get"}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"properties":{"detail":{"items":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"}}}}}}}}}
```

## List Available Accounts

> Returns all available accounts. Note that accounts which are already\
> associated with the supplied environment as well as those which are\
> automated via OU associations are excluded.

OpenAPI:

```json
{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"security":[{"HTTPBearer":[]}],"components":{"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}},"paths":{"/api/environments/accounts":{"get":{"tags":["environments"],"summary":"List Available Accounts","description":"Returns all available accounts. Note that accounts which are already\nassociated with the supplied environment as well as those which are\nautomated via OU associations are excluded.","operationId":"list_available_accounts_api_environments_accounts_get","parameters":[{"name":"source","in":"query","required":true,"schema":{"enum":["aws","azure","gcp","k8s"],"type":"string","title":"Source"}},{"name":"name","in":"query","required":true,"schema":{"enum":["Corporate","Development","Disaster Recovery","Production","Sandbox","Staging","Test","Unassigned"],"type":"string","title":"Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"properties":{"name":{"type":"string","enum":["Corporate","Development","Disaster Recovery","Production","Sandbox","Staging","Test","Unassigned"],"title":"Name"},"source":{"type":"string","enum":["aws","azure","gcp","k8s"],"title":"Source"},"account_id":{"type":"string","title":"Account Id"},"account_name":{"type":"string","title":"Account Name"},"date_added":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Date Added"},"system_managed":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"System Managed","default":false},"tag_managed":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Tag Managed","default":false}},"type":"object","required":["name","source","account_id","account_name"],"title":"EnvironmentAccount"},"title":"Response List Available Accounts Api Environments Accounts Get"}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"properties":{"detail":{"items":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"}}}}}}}}}
```

## Update Environment For Accounts

> Update the environment associated with a list of accounts. Note that any\
> account in the list that is already associated with an environment that is\
> managed by the system via OU mapping will be ignored.

OpenAPI:

```json
{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"security":[{"HTTPBearer":[]}],"components":{"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}},"paths":{"/api/environments/accounts":{"post":{"tags":["environments"],"summary":"Update Environment For Accounts","description":"Update the environment associated with a list of accounts. Note that any\naccount in the list that is already associated with an environment that is\nmanaged by the system via OU mapping will be ignored.","operationId":"update_environment_for_accounts_api_environments_accounts_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"name":{"type":"string","enum":["Corporate","Development","Disaster Recovery","Production","Sandbox","Staging","Test","Unassigned"],"title":"Name"},"source":{"type":"string","enum":["aws","azure","gcp","k8s"],"title":"Source"},"account_list":{"items":{"type":"string"},"type":"array","title":"Account List"}},"type":"object","required":["name","source","account_list"],"title":"EnvironmentAccountList"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"properties":{"ok":{"type":"boolean","title":"Ok"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["ok"],"title":"Status"}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"properties":{"detail":{"items":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"}}}}}}}}}
```

## GET /api/environments/linked\_organizational\_units

> List Linked Organizational Units

OpenAPI:

```json
{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"security":[{"HTTPBearer":[]}],"components":{"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}},"paths":{"/api/environments/linked_organizational_units":{"get":{"tags":["environments"],"summary":"List Linked Organizational Units","operationId":"list_linked_organizational_units_api_environments_linked_organizational_units_get","parameters":[{"name":"source","in":"query","required":true,"schema":{"enum":["aws","azure","gcp"],"type":"string","title":"Source"}},{"name":"name","in":"query","required":true,"schema":{"enum":["Corporate","Development","Disaster Recovery","Production","Sandbox","Staging","Test","Unassigned"],"type":"string","title":"Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"properties":{"name":{"type":"string","enum":["Corporate","Development","Disaster Recovery","Production","Sandbox","Staging","Test","Unassigned"],"title":"Name"},"source":{"type":"string","enum":["aws","azure","gcp","k8s"],"title":"Source"},"organizational_unit_id":{"type":"string","title":"Organizational Unit Id"},"organizational_unit_name":{"type":"string","title":"Organizational Unit Name"},"date_added":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Date Added"},"accounts":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Accounts","default":0}},"type":"object","required":["name","source","organizational_unit_id","organizational_unit_name"],"title":"EnvironmentOrganizationalUnit"},"title":"Response List Linked Organizational Units Api Environments Linked Organizational Units Get"}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"properties":{"detail":{"items":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"}}}}}}}}}
```

## GET /api/environments/organizational\_units

> List Organizational Units

OpenAPI:

```json
{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"security":[{"HTTPBearer":[]}],"components":{"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}},"paths":{"/api/environments/organizational_units":{"get":{"tags":["environments"],"summary":"List Organizational Units","operationId":"list_organizational_units_api_environments_organizational_units_get","parameters":[{"name":"source","in":"query","required":true,"schema":{"enum":["aws","azure","gcp"],"type":"string","title":"Source"}},{"name":"name","in":"query","required":true,"schema":{"enum":["Corporate","Development","Disaster Recovery","Production","Sandbox","Staging","Test","Unassigned"],"type":"string","title":"Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"properties":{"organizational_unit_id":{"type":"string","title":"Organizational Unit Id"},"organizational_unit_name":{"type":"string","title":"Organizational Unit Name"}},"type":"object","required":["organizational_unit_id","organizational_unit_name"],"title":"OrganizationalUnit"},"title":"Response List Organizational Units Api Environments Organizational Units Get"}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"properties":{"detail":{"items":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"}}}}}}}}}
```

## Update Environment For Ous

> Update the environment associated with a list of OUs.

OpenAPI:

```json
{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"security":[{"HTTPBearer":[]}],"components":{"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}},"paths":{"/api/environments/organizational_units":{"post":{"tags":["environments"],"summary":"Update Environment For Ous","description":"Update the environment associated with a list of OUs.","operationId":"update_environment_for_ous_api_environments_organizational_units_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"name":{"type":"string","enum":["Corporate","Development","Disaster Recovery","Production","Sandbox","Staging","Test","Unassigned"],"title":"Name"},"source":{"type":"string","enum":["aws","azure","gcp","k8s"],"title":"Source"},"organizational_unit_list":{"items":{"type":"string"},"type":"array","title":"Organizational Unit List"}},"type":"object","required":["name","source","organizational_unit_list"],"title":"EnvironmentOrganizationalUnitList"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"properties":{"ok":{"type":"boolean","title":"Ok"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["ok"],"title":"Status"}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"properties":{"detail":{"items":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"}}}}}}}}}
```

## DELETE /api/environments/organizational\_unit/unassign

> Unassign Ou

OpenAPI:

```json
{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"security":[{"HTTPBearer":[]}],"components":{"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}},"paths":{"/api/environments/organizational_unit/unassign":{"delete":{"tags":["environments"],"summary":"Unassign Ou","operationId":"unassign_ou_api_environments_organizational_unit_unassign_delete","parameters":[{"name":"ou_id","in":"query","required":true,"schema":{"type":"string","title":"Ou Id"}},{"name":"name","in":"query","required":true,"schema":{"enum":["Corporate","Development","Disaster Recovery","Production","Sandbox","Staging","Test","Unassigned"],"type":"string","title":"Name"}},{"name":"source","in":"query","required":true,"schema":{"enum":["aws","azure","gcp","k8s"],"type":"string","title":"Source"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"properties":{"ok":{"type":"boolean","title":"Ok"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["ok"],"title":"Status"}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"properties":{"detail":{"items":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"}}}}}}}}}
```

## GET /api/environments/tags

> List Tags For Environment

OpenAPI:

```json
{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"security":[{"HTTPBearer":[]}],"components":{"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}},"paths":{"/api/environments/tags":{"get":{"tags":["environments"],"summary":"List Tags For Environment","operationId":"list_tags_for_environment_api_environments_tags_get","parameters":[{"name":"source","in":"query","required":true,"schema":{"enum":["aws","azure","gcp","k8s"],"type":"string","title":"Source"}},{"name":"name","in":"query","required":true,"schema":{"enum":["Corporate","Development","Disaster Recovery","Production","Sandbox","Staging","Test","Unassigned"],"type":"string","title":"Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"properties":{"name":{"type":"string","enum":["Corporate","Development","Disaster Recovery","Production","Sandbox","Staging","Test","Unassigned"],"title":"Name"},"source":{"type":"string","enum":["aws","azure","gcp","k8s"],"title":"Source"},"tag_key":{"type":"string","title":"Tag Key"},"tag_value":{"type":"string","title":"Tag Value"},"case_sensitive":{"type":"boolean","title":"Case Sensitive"},"allow_resource_override":{"type":"boolean","title":"Allow Resource Override"}},"type":"object","required":["name","source","tag_key","tag_value","case_sensitive","allow_resource_override"],"title":"EnvironmentTag"},"title":"Response List Tags For Environment Api Environments Tags Get"}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"properties":{"detail":{"items":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"}}}}}}}}}
```

## Assign Tag To Environment

> Associate a tag key/value pair with an environment

OpenAPI:

```json
{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"security":[{"HTTPBearer":[]}],"components":{"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}},"paths":{"/api/environments/tag":{"post":{"tags":["environments"],"summary":"Assign Tag To Environment","description":"Associate a tag key/value pair with an environment","operationId":"assign_tag_to_environment_api_environments_tag_post","requestBody":{"content":{"application/json":{"schema":{"properties":{"name":{"type":"string","enum":["Corporate","Development","Disaster Recovery","Production","Sandbox","Staging","Test","Unassigned"],"title":"Name"},"source":{"type":"string","enum":["aws","azure","gcp","k8s"],"title":"Source"},"tag_key":{"type":"string","title":"Tag Key"},"tag_value":{"type":"string","title":"Tag Value"},"case_sensitive":{"type":"boolean","title":"Case Sensitive"},"allow_resource_override":{"type":"boolean","title":"Allow Resource Override"}},"type":"object","required":["name","source","tag_key","tag_value","case_sensitive","allow_resource_override"],"title":"EnvironmentTag"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"properties":{"ok":{"type":"boolean","title":"Ok"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["ok"],"title":"Status"}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"properties":{"detail":{"items":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"}}}}}}}}}
```

## DELETE /api/environments/tag/unassign

> Unassign Tag

OpenAPI:

```json
{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"security":[{"HTTPBearer":[]}],"components":{"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}},"paths":{"/api/environments/tag/unassign":{"delete":{"tags":["environments"],"summary":"Unassign Tag","operationId":"unassign_tag_api_environments_tag_unassign_delete","parameters":[{"name":"tag_key","in":"query","required":true,"schema":{"type":"string","title":"Tag Key"}},{"name":"tag_value","in":"query","required":true,"schema":{"type":"string","title":"Tag Value"}},{"name":"source","in":"query","required":true,"schema":{"enum":["aws","azure","gcp","k8s"],"type":"string","title":"Source"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"properties":{"ok":{"type":"boolean","title":"Ok"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["ok"],"title":"Status"}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"properties":{"detail":{"items":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"}}}}}}}}}
```

## GET /api/environments/task\_statuses/active

> List Active Task Status

OpenAPI:

```json
{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"security":[{"HTTPBearer":[]}],"components":{"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}},"paths":{"/api/environments/task_statuses/active":{"get":{"tags":["environments"],"summary":"List Active Task Status","operationId":"list_active_task_status_api_environments_task_statuses_active_get","parameters":[{"name":"task_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Task Type"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"properties":{"task_type":{"type":"string","title":"Task Type"},"task_id":{"type":"string","title":"Task Id"},"exectuor":{"type":"string","title":"Exectuor"},"status":{"type":"string","title":"Status"},"progress":{"type":"string","title":"Progress"},"execution_id":{"type":"string","title":"Execution Id"},"start_time":{"type":"string","format":"date-time","title":"Start Time"}},"type":"object","required":["task_type","task_id","exectuor","status","progress","execution_id","start_time"],"title":"TaskStatusModel"},"title":"Response List Active Task Status Api Environments Task Statuses Active Get"}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"properties":{"detail":{"items":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"}}}}}}}}}
```
