Get all audit events by resource name
curl --request GET \
--url https://audit.cpln.io/audit/org/{org}/resource/name/{resourceName} \
--header 'Authorization: <api-key>'import requests
url = "https://audit.cpln.io/audit/org/{org}/resource/name/{resourceName}"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://audit.cpln.io/audit/org/{org}/resource/name/{resourceName}', 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://audit.cpln.io/audit/org/{org}/resource/name/{resourceName}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://audit.cpln.io/audit/org/{org}/resource/name/{resourceName}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://audit.cpln.io/audit/org/{org}/resource/name/{resourceName}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://audit.cpln.io/audit/org/{org}/resource/name/{resourceName}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"kind": "queryresult",
"itemKind": "auditevent",
"items": [
{
"resource": {
"id": "dfedd8b9-7737-498a-883f-0162510c0d68",
"name": "my-workload",
"type": "workload",
"data": {
"foo": "bar"
}
},
"id": "7f2195ac-e003-42a3-8324-d4bb1f11d10e",
"eventTime": "2021-01-02T13:01:02.345Z",
"postedTime": "2021-01-02T13:01:03.123Z",
"receivedTime": "2021-01-02T13:01:03.159Z",
"requestId": "d4e26a95-1988-4bf5-94fb-40d605cce0e9",
"context": {
"org": "myorg",
"name": "audit-context-1",
"remoteIp": "1.2.3.4",
"eventSource": "system",
"location": "aws-us-west-2",
"gvcAlias": "gm0b1e3a1vxjj",
"podId": "workload-00016-deployment-54b5b8f94f-jqkcn",
"data": {}
},
"subject": {
"email": "bob@company.com",
"name": "Bob Johnson",
"claims": {},
"data": {}
},
"action": {
"type": "delete",
"data": {}
},
"result": {
"status": "OK",
"message": "Object created successfully"
}
}
],
"query": {
"param1": "value1",
"param2": "value2"
},
"links": [
{
"rel": "self",
"href": "/audit/org/myorg/id/e40f6816-574a-4150-a089-8bea6b4b588b"
}
]
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Query Events
Get all audit events by resource name
GET
/
org
/
{org}
/
resource
/
name
/
{resourceName}
Get all audit events by resource name
curl --request GET \
--url https://audit.cpln.io/audit/org/{org}/resource/name/{resourceName} \
--header 'Authorization: <api-key>'import requests
url = "https://audit.cpln.io/audit/org/{org}/resource/name/{resourceName}"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://audit.cpln.io/audit/org/{org}/resource/name/{resourceName}', 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://audit.cpln.io/audit/org/{org}/resource/name/{resourceName}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://audit.cpln.io/audit/org/{org}/resource/name/{resourceName}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://audit.cpln.io/audit/org/{org}/resource/name/{resourceName}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://audit.cpln.io/audit/org/{org}/resource/name/{resourceName}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"kind": "queryresult",
"itemKind": "auditevent",
"items": [
{
"resource": {
"id": "dfedd8b9-7737-498a-883f-0162510c0d68",
"name": "my-workload",
"type": "workload",
"data": {
"foo": "bar"
}
},
"id": "7f2195ac-e003-42a3-8324-d4bb1f11d10e",
"eventTime": "2021-01-02T13:01:02.345Z",
"postedTime": "2021-01-02T13:01:03.123Z",
"receivedTime": "2021-01-02T13:01:03.159Z",
"requestId": "d4e26a95-1988-4bf5-94fb-40d605cce0e9",
"context": {
"org": "myorg",
"name": "audit-context-1",
"remoteIp": "1.2.3.4",
"eventSource": "system",
"location": "aws-us-west-2",
"gvcAlias": "gm0b1e3a1vxjj",
"podId": "workload-00016-deployment-54b5b8f94f-jqkcn",
"data": {}
},
"subject": {
"email": "bob@company.com",
"name": "Bob Johnson",
"claims": {},
"data": {}
},
"action": {
"type": "delete",
"data": {}
},
"result": {
"status": "OK",
"message": "Object created successfully"
}
}
],
"query": {
"param1": "value1",
"param2": "value2"
},
"links": [
{
"rel": "self",
"href": "/audit/org/myorg/id/e40f6816-574a-4150-a089-8bea6b4b588b"
}
]
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
serviceAccountKeyjwt
Service account key can be used as API keys
Query Parameters
⌘I