2323 UpdateJobDefinitionRequestCronScheduleConfig ,
2424 CreateJobDefinitionRequest ,
2525 UpdateJobDefinitionRequest ,
26+ StartJobDefinitionRequest ,
2627)
2728from .marshalling import (
2829 marshal_CreateJobDefinitionRequest ,
30+ marshal_StartJobDefinitionRequest ,
2931 marshal_UpdateJobDefinitionRequest ,
3032 unmarshal_JobDefinition ,
3133 unmarshal_JobRun ,
@@ -327,11 +329,21 @@ async def start_job_definition(
327329 * ,
328330 job_definition_id : str ,
329331 region : Optional [Region ] = None ,
332+ command : Optional [str ] = None ,
333+ environment_variables : Optional [Dict [str , str ]] = None ,
334+ replicas : Optional [int ] = None ,
330335 ) -> JobRun :
331336 """
332337 Run an existing job definition by its unique identifier. This will create a new job run.
333338 :param region: Region to target. If none is passed will use default region from the config.
334339 :param job_definition_id: UUID of the job definition to start.
340+ :param command: Contextual startup command for this specific job run.
341+
342+ One-of ('_command'): at most one of 'command' could be set.
343+ :param environment_variables: Contextual environment variables for this specific job run.
344+ :param replicas: Number of jobs to run.
345+
346+ One-of ('_replicas'): at most one of 'replicas' could be set.
335347 :return: :class:`JobRun <JobRun>`
336348
337349 Usage:
@@ -350,6 +362,16 @@ async def start_job_definition(
350362 res = self ._request (
351363 "POST" ,
352364 f"/serverless-jobs/v1alpha1/regions/{ param_region } /job-definitions/{ param_job_definition_id } /start" ,
365+ body = marshal_StartJobDefinitionRequest (
366+ StartJobDefinitionRequest (
367+ job_definition_id = job_definition_id ,
368+ region = region ,
369+ command = command ,
370+ environment_variables = environment_variables ,
371+ replicas = replicas ,
372+ ),
373+ self .client ,
374+ ),
353375 )
354376
355377 self ._throw_on_error (res )
0 commit comments