Zum Hauptinhalt springen

Trigger a cronjob

POST/v2/cronjobs/{cronjobId}/executions
API-Version
v2
Request-Methode
POST
Operation-ID
cronjob-create-execution

Request​

  • cronjobIdstringrequired

    ID of the Cronjob to trigger.

Responses​

Format
application/json
Beschreibung

Created

  • idstringrequired

    execution-id

Content-Type: application/json

{
"id": "string"
}
{
"properties": {
"id": {
"description": "execution-id",
"type": "string"
}
},
"required": [
"id"
],
"type": "object"
}

Nutzungsbeispiele​

$ curl \
--fail \
--location \
-X POST \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
https://api.mittwald.de/v2/cronjobs/string/executions
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.createExecution({
"cronjobId": "string"
});

assertStatus(response, 201);

use \Mittwald\ApiClient\Generated\V2\Clients\Cronjob\CreateExecution\CreateExecutionRequest;

$client = MittwaldAPIClient::newWithToken(getenv('MITTWALD_API_TOKEN'));

$request = (new CreateExecutionRequest(
cronjobId: "string"
));
$response = $client->cronjob()->createExecution($request);

var_dump($response->getBody();

Auf dieser Seite