Create target
curl --request POST \
--url https://api.gcore.com/cdn/logs_uploader/targets \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"config": {
"access_key_id": "<string>",
"secret_access_key": "<string>",
"region": "<string>",
"bucket_name": "<string>",
"endpoint": "<string>",
"directory": "<string>",
"use_path_style": true
},
"name": "Target",
"description": "<string>"
}
'import requests
url = "https://api.gcore.com/cdn/logs_uploader/targets"
payload = {
"config": {
"access_key_id": "<string>",
"secret_access_key": "<string>",
"region": "<string>",
"bucket_name": "<string>",
"endpoint": "<string>",
"directory": "<string>",
"use_path_style": True
},
"name": "Target",
"description": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
config: {
access_key_id: '<string>',
secret_access_key: '<string>',
region: '<string>',
bucket_name: '<string>',
endpoint: '<string>',
directory: '<string>',
use_path_style: true
},
name: 'Target',
description: '<string>'
})
};
fetch('https://api.gcore.com/cdn/logs_uploader/targets', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'config' => [
'access_key_id' => '<string>',
'secret_access_key' => '<string>',
'region' => '<string>',
'bucket_name' => '<string>',
'endpoint' => '<string>',
'directory' => '<string>',
'use_path_style' => true
],
'name' => 'Target',
'description' => '<string>'
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.gcore.com/cdn/logs_uploader/targets"
payload := strings.NewReader("{\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 \"name\": \"Target\",\n \"description\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.gcore.com/cdn/logs_uploader/targets")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\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 \"name\": \"Target\",\n \"description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/cdn/logs_uploader/targets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\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 \"name\": \"Target\",\n \"description\": \"<string>\"\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",
"name": "<string>",
"description": "<string>",
"related_uploader_configs": [
123
],
"status": {
"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
Create target
Create logs uploader target.
POST
/
cdn
/
logs_uploader
/
targets
Create target
curl --request POST \
--url https://api.gcore.com/cdn/logs_uploader/targets \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"config": {
"access_key_id": "<string>",
"secret_access_key": "<string>",
"region": "<string>",
"bucket_name": "<string>",
"endpoint": "<string>",
"directory": "<string>",
"use_path_style": true
},
"name": "Target",
"description": "<string>"
}
'import requests
url = "https://api.gcore.com/cdn/logs_uploader/targets"
payload = {
"config": {
"access_key_id": "<string>",
"secret_access_key": "<string>",
"region": "<string>",
"bucket_name": "<string>",
"endpoint": "<string>",
"directory": "<string>",
"use_path_style": True
},
"name": "Target",
"description": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
config: {
access_key_id: '<string>',
secret_access_key: '<string>',
region: '<string>',
bucket_name: '<string>',
endpoint: '<string>',
directory: '<string>',
use_path_style: true
},
name: 'Target',
description: '<string>'
})
};
fetch('https://api.gcore.com/cdn/logs_uploader/targets', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'config' => [
'access_key_id' => '<string>',
'secret_access_key' => '<string>',
'region' => '<string>',
'bucket_name' => '<string>',
'endpoint' => '<string>',
'directory' => '<string>',
'use_path_style' => true
],
'name' => 'Target',
'description' => '<string>'
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.gcore.com/cdn/logs_uploader/targets"
payload := strings.NewReader("{\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 \"name\": \"Target\",\n \"description\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.gcore.com/cdn/logs_uploader/targets")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\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 \"name\": \"Target\",\n \"description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/cdn/logs_uploader/targets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\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 \"name\": \"Target\",\n \"description\": \"<string>\"\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",
"name": "<string>",
"description": "<string>",
"related_uploader_configs": [
123
],
"status": {
"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
API key for authentication. Make sure to include the word apikey, followed by a single space and then your token.
Example: apikey 1234$abcdef
Body
application/json
Type of storage for logs.
Available options:
s3_gcore, s3_amazon, s3_oss, s3_other, s3_v1, ftp, sftp, http, azure_blob, sls Config for specific storage type.
- S3 Gcore Config
- S3 Amazon Config
- S3 OSS Config
- S3 Other Config
- S3 V1 Config
- FTP Config
- SFTP Config
- HTTP Config
- Azure Blob Config
- SLS Config
Show child attributes
Show child attributes
Name of the target.
Maximum string length:
255Description of the target.
Maximum string length:
255Response
Successful.
Client that owns the target.
Time when logs uploader target was created.
Time when logs uploader target was updated.
Type of storage for logs.
Available options:
s3_gcore, s3_amazon, s3_oss, s3_other, s3_v1, ftp, sftp, http, azure_blob, sls Name of the target.
Maximum string length:
255Description of the target.
Maximum string length:
255List of logs uploader configs that use this target.
Validation status of the logs uploader target. Informs if the specified target is reachable.
Show child attributes
Show child attributes
Config for specific storage type.
- S3 Gcore Config
- S3 Amazon Config
- S3 OSS Config
- S3 Other Config
- S3 V1 Config
- FTP Config
- SFTP Config
- HTTP Config
- Azure Blob Config
- SLS Config
Show child attributes
Show child attributes
Was this page helpful?
⌘I