Preview an Enterprise copy
Answers whether the environment can be copied into the site now, every reason it cannot (blockers, the first being the one a start refuses with), what to know first (warnings) and the value to send as confirm_target_site. It reads the environment and writes nothing.
Query parameters
The id of the CoreStack Enterprise environment to copy from. An id above 2147483647 is refused 422.
The site row id of the CoreCluster site to copy into. An id above 2147483647 is refused 422.
Returns
200 The preview. can_copy is false while blockers lists anything.
Fields of the 200 answer
Fields
Every reason the copy cannot start now, in the order a start checks them.
Fields of each item
The stable code a start refuses with.
True when blockers is empty.
The value to send as confirm_target_site.
Always null on a preview.
The environment, as this preview read it.
Fields
At least 1.
The application the environment runs, such as magento2. Null when it could not be read.
Fields
Fields
At least 1.
The site the copy would replace.
Fields
At least 1.
The site's name, which confirm_target_site must equal.
At least 1.
What to know before copying. None of these stops the copy.
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/enterprise-copies/preview?enterprise_env_id=1312&target_site_id=1043' \
-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/enterprise-copies/preview?enterprise_env_id=1312&target_site_id=1043');
$data = $response->json();const res = await fetch('https://manage.corefinity.com/api/enterprise-copies/preview?enterprise_env_id=1312&target_site_id=1043', {
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/enterprise-copies/preview?enterprise_env_id=1312&target_site_id=1043",
headers={
"Authorization": f"Bearer {os.environ['COREFINITY_TOKEN']}",
"Accept": "application/json",
},
)
data = res.json() if res.content else None{
"preview": {
"blockers": [
{
"message": "This site's scheduled tasks are on: switch them off before copying into it.",
"reason": "target_crons_on"
}
],
"can_copy": false,
"confirm": "harbourandfinch-example-com-staging",
"copy_of": null,
"source": {
"environment_id": 1312,
"name": "Staging",
"platform": "magento2",
"sizes": {
"db_bytes": 10737418240,
"files_bytes": 32212254720
},
"versions": {
"mariadb": "10.6.21-MariaDB-ubu2004",
"php": "8.1.27"
},
"website_id": 1310
},
"target": {
"cluster_id": 1017,
"domain": "staging.harbourandfinch.example.com",
"mariadb_version": "10.6",
"name": "harbourandfinch-example-com-staging",
"platform": "magento2",
"site_id": 1043
},
"warnings": []
}
}{
"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": {
"enterprise_env_id": [
"The enterprise env id field is required."
]
},
"field": "enterprise_env_id",
"message": "The enterprise env id field is required.",
"reason": "invalid"
}{
"code": "rate_limited",
"message": "Too many requests. Try again in 60 seconds.",
"reason": "rate_limited",
"retry_after_seconds": 60
}