Update an existing policy
curl --request PUT \
--url https://api.app.chainloop.dev/v1/policies \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"policy": {
"metadata": {
"organization": "organization",
"name": "name",
"description": "description",
"annotations": {
"key": "annotations"
},
"display_name": "display_name",
"finding_type": "finding_type"
},
"kind": "kind",
"api_version": "api_version",
"spec": {
"path": "path",
"auto_match": {
"path": "path",
"ref": "ref",
"embedded": "embedded"
},
"inputs": [
{
"default": "default",
"name": "name",
"description": "description",
"required": true
},
{
"default": "default",
"name": "name",
"description": "description",
"required": true
}
],
"policies": [
{
"path": "path",
"ref": "ref",
"kind": "kind",
"attestation_phases": [
"ATTESTATION_PHASE_UNSPECIFIED",
"ATTESTATION_PHASE_UNSPECIFIED"
],
"embedded": "embedded"
},
{
"path": "path",
"ref": "ref",
"kind": "kind",
"attestation_phases": [
"ATTESTATION_PHASE_UNSPECIFIED",
"ATTESTATION_PHASE_UNSPECIFIED"
],
"embedded": "embedded"
}
],
"type": "type",
"embedded": "embedded"
}
},
"raw_schema": "<string>"
}
'import requests
url = "https://api.app.chainloop.dev/v1/policies"
payload = {
"policy": {
"metadata": {
"organization": "organization",
"name": "name",
"description": "description",
"annotations": { "key": "annotations" },
"display_name": "display_name",
"finding_type": "finding_type"
},
"kind": "kind",
"api_version": "api_version",
"spec": {
"path": "path",
"auto_match": {
"path": "path",
"ref": "ref",
"embedded": "embedded"
},
"inputs": [
{
"default": "default",
"name": "name",
"description": "description",
"required": True
},
{
"default": "default",
"name": "name",
"description": "description",
"required": True
}
],
"policies": [
{
"path": "path",
"ref": "ref",
"kind": "kind",
"attestation_phases": ["ATTESTATION_PHASE_UNSPECIFIED", "ATTESTATION_PHASE_UNSPECIFIED"],
"embedded": "embedded"
},
{
"path": "path",
"ref": "ref",
"kind": "kind",
"attestation_phases": ["ATTESTATION_PHASE_UNSPECIFIED", "ATTESTATION_PHASE_UNSPECIFIED"],
"embedded": "embedded"
}
],
"type": "type",
"embedded": "embedded"
}
},
"raw_schema": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
policy: {
metadata: {
organization: 'organization',
name: 'name',
description: 'description',
annotations: {key: 'annotations'},
display_name: 'display_name',
finding_type: 'finding_type'
},
kind: 'kind',
api_version: 'api_version',
spec: {
path: 'path',
auto_match: {path: 'path', ref: 'ref', embedded: 'embedded'},
inputs: [
{default: 'default', name: 'name', description: 'description', required: true},
{default: 'default', name: 'name', description: 'description', required: true}
],
policies: [
{
path: 'path',
ref: 'ref',
kind: 'kind',
attestation_phases: ['ATTESTATION_PHASE_UNSPECIFIED', 'ATTESTATION_PHASE_UNSPECIFIED'],
embedded: 'embedded'
},
{
path: 'path',
ref: 'ref',
kind: 'kind',
attestation_phases: ['ATTESTATION_PHASE_UNSPECIFIED', 'ATTESTATION_PHASE_UNSPECIFIED'],
embedded: 'embedded'
}
],
type: 'type',
embedded: 'embedded'
}
},
raw_schema: '<string>'
})
};
fetch('https://api.app.chainloop.dev/v1/policies', 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.app.chainloop.dev/v1/policies",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'policy' => [
'metadata' => [
'organization' => 'organization',
'name' => 'name',
'description' => 'description',
'annotations' => [
'key' => 'annotations'
],
'display_name' => 'display_name',
'finding_type' => 'finding_type'
],
'kind' => 'kind',
'api_version' => 'api_version',
'spec' => [
'path' => 'path',
'auto_match' => [
'path' => 'path',
'ref' => 'ref',
'embedded' => 'embedded'
],
'inputs' => [
[
'default' => 'default',
'name' => 'name',
'description' => 'description',
'required' => true
],
[
'default' => 'default',
'name' => 'name',
'description' => 'description',
'required' => true
]
],
'policies' => [
[
'path' => 'path',
'ref' => 'ref',
'kind' => 'kind',
'attestation_phases' => [
'ATTESTATION_PHASE_UNSPECIFIED',
'ATTESTATION_PHASE_UNSPECIFIED'
],
'embedded' => 'embedded'
],
[
'path' => 'path',
'ref' => 'ref',
'kind' => 'kind',
'attestation_phases' => [
'ATTESTATION_PHASE_UNSPECIFIED',
'ATTESTATION_PHASE_UNSPECIFIED'
],
'embedded' => 'embedded'
]
],
'type' => 'type',
'embedded' => 'embedded'
]
],
'raw_schema' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.app.chainloop.dev/v1/policies"
payload := strings.NewReader("{\n \"policy\": {\n \"metadata\": {\n \"organization\": \"organization\",\n \"name\": \"name\",\n \"description\": \"description\",\n \"annotations\": {\n \"key\": \"annotations\"\n },\n \"display_name\": \"display_name\",\n \"finding_type\": \"finding_type\"\n },\n \"kind\": \"kind\",\n \"api_version\": \"api_version\",\n \"spec\": {\n \"path\": \"path\",\n \"auto_match\": {\n \"path\": \"path\",\n \"ref\": \"ref\",\n \"embedded\": \"embedded\"\n },\n \"inputs\": [\n {\n \"default\": \"default\",\n \"name\": \"name\",\n \"description\": \"description\",\n \"required\": true\n },\n {\n \"default\": \"default\",\n \"name\": \"name\",\n \"description\": \"description\",\n \"required\": true\n }\n ],\n \"policies\": [\n {\n \"path\": \"path\",\n \"ref\": \"ref\",\n \"kind\": \"kind\",\n \"attestation_phases\": [\n \"ATTESTATION_PHASE_UNSPECIFIED\",\n \"ATTESTATION_PHASE_UNSPECIFIED\"\n ],\n \"embedded\": \"embedded\"\n },\n {\n \"path\": \"path\",\n \"ref\": \"ref\",\n \"kind\": \"kind\",\n \"attestation_phases\": [\n \"ATTESTATION_PHASE_UNSPECIFIED\",\n \"ATTESTATION_PHASE_UNSPECIFIED\"\n ],\n \"embedded\": \"embedded\"\n }\n ],\n \"type\": \"type\",\n \"embedded\": \"embedded\"\n }\n },\n \"raw_schema\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.put("https://api.app.chainloop.dev/v1/policies")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"policy\": {\n \"metadata\": {\n \"organization\": \"organization\",\n \"name\": \"name\",\n \"description\": \"description\",\n \"annotations\": {\n \"key\": \"annotations\"\n },\n \"display_name\": \"display_name\",\n \"finding_type\": \"finding_type\"\n },\n \"kind\": \"kind\",\n \"api_version\": \"api_version\",\n \"spec\": {\n \"path\": \"path\",\n \"auto_match\": {\n \"path\": \"path\",\n \"ref\": \"ref\",\n \"embedded\": \"embedded\"\n },\n \"inputs\": [\n {\n \"default\": \"default\",\n \"name\": \"name\",\n \"description\": \"description\",\n \"required\": true\n },\n {\n \"default\": \"default\",\n \"name\": \"name\",\n \"description\": \"description\",\n \"required\": true\n }\n ],\n \"policies\": [\n {\n \"path\": \"path\",\n \"ref\": \"ref\",\n \"kind\": \"kind\",\n \"attestation_phases\": [\n \"ATTESTATION_PHASE_UNSPECIFIED\",\n \"ATTESTATION_PHASE_UNSPECIFIED\"\n ],\n \"embedded\": \"embedded\"\n },\n {\n \"path\": \"path\",\n \"ref\": \"ref\",\n \"kind\": \"kind\",\n \"attestation_phases\": [\n \"ATTESTATION_PHASE_UNSPECIFIED\",\n \"ATTESTATION_PHASE_UNSPECIFIED\"\n ],\n \"embedded\": \"embedded\"\n }\n ],\n \"type\": \"type\",\n \"embedded\": \"embedded\"\n }\n },\n \"raw_schema\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.app.chainloop.dev/v1/policies")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"policy\": {\n \"metadata\": {\n \"organization\": \"organization\",\n \"name\": \"name\",\n \"description\": \"description\",\n \"annotations\": {\n \"key\": \"annotations\"\n },\n \"display_name\": \"display_name\",\n \"finding_type\": \"finding_type\"\n },\n \"kind\": \"kind\",\n \"api_version\": \"api_version\",\n \"spec\": {\n \"path\": \"path\",\n \"auto_match\": {\n \"path\": \"path\",\n \"ref\": \"ref\",\n \"embedded\": \"embedded\"\n },\n \"inputs\": [\n {\n \"default\": \"default\",\n \"name\": \"name\",\n \"description\": \"description\",\n \"required\": true\n },\n {\n \"default\": \"default\",\n \"name\": \"name\",\n \"description\": \"description\",\n \"required\": true\n }\n ],\n \"policies\": [\n {\n \"path\": \"path\",\n \"ref\": \"ref\",\n \"kind\": \"kind\",\n \"attestation_phases\": [\n \"ATTESTATION_PHASE_UNSPECIFIED\",\n \"ATTESTATION_PHASE_UNSPECIFIED\"\n ],\n \"embedded\": \"embedded\"\n },\n {\n \"path\": \"path\",\n \"ref\": \"ref\",\n \"kind\": \"kind\",\n \"attestation_phases\": [\n \"ATTESTATION_PHASE_UNSPECIFIED\",\n \"ATTESTATION_PHASE_UNSPECIFIED\"\n ],\n \"embedded\": \"embedded\"\n }\n ],\n \"type\": \"type\",\n \"embedded\": \"embedded\"\n }\n },\n \"raw_schema\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{}{
"code": 0,
"details": [
"details",
"details"
],
"message": "message"
}{
"code": 6,
"details": [
"details",
"details"
],
"message": "message"
}{
"code": 1,
"details": [
"details",
"details"
],
"message": "message"
}{
"code": 5,
"details": [
"details",
"details"
],
"message": "message"
}{
"code": 5,
"details": [
{
"@type": "@type"
},
{
"@type": "@type"
}
],
"message": "message"
}Update an existing policy
Updates an existing policy with a new definition. This creates a new version of the policy.
PUT
/
v1
/
policies
Update an existing policy
curl --request PUT \
--url https://api.app.chainloop.dev/v1/policies \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"policy": {
"metadata": {
"organization": "organization",
"name": "name",
"description": "description",
"annotations": {
"key": "annotations"
},
"display_name": "display_name",
"finding_type": "finding_type"
},
"kind": "kind",
"api_version": "api_version",
"spec": {
"path": "path",
"auto_match": {
"path": "path",
"ref": "ref",
"embedded": "embedded"
},
"inputs": [
{
"default": "default",
"name": "name",
"description": "description",
"required": true
},
{
"default": "default",
"name": "name",
"description": "description",
"required": true
}
],
"policies": [
{
"path": "path",
"ref": "ref",
"kind": "kind",
"attestation_phases": [
"ATTESTATION_PHASE_UNSPECIFIED",
"ATTESTATION_PHASE_UNSPECIFIED"
],
"embedded": "embedded"
},
{
"path": "path",
"ref": "ref",
"kind": "kind",
"attestation_phases": [
"ATTESTATION_PHASE_UNSPECIFIED",
"ATTESTATION_PHASE_UNSPECIFIED"
],
"embedded": "embedded"
}
],
"type": "type",
"embedded": "embedded"
}
},
"raw_schema": "<string>"
}
'import requests
url = "https://api.app.chainloop.dev/v1/policies"
payload = {
"policy": {
"metadata": {
"organization": "organization",
"name": "name",
"description": "description",
"annotations": { "key": "annotations" },
"display_name": "display_name",
"finding_type": "finding_type"
},
"kind": "kind",
"api_version": "api_version",
"spec": {
"path": "path",
"auto_match": {
"path": "path",
"ref": "ref",
"embedded": "embedded"
},
"inputs": [
{
"default": "default",
"name": "name",
"description": "description",
"required": True
},
{
"default": "default",
"name": "name",
"description": "description",
"required": True
}
],
"policies": [
{
"path": "path",
"ref": "ref",
"kind": "kind",
"attestation_phases": ["ATTESTATION_PHASE_UNSPECIFIED", "ATTESTATION_PHASE_UNSPECIFIED"],
"embedded": "embedded"
},
{
"path": "path",
"ref": "ref",
"kind": "kind",
"attestation_phases": ["ATTESTATION_PHASE_UNSPECIFIED", "ATTESTATION_PHASE_UNSPECIFIED"],
"embedded": "embedded"
}
],
"type": "type",
"embedded": "embedded"
}
},
"raw_schema": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
policy: {
metadata: {
organization: 'organization',
name: 'name',
description: 'description',
annotations: {key: 'annotations'},
display_name: 'display_name',
finding_type: 'finding_type'
},
kind: 'kind',
api_version: 'api_version',
spec: {
path: 'path',
auto_match: {path: 'path', ref: 'ref', embedded: 'embedded'},
inputs: [
{default: 'default', name: 'name', description: 'description', required: true},
{default: 'default', name: 'name', description: 'description', required: true}
],
policies: [
{
path: 'path',
ref: 'ref',
kind: 'kind',
attestation_phases: ['ATTESTATION_PHASE_UNSPECIFIED', 'ATTESTATION_PHASE_UNSPECIFIED'],
embedded: 'embedded'
},
{
path: 'path',
ref: 'ref',
kind: 'kind',
attestation_phases: ['ATTESTATION_PHASE_UNSPECIFIED', 'ATTESTATION_PHASE_UNSPECIFIED'],
embedded: 'embedded'
}
],
type: 'type',
embedded: 'embedded'
}
},
raw_schema: '<string>'
})
};
fetch('https://api.app.chainloop.dev/v1/policies', 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.app.chainloop.dev/v1/policies",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'policy' => [
'metadata' => [
'organization' => 'organization',
'name' => 'name',
'description' => 'description',
'annotations' => [
'key' => 'annotations'
],
'display_name' => 'display_name',
'finding_type' => 'finding_type'
],
'kind' => 'kind',
'api_version' => 'api_version',
'spec' => [
'path' => 'path',
'auto_match' => [
'path' => 'path',
'ref' => 'ref',
'embedded' => 'embedded'
],
'inputs' => [
[
'default' => 'default',
'name' => 'name',
'description' => 'description',
'required' => true
],
[
'default' => 'default',
'name' => 'name',
'description' => 'description',
'required' => true
]
],
'policies' => [
[
'path' => 'path',
'ref' => 'ref',
'kind' => 'kind',
'attestation_phases' => [
'ATTESTATION_PHASE_UNSPECIFIED',
'ATTESTATION_PHASE_UNSPECIFIED'
],
'embedded' => 'embedded'
],
[
'path' => 'path',
'ref' => 'ref',
'kind' => 'kind',
'attestation_phases' => [
'ATTESTATION_PHASE_UNSPECIFIED',
'ATTESTATION_PHASE_UNSPECIFIED'
],
'embedded' => 'embedded'
]
],
'type' => 'type',
'embedded' => 'embedded'
]
],
'raw_schema' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.app.chainloop.dev/v1/policies"
payload := strings.NewReader("{\n \"policy\": {\n \"metadata\": {\n \"organization\": \"organization\",\n \"name\": \"name\",\n \"description\": \"description\",\n \"annotations\": {\n \"key\": \"annotations\"\n },\n \"display_name\": \"display_name\",\n \"finding_type\": \"finding_type\"\n },\n \"kind\": \"kind\",\n \"api_version\": \"api_version\",\n \"spec\": {\n \"path\": \"path\",\n \"auto_match\": {\n \"path\": \"path\",\n \"ref\": \"ref\",\n \"embedded\": \"embedded\"\n },\n \"inputs\": [\n {\n \"default\": \"default\",\n \"name\": \"name\",\n \"description\": \"description\",\n \"required\": true\n },\n {\n \"default\": \"default\",\n \"name\": \"name\",\n \"description\": \"description\",\n \"required\": true\n }\n ],\n \"policies\": [\n {\n \"path\": \"path\",\n \"ref\": \"ref\",\n \"kind\": \"kind\",\n \"attestation_phases\": [\n \"ATTESTATION_PHASE_UNSPECIFIED\",\n \"ATTESTATION_PHASE_UNSPECIFIED\"\n ],\n \"embedded\": \"embedded\"\n },\n {\n \"path\": \"path\",\n \"ref\": \"ref\",\n \"kind\": \"kind\",\n \"attestation_phases\": [\n \"ATTESTATION_PHASE_UNSPECIFIED\",\n \"ATTESTATION_PHASE_UNSPECIFIED\"\n ],\n \"embedded\": \"embedded\"\n }\n ],\n \"type\": \"type\",\n \"embedded\": \"embedded\"\n }\n },\n \"raw_schema\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.put("https://api.app.chainloop.dev/v1/policies")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"policy\": {\n \"metadata\": {\n \"organization\": \"organization\",\n \"name\": \"name\",\n \"description\": \"description\",\n \"annotations\": {\n \"key\": \"annotations\"\n },\n \"display_name\": \"display_name\",\n \"finding_type\": \"finding_type\"\n },\n \"kind\": \"kind\",\n \"api_version\": \"api_version\",\n \"spec\": {\n \"path\": \"path\",\n \"auto_match\": {\n \"path\": \"path\",\n \"ref\": \"ref\",\n \"embedded\": \"embedded\"\n },\n \"inputs\": [\n {\n \"default\": \"default\",\n \"name\": \"name\",\n \"description\": \"description\",\n \"required\": true\n },\n {\n \"default\": \"default\",\n \"name\": \"name\",\n \"description\": \"description\",\n \"required\": true\n }\n ],\n \"policies\": [\n {\n \"path\": \"path\",\n \"ref\": \"ref\",\n \"kind\": \"kind\",\n \"attestation_phases\": [\n \"ATTESTATION_PHASE_UNSPECIFIED\",\n \"ATTESTATION_PHASE_UNSPECIFIED\"\n ],\n \"embedded\": \"embedded\"\n },\n {\n \"path\": \"path\",\n \"ref\": \"ref\",\n \"kind\": \"kind\",\n \"attestation_phases\": [\n \"ATTESTATION_PHASE_UNSPECIFIED\",\n \"ATTESTATION_PHASE_UNSPECIFIED\"\n ],\n \"embedded\": \"embedded\"\n }\n ],\n \"type\": \"type\",\n \"embedded\": \"embedded\"\n }\n },\n \"raw_schema\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.app.chainloop.dev/v1/policies")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"policy\": {\n \"metadata\": {\n \"organization\": \"organization\",\n \"name\": \"name\",\n \"description\": \"description\",\n \"annotations\": {\n \"key\": \"annotations\"\n },\n \"display_name\": \"display_name\",\n \"finding_type\": \"finding_type\"\n },\n \"kind\": \"kind\",\n \"api_version\": \"api_version\",\n \"spec\": {\n \"path\": \"path\",\n \"auto_match\": {\n \"path\": \"path\",\n \"ref\": \"ref\",\n \"embedded\": \"embedded\"\n },\n \"inputs\": [\n {\n \"default\": \"default\",\n \"name\": \"name\",\n \"description\": \"description\",\n \"required\": true\n },\n {\n \"default\": \"default\",\n \"name\": \"name\",\n \"description\": \"description\",\n \"required\": true\n }\n ],\n \"policies\": [\n {\n \"path\": \"path\",\n \"ref\": \"ref\",\n \"kind\": \"kind\",\n \"attestation_phases\": [\n \"ATTESTATION_PHASE_UNSPECIFIED\",\n \"ATTESTATION_PHASE_UNSPECIFIED\"\n ],\n \"embedded\": \"embedded\"\n },\n {\n \"path\": \"path\",\n \"ref\": \"ref\",\n \"kind\": \"kind\",\n \"attestation_phases\": [\n \"ATTESTATION_PHASE_UNSPECIFIED\",\n \"ATTESTATION_PHASE_UNSPECIFIED\"\n ],\n \"embedded\": \"embedded\"\n }\n ],\n \"type\": \"type\",\n \"embedded\": \"embedded\"\n }\n },\n \"raw_schema\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{}{
"code": 0,
"details": [
"details",
"details"
],
"message": "message"
}{
"code": 6,
"details": [
"details",
"details"
],
"message": "message"
}{
"code": 1,
"details": [
"details",
"details"
],
"message": "message"
}{
"code": 5,
"details": [
"details",
"details"
],
"message": "message"
}{
"code": 5,
"details": [
{
"@type": "@type"
},
{
"@type": "@type"
}
],
"message": "message"
}Authorizations
Bearer token for authentication
Body
application/json
Request to update an existing policy
Request to update an existing policy
A policy that can be applied to materials in Chainloop to validate compliance with specific requirements
Show child attributes
Show child attributes
Example:
{
"metadata": {
"organization": "organization",
"name": "name",
"description": "description",
"annotations": { "key": "annotations" },
"display_name": "display_name",
"finding_type": "finding_type"
},
"kind": "kind",
"api_version": "api_version",
"spec": {
"path": "path",
"auto_match": {
"path": "path",
"ref": "ref",
"embedded": "embedded"
},
"inputs": [
{
"default": "default",
"name": "name",
"description": "description",
"required": true
},
{
"default": "default",
"name": "name",
"description": "description",
"required": true
}
],
"policies": [
{
"path": "path",
"ref": "ref",
"kind": "kind",
"attestation_phases": [
"ATTESTATION_PHASE_UNSPECIFIED",
"ATTESTATION_PHASE_UNSPECIFIED"
],
"embedded": "embedded"
},
{
"path": "path",
"ref": "ref",
"kind": "kind",
"attestation_phases": [
"ATTESTATION_PHASE_UNSPECIFIED",
"ATTESTATION_PHASE_UNSPECIFIED"
],
"embedded": "embedded"
}
],
"type": "type",
"embedded": "embedded"
}
}
Base64 raw representation of the policy schema in JSON or YAML format
Response
A successful response.
Response for the policy update request
⌘I
