from engini import Engini
client = Engini() # reads ENGINI_API_KEY
agent = client.opa.create("Warehouse SQL")
# the response carries the agent token - store it nowimport { Engini } from "@engini/sdk";
const client = new Engini(); // reads ENGINI_API_KEY
const agent = await client.opa.create({ name: "Warehouse SQL" });
// the response carries the agent token - store it nowengini opa create --name "Warehouse SQL" --jsonconst options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
applicationSlug: '<string>',
settings: {parallelTasks: 123, pullPeriodSeconds: 123, logLevel: '<string>'}
})
};
fetch('https://api.engini.io/v1/on-prem-agents', 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.engini.io/v1/on-prem-agents",
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([
'name' => '<string>',
'description' => '<string>',
'applicationSlug' => '<string>',
'settings' => [
'parallelTasks' => 123,
'pullPeriodSeconds' => 123,
'logLevel' => '<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.engini.io/v1/on-prem-agents"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"applicationSlug\": \"<string>\",\n \"settings\": {\n \"parallelTasks\": 123,\n \"pullPeriodSeconds\": 123,\n \"logLevel\": \"<string>\"\n }\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://api.engini.io/v1/on-prem-agents")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"applicationSlug\": \"<string>\",\n \"settings\": {\n \"parallelTasks\": 123,\n \"pullPeriodSeconds\": 123,\n \"logLevel\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.engini.io/v1/on-prem-agents")
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 \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"applicationSlug\": \"<string>\",\n \"settings\": {\n \"parallelTasks\": 123,\n \"pullPeriodSeconds\": 123,\n \"logLevel\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"agentId": 123,
"status": "<string>",
"createdBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdDate": "2023-11-07T05:31:56Z",
"name": "<string>",
"description": "<string>",
"version": "<string>",
"lastSeenAt": "2023-11-07T05:31:56Z",
"workspace": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"environment": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"type": "<string>"
},
"updatedBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"updatedDate": "2023-11-07T05:31:56Z",
"settings": {
"parallelTasks": 123,
"pullPeriodSeconds": 123,
"logLevel": "<string>"
},
"appliedToAgent": true,
"dispatchedTaskIds": [
"<string>"
],
"token": "<string>"
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}Create an on-premise agent.
The response carries the agent’s token - the live credential it uses to authenticate to the task service - so a machine can provision a box in one round-trip. Callers who would rather not have it in shell history can omit it here and read it later from GET /v1/on-prem-agents//token.
Each setting is range-checked against what this agent’s connector declares it accepts - currently parallelTasks 1-100 and pullPeriodSeconds 10-9999999, the same bounds the Engini UI enforces. An out-of-range value is a 400 naming each offending field, and persists nothing. Note the DTO summaries in the published Engini.Models package still say “Minimum 1” for both; the bounds enforced here are the connector’s own metadata.
from engini import Engini
client = Engini() # reads ENGINI_API_KEY
agent = client.opa.create("Warehouse SQL")
# the response carries the agent token - store it nowimport { Engini } from "@engini/sdk";
const client = new Engini(); // reads ENGINI_API_KEY
const agent = await client.opa.create({ name: "Warehouse SQL" });
// the response carries the agent token - store it nowengini opa create --name "Warehouse SQL" --jsonconst options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
applicationSlug: '<string>',
settings: {parallelTasks: 123, pullPeriodSeconds: 123, logLevel: '<string>'}
})
};
fetch('https://api.engini.io/v1/on-prem-agents', 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.engini.io/v1/on-prem-agents",
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([
'name' => '<string>',
'description' => '<string>',
'applicationSlug' => '<string>',
'settings' => [
'parallelTasks' => 123,
'pullPeriodSeconds' => 123,
'logLevel' => '<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.engini.io/v1/on-prem-agents"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"applicationSlug\": \"<string>\",\n \"settings\": {\n \"parallelTasks\": 123,\n \"pullPeriodSeconds\": 123,\n \"logLevel\": \"<string>\"\n }\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://api.engini.io/v1/on-prem-agents")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"applicationSlug\": \"<string>\",\n \"settings\": {\n \"parallelTasks\": 123,\n \"pullPeriodSeconds\": 123,\n \"logLevel\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.engini.io/v1/on-prem-agents")
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 \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"applicationSlug\": \"<string>\",\n \"settings\": {\n \"parallelTasks\": 123,\n \"pullPeriodSeconds\": 123,\n \"logLevel\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"agentId": 123,
"status": "<string>",
"createdBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdDate": "2023-11-07T05:31:56Z",
"name": "<string>",
"description": "<string>",
"version": "<string>",
"lastSeenAt": "2023-11-07T05:31:56Z",
"workspace": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"environment": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"type": "<string>"
},
"updatedBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"updatedDate": "2023-11-07T05:31:56Z",
"settings": {
"parallelTasks": 123,
"pullPeriodSeconds": 123,
"logLevel": "<string>"
},
"appliedToAgent": true,
"dispatchedTaskIds": [
"<string>"
],
"token": "<string>"
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}Body
The agent creation payload. name is required; each omitted setting takes its own default (2 parallel tasks, 10s pull, Information).
Request body for creating an on-premise agent.
Response
The newly created agent, including its token.
Response for agent creation. Carries the token so a caller can provision a box in one round-trip. The token is a live credential - callers who would rather not have it in shell history should read it later from GET /v1/on-prem-agents/{id}/token instead.