CorefinityCorefinityDocs
Open the Control PanelControl Panel
Enterprise copies · 2 of 5

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.

GET/api/enterprise-copies/preview

Query parameters

enterprise_env_idintegerRequired

The id of the CoreStack Enterprise environment to copy from. An id above 2147483647 is refused 422.

target_site_idintegerRequired

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
previewobjectRequired
Fields
blockersarray of objectsRequired

Every reason the copy cannot start now, in the order a start checks them.

Fields of each item
messagestringRequired
reasonstringRequired

The stable code a start refuses with.

can_copybooleanRequired

True when blockers is empty.

confirmstringRequired

The value to send as confirm_target_site.

copy_ofinteger or nullRequired

Always null on a preview.

sourceobjectRequired

The environment, as this preview read it.

Fields
environment_idintegerRequired

At least 1.

namestringRequired
platformstring or nullRequired

The application the environment runs, such as magento2. Null when it could not be read.

sizesobjectRequired
Fields
db_bytesinteger or nullRequired
files_bytesinteger or nullRequired
versionsobjectRequired
Fields
mariadbstring or nullRequired
phpstring or nullRequired
website_idintegerRequired

At least 1.

targetobjectRequired

The site the copy would replace.

Fields
cluster_idintegerRequired

At least 1.

domainstringRequired
mariadb_versionstring or nullRequired
namestringRequired

The site's name, which confirm_target_site must equal.

platformstringRequired
site_idintegerRequired

At least 1.

warningsarray of stringsRequired

What to know before copying. None of these stops the copy.

If it is refused

StatusReasonWhat to do
401noneSend a valid token as Authorization: Bearer <token>.
403scope_requiredUse a token with the scope named in scope.
404noneCheck the id. You see only what your account can reach.
422invalidFix the field named in field; errors says why.
429rate_limitedWait 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"
{
  "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": []
  }
}
Try it
Held in this tab's memory only. Never stored or sent to us.

Use a token with only the read scope. How to make one

Was this helpful?
Open in ClaudeOpen in ChatGPT