:py:mod:`astronomer.providers.amazon.aws.hooks.emr` =================================================== .. py:module:: astronomer.providers.amazon.aws.hooks.emr Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: astronomer.providers.amazon.aws.hooks.emr.EmrContainerHookAsync astronomer.providers.amazon.aws.hooks.emr.EmrStepSensorHookAsync astronomer.providers.amazon.aws.hooks.emr.EmrJobFlowHookAsync .. py:class:: EmrContainerHookAsync(virtual_cluster_id, *args, **kwargs) Bases: :py:obj:`astronomer.providers.amazon.aws.hooks.base_aws.AwsBaseHookAsync` The EmrContainerHookAsync interact with AWS EMR EKS Virtual Cluster to run, poll jobs and return job status Additional arguments (such as ``aws_conn_id``) may be specified and are passed down to the underlying AwsBaseHook. :param virtual_cluster_id: Cluster ID of the EMR on EKS virtual cluster :type virtual_cluster_id: str .. py:method:: check_job_status(job_id) :async: Fetch the status of submitted job run. Returns None or one of valid query states. :param job_id: Id of submitted job run .. py:method:: get_job_failure_reason(job_id) :async: Fetch the reason for a job failure (e.g. error message). Returns None or reason string. :param job_id: Id of submitted job run :return: str .. py:class:: EmrStepSensorHookAsync(job_flow_id, step_id, *args, **kwargs) Bases: :py:obj:`astronomer.providers.amazon.aws.hooks.base_aws.AwsBaseHookAsync` A thin wrapper to interact with AWS EMR API Additional arguments may be specified and are passed down to the underlying AwsBaseHook. For more details see here. - airflow.providers.amazon.aws.hooks.base_aws.AwsBaseHook :param job_flow_id: id of the JobFlow to add steps to :param step_id: step to check the state of :param client_type: boto3.client client_type. Eg 's3', 'emr' etc :param resource_type: boto3.resource resource_type. Eg 'dynamodb' etc :param config: Configuration for botocore client. .. py:method:: emr_describe_step() :async: Make an API call with boto3 and get details about the cluster step. For AWS API definition see here:: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/emr.html#EMR.Client.describe_step :return: AWS EMR.Client.describe_step Api response Dict .. py:method:: state_from_response(response) :staticmethod: Get state from response dictionary. :param response: response from AWS API :return: execution state of the cluster step .. py:method:: failure_message_from_response(response) :staticmethod: Get failure message from response dictionary. :param response: response from AWS API :return: failure message .. py:class:: EmrJobFlowHookAsync(*args, **kwargs) Bases: :py:obj:`astronomer.providers.amazon.aws.hooks.base_aws.AwsBaseHookAsync` EmrJobFlowHookAsync is wrapper Interact with AWS EMR.Using Aiobotocore client makes API call to get cluster-level details by job_flow_id. Additional arguments (such as ``aws_conn_id``) may be specified and are passed down to the underlying AwsBaseHookAsync. .. py:method:: get_cluster_details(job_flow_id) :async: Using Aiobotocore client makes API call to ``describe_cluster`` get the cluster details, from cluster details fetch the cluster status :param job_flow_id: job_flow_id to check the state of cluster .. py:method:: state_from_response(response) :staticmethod: Get state from response dictionary. :param response: response from AWS API :return: current state of the cluster .. py:method:: failure_message_from_response(response) :staticmethod: Get failure message from response dictionary. :param response: response from EMR AWS API