airflow.contrib.operators.sagemaker_endpoint_operator

Module Contents

class airflow.contrib.operators.sagemaker_endpoint_operator.SageMakerEndpointOperator(config, wait_for_completion=True, check_interval=30, max_ingestion_time=None, operation='create', *args, **kwargs)[source]

Bases:airflow.contrib.operators.sagemaker_base_operator.SageMakerBaseOperator

Create a SageMaker endpoint.

This operator returns The ARN of the endpoint created in Amazon SageMaker

Parameters
  • config (dict) –

    The configuration necessary to create an endpoint.

    If you need to create a SageMaker endpoint based on an existed SageMaker model and an existed SageMaker endpoint config:

    config = endpoint_configuration;
    

    If you need to create all of SageMaker model, SageMaker endpoint-config and SageMaker endpoint:

    config = {
        'Model': model_configuration,
        'EndpointConfig': endpoint_config_configuration,
        'Endpoint': endpoint_configuration
    }
    

    For details of the configuration parameter of model_configuration see SageMaker.Client.create_model()

    For details of the configuration parameter of endpoint_config_configuration see SageMaker.Client.create_endpoint_config()

    For details of the configuration parameter of endpoint_configuration see SageMaker.Client.create_endpoint()

  • aws_conn_id (str) – The AWS connection ID to use.

  • wait_for_completion (bool) – Whether the operator should wait until the endpoint creation finishes.

  • check_interval (int) – If wait is set to True, this is the time interval, in seconds, that this operation waits before polling the status of the endpoint creation.

  • max_ingestion_time (int) – If wait is set to True, this operation fails if the endpoint creation doesn’t finish within max_ingestion_time seconds. If you set this parameter to None it never times out.

  • operation (str) – Whether to create an endpoint or update an endpoint. Must be either ‘create or ‘update’.

create_integer_fields(self)[source]
expand_role(self)[source]
execute(self, context)[source]