Anomalies
Create anomaly suppression
Create a tenant-scoped anomaly suppression rule matching candidates by scope predicate.
POST
/
api
/
v1
/
tenant
/
anomaly-suppressions
Create anomaly suppression
curl --request POST \
--url https://api.costgraph.ai/api/v1/tenant/anomaly-suppressions \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"anomaly_type": "<string>",
"category": "<string>",
"expires_at": "<string>",
"provider": "<string>",
"reason": "<string>",
"region": "<string>",
"resource_id": "<string>",
"resource_type": "<string>",
"service": "<string>"
}
'import requests
url = "https://api.costgraph.ai/api/v1/tenant/anomaly-suppressions"
payload = {
"anomaly_type": "<string>",
"category": "<string>",
"expires_at": "<string>",
"provider": "<string>",
"reason": "<string>",
"region": "<string>",
"resource_id": "<string>",
"resource_type": "<string>",
"service": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
anomaly_type: '<string>',
category: '<string>',
expires_at: '<string>',
provider: '<string>',
reason: '<string>',
region: '<string>',
resource_id: '<string>',
resource_type: '<string>',
service: '<string>'
})
};
fetch('https://api.costgraph.ai/api/v1/tenant/anomaly-suppressions', 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.costgraph.ai/api/v1/tenant/anomaly-suppressions",
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([
'anomaly_type' => '<string>',
'category' => '<string>',
'expires_at' => '<string>',
'provider' => '<string>',
'reason' => '<string>',
'region' => '<string>',
'resource_id' => '<string>',
'resource_type' => '<string>',
'service' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.costgraph.ai/api/v1/tenant/anomaly-suppressions"
payload := strings.NewReader("{\n \"anomaly_type\": \"<string>\",\n \"category\": \"<string>\",\n \"expires_at\": \"<string>\",\n \"provider\": \"<string>\",\n \"reason\": \"<string>\",\n \"region\": \"<string>\",\n \"resource_id\": \"<string>\",\n \"resource_type\": \"<string>\",\n \"service\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.costgraph.ai/api/v1/tenant/anomaly-suppressions")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"anomaly_type\": \"<string>\",\n \"category\": \"<string>\",\n \"expires_at\": \"<string>\",\n \"provider\": \"<string>\",\n \"reason\": \"<string>\",\n \"region\": \"<string>\",\n \"resource_id\": \"<string>\",\n \"resource_type\": \"<string>\",\n \"service\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.costgraph.ai/api/v1/tenant/anomaly-suppressions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"anomaly_type\": \"<string>\",\n \"category\": \"<string>\",\n \"expires_at\": \"<string>\",\n \"provider\": \"<string>\",\n \"reason\": \"<string>\",\n \"region\": \"<string>\",\n \"resource_id\": \"<string>\",\n \"resource_type\": \"<string>\",\n \"service\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"message": "some message",
"status": "success",
"data": {
"anomaly_type": "<string>",
"category": "<string>",
"created_at": "<string>",
"created_by": "<string>",
"expires_at": "<string>",
"id": "<string>",
"provider": "<string>",
"reason": "<string>",
"region": "<string>",
"resource_id": "<string>",
"resource_type": "<string>",
"service": "<string>",
"tenant_id": "<string>",
"updated_at": "<string>"
}
}{
"message": "some message",
"status": "error"
}{
"message": "some message",
"status": "error"
}Authorizations
Enter "Bearer {token}"
Body
application/json
Suppression to create
Was this page helpful?
⌘I
Create anomaly suppression
curl --request POST \
--url https://api.costgraph.ai/api/v1/tenant/anomaly-suppressions \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"anomaly_type": "<string>",
"category": "<string>",
"expires_at": "<string>",
"provider": "<string>",
"reason": "<string>",
"region": "<string>",
"resource_id": "<string>",
"resource_type": "<string>",
"service": "<string>"
}
'import requests
url = "https://api.costgraph.ai/api/v1/tenant/anomaly-suppressions"
payload = {
"anomaly_type": "<string>",
"category": "<string>",
"expires_at": "<string>",
"provider": "<string>",
"reason": "<string>",
"region": "<string>",
"resource_id": "<string>",
"resource_type": "<string>",
"service": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
anomaly_type: '<string>',
category: '<string>',
expires_at: '<string>',
provider: '<string>',
reason: '<string>',
region: '<string>',
resource_id: '<string>',
resource_type: '<string>',
service: '<string>'
})
};
fetch('https://api.costgraph.ai/api/v1/tenant/anomaly-suppressions', 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.costgraph.ai/api/v1/tenant/anomaly-suppressions",
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([
'anomaly_type' => '<string>',
'category' => '<string>',
'expires_at' => '<string>',
'provider' => '<string>',
'reason' => '<string>',
'region' => '<string>',
'resource_id' => '<string>',
'resource_type' => '<string>',
'service' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.costgraph.ai/api/v1/tenant/anomaly-suppressions"
payload := strings.NewReader("{\n \"anomaly_type\": \"<string>\",\n \"category\": \"<string>\",\n \"expires_at\": \"<string>\",\n \"provider\": \"<string>\",\n \"reason\": \"<string>\",\n \"region\": \"<string>\",\n \"resource_id\": \"<string>\",\n \"resource_type\": \"<string>\",\n \"service\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.costgraph.ai/api/v1/tenant/anomaly-suppressions")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"anomaly_type\": \"<string>\",\n \"category\": \"<string>\",\n \"expires_at\": \"<string>\",\n \"provider\": \"<string>\",\n \"reason\": \"<string>\",\n \"region\": \"<string>\",\n \"resource_id\": \"<string>\",\n \"resource_type\": \"<string>\",\n \"service\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.costgraph.ai/api/v1/tenant/anomaly-suppressions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"anomaly_type\": \"<string>\",\n \"category\": \"<string>\",\n \"expires_at\": \"<string>\",\n \"provider\": \"<string>\",\n \"reason\": \"<string>\",\n \"region\": \"<string>\",\n \"resource_id\": \"<string>\",\n \"resource_type\": \"<string>\",\n \"service\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"message": "some message",
"status": "success",
"data": {
"anomaly_type": "<string>",
"category": "<string>",
"created_at": "<string>",
"created_by": "<string>",
"expires_at": "<string>",
"id": "<string>",
"provider": "<string>",
"reason": "<string>",
"region": "<string>",
"resource_id": "<string>",
"resource_type": "<string>",
"service": "<string>",
"tenant_id": "<string>",
"updated_at": "<string>"
}
}{
"message": "some message",
"status": "error"
}{
"message": "some message",
"status": "error"
}