Skip to content

create_monitoring_schedule

create_monitoring_schedule(
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    monitoring_schedule_name: Optional[MonitoringScheduleName] = None,
    monitoring_schedule_config: Optional[MonitoringScheduleConfig] = None,
    tags: Optional[TagList] = None,
) -> CreateMonitoringScheduleResponse

Creates a schedule that regularly starts Amazon SageMaker AI Processing Jobs to monitor the data captured for an Amazon SageMaker AI Endpoint.

Parameters:

  • monitoring_schedule_name (Optional[MonitoringScheduleName], default: None ) –

    The name of the monitoring schedule. The name must be unique within an Amazon Web Services Region within an Amazon Web Services account.

  • monitoring_schedule_config (Optional[MonitoringScheduleConfig], default: None ) –

    The configuration object that specifies the monitoring schedule and defines the monitoring job.

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

    (Optional) An array of key-value pairs. For more information, see Using Cost Allocation Tags in the Amazon Web Services Billing and Cost Management User Guide.

Raises:

  • ResourceInUse –

    Resource being accessed is in use.

  • ResourceLimitExceeded –

    You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_sagemaker/_services/sage_maker.py
def create_monitoring_schedule(
    self,
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    monitoring_schedule_name: Optional[
        "capo_sagemaker.types.monitoring_schedule_name.MonitoringScheduleName"
    ] = None,
    monitoring_schedule_config: Optional[
        "capo_sagemaker.types.monitoring_schedule_config.MonitoringScheduleConfig"
    ] = None,
    tags: Optional["capo_sagemaker.types.tag_list.TagList"] = None,
) -> "capo_sagemaker.types.create_monitoring_schedule_response.CreateMonitoringScheduleResponse":
    """<p>Creates a schedule that regularly starts Amazon SageMaker AI Processing Jobs to monitor the data captured for an Amazon SageMaker AI Endpoint.</p>

    Args:
        monitoring_schedule_name: <p>The name of the monitoring schedule. The name must be unique within an Amazon Web Services Region within an Amazon Web Services account.</p>
        monitoring_schedule_config: <p>The configuration object that specifies the monitoring schedule and defines the monitoring job.</p>
        tags: <p>(Optional) An array of key-value pairs. For more information, see <a href=" https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html#allocation-whatURL">Using Cost Allocation Tags</a> in the <i>Amazon Web Services Billing and Cost Management User Guide</i>.</p>

    Raises:
        capo_sagemaker.errors.resource_in_use.ResourceInUse: <p>Resource being accessed is in use.</p>
        capo_sagemaker.errors.resource_limit_exceeded.ResourceLimitExceeded: <p> You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created. </p>
        capo_sagemaker.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_sagemaker.types.create_monitoring_schedule_request.CreateMonitoringScheduleRequest]",
    ) -> OperationResponse[
        "capo_sagemaker.types.create_monitoring_schedule_response.CreateMonitoringScheduleResponse"
    ]:
        import capo_sagemaker._operations.sage_maker.create_monitoring_schedule

        output, http_response = (
            capo_sagemaker._operations.sage_maker.create_monitoring_schedule.create_monitoring_schedule(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateMonitoringSchedule")
    )
    input_: capo_sagemaker.types.create_monitoring_schedule_request.CreateMonitoringScheduleRequest = {}
    if monitoring_schedule_name is not None:
        input_["monitoring_schedule_name"] = monitoring_schedule_name
    if monitoring_schedule_config is not None:
        input_["monitoring_schedule_config"] = monitoring_schedule_config
    if tags is not None:
        input_["tags"] = tags

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output