Integrations
Create integration
Register a Link instance as an integration so Specter can discover and use the backends it exposes.
POST
/
api
/
admin
/
integrations
Create integration
curl --request POST \
--url https://{instance}.{env}.on-hellgate.cloud/api/admin/integrations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"base_url": "http://link:4000",
"name": "Link Production",
"slug": "link-prod",
"type": "link",
"description": "<string>",
"enabled": true,
"timeout_ms": 5000
}
'import requests
url = "https://{instance}.{env}.on-hellgate.cloud/api/admin/integrations"
payload = {
"base_url": "http://link:4000",
"name": "Link Production",
"slug": "link-prod",
"type": "link",
"description": "<string>",
"enabled": True,
"timeout_ms": 5000
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
base_url: 'http://link:4000',
name: 'Link Production',
slug: 'link-prod',
type: 'link',
description: '<string>',
enabled: true,
timeout_ms: 5000
})
};
fetch('https://{instance}.{env}.on-hellgate.cloud/api/admin/integrations', 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://{instance}.{env}.on-hellgate.cloud/api/admin/integrations",
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([
'base_url' => 'http://link:4000',
'name' => 'Link Production',
'slug' => 'link-prod',
'type' => 'link',
'description' => '<string>',
'enabled' => true,
'timeout_ms' => 5000
]),
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://{instance}.{env}.on-hellgate.cloud/api/admin/integrations"
payload := strings.NewReader("{\n \"base_url\": \"http://link:4000\",\n \"name\": \"Link Production\",\n \"slug\": \"link-prod\",\n \"type\": \"link\",\n \"description\": \"<string>\",\n \"enabled\": true,\n \"timeout_ms\": 5000\n}")
req, _ := http.NewRequest("POST", 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.post("https://{instance}.{env}.on-hellgate.cloud/api/admin/integrations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"base_url\": \"http://link:4000\",\n \"name\": \"Link Production\",\n \"slug\": \"link-prod\",\n \"type\": \"link\",\n \"description\": \"<string>\",\n \"enabled\": true,\n \"timeout_ms\": 5000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{instance}.{env}.on-hellgate.cloud/api/admin/integrations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"base_url\": \"http://link:4000\",\n \"name\": \"Link Production\",\n \"slug\": \"link-prod\",\n \"type\": \"link\",\n \"description\": \"<string>\",\n \"enabled\": true,\n \"timeout_ms\": 5000\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"base_url": "http://link:4000",
"description": "<string>",
"enabled": true,
"inserted_at": "2023-11-07T05:31:56Z",
"name": "Link Production",
"slug": "link-prod",
"timeout_ms": 5000,
"type": "link",
"updated_at": "2023-11-07T05:31:56Z"
}{
"classifier": "NOT_FOUND",
"code": 404,
"message": "The requested resource does not exist"
}{
"classifier": "NOT_FOUND",
"code": 404,
"message": "The requested resource does not exist"
}{
"classifier": "VALIDATION_ERROR",
"code": 422,
"validation_errors": [
{
"message": "must be a positive integer",
"path": "limit"
}
]
}Authorizations
HS256-signed JWT bearer token, obtained via the OAuth2 client-credentials grant (see Authentication).
Body
application/json
Integration attributes
Example:
"http://link:4000"
Example:
"Link Production"
Stable, lowercase slug used to reference the integration in rules
Example:
"link-prod"
link — points at a Link instance (rules supply a /<backend_id> suffix).
Available options:
link Example:
5000
Response
Created integration
Previous
Get integrationsList the Link integrations registered on this instance. Each integration exposes one or more backends to
your rulesets.
Next
⌘I
Create integration
curl --request POST \
--url https://{instance}.{env}.on-hellgate.cloud/api/admin/integrations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"base_url": "http://link:4000",
"name": "Link Production",
"slug": "link-prod",
"type": "link",
"description": "<string>",
"enabled": true,
"timeout_ms": 5000
}
'import requests
url = "https://{instance}.{env}.on-hellgate.cloud/api/admin/integrations"
payload = {
"base_url": "http://link:4000",
"name": "Link Production",
"slug": "link-prod",
"type": "link",
"description": "<string>",
"enabled": True,
"timeout_ms": 5000
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
base_url: 'http://link:4000',
name: 'Link Production',
slug: 'link-prod',
type: 'link',
description: '<string>',
enabled: true,
timeout_ms: 5000
})
};
fetch('https://{instance}.{env}.on-hellgate.cloud/api/admin/integrations', 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://{instance}.{env}.on-hellgate.cloud/api/admin/integrations",
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([
'base_url' => 'http://link:4000',
'name' => 'Link Production',
'slug' => 'link-prod',
'type' => 'link',
'description' => '<string>',
'enabled' => true,
'timeout_ms' => 5000
]),
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://{instance}.{env}.on-hellgate.cloud/api/admin/integrations"
payload := strings.NewReader("{\n \"base_url\": \"http://link:4000\",\n \"name\": \"Link Production\",\n \"slug\": \"link-prod\",\n \"type\": \"link\",\n \"description\": \"<string>\",\n \"enabled\": true,\n \"timeout_ms\": 5000\n}")
req, _ := http.NewRequest("POST", 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.post("https://{instance}.{env}.on-hellgate.cloud/api/admin/integrations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"base_url\": \"http://link:4000\",\n \"name\": \"Link Production\",\n \"slug\": \"link-prod\",\n \"type\": \"link\",\n \"description\": \"<string>\",\n \"enabled\": true,\n \"timeout_ms\": 5000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{instance}.{env}.on-hellgate.cloud/api/admin/integrations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"base_url\": \"http://link:4000\",\n \"name\": \"Link Production\",\n \"slug\": \"link-prod\",\n \"type\": \"link\",\n \"description\": \"<string>\",\n \"enabled\": true,\n \"timeout_ms\": 5000\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"base_url": "http://link:4000",
"description": "<string>",
"enabled": true,
"inserted_at": "2023-11-07T05:31:56Z",
"name": "Link Production",
"slug": "link-prod",
"timeout_ms": 5000,
"type": "link",
"updated_at": "2023-11-07T05:31:56Z"
}{
"classifier": "NOT_FOUND",
"code": 404,
"message": "The requested resource does not exist"
}{
"classifier": "NOT_FOUND",
"code": 404,
"message": "The requested resource does not exist"
}{
"classifier": "VALIDATION_ERROR",
"code": 422,
"validation_errors": [
{
"message": "must be a positive integer",
"path": "limit"
}
]
}