Update a site's deployment options
Changes the deployment options you send and keeps the rest: the extra paths kept between releases, the paths a build may read, the check before the switch, the warm-up and the cache purges. A list is sent whole and replaces the saved one. Your role needs the Edit Environment Deployment Pipeline permission.
Path parameters
The id of a site row. A website's production site and each of its environments has its own id. Digits only. At least 1.
Body
The whole list of paths a build may read from the live site, at most 50, each named once.
Purge Cloudflare's cache after the switch.
The whole list of extra paths kept between releases, at most 50, each named once: a folder's path, or {path, kind}. No path may equal, hold or sit inside another, or one the platform itself keeps (platform_shared in the answer).
Fields of an item given as an object
A folder (dir, the default) or a file.
dirfileA path inside the site, relative to its root: no leading slash, no . or .. segment, of letters, digits and . _ / @ + -, at most 255 characters.
Where the path's data is kept between releases, relative to the shared folder. Leave it out to keep the saved place, or the default for a new path.
Check the new release answers before visitors are switched to it. Off (false), on (true), or on with up to five paths to request.
Magento 2 only.
Magento 2 only. Purge Varnish after the switch.
Request pages of the new release before the switch. Off (false), on (true), or on with up to ten paths to request.
Returns
200 The deployment options after the change.
Fields of the 200 answer
Fields of each item
dirfileA path relative to the site's root. Up to 255 characters.
Where the path's data is kept between releases, relative to the shared folder, when that is not the default.
Laravel only, read only. The environment's own switch, which a pipeline whose run_migrations is null follows. Null on every other platform.
The paths the platform itself keeps between releases.
Fields of each item
dirfileA path relative to the site's root. Up to 255 characters.
Where the path's data is kept between releases, relative to the shared folder, when that is not the default.
Off (false), on (true), or on with the paths to request.
Magento 2 only. Whether Varnish is purged after the switch.
Off (false), on (true), or on with the paths to request.
If it is refused
| Status | Reason | What to do |
|---|---|---|
401 | none | Send a valid token as Authorization: Bearer <token>. |
403 | company_unavailable | Your company is unavailable. |
403 | scope_required | Use a token with the scope named in scope. |
403 | forbidden | The person is not allowed to do this. |
403 | two_factor_required | Turn on two-factor on your account, then send again. |
404 | feature_off | This feature is not on for your organisation yet. |
409 | managed_elsewhere | This site is read-only here. Change it in the control panel that manages it. |
422 | invalid | Fix the field named in field; errors says why. |
422 | wrong_platform | This is not available for the site's platform. Use it on a site of the platform it is for. |
429 | rate_limited | Wait for the seconds in Retry-After. |
Reasons are listed by name in Errors and refusals.
The same task elsewhere
curl -X PUT https://manage.corefinity.com/api/corestack/sites/1042/deployments/options \
-H "Authorization: Bearer $COREFINITY_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"cloudflare_purge": false,
"extra_shared_paths": [
"public/uploads",
"var/exports"
]
}'use Illuminate\Support\Facades\Http;
$response = Http::withToken(env('COREFINITY_TOKEN'))
->acceptJson()
->put('https://manage.corefinity.com/api/corestack/sites/1042/deployments/options', [
'cloudflare_purge' => false,
'extra_shared_paths' => [
'public/uploads',
'var/exports',
],
]);
$data = $response->json();const res = await fetch('https://manage.corefinity.com/api/corestack/sites/1042/deployments/options', {
method: 'PUT',
headers: {
Authorization: `Bearer ${process.env.COREFINITY_TOKEN}`,
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
cloudflare_purge: false,
extra_shared_paths: [
'public/uploads',
'var/exports',
],
}),
});
// 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.put(
"https://manage.corefinity.com/api/corestack/sites/1042/deployments/options",
headers={
"Authorization": f"Bearer {os.environ['COREFINITY_TOKEN']}",
"Accept": "application/json",
},
json={
"cloudflare_purge": False,
"extra_shared_paths": [
"public/uploads",
"var/exports",
],
},
)
data = res.json() if res.content else None{
"build_reads": [],
"cloudflare_purge": false,
"extra_shared_paths": [
{
"kind": "dir",
"path": "public/uploads"
},
{
"kind": "dir",
"path": "var/exports"
}
],
"migrate": false,
"platform_shared": [
{
"kind": "dir",
"path": "storage"
},
{
"kind": "file",
"path": ".env"
}
],
"pre_switch_check": false,
"snapshot_before_upgrade": false,
"warm_up": false
}{
"message": "Unauthenticated."
}{
"code": "company_unavailable",
"message": "Your company is unavailable.",
"reason": "company_unavailable"
}{
"code": "feature_off",
"message": "Not found.",
"reason": "feature_off"
}{
"code": "managed_elsewhere",
"message": "This site is managed by another control panel",
"reason": "managed_elsewhere"
}{
"code": "invalid",
"errors": {
"build_reads": [
"Enter at most 50 paths."
]
},
"field": "build_reads",
"message": "Enter at most 50 paths.",
"reason": "invalid"
}{
"code": "rate_limited",
"message": "Too many requests. Try again in 60 seconds.",
"reason": "rate_limited",
"retry_after_seconds": 60
}Try it is off for this endpointIt overwrites data that cannot be brought back. Copy the request and run it yourself when you are sure.