Zum Hauptinhalt springen

Update a cronjob

PATCH/v2/cronjobs/{cronjobId}
API-Version
v2
Request-Methode
PATCH
Operation-ID
cronjob-update-cronjob

Request​

  • cronjobIdstringrequired

    ID of the Cronjob to be updated.

Responses​

Kein Response-Inhalt angegeben.

Nutzungsbeispiele​

$ curl \
--fail \
--location \
-X PATCH \
-d '{"active":true,"concurrencyPolicy":"allow","description":"i am a cronjob","destination":{"url":"https://mydomain.com"},"email":"email@mittwald.example","failedExecutionAlertThreshold":123,"interval":"*/5 * * * *","target":{"appInstallationId":"f0f86186-0a5a-45b2-aa33-502777496347","destination":{"url":"https://mydomain.com"}},"timeZone":"string","timeout":123}' \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
-H 'Content-Type: application/json' \
https://api.mittwald.de/v2/cronjobs/string
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": "string",
"data": {
"active": true,
"concurrencyPolicy": "allow",
"description": "i am a cronjob",
"destination": {
"url": "https://mydomain.com"
},
"email": "email@mittwald.example",
"failedExecutionAlertThreshold": 123,
"interval": "*/5 * * * *",
"target": {
"appInstallationId": "f0f86186-0a5a-45b2-aa33-502777496347",
"destination": {
"url": "https://mydomain.com"
}
},
"timeZone": "string",
"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: "string",
body: $body
));
$response = $client->cronjob()->updateCronjob($request);

var_dump($response->getBody();

Auf dieser Seite