Review a Pipeline's Stages
curl --request POST \
--url https://api.monaco.com/v1/pipelines/{pipeline_id}/stages/review \
--header 'Content-Type: application/json' \
--data '
{
"config_version": "3f2a9c1b7d4e8a60",
"stages": [
{
"display_name": "Security Review",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"key": "security_review",
"description": "<string>",
"allow_automatic_entry": true,
"allow_automatic_exit": true
}
],
"deletions": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"remap_to_key": "negotiation"
}
]
}
'import requests
url = "https://api.monaco.com/v1/pipelines/{pipeline_id}/stages/review"
payload = {
"config_version": "3f2a9c1b7d4e8a60",
"stages": [
{
"display_name": "Security Review",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"key": "security_review",
"description": "<string>",
"allow_automatic_entry": True,
"allow_automatic_exit": True
}
],
"deletions": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"remap_to_key": "negotiation"
}
]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
config_version: '3f2a9c1b7d4e8a60',
stages: [
{
display_name: 'Security Review',
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
key: 'security_review',
description: '<string>',
allow_automatic_entry: true,
allow_automatic_exit: true
}
],
deletions: [{id: '3c90c3cc-0d44-4b50-8888-8dd25736052a', remap_to_key: 'negotiation'}]
})
};
fetch('https://api.monaco.com/v1/pipelines/{pipeline_id}/stages/review', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.monaco.com/v1/pipelines/{pipeline_id}/stages/review",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'config_version' => '3f2a9c1b7d4e8a60',
'stages' => [
[
'display_name' => 'Security Review',
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'key' => 'security_review',
'description' => '<string>',
'allow_automatic_entry' => true,
'allow_automatic_exit' => true
]
],
'deletions' => [
[
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'remap_to_key' => 'negotiation'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.monaco.com/v1/pipelines/{pipeline_id}/stages/review"
payload := strings.NewReader("{\n \"config_version\": \"3f2a9c1b7d4e8a60\",\n \"stages\": [\n {\n \"display_name\": \"Security Review\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"key\": \"security_review\",\n \"description\": \"<string>\",\n \"allow_automatic_entry\": true,\n \"allow_automatic_exit\": true\n }\n ],\n \"deletions\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"remap_to_key\": \"negotiation\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.monaco.com/v1/pipelines/{pipeline_id}/stages/review")
.header("Content-Type", "application/json")
.body("{\n \"config_version\": \"3f2a9c1b7d4e8a60\",\n \"stages\": [\n {\n \"display_name\": \"Security Review\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"key\": \"security_review\",\n \"description\": \"<string>\",\n \"allow_automatic_entry\": true,\n \"allow_automatic_exit\": true\n }\n ],\n \"deletions\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"remap_to_key\": \"negotiation\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.monaco.com/v1/pipelines/{pipeline_id}/stages/review")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"config_version\": \"3f2a9c1b7d4e8a60\",\n \"stages\": [\n {\n \"display_name\": \"Security Review\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"key\": \"security_review\",\n \"description\": \"<string>\",\n \"allow_automatic_entry\": true,\n \"allow_automatic_exit\": true\n }\n ],\n \"deletions\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"remap_to_key\": \"negotiation\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"config_version": "<string>",
"stage_guidance": [
{
"index": 123,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"display_name": "<string>",
"result": "recommendation",
"proposed_description": "<string>",
"rationale": "<string>",
"suggested_stage_group": "pre_pipeline"
}
],
"ordering": {
"result": "not_needed",
"explanation": "<string>",
"misplaced_stages": [
{
"index": 123,
"display_name": "<string>",
"explanation": "<string>"
}
],
"suggested_order": [
{
"index": 123,
"display_name": "<string>",
"stage_group": "pre_pipeline"
}
]
}
},
"meta": {
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "not_found",
"message": "Resource not found",
"data": {}
}
}Pipelines
Review a Pipeline's Stages
Checks a proposed stage list, in the body update_pipeline_stages takes, without changing anything. Active stages that are new or whose name or description changed get a description check with a suggested description and stage group. When active stages were added, removed, moved or redefined and automatic stage updates are on, the order is checked and a corrected order may be suggested. Requires an admin.
POST
/
v1
/
pipelines
/
{pipeline_id}
/
stages
/
review
Review a Pipeline's Stages
curl --request POST \
--url https://api.monaco.com/v1/pipelines/{pipeline_id}/stages/review \
--header 'Content-Type: application/json' \
--data '
{
"config_version": "3f2a9c1b7d4e8a60",
"stages": [
{
"display_name": "Security Review",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"key": "security_review",
"description": "<string>",
"allow_automatic_entry": true,
"allow_automatic_exit": true
}
],
"deletions": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"remap_to_key": "negotiation"
}
]
}
'import requests
url = "https://api.monaco.com/v1/pipelines/{pipeline_id}/stages/review"
payload = {
"config_version": "3f2a9c1b7d4e8a60",
"stages": [
{
"display_name": "Security Review",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"key": "security_review",
"description": "<string>",
"allow_automatic_entry": True,
"allow_automatic_exit": True
}
],
"deletions": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"remap_to_key": "negotiation"
}
]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
config_version: '3f2a9c1b7d4e8a60',
stages: [
{
display_name: 'Security Review',
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
key: 'security_review',
description: '<string>',
allow_automatic_entry: true,
allow_automatic_exit: true
}
],
deletions: [{id: '3c90c3cc-0d44-4b50-8888-8dd25736052a', remap_to_key: 'negotiation'}]
})
};
fetch('https://api.monaco.com/v1/pipelines/{pipeline_id}/stages/review', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.monaco.com/v1/pipelines/{pipeline_id}/stages/review",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'config_version' => '3f2a9c1b7d4e8a60',
'stages' => [
[
'display_name' => 'Security Review',
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'key' => 'security_review',
'description' => '<string>',
'allow_automatic_entry' => true,
'allow_automatic_exit' => true
]
],
'deletions' => [
[
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'remap_to_key' => 'negotiation'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.monaco.com/v1/pipelines/{pipeline_id}/stages/review"
payload := strings.NewReader("{\n \"config_version\": \"3f2a9c1b7d4e8a60\",\n \"stages\": [\n {\n \"display_name\": \"Security Review\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"key\": \"security_review\",\n \"description\": \"<string>\",\n \"allow_automatic_entry\": true,\n \"allow_automatic_exit\": true\n }\n ],\n \"deletions\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"remap_to_key\": \"negotiation\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.monaco.com/v1/pipelines/{pipeline_id}/stages/review")
.header("Content-Type", "application/json")
.body("{\n \"config_version\": \"3f2a9c1b7d4e8a60\",\n \"stages\": [\n {\n \"display_name\": \"Security Review\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"key\": \"security_review\",\n \"description\": \"<string>\",\n \"allow_automatic_entry\": true,\n \"allow_automatic_exit\": true\n }\n ],\n \"deletions\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"remap_to_key\": \"negotiation\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.monaco.com/v1/pipelines/{pipeline_id}/stages/review")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"config_version\": \"3f2a9c1b7d4e8a60\",\n \"stages\": [\n {\n \"display_name\": \"Security Review\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"key\": \"security_review\",\n \"description\": \"<string>\",\n \"allow_automatic_entry\": true,\n \"allow_automatic_exit\": true\n }\n ],\n \"deletions\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"remap_to_key\": \"negotiation\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"config_version": "<string>",
"stage_guidance": [
{
"index": 123,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"display_name": "<string>",
"result": "recommendation",
"proposed_description": "<string>",
"rationale": "<string>",
"suggested_stage_group": "pre_pipeline"
}
],
"ordering": {
"result": "not_needed",
"explanation": "<string>",
"misplaced_stages": [
{
"index": 123,
"display_name": "<string>",
"explanation": "<string>"
}
],
"suggested_order": [
{
"index": 123,
"display_name": "<string>",
"stage_group": "pre_pipeline"
}
]
}
},
"meta": {
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "not_found",
"message": "Resource not found",
"data": {}
}
}Body
application/json
The pipeline's complete stage list.
Stages are ordered by stage group, then by their order in stages. Every existing
stage must appear in stages or in deletions.