Skip to content

create_schedule async

create_schedule(
    cron_expression: CronExpression,
    name: ScheduleName,
    *,
    config_overrides: Optional[AsyncDataBrewClientConfig] = None,
    job_names: Optional[JobNameList] = None,
    tags: Optional[TagMap] = None,
) -> CreateScheduleResponse

Creates a new schedule for one or more DataBrew jobs. Jobs can be run at a specific date and time, or at regular intervals.

Parameters:

  • job_names (Optional[JobNameList], default: None ) –

    The name or names of one or more jobs to be run.

  • cron_expression (CronExpression) –

    The date or dates and time or times when the jobs are to be run. For more information, see Cron expressions in the Glue DataBrew Developer Guide.

  • tags (Optional[TagMap], default: None ) –

    Metadata tags to apply to this schedule.

  • name (ScheduleName) –

    A unique name for the schedule. Valid characters are alphanumeric (A-Z, a-z, 0-9), hyphen (-), period (.), and space.

Raises:

Source code in docs_src/capo_databrew/_services/async_data_brew.py
async def create_schedule(
    self,
    cron_expression: "capo_databrew.types.cron_expression.CronExpression",
    name: "capo_databrew.types.schedule_name.ScheduleName",
    *,
    config_overrides: Optional[AsyncDataBrewClientConfig] = None,
    job_names: Optional["capo_databrew.types.job_name_list.JobNameList"] = None,
    tags: Optional["capo_databrew.types.tag_map.TagMap"] = None,
) -> "capo_databrew.types.create_schedule_response.CreateScheduleResponse":
    """<p>Creates a new schedule for one or more DataBrew jobs. Jobs can be run at a specific date and time, or at regular intervals.</p>

    Args:
        job_names: <p>The name or names of one or more jobs to be run.</p>
        cron_expression: <p>The date or dates and time or times when the jobs are to be run. For more information, see <a href="https://docs.aws.amazon.com/databrew/latest/dg/jobs.cron.html">Cron expressions</a> in the <i>Glue DataBrew Developer Guide</i>.</p>
        tags: <p>Metadata tags to apply to this schedule.</p>
        name: <p>A unique name for the schedule. Valid characters are alphanumeric (A-Z, a-z, 0-9), hyphen (-), period (.), and space.</p>

    Raises:
        capo_databrew.errors.conflict_exception.ConflictException: <p>Updating or deleting a resource can cause an inconsistent state.</p>
        capo_databrew.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>A service quota is exceeded.</p>
        capo_databrew.errors.validation_exception.ValidationException: <p>The input parameters for this request failed validation.</p>
        capo_databrew.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_databrew.types.create_schedule_request.CreateScheduleRequest]",
    ) -> AsyncOperationResponse[
        "capo_databrew.types.create_schedule_response.CreateScheduleResponse"
    ]:
        import capo_databrew._operations.aws_glue_data_brew.create_schedule

        (
            output,
            http_response,
        ) = await capo_databrew._operations.aws_glue_data_brew.create_schedule.async_create_schedule(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateSchedule")
    )
    input_: capo_databrew.types.create_schedule_request.CreateScheduleRequest = {
        "cron_expression": cron_expression,
        "name": name,
    }
    if job_names is not None:
        input_["job_names"] = job_names
    if tags is not None:
        input_["tags"] = tags

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output