Log Drains
Update a log drain
Updates an existing log drain’s configuration.
PATCH
/
v1
/
log-drains
/
{drainID}
Update a log drain
curl --request PATCH \
--url https://api.strait.dev/v1/log-drains/{drainID} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"auth_config": {},
"auth_type": "<string>",
"enabled": true,
"endpoint_url": "<string>",
"level_filter": [
"<string>"
],
"name": "<string>"
}
'import requests
url = "https://api.strait.dev/v1/log-drains/{drainID}"
payload = {
"auth_config": {},
"auth_type": "<string>",
"enabled": True,
"endpoint_url": "<string>",
"level_filter": ["<string>"],
"name": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
auth_config: {},
auth_type: '<string>',
enabled: true,
endpoint_url: '<string>',
level_filter: ['<string>'],
name: '<string>'
})
};
fetch('https://api.strait.dev/v1/log-drains/{drainID}', 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.strait.dev/v1/log-drains/{drainID}",
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([
'auth_config' => [
],
'auth_type' => '<string>',
'enabled' => true,
'endpoint_url' => '<string>',
'level_filter' => [
'<string>'
],
'name' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.strait.dev/v1/log-drains/{drainID}"
payload := strings.NewReader("{\n \"auth_config\": {},\n \"auth_type\": \"<string>\",\n \"enabled\": true,\n \"endpoint_url\": \"<string>\",\n \"level_filter\": [\n \"<string>\"\n ],\n \"name\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.patch("https://api.strait.dev/v1/log-drains/{drainID}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"auth_config\": {},\n \"auth_type\": \"<string>\",\n \"enabled\": true,\n \"endpoint_url\": \"<string>\",\n \"level_filter\": [\n \"<string>\"\n ],\n \"name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.strait.dev/v1/log-drains/{drainID}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"auth_config\": {},\n \"auth_type\": \"<string>\",\n \"enabled\": true,\n \"endpoint_url\": \"<string>\",\n \"level_filter\": [\n \"<string>\"\n ],\n \"name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"auth_type": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"drain_type": "<string>",
"enabled": true,
"endpoint_url": "<string>",
"id": "<string>",
"name": "<string>",
"project_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"$schema": "<string>",
"auth_config": {},
"level_filter": [
"<string>"
]
}{
"$schema": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "about:blank"
}{
"$schema": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "about:blank"
}{
"$schema": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "about:blank"
}{
"$schema": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "about:blank"
}{
"$schema": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "about:blank"
}Authorizations
API key passed as Bearer token
Path Parameters
Body
application/json
Response
OK
A URL to the JSON Schema for this object.
Example:
"https://api.strait.dev/schemas/LogDrain.json"
Show child attributes
Show child attributes
⌘I
Update a log drain
curl --request PATCH \
--url https://api.strait.dev/v1/log-drains/{drainID} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"auth_config": {},
"auth_type": "<string>",
"enabled": true,
"endpoint_url": "<string>",
"level_filter": [
"<string>"
],
"name": "<string>"
}
'import requests
url = "https://api.strait.dev/v1/log-drains/{drainID}"
payload = {
"auth_config": {},
"auth_type": "<string>",
"enabled": True,
"endpoint_url": "<string>",
"level_filter": ["<string>"],
"name": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
auth_config: {},
auth_type: '<string>',
enabled: true,
endpoint_url: '<string>',
level_filter: ['<string>'],
name: '<string>'
})
};
fetch('https://api.strait.dev/v1/log-drains/{drainID}', 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.strait.dev/v1/log-drains/{drainID}",
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([
'auth_config' => [
],
'auth_type' => '<string>',
'enabled' => true,
'endpoint_url' => '<string>',
'level_filter' => [
'<string>'
],
'name' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.strait.dev/v1/log-drains/{drainID}"
payload := strings.NewReader("{\n \"auth_config\": {},\n \"auth_type\": \"<string>\",\n \"enabled\": true,\n \"endpoint_url\": \"<string>\",\n \"level_filter\": [\n \"<string>\"\n ],\n \"name\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.patch("https://api.strait.dev/v1/log-drains/{drainID}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"auth_config\": {},\n \"auth_type\": \"<string>\",\n \"enabled\": true,\n \"endpoint_url\": \"<string>\",\n \"level_filter\": [\n \"<string>\"\n ],\n \"name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.strait.dev/v1/log-drains/{drainID}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"auth_config\": {},\n \"auth_type\": \"<string>\",\n \"enabled\": true,\n \"endpoint_url\": \"<string>\",\n \"level_filter\": [\n \"<string>\"\n ],\n \"name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"auth_type": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"drain_type": "<string>",
"enabled": true,
"endpoint_url": "<string>",
"id": "<string>",
"name": "<string>",
"project_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"$schema": "<string>",
"auth_config": {},
"level_filter": [
"<string>"
]
}{
"$schema": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "about:blank"
}{
"$schema": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "about:blank"
}{
"$schema": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "about:blank"
}{
"$schema": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "about:blank"
}{
"$schema": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "about:blank"
}