Update a cronjob
PATCH/cronjobs/ {cronjobId}/
v2
PATCH
cronjob-update-cronjob
Request
Responses
Usage examples
- cURL
- JavaScript SDK
- PHP SDK
$ curl \
--fail \
--location \
-X PATCH \
-d '{"active":true,"description":"i am a cronjob","destination":{"url":"https://mydomain.com"},"email":"email@mittwald.example","interval":"*/5 * * * *","timeout":123}' \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
-H 'Content-Type: application/json' \
https://api.mittwald.de/v2/cronjobs/f0f86186-0a5a-45b2-aa33-502777496347
import { MittwaldAPIV2Client } from "@mittwald/api-client";
import { assertStatus } from "@mittwald/api-client-commons";
const client = MittwaldAPIClient.newWithToken(process.env.MITTWALD_API_TOKEN);
const response = await client.cronjob.updateCronjob({
"cronjobId": "f0f86186-0a5a-45b2-aa33-502777496347",
"data": {
"active": true,
"description": "i am a cronjob",
"destination": {
"url": "https://mydomain.com"
},
"email": "email@mittwald.example",
"interval": "*/5 * * * *",
"timeout": 123
}
});
assertStatus(response, 204);
use \Mittwald\ApiClient\Generated\V2\Clients\Cronjob\UpdateCronjob\UpdateCronjobRequest;
use \Mittwald\ApiClient\Generated\V2\Clients\Cronjob\UpdateCronjob\UpdateCronjobRequestBody;
$client = MittwaldAPIClient::newWithToken(getenv('MITTWALD_API_TOKEN'));
// TODO: Please consult the properties and constructor signature of
// UpdateCronjobRequestBody to learn how to construct a valid instance
$body = new UpdateCronjobRequestBody(/* TODO: ... */);
$request = (new UpdateCronjobRequest(
cronjobId: "f0f86186-0a5a-45b2-aa33-502777496347",
body: $body
));
$response = $client->cronjob()->updateCronjob($request);
var_dump($response->getBody();