Register Application To Queue
curl --request POST \
--url https://{host}/api/resources/v1/app-runtime-config/{queue_id}/application/{app_id} \
--header 'Content-Type: application/json' \
--data '
{
"env": {},
"default_resources": {
"cpu": 123,
"memory_gb": 123
},
"attributes": {
"image": "<string>",
"working_dir": "<string>",
"mount": {},
"network": "<string>",
"ports": [
123
]
},
"service_port": 123
}
'import requests
url = "https://{host}/api/resources/v1/app-runtime-config/{queue_id}/application/{app_id}"
payload = {
"env": {},
"default_resources": {
"cpu": 123,
"memory_gb": 123
},
"attributes": {
"image": "<string>",
"working_dir": "<string>",
"mount": {},
"network": "<string>",
"ports": [123]
},
"service_port": 123
}
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({
env: {},
default_resources: {cpu: 123, memory_gb: 123},
attributes: {
image: '<string>',
working_dir: '<string>',
mount: {},
network: '<string>',
ports: [123]
},
service_port: 123
})
};
fetch('https://{host}/api/resources/v1/app-runtime-config/{queue_id}/application/{app_id}', 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://{host}/api/resources/v1/app-runtime-config/{queue_id}/application/{app_id}",
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([
'env' => [
],
'default_resources' => [
'cpu' => 123,
'memory_gb' => 123
],
'attributes' => [
'image' => '<string>',
'working_dir' => '<string>',
'mount' => [
],
'network' => '<string>',
'ports' => [
123
]
],
'service_port' => 123
]),
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 := "https://{host}/api/resources/v1/app-runtime-config/{queue_id}/application/{app_id}"
payload := strings.NewReader("{\n \"env\": {},\n \"default_resources\": {\n \"cpu\": 123,\n \"memory_gb\": 123\n },\n \"attributes\": {\n \"image\": \"<string>\",\n \"working_dir\": \"<string>\",\n \"mount\": {},\n \"network\": \"<string>\",\n \"ports\": [\n 123\n ]\n },\n \"service_port\": 123\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("https://{host}/api/resources/v1/app-runtime-config/{queue_id}/application/{app_id}")
.header("Content-Type", "application/json")
.body("{\n \"env\": {},\n \"default_resources\": {\n \"cpu\": 123,\n \"memory_gb\": 123\n },\n \"attributes\": {\n \"image\": \"<string>\",\n \"working_dir\": \"<string>\",\n \"mount\": {},\n \"network\": \"<string>\",\n \"ports\": [\n 123\n ]\n },\n \"service_port\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/resources/v1/app-runtime-config/{queue_id}/application/{app_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"env\": {},\n \"default_resources\": {\n \"cpu\": 123,\n \"memory_gb\": 123\n },\n \"attributes\": {\n \"image\": \"<string>\",\n \"working_dir\": \"<string>\",\n \"mount\": {},\n \"network\": \"<string>\",\n \"ports\": [\n 123\n ]\n },\n \"service_port\": 123\n}"
response = http.request(request)
puts response.read_bodyusing RestSharp;
var options = new RestClientOptions("https://{host}/api/resources/v1/app-runtime-config/{queue_id}/application/{app_id}");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddJsonBody("{\n \"env\": {},\n \"default_resources\": {\n \"cpu\": 123,\n \"memory_gb\": 123\n },\n \"attributes\": {\n \"image\": \"<string>\",\n \"working_dir\": \"<string>\",\n \"mount\": {},\n \"network\": \"<string>\",\n \"ports\": [\n 123\n ]\n },\n \"service_port\": 123\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_WRITEDATA, stdout);
curl_easy_setopt(hnd, CURLOPT_URL, "https://{host}/api/resources/v1/app-runtime-config/{queue_id}/application/{app_id}");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Content-Type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"env\": {},\n \"default_resources\": {\n \"cpu\": 123,\n \"memory_gb\": 123\n },\n \"attributes\": {\n \"image\": \"<string>\",\n \"working_dir\": \"<string>\",\n \"mount\": {},\n \"network\": \"<string>\",\n \"ports\": [\n 123\n ]\n },\n \"service_port\": 123\n}");
CURLcode ret = curl_easy_perform(hnd);123{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Register Application To Queue
Registers an application to the provided queue.
:param queue_id: The queue where the application will be registered :param app_id: The application to register
POST
/
app-runtime-config
/
{queue_id}
/
application
/
{app_id}
Register Application To Queue
curl --request POST \
--url https://{host}/api/resources/v1/app-runtime-config/{queue_id}/application/{app_id} \
--header 'Content-Type: application/json' \
--data '
{
"env": {},
"default_resources": {
"cpu": 123,
"memory_gb": 123
},
"attributes": {
"image": "<string>",
"working_dir": "<string>",
"mount": {},
"network": "<string>",
"ports": [
123
]
},
"service_port": 123
}
'import requests
url = "https://{host}/api/resources/v1/app-runtime-config/{queue_id}/application/{app_id}"
payload = {
"env": {},
"default_resources": {
"cpu": 123,
"memory_gb": 123
},
"attributes": {
"image": "<string>",
"working_dir": "<string>",
"mount": {},
"network": "<string>",
"ports": [123]
},
"service_port": 123
}
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({
env: {},
default_resources: {cpu: 123, memory_gb: 123},
attributes: {
image: '<string>',
working_dir: '<string>',
mount: {},
network: '<string>',
ports: [123]
},
service_port: 123
})
};
fetch('https://{host}/api/resources/v1/app-runtime-config/{queue_id}/application/{app_id}', 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://{host}/api/resources/v1/app-runtime-config/{queue_id}/application/{app_id}",
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([
'env' => [
],
'default_resources' => [
'cpu' => 123,
'memory_gb' => 123
],
'attributes' => [
'image' => '<string>',
'working_dir' => '<string>',
'mount' => [
],
'network' => '<string>',
'ports' => [
123
]
],
'service_port' => 123
]),
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 := "https://{host}/api/resources/v1/app-runtime-config/{queue_id}/application/{app_id}"
payload := strings.NewReader("{\n \"env\": {},\n \"default_resources\": {\n \"cpu\": 123,\n \"memory_gb\": 123\n },\n \"attributes\": {\n \"image\": \"<string>\",\n \"working_dir\": \"<string>\",\n \"mount\": {},\n \"network\": \"<string>\",\n \"ports\": [\n 123\n ]\n },\n \"service_port\": 123\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("https://{host}/api/resources/v1/app-runtime-config/{queue_id}/application/{app_id}")
.header("Content-Type", "application/json")
.body("{\n \"env\": {},\n \"default_resources\": {\n \"cpu\": 123,\n \"memory_gb\": 123\n },\n \"attributes\": {\n \"image\": \"<string>\",\n \"working_dir\": \"<string>\",\n \"mount\": {},\n \"network\": \"<string>\",\n \"ports\": [\n 123\n ]\n },\n \"service_port\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/resources/v1/app-runtime-config/{queue_id}/application/{app_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"env\": {},\n \"default_resources\": {\n \"cpu\": 123,\n \"memory_gb\": 123\n },\n \"attributes\": {\n \"image\": \"<string>\",\n \"working_dir\": \"<string>\",\n \"mount\": {},\n \"network\": \"<string>\",\n \"ports\": [\n 123\n ]\n },\n \"service_port\": 123\n}"
response = http.request(request)
puts response.read_bodyusing RestSharp;
var options = new RestClientOptions("https://{host}/api/resources/v1/app-runtime-config/{queue_id}/application/{app_id}");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddJsonBody("{\n \"env\": {},\n \"default_resources\": {\n \"cpu\": 123,\n \"memory_gb\": 123\n },\n \"attributes\": {\n \"image\": \"<string>\",\n \"working_dir\": \"<string>\",\n \"mount\": {},\n \"network\": \"<string>\",\n \"ports\": [\n 123\n ]\n },\n \"service_port\": 123\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_WRITEDATA, stdout);
curl_easy_setopt(hnd, CURLOPT_URL, "https://{host}/api/resources/v1/app-runtime-config/{queue_id}/application/{app_id}");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Content-Type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"env\": {},\n \"default_resources\": {\n \"cpu\": 123,\n \"memory_gb\": 123\n },\n \"attributes\": {\n \"image\": \"<string>\",\n \"working_dir\": \"<string>\",\n \"mount\": {},\n \"network\": \"<string>\",\n \"ports\": [\n 123\n ]\n },\n \"service_port\": 123\n}");
CURLcode ret = curl_easy_perform(hnd);123{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Body
application/json
AppRuntimeConfig definition for creation.
Response
Successful Response
The response is of type integer.
Was this page helpful?