Get an environment's deployment settings
Answers how the environment deploys: whether its pipeline is on, its deployment source, whether a push deploys on its own, and each of its pipelines with its folders and build switches.
Path parameters
The id of a CoreStack Enterprise environment. Not the same number as a site row id. At least 1.
Returns
200 The deployment settings.
Fields of the 200 answer
Fields
Where deployments come from.
manualsftpgitnullThe sources the environment may be set to. sftp is listed only for an environment that still uses it.
manualsftpgitThe environment's id.
automatic deploys every push on its own. manual leaves each push waiting to be deployed. Null unless the pipeline is on and the source is git.
manualautomaticnullWhether the deployment pipeline is on.
Fields of each item
Whether you may change the pipeline's build switches.
Whether you may change the pipeline's folders.
Whether a build keeps its own var folder. Null on a pipeline it does not apply to.
What to know about the build switches as they are set. Empty when nothing.
Whether scheduled tasks pause while a build runs. Null on a pipeline it does not apply to.
The pipeline's web folder.
The pipeline's storage folder.
How many repositories the environment has.
If it is refused
| Status | Reason | What to do |
|---|---|---|
401 | none | Send a valid token as Authorization: Bearer <token>. |
403 | scope_required | Use a token with the scope named in scope. |
404 | none | Check the id. You see only what your account can reach. |
422 | invalid | Fix the field named in field; errors says why. |
429 | rate_limited | Wait for the seconds in Retry-After. |
Reasons are listed by name in Errors and refusals.
The same task elsewhere
curl https://manage.corefinity.com/api/environments/1311/deployment-settings \
-H "Authorization: Bearer $COREFINITY_TOKEN" \
-H "Accept: application/json"use Illuminate\Support\Facades\Http;
$response = Http::withToken(env('COREFINITY_TOKEN'))
->acceptJson()
->get('https://manage.corefinity.com/api/environments/1311/deployment-settings');
$data = $response->json();const res = await fetch('https://manage.corefinity.com/api/environments/1311/deployment-settings', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.COREFINITY_TOKEN}`,
Accept: 'application/json',
},
});
// An answer with no body (204) has nothing to parse.
const text = await res.text();
const data = text && JSON.parse(text);import os
import requests
res = requests.get(
"https://manage.corefinity.com/api/environments/1311/deployment-settings",
headers={
"Authorization": f"Bearer {os.environ['COREFINITY_TOKEN']}",
"Accept": "application/json",
},
)
data = res.json() if res.content else None{
"deployment_settings": {
"deployment_source": "git",
"deployment_sources": [
"manual",
"git"
],
"enterprise_env_id": 1311,
"git_deploys": "manual",
"pipeline_enabled": true,
"pipelines": [
{
"build_switches_editable": false,
"folders_editable": true,
"isolate_build_var": null,
"name": "Storefront (Wordpress)",
"notes": [],
"pause_crons_during_build": null,
"pipeline_id": 2210,
"root_directory": "/var/www/harbourandfinch.example.com/",
"root_storage": "/var/www/harbourandfinch.example.com/shared/"
}
],
"repositories": 1
}
}{
"message": "Unauthenticated."
}{
"code": "scope_required",
"message": "This access token does not have the destructive scope this needs. Use a token with the destructive scope.",
"reason": "scope_required",
"scope": "destructive"
}{
"message": "Not found."
}{
"code": "invalid",
"errors": {
"environment": [
"This is a CoreStack or CoreCluster environment: name it by its site_id."
]
},
"field": "environment",
"message": "This is a CoreStack or CoreCluster environment: name it by its site_id.",
"reason": "invalid"
}{
"code": "rate_limited",
"message": "Too many requests. Try again in 60 seconds.",
"reason": "rate_limited",
"retry_after_seconds": 60
}