using Salad.Cloud.SDK;
using Salad.Cloud.SDK.Config;
using Salad.Cloud.SDK.Models;
var config = new SaladCloudSdkConfig{};
var client = new SaladCloudSdkClient(config);
var input = new QueueJobPrototype(new object {}, new object {}, "webhook");
var response = await client.Queues.CreateQueueJobAsync(input, "acme-corp", "dev-env", "fifo-queue");
Console.WriteLine(response);import com.salad.cloud.sdk.SaladCloudSdk;
import com.salad.cloud.sdk.config.ApiKeyAuthConfig;
import com.salad.cloud.sdk.config.SaladCloudSdkConfig;
import com.salad.cloud.sdk.models.QueueJob;
import com.salad.cloud.sdk.models.QueueJobPrototype;
public class Main {
public static void main(String[] args) {
SaladCloudSdkConfig config = SaladCloudSdkConfig.builder()
.apiKeyAuthConfig(ApiKeyAuthConfig.builder().apiKey("YOUR_API_KEY").build())
.build();
SaladCloudSdk saladCloudSdk = new SaladCloudSdk(config);
QueueJobPrototype queueJobPrototype = QueueJobPrototype.builder()
.input(new Object())
.metadata(new Object())
.webhook("webhook")
.build();
QueueJob response = saladCloudSdk.queues.createQueueJob("acme-corp", "dev-env", "fifo-queue", queueJobPrototype);
System.out.println(response);
}
}import (
"fmt"
"encoding/json"
"context"
"github.com/saladtechnologies/salad-cloud-sdk-go/pkg/saladcloudsdkconfig"
"github.com/saladtechnologies/salad-cloud-sdk-go/pkg/saladcloudsdk"
"github.com/saladtechnologies/salad-cloud-sdk-go/pkg/util"
"github.com/saladtechnologies/salad-cloud-sdk-go/pkg/queues"
)
config := saladcloudsdkconfig.NewConfig()
config.SetApiKey("API_KEY")
client := saladcloudsdk.NewSaladCloudSdk(config)
request := queues.QueueJobPrototype{
Input: []byte{},
Metadata: []byte{},
Webhook: util.ToPointer("webhook"),
}
response, err := client.Queues.CreateQueueJob(context.Background(), "acme-corp", "dev-env", "fifo-queue", request)
if err != nil {
panic(err)
}
fmt.Println(response)import { QueueJobPrototype, SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk';
(async () => {
const saladCloudSdk = new SaladCloudSdk({
apiKey: 'YOUR_API_KEY',
});
const queueJobPrototype: QueueJobPrototype = {
input: [],
metadata: {},
webhook: 'webhook',
};
const { data } = await saladCloudSdk.queues.createQueueJob('acme-corp', 'dev-env', 'fifo-queue', queueJobPrototype);
console.log(data);
})();from salad_cloud_sdk import SaladCloudSdk
from salad_cloud_sdk.models import QueueJobPrototype
sdk = SaladCloudSdk(
api_key="YOUR_API_KEY",
api_key_header="YOUR_API_KEY_HEADER",
timeout=10000
)
request_body = QueueJobPrototype(
input="",
metadata={},
webhook="webhook"
)
result = sdk.queues.create_queue_job(
request_body=request_body,
organization_name="acme-corp",
project_name="dev-env",
queue_name="fifo-queue"
)
print(result)curl --request POST \
--url https://api.salad.com/api/public/organizations/{organization_name}/projects/{project_name}/queues/{queue_name}/jobs \
--header 'Content-Type: application/json' \
--header 'Salad-Api-Key: <api-key>' \
--data '
{
"input": "<unknown>",
"metadata": {},
"webhook": "<string>"
}
'const options = {
method: 'POST',
headers: {'Salad-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({input: '<unknown>', metadata: {}, webhook: '<string>'})
};
fetch('https://api.salad.com/api/public/organizations/{organization_name}/projects/{project_name}/queues/{queue_name}/jobs', 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.salad.com/api/public/organizations/{organization_name}/projects/{project_name}/queues/{queue_name}/jobs",
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([
'input' => '<unknown>',
'metadata' => [
],
'webhook' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Salad-Api-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("https://api.salad.com/api/public/organizations/{organization_name}/projects/{project_name}/queues/{queue_name}/jobs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Salad-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"input\": \"<unknown>\",\n \"metadata\": {},\n \"webhook\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"create_time": "2023-11-07T05:31:56Z",
"events": [
{
"time": "2023-11-07T05:31:56Z"
}
],
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"input": "<unknown>",
"update_time": "2023-11-07T05:31:56Z",
"metadata": {},
"output": "<unknown>",
"webhook": "<string>"
}{
"detail": "<string>",
"instance": "<string>",
"status": 349,
"title": "<string>",
"type": "about:blank"
}{
"detail": "<string>",
"instance": "<string>",
"status": 349,
"title": "<string>",
"type": "about:blank"
}{
"detail": "<string>",
"instance": "<string>",
"status": 349,
"title": "<string>",
"type": "about:blank"
}{
"detail": "<string>",
"instance": "<string>",
"status": 349,
"title": "<string>",
"type": "about:blank"
}Create Job
Creates a new job
using Salad.Cloud.SDK;
using Salad.Cloud.SDK.Config;
using Salad.Cloud.SDK.Models;
var config = new SaladCloudSdkConfig{};
var client = new SaladCloudSdkClient(config);
var input = new QueueJobPrototype(new object {}, new object {}, "webhook");
var response = await client.Queues.CreateQueueJobAsync(input, "acme-corp", "dev-env", "fifo-queue");
Console.WriteLine(response);import com.salad.cloud.sdk.SaladCloudSdk;
import com.salad.cloud.sdk.config.ApiKeyAuthConfig;
import com.salad.cloud.sdk.config.SaladCloudSdkConfig;
import com.salad.cloud.sdk.models.QueueJob;
import com.salad.cloud.sdk.models.QueueJobPrototype;
public class Main {
public static void main(String[] args) {
SaladCloudSdkConfig config = SaladCloudSdkConfig.builder()
.apiKeyAuthConfig(ApiKeyAuthConfig.builder().apiKey("YOUR_API_KEY").build())
.build();
SaladCloudSdk saladCloudSdk = new SaladCloudSdk(config);
QueueJobPrototype queueJobPrototype = QueueJobPrototype.builder()
.input(new Object())
.metadata(new Object())
.webhook("webhook")
.build();
QueueJob response = saladCloudSdk.queues.createQueueJob("acme-corp", "dev-env", "fifo-queue", queueJobPrototype);
System.out.println(response);
}
}import (
"fmt"
"encoding/json"
"context"
"github.com/saladtechnologies/salad-cloud-sdk-go/pkg/saladcloudsdkconfig"
"github.com/saladtechnologies/salad-cloud-sdk-go/pkg/saladcloudsdk"
"github.com/saladtechnologies/salad-cloud-sdk-go/pkg/util"
"github.com/saladtechnologies/salad-cloud-sdk-go/pkg/queues"
)
config := saladcloudsdkconfig.NewConfig()
config.SetApiKey("API_KEY")
client := saladcloudsdk.NewSaladCloudSdk(config)
request := queues.QueueJobPrototype{
Input: []byte{},
Metadata: []byte{},
Webhook: util.ToPointer("webhook"),
}
response, err := client.Queues.CreateQueueJob(context.Background(), "acme-corp", "dev-env", "fifo-queue", request)
if err != nil {
panic(err)
}
fmt.Println(response)import { QueueJobPrototype, SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk';
(async () => {
const saladCloudSdk = new SaladCloudSdk({
apiKey: 'YOUR_API_KEY',
});
const queueJobPrototype: QueueJobPrototype = {
input: [],
metadata: {},
webhook: 'webhook',
};
const { data } = await saladCloudSdk.queues.createQueueJob('acme-corp', 'dev-env', 'fifo-queue', queueJobPrototype);
console.log(data);
})();from salad_cloud_sdk import SaladCloudSdk
from salad_cloud_sdk.models import QueueJobPrototype
sdk = SaladCloudSdk(
api_key="YOUR_API_KEY",
api_key_header="YOUR_API_KEY_HEADER",
timeout=10000
)
request_body = QueueJobPrototype(
input="",
metadata={},
webhook="webhook"
)
result = sdk.queues.create_queue_job(
request_body=request_body,
organization_name="acme-corp",
project_name="dev-env",
queue_name="fifo-queue"
)
print(result)curl --request POST \
--url https://api.salad.com/api/public/organizations/{organization_name}/projects/{project_name}/queues/{queue_name}/jobs \
--header 'Content-Type: application/json' \
--header 'Salad-Api-Key: <api-key>' \
--data '
{
"input": "<unknown>",
"metadata": {},
"webhook": "<string>"
}
'const options = {
method: 'POST',
headers: {'Salad-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({input: '<unknown>', metadata: {}, webhook: '<string>'})
};
fetch('https://api.salad.com/api/public/organizations/{organization_name}/projects/{project_name}/queues/{queue_name}/jobs', 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.salad.com/api/public/organizations/{organization_name}/projects/{project_name}/queues/{queue_name}/jobs",
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([
'input' => '<unknown>',
'metadata' => [
],
'webhook' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Salad-Api-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("https://api.salad.com/api/public/organizations/{organization_name}/projects/{project_name}/queues/{queue_name}/jobs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Salad-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"input\": \"<unknown>\",\n \"metadata\": {},\n \"webhook\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"create_time": "2023-11-07T05:31:56Z",
"events": [
{
"time": "2023-11-07T05:31:56Z"
}
],
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"input": "<unknown>",
"update_time": "2023-11-07T05:31:56Z",
"metadata": {},
"output": "<unknown>",
"webhook": "<string>"
}{
"detail": "<string>",
"instance": "<string>",
"status": 349,
"title": "<string>",
"type": "about:blank"
}{
"detail": "<string>",
"instance": "<string>",
"status": 349,
"title": "<string>",
"type": "about:blank"
}{
"detail": "<string>",
"instance": "<string>",
"status": 349,
"title": "<string>",
"type": "about:blank"
}{
"detail": "<string>",
"instance": "<string>",
"status": 349,
"title": "<string>",
"type": "about:blank"
}Authorizations
Path Parameters
Your organization name. This identifies the billing context for the API operation and represents a security boundary for SaladCloud resources. The organization must be created before using the API, and you must be a member of the organization. The organization name.
2 - 63^[a-z][a-z0-9-]{0,61}[a-z0-9]$"acme-corp"
Your project name. This represents a collection of related SaladCloud resources. The project must be created before using the API. The project name.
2 - 63^[a-z][a-z0-9-]{0,61}[a-z0-9]$"dev-env"
The queue name.
2 - 63^[a-z][a-z0-9-]{0,61}[a-z0-9]$"fifo-queue"
Body
Response
Created
Represents a queue job
The job creation time
The job events
1000Show child attributes
Show child attributes
The job identifier
The job input. May be any valid JSON.
The job status
pending, running, succeeded, cancelled, failed The job update time
Additional metadata for the job
The job output. May be any valid JSON.
The webhook URL to notify when the job completes
20 - 27^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(Z|[+-]\\d{2}:\\d{2})$Was this page helpful?