Accept a carried-over pipeline
Decides the carried-over lines of one pipeline and turns it into a three-stage pipeline. Each line that needs a look is accepted, removed or edited; lines [] accepts the translation as it is, once no line needs a look. Your role needs the Edit Environment Deployment Pipeline permission.
- Needs
execas well: An edit brings new text.
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
At least 1.
A decision for each line that needs a look, named by its stage and index as the read answers them. An empty list accepts the translation as it is. Up to 600 items.
Fields of each item
acceptremoveeditAt least 0.
builddatabasepost_deployWith edit, the new line. Up to 4,096 characters.
The pipeline's revision from the read. Leave it out while that is null.
Returns
200 What was carried over, with the pipeline now accepted.
Fields of the 200 answer
Each carried-over pipeline, with its translated lines and whether it is accepted.
Fields of each item
Settings the translation made, in words.
Fields of each item
What the translation did with the line, such as kept, rewritten or removed.
Why the line needs a look.
The lines it became, each with its stage.
The line's stage and index, which a decision names it by.
Fields
The command as it was carried over.
The repository the pipeline deploys from.
Send this with the accept when it is not null.
needs_review while a line needs a look, accepted once the pipeline has been accepted.
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. |
409 | not_available | The tool does not apply to this object. |
422 | invalid | Fix the field named in field; errors says why. |
422 | line_credentials | This line holds a credential. Move this value into a variable, then save again. |
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 POST https://manage.corefinity.com/api/corestack/sites/1042/deployments/carried-over/accept \
-H "Authorization: Bearer $COREFINITY_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"binding_id": 2210,
"lines": [
{
"action": "remove",
"index": 1,
"stage": "build"
}
]
}'use Illuminate\Support\Facades\Http;
$response = Http::withToken(env('COREFINITY_TOKEN'))
->acceptJson()
->post('https://manage.corefinity.com/api/corestack/sites/1042/deployments/carried-over/accept', [
'binding_id' => 2210,
'lines' => [
[
'action' => 'remove',
'index' => 1,
'stage' => 'build',
],
],
]);
$data = $response->json();const res = await fetch('https://manage.corefinity.com/api/corestack/sites/1042/deployments/carried-over/accept', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.COREFINITY_TOKEN}`,
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
binding_id: 2210,
lines: [
{
action: 'remove',
index: 1,
stage: 'build',
},
],
}),
});
// 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.post(
"https://manage.corefinity.com/api/corestack/sites/1042/deployments/carried-over/accept",
headers={
"Authorization": f"Bearer {os.environ['COREFINITY_TOKEN']}",
"Accept": "application/json",
},
json={
"binding_id": 2210,
"lines": [
{
"action": "remove",
"index": 1,
"stage": "build",
},
],
},
)
data = res.json() if res.content else None{
"attention_id": "deploy_pipeline_carried:1042",
"auto_deploy": false,
"bindings": [
{
"also_set": [
"Maintenance page: off"
],
"binding_id": 2210,
"label": "Default pipeline",
"lines": [
{
"change": "kept",
"needs_review": false,
"result": [
{
"stage": "build",
"text": "composer install --no-dev"
}
],
"source": {
"index": 0,
"stage": "build"
},
"text": "composer install --no-dev"
},
{
"change": "removed",
"needs_review": false,
"reason": "Copies from the old server need a look",
"result": [],
"source": {
"index": 1,
"stage": "build"
},
"text": "scp [email protected]:/var/www/media.tgz ."
}
],
"rehearsal": null,
"repository": {
"branch": "main",
"provider": "gitlab",
"repo": "northwind-digital/harbourandfinch"
},
"revision": "e64e702d17d85dd8",
"state": "accepted"
}
],
"files_mode": false,
"moved_at": null
}{
"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": {
"lines.0": [
"An edit needs its new text, on one line."
]
},
"field": "lines.0",
"message": "An edit needs its new text, on one line.",
"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.