MWAA / Client / invoke_rest_api

invoke_rest_api#

MWAA.Client.invoke_rest_api(**kwargs)#

Invokes the Apache Airflow REST API on the webserver with the specified inputs. To learn more, see Using the Apache Airflow REST API

See also: AWS API Documentation

Request Syntax

response = client.invoke_rest_api(
    Name='string',
    Path='string',
    Method='GET'|'PUT'|'POST'|'PATCH'|'DELETE',
    QueryParameters={...}|[...]|123|123.4|'string'|True|None,
    Body={...}|[...]|123|123.4|'string'|True|None
)
Parameters:
  • Name (string) –

    [REQUIRED]

    The name of the Amazon MWAA environment. For example, MyMWAAEnvironment.

  • Path (string) –

    [REQUIRED]

    The Apache Airflow REST API endpoint path to be called. For example, /dags/123456/clearTaskInstances. For more information, see Apache Airflow API

  • Method (string) –

    [REQUIRED]

    The HTTP method used for making Airflow REST API calls. For example, POST.

  • QueryParameters (document) – Query parameters to be included in the Apache Airflow REST API call, provided as a JSON object.

  • Body (document) – The request body for the Apache Airflow REST API call, provided as a JSON object.

Return type:

dict

Returns:

Response Syntax

{
    'RestApiStatusCode': 123,
    'RestApiResponse': {...}|[...]|123|123.4|'string'|True|None
}

Response Structure

  • (dict) –

    • RestApiStatusCode (integer) –

      The HTTP status code returned by the Apache Airflow REST API call.

    • RestApiResponse (document) –

      The response data from the Apache Airflow REST API call, provided as a JSON object.

Exceptions