Replace a bundle's primary policy with a different policy
curl --request POST \
--url https://mycluster.domino.tech/api/governance/v1/rpc/replace-bundle-primary-policy \
--header 'Content-Type: application/json' \
--data '
{
"bundleId": "<string>",
"newPolicyId": "<string>",
"disableOldPolicy": true
}
'import requests
url = "https://mycluster.domino.tech/api/governance/v1/rpc/replace-bundle-primary-policy"
payload = {
"bundleId": "<string>",
"newPolicyId": "<string>",
"disableOldPolicy": True
}
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({bundleId: '<string>', newPolicyId: '<string>', disableOldPolicy: true})
};
fetch('https://mycluster.domino.tech/api/governance/v1/rpc/replace-bundle-primary-policy', 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://mycluster.domino.tech/api/governance/v1/rpc/replace-bundle-primary-policy",
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([
'bundleId' => '<string>',
'newPolicyId' => '<string>',
'disableOldPolicy' => true
]),
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://mycluster.domino.tech/api/governance/v1/rpc/replace-bundle-primary-policy"
payload := strings.NewReader("{\n \"bundleId\": \"<string>\",\n \"newPolicyId\": \"<string>\",\n \"disableOldPolicy\": true\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://mycluster.domino.tech/api/governance/v1/rpc/replace-bundle-primary-policy")
.header("Content-Type", "application/json")
.body("{\n \"bundleId\": \"<string>\",\n \"newPolicyId\": \"<string>\",\n \"disableOldPolicy\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mycluster.domino.tech/api/governance/v1/rpc/replace-bundle-primary-policy")
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 \"bundleId\": \"<string>\",\n \"newPolicyId\": \"<string>\",\n \"disableOldPolicy\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"attachments": [
{
"approvalTimelineMap": {},
"createdAt": "<string>",
"createdBy": {},
"id": "<string>",
"identifier": {}
}
],
"classificationValue": "<string>",
"commentsCount": 123,
"createdAt": "<string>",
"createdBy": {},
"currentStageInfo": {
"openFindingsCount": 123,
"pendingApprovalsCount": 123
},
"enforcedPolicyIds": [
"<string>"
],
"evidenceRestricted": true,
"gates": [
{
"approvals": [
{
"id": "<string>",
"name": "<string>",
"stageApprovalId": "<string>"
}
],
"bundleId": "<string>",
"id": "<string>",
"isOpen": true,
"name": "<string>",
"policyGateId": "<string>",
"policyId": "<string>",
"policyVersionId": "<string>",
"reason": "<string>",
"resources": [
{
"failOpen": true,
"parameters": {}
}
]
}
],
"hasRevalidationSchedule": true,
"name": "<string>",
"policies": [
{
"allowProjectApprovers": true,
"bundleId": "<string>",
"classificationValue": "<string>",
"compliantToCurrentStage": true,
"createdAt": "<string>",
"deactivatedAt": "<string>",
"enforceSequentialOrder": true,
"hasRevalidationSchedule": true,
"isLatestVersion": true,
"isPolicyArchived": true,
"policyId": "<string>",
"policyName": "<string>",
"policyVersion": "<string>",
"policyVersionId": "<string>",
"stage": "<string>",
"stageAssignee": {
"id": "<string>",
"name": "<string>"
},
"upgradeRequired": true
}
],
"policyId": "<string>",
"policyName": "<string>",
"policyVersion": "<string>",
"policyVersionId": "<string>",
"projectId": "<string>",
"projectName": "<string>",
"projectOwner": "<string>",
"stage": "<string>",
"stageApprovals": [
{
"approvers": [
{
"editable": true,
"id": "<string>",
"name": "<string>",
"showByDefault": true,
"fromOrganizationUserId": "<string>",
"isOrganizationUser": true
}
],
"evidence": {
"artifacts": [
{
"details": {},
"id": "<string>",
"policyEntityId": "<string>",
"required": true,
"visibilityRule": "<string>",
"visible": true
}
],
"createdAt": "<string>",
"description": "<string>",
"externalId": "<string>",
"id": "<string>",
"name": "<string>",
"policyId": "<string>",
"policyVersionId": "<string>",
"visible": true
},
"id": "<string>",
"name": "<string>",
"policyEntityId": "<string>",
"revalidationConfig": {
"openWindowDaysBefore": 2,
"recurring": {
"every": 2,
"startDate": "<string>"
}
}
}
],
"stageAssignee": {
"id": "<string>",
"name": "<string>"
},
"stages": [
{
"assignedAt": "<string>",
"assignee": {
"id": "<string>",
"name": "<string>"
},
"bundleId": "<string>",
"stage": {
"approvals": [
{
"approvers": [
{
"editable": true,
"id": "<string>",
"name": "<string>",
"showByDefault": true,
"fromOrganizationUserId": "<string>",
"isOrganizationUser": true
}
],
"evidence": {
"artifacts": [
{
"details": {},
"id": "<string>",
"policyEntityId": "<string>",
"required": true,
"visibilityRule": "<string>",
"visible": true
}
],
"createdAt": "<string>",
"description": "<string>",
"externalId": "<string>",
"id": "<string>",
"name": "<string>",
"policyId": "<string>",
"policyVersionId": "<string>",
"visible": true
},
"id": "<string>",
"name": "<string>",
"policyEntityId": "<string>",
"revalidationConfig": {
"openWindowDaysBefore": 2,
"recurring": {
"every": 2,
"startDate": "<string>"
}
}
}
],
"evidenceSet": [
{
"artifacts": [
{
"details": {},
"id": "<string>",
"policyEntityId": "<string>",
"required": true,
"visibilityRule": "<string>",
"visible": true
}
],
"createdAt": "<string>",
"description": "<string>",
"externalId": "<string>",
"id": "<string>",
"name": "<string>",
"policyId": "<string>",
"policyVersionId": "<string>",
"visible": true
}
],
"id": "<string>",
"name": "<string>",
"notifyOnTransition": true,
"policyEntityId": "<string>",
"policyVersionId": "<string>"
},
"stageId": "<string>"
}
]
}{
"code": "BUNDLE_REQUIRES_POLICY",
"message": "<string>"
}{
"code": "BUNDLE_REQUIRES_POLICY",
"message": "<string>"
}{
"code": "BUNDLE_REQUIRES_POLICY",
"message": "<string>"
}{
"code": "BUNDLE_REQUIRES_POLICY",
"message": "<string>"
}{
"code": "BUNDLE_REQUIRES_POLICY",
"message": "<string>"
}bundles
Replace a bundle's primary policy with a different policy
Replaces the bundle’s primary policy with a completely different policy. Set disableOldPolicy=true to deactivate the old primary (default: false).
POST
/
api
/
governance
/
v1
/
rpc
/
replace-bundle-primary-policy
Replace a bundle's primary policy with a different policy
curl --request POST \
--url https://mycluster.domino.tech/api/governance/v1/rpc/replace-bundle-primary-policy \
--header 'Content-Type: application/json' \
--data '
{
"bundleId": "<string>",
"newPolicyId": "<string>",
"disableOldPolicy": true
}
'import requests
url = "https://mycluster.domino.tech/api/governance/v1/rpc/replace-bundle-primary-policy"
payload = {
"bundleId": "<string>",
"newPolicyId": "<string>",
"disableOldPolicy": True
}
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({bundleId: '<string>', newPolicyId: '<string>', disableOldPolicy: true})
};
fetch('https://mycluster.domino.tech/api/governance/v1/rpc/replace-bundle-primary-policy', 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://mycluster.domino.tech/api/governance/v1/rpc/replace-bundle-primary-policy",
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([
'bundleId' => '<string>',
'newPolicyId' => '<string>',
'disableOldPolicy' => true
]),
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://mycluster.domino.tech/api/governance/v1/rpc/replace-bundle-primary-policy"
payload := strings.NewReader("{\n \"bundleId\": \"<string>\",\n \"newPolicyId\": \"<string>\",\n \"disableOldPolicy\": true\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://mycluster.domino.tech/api/governance/v1/rpc/replace-bundle-primary-policy")
.header("Content-Type", "application/json")
.body("{\n \"bundleId\": \"<string>\",\n \"newPolicyId\": \"<string>\",\n \"disableOldPolicy\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mycluster.domino.tech/api/governance/v1/rpc/replace-bundle-primary-policy")
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 \"bundleId\": \"<string>\",\n \"newPolicyId\": \"<string>\",\n \"disableOldPolicy\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"attachments": [
{
"approvalTimelineMap": {},
"createdAt": "<string>",
"createdBy": {},
"id": "<string>",
"identifier": {}
}
],
"classificationValue": "<string>",
"commentsCount": 123,
"createdAt": "<string>",
"createdBy": {},
"currentStageInfo": {
"openFindingsCount": 123,
"pendingApprovalsCount": 123
},
"enforcedPolicyIds": [
"<string>"
],
"evidenceRestricted": true,
"gates": [
{
"approvals": [
{
"id": "<string>",
"name": "<string>",
"stageApprovalId": "<string>"
}
],
"bundleId": "<string>",
"id": "<string>",
"isOpen": true,
"name": "<string>",
"policyGateId": "<string>",
"policyId": "<string>",
"policyVersionId": "<string>",
"reason": "<string>",
"resources": [
{
"failOpen": true,
"parameters": {}
}
]
}
],
"hasRevalidationSchedule": true,
"name": "<string>",
"policies": [
{
"allowProjectApprovers": true,
"bundleId": "<string>",
"classificationValue": "<string>",
"compliantToCurrentStage": true,
"createdAt": "<string>",
"deactivatedAt": "<string>",
"enforceSequentialOrder": true,
"hasRevalidationSchedule": true,
"isLatestVersion": true,
"isPolicyArchived": true,
"policyId": "<string>",
"policyName": "<string>",
"policyVersion": "<string>",
"policyVersionId": "<string>",
"stage": "<string>",
"stageAssignee": {
"id": "<string>",
"name": "<string>"
},
"upgradeRequired": true
}
],
"policyId": "<string>",
"policyName": "<string>",
"policyVersion": "<string>",
"policyVersionId": "<string>",
"projectId": "<string>",
"projectName": "<string>",
"projectOwner": "<string>",
"stage": "<string>",
"stageApprovals": [
{
"approvers": [
{
"editable": true,
"id": "<string>",
"name": "<string>",
"showByDefault": true,
"fromOrganizationUserId": "<string>",
"isOrganizationUser": true
}
],
"evidence": {
"artifacts": [
{
"details": {},
"id": "<string>",
"policyEntityId": "<string>",
"required": true,
"visibilityRule": "<string>",
"visible": true
}
],
"createdAt": "<string>",
"description": "<string>",
"externalId": "<string>",
"id": "<string>",
"name": "<string>",
"policyId": "<string>",
"policyVersionId": "<string>",
"visible": true
},
"id": "<string>",
"name": "<string>",
"policyEntityId": "<string>",
"revalidationConfig": {
"openWindowDaysBefore": 2,
"recurring": {
"every": 2,
"startDate": "<string>"
}
}
}
],
"stageAssignee": {
"id": "<string>",
"name": "<string>"
},
"stages": [
{
"assignedAt": "<string>",
"assignee": {
"id": "<string>",
"name": "<string>"
},
"bundleId": "<string>",
"stage": {
"approvals": [
{
"approvers": [
{
"editable": true,
"id": "<string>",
"name": "<string>",
"showByDefault": true,
"fromOrganizationUserId": "<string>",
"isOrganizationUser": true
}
],
"evidence": {
"artifacts": [
{
"details": {},
"id": "<string>",
"policyEntityId": "<string>",
"required": true,
"visibilityRule": "<string>",
"visible": true
}
],
"createdAt": "<string>",
"description": "<string>",
"externalId": "<string>",
"id": "<string>",
"name": "<string>",
"policyId": "<string>",
"policyVersionId": "<string>",
"visible": true
},
"id": "<string>",
"name": "<string>",
"policyEntityId": "<string>",
"revalidationConfig": {
"openWindowDaysBefore": 2,
"recurring": {
"every": 2,
"startDate": "<string>"
}
}
}
],
"evidenceSet": [
{
"artifacts": [
{
"details": {},
"id": "<string>",
"policyEntityId": "<string>",
"required": true,
"visibilityRule": "<string>",
"visible": true
}
],
"createdAt": "<string>",
"description": "<string>",
"externalId": "<string>",
"id": "<string>",
"name": "<string>",
"policyId": "<string>",
"policyVersionId": "<string>",
"visible": true
}
],
"id": "<string>",
"name": "<string>",
"notifyOnTransition": true,
"policyEntityId": "<string>",
"policyVersionId": "<string>"
},
"stageId": "<string>"
}
]
}{
"code": "BUNDLE_REQUIRES_POLICY",
"message": "<string>"
}{
"code": "BUNDLE_REQUIRES_POLICY",
"message": "<string>"
}{
"code": "BUNDLE_REQUIRES_POLICY",
"message": "<string>"
}{
"code": "BUNDLE_REQUIRES_POLICY",
"message": "<string>"
}{
"code": "BUNDLE_REQUIRES_POLICY",
"message": "<string>"
}Body
application/json
Request to replace bundle primary policy
Response
OK
Available options:
Active, Archived, Complete Show child attributes
Show child attributes
The classification value of the primary policy
Show child attributes
Show child attributes
Policy IDs mandated by a PolicyEnforcer; these cannot be deactivated
Show child attributes
Show child attributes
Whether the bundle has an active revalidation schedule
Show child attributes
Show child attributes
The ID of the primary policy
The version of the primary policy
The version ID of the primary policy
The stage of the primary policy
Show child attributes
Show child attributes
The assignee to the stage of the primary policy
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Related topics
Replace a policy version in a bundleUpdate the policy of a bundleCreate new bundleAdd a policy to govern a bundleWas this page helpful?
⌘I