Create or revision-conditionally update one resident schedule
curl --request PUT \
--url http://127.0.0.1/v1/schedules/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"maxCostUsd": 123,
"when": {
"at": "2023-11-07T05:31:56Z",
"kind": "once"
},
"workflow": "<string>",
"active": true,
"jitter": "hash",
"maxLatenessSeconds": 1,
"pauseReason": "<string>",
"pauseUntil": "2023-12-25",
"tolerance": "<string>"
}
'import requests
url = "http://127.0.0.1/v1/schedules/{id}"
payload = {
"maxCostUsd": 123,
"when": {
"at": "2023-11-07T05:31:56Z",
"kind": "once"
},
"workflow": "<string>",
"active": True,
"jitter": "hash",
"maxLatenessSeconds": 1,
"pauseReason": "<string>",
"pauseUntil": "2023-12-25",
"tolerance": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
maxCostUsd: 123,
when: {at: '2023-11-07T05:31:56Z', kind: 'once'},
workflow: '<string>',
active: true,
jitter: 'hash',
maxLatenessSeconds: 1,
pauseReason: '<string>',
pauseUntil: '2023-12-25',
tolerance: '<string>'
})
};
fetch('http://127.0.0.1/v1/schedules/{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 => "http://127.0.0.1/v1/schedules/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'maxCostUsd' => 123,
'when' => [
'at' => '2023-11-07T05:31:56Z',
'kind' => 'once'
],
'workflow' => '<string>',
'active' => true,
'jitter' => 'hash',
'maxLatenessSeconds' => 1,
'pauseReason' => '<string>',
'pauseUntil' => '2023-12-25',
'tolerance' => '<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 := "http://127.0.0.1/v1/schedules/{id}"
payload := strings.NewReader("{\n \"maxCostUsd\": 123,\n \"when\": {\n \"at\": \"2023-11-07T05:31:56Z\",\n \"kind\": \"once\"\n },\n \"workflow\": \"<string>\",\n \"active\": true,\n \"jitter\": \"hash\",\n \"maxLatenessSeconds\": 1,\n \"pauseReason\": \"<string>\",\n \"pauseUntil\": \"2023-12-25\",\n \"tolerance\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", 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.put("http://127.0.0.1/v1/schedules/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"maxCostUsd\": 123,\n \"when\": {\n \"at\": \"2023-11-07T05:31:56Z\",\n \"kind\": \"once\"\n },\n \"workflow\": \"<string>\",\n \"active\": true,\n \"jitter\": \"hash\",\n \"maxLatenessSeconds\": 1,\n \"pauseReason\": \"<string>\",\n \"pauseUntil\": \"2023-12-25\",\n \"tolerance\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://127.0.0.1/v1/schedules/{id}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"maxCostUsd\": 123,\n \"when\": {\n \"at\": \"2023-11-07T05:31:56Z\",\n \"kind\": \"once\"\n },\n \"workflow\": \"<string>\",\n \"active\": true,\n \"jitter\": \"hash\",\n \"maxLatenessSeconds\": 1,\n \"pauseReason\": \"<string>\",\n \"pauseUntil\": \"2023-12-25\",\n \"tolerance\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"applied": true,
"changed": true,
"status": {}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}API Reference
Create or revision-conditionally update one resident schedule
Create requires If-None-Match: *. Update requires the exact ETag in If-Match. Identical lost-response retries are unchanged and retain the revision.
PUT
/
v1
/
schedules
/
{id}
Create or revision-conditionally update one resident schedule
curl --request PUT \
--url http://127.0.0.1/v1/schedules/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"maxCostUsd": 123,
"when": {
"at": "2023-11-07T05:31:56Z",
"kind": "once"
},
"workflow": "<string>",
"active": true,
"jitter": "hash",
"maxLatenessSeconds": 1,
"pauseReason": "<string>",
"pauseUntil": "2023-12-25",
"tolerance": "<string>"
}
'import requests
url = "http://127.0.0.1/v1/schedules/{id}"
payload = {
"maxCostUsd": 123,
"when": {
"at": "2023-11-07T05:31:56Z",
"kind": "once"
},
"workflow": "<string>",
"active": True,
"jitter": "hash",
"maxLatenessSeconds": 1,
"pauseReason": "<string>",
"pauseUntil": "2023-12-25",
"tolerance": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
maxCostUsd: 123,
when: {at: '2023-11-07T05:31:56Z', kind: 'once'},
workflow: '<string>',
active: true,
jitter: 'hash',
maxLatenessSeconds: 1,
pauseReason: '<string>',
pauseUntil: '2023-12-25',
tolerance: '<string>'
})
};
fetch('http://127.0.0.1/v1/schedules/{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 => "http://127.0.0.1/v1/schedules/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'maxCostUsd' => 123,
'when' => [
'at' => '2023-11-07T05:31:56Z',
'kind' => 'once'
],
'workflow' => '<string>',
'active' => true,
'jitter' => 'hash',
'maxLatenessSeconds' => 1,
'pauseReason' => '<string>',
'pauseUntil' => '2023-12-25',
'tolerance' => '<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 := "http://127.0.0.1/v1/schedules/{id}"
payload := strings.NewReader("{\n \"maxCostUsd\": 123,\n \"when\": {\n \"at\": \"2023-11-07T05:31:56Z\",\n \"kind\": \"once\"\n },\n \"workflow\": \"<string>\",\n \"active\": true,\n \"jitter\": \"hash\",\n \"maxLatenessSeconds\": 1,\n \"pauseReason\": \"<string>\",\n \"pauseUntil\": \"2023-12-25\",\n \"tolerance\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", 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.put("http://127.0.0.1/v1/schedules/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"maxCostUsd\": 123,\n \"when\": {\n \"at\": \"2023-11-07T05:31:56Z\",\n \"kind\": \"once\"\n },\n \"workflow\": \"<string>\",\n \"active\": true,\n \"jitter\": \"hash\",\n \"maxLatenessSeconds\": 1,\n \"pauseReason\": \"<string>\",\n \"pauseUntil\": \"2023-12-25\",\n \"tolerance\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://127.0.0.1/v1/schedules/{id}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"maxCostUsd\": 123,\n \"when\": {\n \"at\": \"2023-11-07T05:31:56Z\",\n \"kind\": \"once\"\n },\n \"workflow\": \"<string>\",\n \"active\": true,\n \"jitter\": \"hash\",\n \"maxLatenessSeconds\": 1,\n \"pauseReason\": \"<string>\",\n \"pauseUntil\": \"2023-12-25\",\n \"tolerance\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"applied": true,
"changed": true,
"status": {}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Authorizations
Exactly one Authorization: Bearer value from the token file
Path Parameters
Required string length:
1 - 255Body
application/json
Available options:
catch-up, catch-up-once, skip - Option 1
- Option 2
Show child attributes
Show child attributes
Maximum string length:
1024Pattern:
^[^/].*\.nika\.yaml$Available options:
next_slot, on_completion Available options:
hash Required range:
x >= 0Available options:
skip, queue, replace Maximum string length:
1024Was this page helpful?