diff --git a/packages/clients/src/api/jobs/v1alpha1/api.gen.ts b/packages/clients/src/api/jobs/v1alpha1/api.gen.ts index 788f4116c..90873ffcb 100644 --- a/packages/clients/src/api/jobs/v1alpha1/api.gen.ts +++ b/packages/clients/src/api/jobs/v1alpha1/api.gen.ts @@ -40,6 +40,12 @@ export class API extends ParentAPI { /** Lists the available regions of the API. */ public static readonly LOCALITIES: Region[] = ['fr-par', 'nl-ams', 'pl-waw'] + /** + * Create a new job definition in a specified Project. + * + * @param request - The request {@link CreateJobDefinitionRequest} + * @returns A Promise of JobDefinition + */ createJobDefinition = (request: Readonly) => this.client.fetch( { @@ -56,6 +62,12 @@ export class API extends ParentAPI { unmarshalJobDefinition, ) + /** + * Get a job definition by its unique identifier. + * + * @param request - The request {@link GetJobDefinitionRequest} + * @returns A Promise of JobDefinition + */ getJobDefinition = (request: Readonly) => this.client.fetch( { @@ -94,6 +106,12 @@ export class API extends ParentAPI { unmarshalListJobDefinitionsResponse, ) + /** + * List all your job definitions with filters. + * + * @param request - The request {@link ListJobDefinitionsRequest} + * @returns A Promise of ListJobDefinitionsResponse + */ listJobDefinitions = (request: Readonly = {}) => enrichForPagination( 'jobDefinitions', @@ -101,6 +119,13 @@ export class API extends ParentAPI { request, ) + /** + * Update an existing job definition associated with the specified unique + * identifier. + * + * @param request - The request {@link UpdateJobDefinitionRequest} + * @returns A Promise of JobDefinition + */ updateJobDefinition = (request: Readonly) => this.client.fetch( { @@ -120,6 +145,11 @@ export class API extends ParentAPI { unmarshalJobDefinition, ) + /** + * Delete an exsisting job definition by its unique identifier. + * + * @param request - The request {@link DeleteJobDefinitionRequest} + */ deleteJobDefinition = (request: Readonly) => this.client.fetch({ method: 'DELETE', @@ -132,6 +162,13 @@ export class API extends ParentAPI { )}`, }) + /** + * Run an existing job definition by its unique identifier. This will create a + * new job run. + * + * @param request - The request {@link StartJobDefinitionRequest} + * @returns A Promise of JobRun + */ startJobDefinition = (request: Readonly) => this.client.fetch( { @@ -149,6 +186,12 @@ export class API extends ParentAPI { unmarshalJobRun, ) + /** + * Get a job run by its unique identifier. + * + * @param request - The request {@link GetJobRunRequest} + * @returns A Promise of JobRun + */ getJobRun = (request: Readonly) => this.client.fetch( { @@ -161,6 +204,12 @@ export class API extends ParentAPI { unmarshalJobRun, ) + /** + * Stop a job run by its unique identifier. + * + * @param request - The request {@link StopJobRunRequest} + * @returns A Promise of JobRun + */ stopJobRun = (request: Readonly) => this.client.fetch( { @@ -197,6 +246,12 @@ export class API extends ParentAPI { unmarshalListJobRunsResponse, ) + /** + * List all job runs with filters. + * + * @param request - The request {@link ListJobRunsRequest} + * @returns A Promise of ListJobRunsResponse + */ listJobRuns = (request: Readonly = {}) => enrichForPagination('jobRuns', this.pageOfListJobRuns, request) } diff --git a/packages/clients/src/api/jobs/v1alpha1/types.gen.ts b/packages/clients/src/api/jobs/v1alpha1/types.gen.ts index 8091d349a..ed3e4b1b3 100644 --- a/packages/clients/src/api/jobs/v1alpha1/types.gen.ts +++ b/packages/clients/src/api/jobs/v1alpha1/types.gen.ts @@ -62,14 +62,23 @@ export type CreateJobDefinitionRequest = { * config. */ region?: Region + /** Name of the job definition. */ name?: string + /** CPU limit of the job. */ cpuLimit: number + /** Memory limit of the job. */ memoryLimit: number + /** Image to use for the job. */ imageUri: string + /** Startup command. */ command: string + /** UUID of the Scaleway Project containing the job. */ projectId?: string + /** Environment variables of the job. */ environmentVariables?: Record + /** Description of the job. */ description: string + /** Timeout of the job in seconds. */ jobTimeout?: string } @@ -79,6 +88,7 @@ export type DeleteJobDefinitionRequest = { * config. */ region?: Region + /** UUID of the job definition to delete. */ jobDefinitionId: string } @@ -88,6 +98,7 @@ export type GetJobDefinitionRequest = { * config. */ region?: Region + /** UUID of the job definition to get. */ jobDefinitionId: string } @@ -97,6 +108,7 @@ export type GetJobRunRequest = { * config. */ region?: Region + /** UUID of the job run to get. */ jobRunId: string } @@ -141,6 +153,7 @@ export type StartJobDefinitionRequest = { * config. */ region?: Region + /** UUID of the job definition to start. */ jobDefinitionId: string } @@ -150,6 +163,7 @@ export type StopJobRunRequest = { * config. */ region?: Region + /** UUID of the job run to stop. */ jobRunId: string } @@ -159,13 +173,22 @@ export type UpdateJobDefinitionRequest = { * config. */ region?: Region + /** UUID of the job definition to update. */ jobDefinitionId: string + /** Name of the job definition. */ name?: string + /** CPU limit of the job. */ cpuLimit?: number + /** Memory limit of the job. */ memoryLimit?: number + /** Image to use for the job. */ imageUri?: string + /** Startup command. */ command?: string + /** Environment variables of the job. */ environmentVariables?: Record + /** Description of the job. */ description?: string + /** Timeout of the job in seconds. */ jobTimeout?: string }