import os
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
waap_insight = client.waap.domains.insights.replace(
insight_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
domain_id=1,
status="OPEN",
)
print(waap_insight.id)package main
import (
"context"
"fmt"
"github.com/G-Core/gcore-go"
"github.com/G-Core/gcore-go/option"
"github.com/G-Core/gcore-go/waap"
)
func main() {
client := gcore.NewClient(
option.WithAPIKey("My API Key"),
)
waapInsight, err := client.Waap.Domains.Insights.Replace(
context.TODO(),
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
waap.DomainInsightReplaceParams{
DomainID: 1,
Status: waap.DomainInsightReplaceParamsStatusOpen,
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", waapInsight.ID)
}
curl --request PUT \
--url https://api.gcore.com/waap/v1/domains/{domain_id}/insights/{insight_id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '{}'const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://api.gcore.com/waap/v1/domains/{domain_id}/insights/{insight_id}', 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.gcore.com/waap/v1/domains/{domain_id}/insights/{insight_id}",
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([
]),
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;
}HttpResponse<String> response = Unirest.put("https://api.gcore.com/waap/v1/domains/{domain_id}/insights/{insight_id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/waap/v1/domains/{domain_id}/insights/{insight_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"insight_type": "<string>",
"labels": {},
"first_seen": "2023-11-07T05:31:56Z",
"last_seen": "2023-11-07T05:31:56Z",
"last_status_change": "2023-11-07T05:31:56Z",
"status": "OPEN",
"description": "A request originated from a high-risk IP: 1.2.3.4, but it was allowed by rule: 'my custom rule' the description of the insight",
"recommendation": "disable or delete rule \"my-custom-rule\""
}{
"type": "http-bad-request",
"title": "Bad Request",
"status": 400,
"detail": "Invalid domain name: ''''"
}{
"detail": "Auth token is missing or invalid"
}{
"detail": "Permission denied"
}{
"type": "http-not-found",
"title": "Not Found",
"status": 404,
"detail": "The resource is not found"
}{
"type": "request-validation-failed",
"title": "Request validation error.",
"status": 422,
"detail": "One or more fields have validation errors.",
"errors": [
{
"loc": [
"body",
"name"
],
"detail": "Input should be a valid string"
},
{
"loc": [
"body",
"date"
],
"detail": "Field required"
},
{
"loc": [
"query",
"limit"
],
"detail": "Field required"
}
]
}{
"type": "internal-server-error",
"title": "Internal server error.",
"status": 500,
"detail": "An unexpected condition was encountered which prevented the server from fulfilling the request."
}Update an insight
Update the status of an insight for a specific domain.
import os
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
waap_insight = client.waap.domains.insights.replace(
insight_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
domain_id=1,
status="OPEN",
)
print(waap_insight.id)package main
import (
"context"
"fmt"
"github.com/G-Core/gcore-go"
"github.com/G-Core/gcore-go/option"
"github.com/G-Core/gcore-go/waap"
)
func main() {
client := gcore.NewClient(
option.WithAPIKey("My API Key"),
)
waapInsight, err := client.Waap.Domains.Insights.Replace(
context.TODO(),
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
waap.DomainInsightReplaceParams{
DomainID: 1,
Status: waap.DomainInsightReplaceParamsStatusOpen,
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", waapInsight.ID)
}
curl --request PUT \
--url https://api.gcore.com/waap/v1/domains/{domain_id}/insights/{insight_id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '{}'const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://api.gcore.com/waap/v1/domains/{domain_id}/insights/{insight_id}', 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.gcore.com/waap/v1/domains/{domain_id}/insights/{insight_id}",
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([
]),
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;
}HttpResponse<String> response = Unirest.put("https://api.gcore.com/waap/v1/domains/{domain_id}/insights/{insight_id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/waap/v1/domains/{domain_id}/insights/{insight_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"insight_type": "<string>",
"labels": {},
"first_seen": "2023-11-07T05:31:56Z",
"last_seen": "2023-11-07T05:31:56Z",
"last_status_change": "2023-11-07T05:31:56Z",
"status": "OPEN",
"description": "A request originated from a high-risk IP: 1.2.3.4, but it was allowed by rule: 'my custom rule' the description of the insight",
"recommendation": "disable or delete rule \"my-custom-rule\""
}{
"type": "http-bad-request",
"title": "Bad Request",
"status": 400,
"detail": "Invalid domain name: ''''"
}{
"detail": "Auth token is missing or invalid"
}{
"detail": "Permission denied"
}{
"type": "http-not-found",
"title": "Not Found",
"status": 404,
"detail": "The resource is not found"
}{
"type": "request-validation-failed",
"title": "Request validation error.",
"status": 422,
"detail": "One or more fields have validation errors.",
"errors": [
{
"loc": [
"body",
"name"
],
"detail": "Input should be a valid string"
},
{
"loc": [
"body",
"date"
],
"detail": "Field required"
},
{
"loc": [
"query",
"limit"
],
"detail": "Field required"
}
]
}{
"type": "internal-server-error",
"title": "Internal server error.",
"status": 500,
"detail": "An unexpected condition was encountered which prevented the server from fulfilling the request."
}Authorizations
API key for authentication. Make sure to include the word apikey, followed by a single space and then your token.
Example: apikey 1234_abcdef
Path Parameters
The domain ID
The ID of the insight
Body
The status of the insight
OPEN, ACKED, CLOSED Response
Successful Response
A generated unique identifier for the insight
The slug of the insight type
^[a-z0-9]+(?:-[a-z0-9]+)*$A hash table of label names and values that apply to the insight
Show child attributes
Show child attributes
The date and time the insight was first seen in ISO 8601 format
The date and time the insight was last seen in ISO 8601 format
The date and time the insight was last seen in ISO 8601 format
The status of the insight
OPEN, ACKED, CLOSED The description of the insight
3 - 450"A request originated from a high-risk IP: 1.2.3.4, but it was allowed by rule: 'my custom rule' the description of the insight"
The recommended action to perform to resolve the insight
3 - 450"disable or delete rule \"my-custom-rule\""
Was this page helpful?