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.get(
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"
)
func main() {
client := gcore.NewClient(
option.WithAPIKey("My API Key"),
)
waapAPIDiscoverySettings, err := client.Waap.Domains.APIDiscovery.Settings.Get(context.TODO(), 1)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", waapAPIDiscoverySettings.DescriptionFileLocation)
}curl --request GET \
--url https://api.gcore.com/waap/v1/domains/{domain_id}/api-discovery/settings \
--header 'Authorization: <api-key>'const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.gcore.com/waap/v1/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/v1/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 => "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;
}HttpResponse<String> response = Unirest.get("https://api.gcore.com/waap/v1/domains/{domain_id}/api-discovery/settings")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/waap/v1/domains/{domain_id}/api-discovery/settings")
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{
"descriptionFileLocation": "<string>",
"descriptionFileScanEnabled": true,
"descriptionFileScanIntervalHours": 123,
"trafficScanEnabled": true,
"trafficScanIntervalHours": 123
}{
"type": "http-bad-request",
"title": "Bad Request",
"status": 400,
"detail": "Invalid domain name: ''''"
}{
"title": "Feature check fail",
"type": "feature-check",
"status": 401,
"detail": "This feature is not available under your current plan. Please upgrade your plan to access this feature."
}{
"detail": "Permission denied"
}{
"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
Get the API discovery settings
Retrieve the API discovery settings for a domain
GET
/
waap
/
v1
/
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.get(
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"
)
func main() {
client := gcore.NewClient(
option.WithAPIKey("My API Key"),
)
waapAPIDiscoverySettings, err := client.Waap.Domains.APIDiscovery.Settings.Get(context.TODO(), 1)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", waapAPIDiscoverySettings.DescriptionFileLocation)
}curl --request GET \
--url https://api.gcore.com/waap/v1/domains/{domain_id}/api-discovery/settings \
--header 'Authorization: <api-key>'const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.gcore.com/waap/v1/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/v1/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 => "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;
}HttpResponse<String> response = Unirest.get("https://api.gcore.com/waap/v1/domains/{domain_id}/api-discovery/settings")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/waap/v1/domains/{domain_id}/api-discovery/settings")
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{
"descriptionFileLocation": "<string>",
"descriptionFileScanEnabled": true,
"descriptionFileScanIntervalHours": 123,
"trafficScanEnabled": true,
"trafficScanIntervalHours": 123
}{
"type": "http-bad-request",
"title": "Bad Request",
"status": 400,
"detail": "Invalid domain name: ''''"
}{
"title": "Feature check fail",
"type": "feature-check",
"status": 401,
"detail": "This feature is not available under your current plan. Please upgrade your plan to access this feature."
}{
"detail": "Permission denied"
}{
"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
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
Response
Successful Response
Response model for the API discovery settings
The URL of the API description file. This will be periodically scanned if descriptionFileScanEnabled is enabled. Supported formats are YAML and JSON, and it must adhere to OpenAPI versions 2, 3, or 3.1.
Indicates if periodic scan of the description file is enabled
The interval in hours for scanning the description file
Indicates if traffic scan is enabled. Traffic scan is used to discover undocumented APIs
The interval in hours for scanning the traffic
Was this page helpful?
⌘I