Create a source
curl --request POST \
--url http://localhost:9601/workspaces/{ws_id}/sources \
--header 'Content-Type: application/json' \
--data '
{
"config": {
"http": {
"methods": [
"POST"
]
}
},
"id": "<string>",
"name": "<string>",
"enabled": true,
"type": "http",
"async": false,
"metadata": {},
"rate_limit": {
"quota": 1,
"period": 2
}
}
'import requests
url = "http://localhost:9601/workspaces/{ws_id}/sources"
payload = {
"config": { "http": { "methods": ["POST"] } },
"id": "<string>",
"name": "<string>",
"enabled": True,
"type": "http",
"async": False,
"metadata": {},
"rate_limit": {
"quota": 1,
"period": 2
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
config: {http: {methods: ['POST']}},
id: '<string>',
name: '<string>',
enabled: true,
type: 'http',
async: false,
metadata: {},
rate_limit: {quota: 1, period: 2}
})
};
fetch('http://localhost:9601/workspaces/{ws_id}/sources', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "9601",
CURLOPT_URL => "http://localhost:9601/workspaces/{ws_id}/sources",
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' => [
'http' => [
'methods' => [
'POST'
]
]
],
'id' => '<string>',
'name' => '<string>',
'enabled' => true,
'type' => 'http',
'async' => false,
'metadata' => [
],
'rate_limit' => [
'quota' => 1,
'period' => 2
]
]),
CURLOPT_HTTPHEADER => [
"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 := "http://localhost:9601/workspaces/{ws_id}/sources"
payload := strings.NewReader("{\n \"config\": {\n \"http\": {\n \"methods\": [\n \"POST\"\n ]\n }\n },\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"enabled\": true,\n \"type\": \"http\",\n \"async\": false,\n \"metadata\": {},\n \"rate_limit\": {\n \"quota\": 1,\n \"period\": 2\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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("http://localhost:9601/workspaces/{ws_id}/sources")
.header("Content-Type", "application/json")
.body("{\n \"config\": {\n \"http\": {\n \"methods\": [\n \"POST\"\n ]\n }\n },\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"enabled\": true,\n \"type\": \"http\",\n \"async\": false,\n \"metadata\": {},\n \"rate_limit\": {\n \"quota\": 1,\n \"period\": 2\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:9601/workspaces/{ws_id}/sources")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"config\": {\n \"http\": {\n \"methods\": [\n \"POST\"\n ]\n }\n },\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"enabled\": true,\n \"type\": \"http\",\n \"async\": false,\n \"metadata\": {},\n \"rate_limit\": {\n \"quota\": 1,\n \"period\": 2\n }\n}"
response = http.request(request)
puts response.read_body{
"config": {
"http": {
"methods": [
"POST"
]
}
},
"id": "<string>",
"name": "<string>",
"enabled": true,
"type": "http",
"async": false,
"metadata": {},
"rate_limit": {
"quota": 1,
"period": 2
},
"created_at": 123,
"updated_at": 123
}Source
Create a source
POST
/
workspaces
/
{ws_id}
/
sources
Create a source
curl --request POST \
--url http://localhost:9601/workspaces/{ws_id}/sources \
--header 'Content-Type: application/json' \
--data '
{
"config": {
"http": {
"methods": [
"POST"
]
}
},
"id": "<string>",
"name": "<string>",
"enabled": true,
"type": "http",
"async": false,
"metadata": {},
"rate_limit": {
"quota": 1,
"period": 2
}
}
'import requests
url = "http://localhost:9601/workspaces/{ws_id}/sources"
payload = {
"config": { "http": { "methods": ["POST"] } },
"id": "<string>",
"name": "<string>",
"enabled": True,
"type": "http",
"async": False,
"metadata": {},
"rate_limit": {
"quota": 1,
"period": 2
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
config: {http: {methods: ['POST']}},
id: '<string>',
name: '<string>',
enabled: true,
type: 'http',
async: false,
metadata: {},
rate_limit: {quota: 1, period: 2}
})
};
fetch('http://localhost:9601/workspaces/{ws_id}/sources', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "9601",
CURLOPT_URL => "http://localhost:9601/workspaces/{ws_id}/sources",
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' => [
'http' => [
'methods' => [
'POST'
]
]
],
'id' => '<string>',
'name' => '<string>',
'enabled' => true,
'type' => 'http',
'async' => false,
'metadata' => [
],
'rate_limit' => [
'quota' => 1,
'period' => 2
]
]),
CURLOPT_HTTPHEADER => [
"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 := "http://localhost:9601/workspaces/{ws_id}/sources"
payload := strings.NewReader("{\n \"config\": {\n \"http\": {\n \"methods\": [\n \"POST\"\n ]\n }\n },\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"enabled\": true,\n \"type\": \"http\",\n \"async\": false,\n \"metadata\": {},\n \"rate_limit\": {\n \"quota\": 1,\n \"period\": 2\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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("http://localhost:9601/workspaces/{ws_id}/sources")
.header("Content-Type", "application/json")
.body("{\n \"config\": {\n \"http\": {\n \"methods\": [\n \"POST\"\n ]\n }\n },\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"enabled\": true,\n \"type\": \"http\",\n \"async\": false,\n \"metadata\": {},\n \"rate_limit\": {\n \"quota\": 1,\n \"period\": 2\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:9601/workspaces/{ws_id}/sources")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"config\": {\n \"http\": {\n \"methods\": [\n \"POST\"\n ]\n }\n },\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"enabled\": true,\n \"type\": \"http\",\n \"async\": false,\n \"metadata\": {},\n \"rate_limit\": {\n \"quota\": 1,\n \"period\": 2\n }\n}"
response = http.request(request)
puts response.read_body{
"config": {
"http": {
"methods": [
"POST"
]
}
},
"id": "<string>",
"name": "<string>",
"enabled": true,
"type": "http",
"async": false,
"metadata": {},
"rate_limit": {
"quota": 1,
"period": 2
},
"created_at": 123,
"updated_at": 123
}Path Parameters
The workspace id
Example:
"default"
Body
application/json
Show child attributes
Show child attributes
Available options:
http Whether to ingest events asynchronously through the queue
Show child attributes
Show child attributes
The rate limit that uses GCRA algorithm (a variant of the leaky bucket algorithm that supports bursts).
Show child attributes
Show child attributes
Response
200 - application/json
OK
Show child attributes
Show child attributes
Available options:
http Whether to ingest events asynchronously through the queue
Show child attributes
Show child attributes
The rate limit that uses GCRA algorithm (a variant of the leaky bucket algorithm that supports bursts).
Show child attributes
Show child attributes
⌘I