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_target = client.cdn.logs_uploader.targets.update(
id=0,
)
print(logs_uploader_target)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"),
)
logsUploaderTarget, err := client.CDN.LogsUploader.Targets.Update(
context.TODO(),
0,
cdn.LogsUploaderTargetUpdateParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", logsUploaderTarget)
}
curl --request PATCH \
--url https://api.gcore.com/cdn/logs_uploader/targets/{id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"config": {
"access_key_id": "<string>",
"secret_access_key": "<string>",
"region": "<string>",
"bucket_name": "<string>",
"endpoint": "<string>",
"directory": "<string>",
"use_path_style": true
}
}
'const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
config: {
access_key_id: '<string>',
secret_access_key: '<string>',
region: '<string>',
bucket_name: '<string>',
endpoint: '<string>',
directory: '<string>',
use_path_style: true
}
})
};
fetch('https://api.gcore.com/cdn/logs_uploader/targets/{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/targets/{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([
'name' => '<string>',
'description' => '<string>',
'config' => [
'access_key_id' => '<string>',
'secret_access_key' => '<string>',
'region' => '<string>',
'bucket_name' => '<string>',
'endpoint' => '<string>',
'directory' => '<string>',
'use_path_style' => true
]
]),
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/targets/{id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"config\": {\n \"access_key_id\": \"<string>\",\n \"secret_access_key\": \"<string>\",\n \"region\": \"<string>\",\n \"bucket_name\": \"<string>\",\n \"endpoint\": \"<string>\",\n \"directory\": \"<string>\",\n \"use_path_style\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/cdn/logs_uploader/targets/{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 \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"config\": {\n \"access_key_id\": \"<string>\",\n \"secret_access_key\": \"<string>\",\n \"region\": \"<string>\",\n \"bucket_name\": \"<string>\",\n \"endpoint\": \"<string>\",\n \"directory\": \"<string>\",\n \"use_path_style\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"storage_type": "s3_gcore",
"id": 123,
"client_id": 123,
"created": "2023-11-07T05:31:56Z",
"updated": "2023-11-07T05:31:56Z",
"name": "<string>",
"description": "<string>",
"related_uploader_configs": [
123
],
"status": {
"status": "in_progress",
"code": 123,
"updated": "2023-11-07T05:31:56Z",
"details": "<string>"
},
"config": {
"access_key_id": "<string>",
"region": "<string>",
"bucket_name": "<string>",
"directory": "<string>",
"endpoint": "<string>",
"use_path_style": true
}
}Logs uploader
Change target
Change logs uploader target partially.
PATCH
/
cdn
/
logs_uploader
/
targets
/
{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_target = client.cdn.logs_uploader.targets.update(
id=0,
)
print(logs_uploader_target)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"),
)
logsUploaderTarget, err := client.CDN.LogsUploader.Targets.Update(
context.TODO(),
0,
cdn.LogsUploaderTargetUpdateParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", logsUploaderTarget)
}
curl --request PATCH \
--url https://api.gcore.com/cdn/logs_uploader/targets/{id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"config": {
"access_key_id": "<string>",
"secret_access_key": "<string>",
"region": "<string>",
"bucket_name": "<string>",
"endpoint": "<string>",
"directory": "<string>",
"use_path_style": true
}
}
'const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
config: {
access_key_id: '<string>',
secret_access_key: '<string>',
region: '<string>',
bucket_name: '<string>',
endpoint: '<string>',
directory: '<string>',
use_path_style: true
}
})
};
fetch('https://api.gcore.com/cdn/logs_uploader/targets/{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/targets/{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([
'name' => '<string>',
'description' => '<string>',
'config' => [
'access_key_id' => '<string>',
'secret_access_key' => '<string>',
'region' => '<string>',
'bucket_name' => '<string>',
'endpoint' => '<string>',
'directory' => '<string>',
'use_path_style' => true
]
]),
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/targets/{id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"config\": {\n \"access_key_id\": \"<string>\",\n \"secret_access_key\": \"<string>\",\n \"region\": \"<string>\",\n \"bucket_name\": \"<string>\",\n \"endpoint\": \"<string>\",\n \"directory\": \"<string>\",\n \"use_path_style\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/cdn/logs_uploader/targets/{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 \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"config\": {\n \"access_key_id\": \"<string>\",\n \"secret_access_key\": \"<string>\",\n \"region\": \"<string>\",\n \"bucket_name\": \"<string>\",\n \"endpoint\": \"<string>\",\n \"directory\": \"<string>\",\n \"use_path_style\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"storage_type": "s3_gcore",
"id": 123,
"client_id": 123,
"created": "2023-11-07T05:31:56Z",
"updated": "2023-11-07T05:31:56Z",
"name": "<string>",
"description": "<string>",
"related_uploader_configs": [
123
],
"status": {
"status": "in_progress",
"code": 123,
"updated": "2023-11-07T05:31:56Z",
"details": "<string>"
},
"config": {
"access_key_id": "<string>",
"region": "<string>",
"bucket_name": "<string>",
"directory": "<string>",
"endpoint": "<string>",
"use_path_style": true
}
}Authorizations
Body
application/json
Response
Successful.
- S3 Gcore Target
- S3 Amazon Target
- S3 OSS Target
- S3 Other Target
- S3 V1 Target
- FTP Target
- SFTP Target
- HTTP Target
- Azure Blob Target
- SLS Target
Was this page helpful?