Create a connector
curl --request POST \
--url https://sreagent.app/api/v1/config/connectors \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"config": {},
"connector_type": "<string>",
"name": "<string>",
"enabled": true,
"metadata": {}
}
'import requests
url = "https://sreagent.app/api/v1/config/connectors"
payload = {
"config": {},
"connector_type": "<string>",
"name": "<string>",
"enabled": True,
"metadata": {}
}
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({
config: {},
connector_type: '<string>',
name: '<string>',
enabled: true,
metadata: {}
})
};
fetch('https://sreagent.app/api/v1/config/connectors', 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://sreagent.app/api/v1/config/connectors",
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' => [
],
'connector_type' => '<string>',
'name' => '<string>',
'enabled' => true,
'metadata' => [
]
]),
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://sreagent.app/api/v1/config/connectors"
payload := strings.NewReader("{\n \"config\": {},\n \"connector_type\": \"<string>\",\n \"name\": \"<string>\",\n \"enabled\": true,\n \"metadata\": {}\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://sreagent.app/api/v1/config/connectors")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"config\": {},\n \"connector_type\": \"<string>\",\n \"name\": \"<string>\",\n \"enabled\": true,\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sreagent.app/api/v1/config/connectors")
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 \"config\": {},\n \"connector_type\": \"<string>\",\n \"name\": \"<string>\",\n \"enabled\": true,\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"error": "<string>",
"message": "<string>"
}connectors
Create a connector
Create an infrastructure connector a runbook step can act through. connector_type is one of kubernetes, ssh, aws_ecs, aws_lambda, aws_ec2, aws_eks, aws_iam, aws_cleanup. aws_iam is the IAM hygiene connector and only self-healing's Security area acts through it (no runbook step can use it, and no read of the account does): it reads a user's access keys and changes a key's status, with a role of its own that needs exactly iam:GetAccessKeyLastUsed, iam:GetUser, iam:ListAccessKeys, iam:UpdateAccessKey on the account's users. aws_cleanup is the only role SRE Agent deletes with (IAM access keys and console passwords, unattached volumes, unassociated Elastic IPs, old snapshots and images, and the retention of log groups that never expire): without it nothing is ever deleted, whatever the autonomy tier. Only self-healing's Security and FinOps areas act through it, after an acknowledgement that names deletions; no runbook step can use it and no read of the account does. Its role is its own and needs exactly autoscaling:DescribeLaunchConfigurations, cloudtrail:DescribeTrails, cloudtrail:LookupEvents, ec2:CreateSnapshot, ec2:CreateTags, ec2:CreateVolume, ec2:DeleteSnapshot, ec2:DeleteVolume, ec2:DeregisterImage, ec2:DescribeAddresses, ec2:DescribeAddressesAttribute, ec2:DescribeImageAttribute, ec2:DescribeImages, ec2:DescribeInstances, ec2:DescribeLaunchTemplateVersions, ec2:DescribeLaunchTemplates, ec2:DescribeSnapshotAttribute, ec2:DescribeSnapshots, ec2:DescribeVolumes, ec2:ListImagesInRecycleBin, ec2:ListSnapshotsInRecycleBin, ec2:ReleaseAddress, ec2:RestoreImageFromRecycleBin, ec2:RestoreSnapshotFromRecycleBin, iam:DeleteAccessKey, iam:DeleteLoginProfile, iam:GetAccessKeyLastUsed, iam:GetGroupPolicy, iam:GetLoginProfile, iam:GetPolicy, iam:GetPolicyVersion, iam:GetUser, iam:GetUserPolicy, iam:ListAccessKeys, iam:ListAttachedGroupPolicies, iam:ListAttachedUserPolicies, iam:ListGroupPolicies, iam:ListGroupsForUser, iam:ListMFADevices, iam:ListUserPolicies, kms:CreateGrant, kms:Decrypt, kms:DescribeKey, kms:GenerateDataKeyWithoutPlaintext, kms:ReEncryptFrom, kms:ReEncryptTo, logs:DeleteRetentionPolicy, logs:DescribeLogGroups, logs:ListTagsForResource, logs:PutRetentionPolicy, rbin:GetRule, rbin:ListRules, with a Deny of every deletion on resources tagged sre-agent:protect. aws_eks is for discovery: it lists EKS clusters and the workloads Container Insights reports, and like every AWS connector it also reads the account-wide inventory (VPCs, subnets, security groups, load balancers, target groups, RDS, ACM). Its role needs exactly these read grants and nothing that writes: acm:ListCertificates, cloudwatch:ListMetrics, ec2:DescribeSecurityGroups, ec2:DescribeSubnets, ec2:DescribeVpcs, eks:DescribeCluster, eks:ListClusters, elasticloadbalancing:DescribeLoadBalancers, elasticloadbalancing:DescribeTargetGroups, rds:DescribeDBInstances. Runbook actions through it need their own grants. To reach EC2 instances via SSM, use aws_ec2 and grant the AWS credentials ssm:SendCommand. `config` holds the type-specific credentials: kubernetes -> {"kubeconfig":"..."}; ssh -> {"host","user","private_key","port"}; aws_* -> {"auth_type":"aws_assume_role"|"aws_access_keys", "role_arn"|"access_key_id"/"secret_access_key", "region"}. metadata labels drive connector selection when several of a type exist.
POST
/
connectors
Create a connector
curl --request POST \
--url https://sreagent.app/api/v1/config/connectors \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"config": {},
"connector_type": "<string>",
"name": "<string>",
"enabled": true,
"metadata": {}
}
'import requests
url = "https://sreagent.app/api/v1/config/connectors"
payload = {
"config": {},
"connector_type": "<string>",
"name": "<string>",
"enabled": True,
"metadata": {}
}
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({
config: {},
connector_type: '<string>',
name: '<string>',
enabled: true,
metadata: {}
})
};
fetch('https://sreagent.app/api/v1/config/connectors', 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://sreagent.app/api/v1/config/connectors",
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' => [
],
'connector_type' => '<string>',
'name' => '<string>',
'enabled' => true,
'metadata' => [
]
]),
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://sreagent.app/api/v1/config/connectors"
payload := strings.NewReader("{\n \"config\": {},\n \"connector_type\": \"<string>\",\n \"name\": \"<string>\",\n \"enabled\": true,\n \"metadata\": {}\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://sreagent.app/api/v1/config/connectors")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"config\": {},\n \"connector_type\": \"<string>\",\n \"name\": \"<string>\",\n \"enabled\": true,\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sreagent.app/api/v1/config/connectors")
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 \"config\": {},\n \"connector_type\": \"<string>\",\n \"name\": \"<string>\",\n \"enabled\": true,\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"error": "<string>",
"message": "<string>"
}Authorizations
Body
application/json
Response
Created.
Was this page helpful?