Python
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_api_discovery_settings = client.waap.domains.api_discovery.settings.update(
domain_id=1,
)
print(waap_api_discovery_settings.description_file_location)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"),
)
waapAPIDiscoverySettings, err := client.Waap.Domains.APIDiscovery.Settings.Update(
context.TODO(),
1,
waap.DomainAPIDiscoverySettingUpdateParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", waapAPIDiscoverySettings.DescriptionFileLocation)
}
curl --request PATCH \
--url https://api.gcore.com/waap/v2/domains/{domain_id}/api-discovery/settings \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"descriptionFileLocation": "<string>",
"descriptionFileScanEnabled": true,
"descriptionFileScanIntervalHours": 12,
"trafficScanEnabled": true,
"trafficScanIntervalHours": 12
}
'const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
descriptionFileLocation: '<string>',
descriptionFileScanEnabled: true,
descriptionFileScanIntervalHours: 12,
trafficScanEnabled: true,
trafficScanIntervalHours: 12
})
};
fetch('https://api.gcore.com/waap/v2/domains/{domain_id}/api-discovery/settings', 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/v2/domains/{domain_id}/api-discovery/settings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'descriptionFileLocation' => '<string>',
'descriptionFileScanEnabled' => true,
'descriptionFileScanIntervalHours' => 12,
'trafficScanEnabled' => true,
'trafficScanIntervalHours' => 12
]),
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.patch("https://api.gcore.com/waap/v2/domains/{domain_id}/api-discovery/settings")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"descriptionFileLocation\": \"<string>\",\n \"descriptionFileScanEnabled\": true,\n \"descriptionFileScanIntervalHours\": 12,\n \"trafficScanEnabled\": true,\n \"trafficScanIntervalHours\": 12\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/waap/v2/domains/{domain_id}/api-discovery/settings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"descriptionFileLocation\": \"<string>\",\n \"descriptionFileScanEnabled\": true,\n \"descriptionFileScanIntervalHours\": 12,\n \"trafficScanEnabled\": true,\n \"trafficScanIntervalHours\": 12\n}"
response = http.request(request)
puts response.read_body{
"descriptionFileLocation": "<string>",
"descriptionFileScanEnabled": true,
"descriptionFileScanIntervalHours": 123,
"trafficScanEnabled": true,
"trafficScanIntervalHours": 123
}{
"type": "http-bad-request",
"title": "Bad Request",
"status": 400,
"detail": "Invalid domain name: ''''"
}{
"detail": "Auth token is missing or invalid"
}{
"title": "Feature check fail",
"type": "feature-check",
"status": 403,
"detail": "This feature is not available under your current plan. Please upgrade your plan to access this feature."
}{
"title": "Resource not found",
"type": "quota-check-no-resource",
"status": 404,
"detail": "The quota resource requested does not exist. Cannot enable WAAP for this domain. Please reach out to our support team."
}{
"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."
}API Discovery
Update API discovery settings
Update the API discovery settings for a domain
PATCH
/
waap
/
v2
/
domains
/
{domain_id}
/
api-discovery
/
settings
Python
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_api_discovery_settings = client.waap.domains.api_discovery.settings.update(
domain_id=1,
)
print(waap_api_discovery_settings.description_file_location)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"),
)
waapAPIDiscoverySettings, err := client.Waap.Domains.APIDiscovery.Settings.Update(
context.TODO(),
1,
waap.DomainAPIDiscoverySettingUpdateParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", waapAPIDiscoverySettings.DescriptionFileLocation)
}
curl --request PATCH \
--url https://api.gcore.com/waap/v2/domains/{domain_id}/api-discovery/settings \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"descriptionFileLocation": "<string>",
"descriptionFileScanEnabled": true,
"descriptionFileScanIntervalHours": 12,
"trafficScanEnabled": true,
"trafficScanIntervalHours": 12
}
'const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
descriptionFileLocation: '<string>',
descriptionFileScanEnabled: true,
descriptionFileScanIntervalHours: 12,
trafficScanEnabled: true,
trafficScanIntervalHours: 12
})
};
fetch('https://api.gcore.com/waap/v2/domains/{domain_id}/api-discovery/settings', 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/v2/domains/{domain_id}/api-discovery/settings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'descriptionFileLocation' => '<string>',
'descriptionFileScanEnabled' => true,
'descriptionFileScanIntervalHours' => 12,
'trafficScanEnabled' => true,
'trafficScanIntervalHours' => 12
]),
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.patch("https://api.gcore.com/waap/v2/domains/{domain_id}/api-discovery/settings")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"descriptionFileLocation\": \"<string>\",\n \"descriptionFileScanEnabled\": true,\n \"descriptionFileScanIntervalHours\": 12,\n \"trafficScanEnabled\": true,\n \"trafficScanIntervalHours\": 12\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/waap/v2/domains/{domain_id}/api-discovery/settings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"descriptionFileLocation\": \"<string>\",\n \"descriptionFileScanEnabled\": true,\n \"descriptionFileScanIntervalHours\": 12,\n \"trafficScanEnabled\": true,\n \"trafficScanIntervalHours\": 12\n}"
response = http.request(request)
puts response.read_body{
"descriptionFileLocation": "<string>",
"descriptionFileScanEnabled": true,
"descriptionFileScanIntervalHours": 123,
"trafficScanEnabled": true,
"trafficScanIntervalHours": 123
}{
"type": "http-bad-request",
"title": "Bad Request",
"status": 400,
"detail": "Invalid domain name: ''''"
}{
"detail": "Auth token is missing or invalid"
}{
"title": "Feature check fail",
"type": "feature-check",
"status": 403,
"detail": "This feature is not available under your current plan. Please upgrade your plan to access this feature."
}{
"title": "Resource not found",
"type": "quota-check-no-resource",
"status": 404,
"detail": "The quota resource requested does not exist. Cannot enable WAAP for this domain. Please reach out to our support team."
}{
"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
Body
application/json
Request model for updating the API discovery settings
Response
Successful Response
Response model for the API discovery settings
Was this page helpful?