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
)
logs_uploader_config = client.cdn.logs_uploader.configs.update(
id=0,
)
print(logs_uploader_config.id)package main
import (
"context"
"fmt"
"github.com/G-Core/gcore-go"
"github.com/G-Core/gcore-go/cdn"
"github.com/G-Core/gcore-go/option"
)
func main() {
client := gcore.NewClient(
option.WithAPIKey("My API Key"),
)
logsUploaderConfig, err := client.CDN.LogsUploader.Configs.Update(
context.TODO(),
0,
cdn.LogsUploaderConfigUpdateParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", logsUploaderConfig.ID)
}
curl --request PATCH \
--url https://api.gcore.com/cdn/logs_uploader/configs/{id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"enabled": true,
"name": "<string>",
"policy": 123,
"target": 123,
"for_all_resources": true,
"resources": [
123
]
}
'const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
enabled: true,
name: '<string>',
policy: 123,
target: 123,
for_all_resources: true,
resources: [123]
})
};
fetch('https://api.gcore.com/cdn/logs_uploader/configs/{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/cdn/logs_uploader/configs/{id}",
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([
'enabled' => true,
'name' => '<string>',
'policy' => 123,
'target' => 123,
'for_all_resources' => true,
'resources' => [
123
]
]),
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/cdn/logs_uploader/configs/{id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"enabled\": true,\n \"name\": \"<string>\",\n \"policy\": 123,\n \"target\": 123,\n \"for_all_resources\": true,\n \"resources\": [\n 123\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/cdn/logs_uploader/configs/{id}")
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 \"enabled\": true,\n \"name\": \"<string>\",\n \"policy\": 123,\n \"target\": 123,\n \"for_all_resources\": true,\n \"resources\": [\n 123\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"client_id": 123,
"created": "2023-11-07T05:31:56Z",
"updated": "2023-11-07T05:31:56Z",
"enabled": true,
"name": "<string>",
"policy": 123,
"target": 123,
"for_all_resources": true,
"resources": [
123
],
"status": {
"status": "in_progress",
"code": 123,
"updated": "2023-11-07T05:31:56Z",
"details": "<string>"
}
}Logs uploader
Change config
Change logs uploader config partially.
PATCH
/
cdn
/
logs_uploader
/
configs
/
{id}
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
)
logs_uploader_config = client.cdn.logs_uploader.configs.update(
id=0,
)
print(logs_uploader_config.id)package main
import (
"context"
"fmt"
"github.com/G-Core/gcore-go"
"github.com/G-Core/gcore-go/cdn"
"github.com/G-Core/gcore-go/option"
)
func main() {
client := gcore.NewClient(
option.WithAPIKey("My API Key"),
)
logsUploaderConfig, err := client.CDN.LogsUploader.Configs.Update(
context.TODO(),
0,
cdn.LogsUploaderConfigUpdateParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", logsUploaderConfig.ID)
}
curl --request PATCH \
--url https://api.gcore.com/cdn/logs_uploader/configs/{id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"enabled": true,
"name": "<string>",
"policy": 123,
"target": 123,
"for_all_resources": true,
"resources": [
123
]
}
'const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
enabled: true,
name: '<string>',
policy: 123,
target: 123,
for_all_resources: true,
resources: [123]
})
};
fetch('https://api.gcore.com/cdn/logs_uploader/configs/{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/cdn/logs_uploader/configs/{id}",
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([
'enabled' => true,
'name' => '<string>',
'policy' => 123,
'target' => 123,
'for_all_resources' => true,
'resources' => [
123
]
]),
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/cdn/logs_uploader/configs/{id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"enabled\": true,\n \"name\": \"<string>\",\n \"policy\": 123,\n \"target\": 123,\n \"for_all_resources\": true,\n \"resources\": [\n 123\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/cdn/logs_uploader/configs/{id}")
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 \"enabled\": true,\n \"name\": \"<string>\",\n \"policy\": 123,\n \"target\": 123,\n \"for_all_resources\": true,\n \"resources\": [\n 123\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"client_id": 123,
"created": "2023-11-07T05:31:56Z",
"updated": "2023-11-07T05:31:56Z",
"enabled": true,
"name": "<string>",
"policy": 123,
"target": 123,
"for_all_resources": true,
"resources": [
123
],
"status": {
"status": "in_progress",
"code": 123,
"updated": "2023-11-07T05:31:56Z",
"details": "<string>"
}
}Authorizations
Body
application/json
Response
Successful.
Was this page helpful?