curl --request PUT \
--url https://app.miget.com/api/v1/apps/{uuid}/cronjobs/{id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"label": "<string>",
"command": "<string>",
"size": "<string>",
"max_run_seconds": 123
}
'import requests
url = "https://app.miget.com/api/v1/apps/{uuid}/cronjobs/{id}"
payload = {
"label": "<string>",
"command": "<string>",
"size": "<string>",
"max_run_seconds": 123
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({label: '<string>', command: '<string>', size: '<string>', max_run_seconds: 123})
};
fetch('https://app.miget.com/api/v1/apps/{uuid}/cronjobs/{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://app.miget.com/api/v1/apps/{uuid}/cronjobs/{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([
'label' => '<string>',
'command' => '<string>',
'size' => '<string>',
'max_run_seconds' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://app.miget.com/api/v1/apps/{uuid}/cronjobs/{id}"
payload := strings.NewReader("{\n \"label\": \"<string>\",\n \"command\": \"<string>\",\n \"size\": \"<string>\",\n \"max_run_seconds\": 123\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<api-key>")
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("https://app.miget.com/api/v1/apps/{uuid}/cronjobs/{id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"label\": \"<string>\",\n \"command\": \"<string>\",\n \"size\": \"<string>\",\n \"max_run_seconds\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.miget.com/api/v1/apps/{uuid}/cronjobs/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"label\": \"<string>\",\n \"command\": \"<string>\",\n \"size\": \"<string>\",\n \"max_run_seconds\": 123\n}"
response = http.request(request)
puts response.read_body{
"uuid": "<string>",
"name": "<string>",
"label": "<string>",
"schedule_type": "<string>",
"interval_type": "<string>",
"hour": "<string>",
"minute": "<string>",
"cron_expression": "<string>",
"command": "<string>",
"size": "<string>",
"overage": "<string>",
"max_run_seconds": 123,
"suspended": true,
"status": "<string>",
"last_job_name": "<string>",
"last_job_status": "<string>",
"last_job_run_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}Update a cron job
Modifies an existing cron job’s configuration: its label, command, size, how long a run may take (max_run_seconds) and what it does past its resource’s cron minutes (overage). Switching overage to ‘bill’ starts Usage Billing’s minimum first, answered with 422 and a checkout_url when the subscription pays for nothing, and resumes the cron job if the used-up minutes paused it.
curl --request PUT \
--url https://app.miget.com/api/v1/apps/{uuid}/cronjobs/{id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"label": "<string>",
"command": "<string>",
"size": "<string>",
"max_run_seconds": 123
}
'import requests
url = "https://app.miget.com/api/v1/apps/{uuid}/cronjobs/{id}"
payload = {
"label": "<string>",
"command": "<string>",
"size": "<string>",
"max_run_seconds": 123
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({label: '<string>', command: '<string>', size: '<string>', max_run_seconds: 123})
};
fetch('https://app.miget.com/api/v1/apps/{uuid}/cronjobs/{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://app.miget.com/api/v1/apps/{uuid}/cronjobs/{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([
'label' => '<string>',
'command' => '<string>',
'size' => '<string>',
'max_run_seconds' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://app.miget.com/api/v1/apps/{uuid}/cronjobs/{id}"
payload := strings.NewReader("{\n \"label\": \"<string>\",\n \"command\": \"<string>\",\n \"size\": \"<string>\",\n \"max_run_seconds\": 123\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<api-key>")
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("https://app.miget.com/api/v1/apps/{uuid}/cronjobs/{id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"label\": \"<string>\",\n \"command\": \"<string>\",\n \"size\": \"<string>\",\n \"max_run_seconds\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.miget.com/api/v1/apps/{uuid}/cronjobs/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"label\": \"<string>\",\n \"command\": \"<string>\",\n \"size\": \"<string>\",\n \"max_run_seconds\": 123\n}"
response = http.request(request)
puts response.read_body{
"uuid": "<string>",
"name": "<string>",
"label": "<string>",
"schedule_type": "<string>",
"interval_type": "<string>",
"hour": "<string>",
"minute": "<string>",
"cron_expression": "<string>",
"command": "<string>",
"size": "<string>",
"overage": "<string>",
"max_run_seconds": 123,
"suspended": true,
"status": "<string>",
"last_job_name": "<string>",
"last_job_status": "<string>",
"last_job_run_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}Authorizations
Body
Update a cron job
What the cron job does once its resource's cron minutes for the billing cycle are used up: 'pause' (the default) until the next renewal, which resumes it, or 'bill', each run past them billed by the second at its size's price on Usage Billing. Choosing 'bill' needs apps:manage and starts Usage Billing's $5 monthly minimum when the subscription pays for nothing else (422 with a checkout_url to complete first). Only where the resource has cron minutes (cron_minutes on GET /api/v1/resources/{uuid}) and is not on an enterprise contract; elsewhere it is ignored: on Usage Billing or a plan that costs nothing every run is billed, and a contract's cron jobs pause at its limit.
pause, bill Response
Update a cron job
Api_V1_Entities_Cronjob model
What a run past its resource's cron minutes does: 'pause' until the next renewal, or 'bill', billed by the second. Always 'bill' on Usage Billing or a plan that costs nothing, which include no cron minutes, and 'pause' on an enterprise contract with a cron minute limit; null where its runs are not billed (an enterprise contract without a limit, a resource exempted from billing on a plan that costs nothing, the workspace pool)

