Skip to main content

Cancel

Cancels running job.

import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";

const CancelProjectJobRequest =
cloudApi.datasphere.jobs_project_job_service.CancelProjectJobRequest;

(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.ProjectJobServiceClient);

const result = await client.cancel(
CancelProjectJobRequest.fromPartial({
// jobId: "jobId",
// reason: "reason",
// graceful: true
})
);
console.log(result);
})();

CancelProjectJobRequest

jobId : string

ID of the job.

reason : string

Optional cancellation reason.

graceful : bool

If the job is launched with graceful shutdown support, the shutdown will be performed gracefully

Empty