invokeRestApi method
Invokes the Apache Airflow REST API on the webserver with the specified inputs. To learn more, see Using the Apache Airflow REST API
May throw AccessDeniedException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw RestApiClientException.
May throw RestApiServerException.
May throw ValidationException.
Parameter method :
The HTTP method used for making Airflow REST API calls. For example,
POST.
Parameter name :
The name of the Amazon MWAA environment. For example,
MyMWAAEnvironment.
Parameter path :
The Apache Airflow REST API endpoint path to be called. For example,
/dags/123456/clearTaskInstances. For more information, see Apache
Airflow API
Parameter body :
The request body for the Apache Airflow REST API call, provided as a JSON
object.
Parameter queryParameters :
Query parameters to be included in the Apache Airflow REST API call,
provided as a JSON object.
Implementation
Future<InvokeRestApiResponse> invokeRestApi({
required RestApiMethod method,
required String name,
required String path,
Object? body,
Document? queryParameters,
}) async {
final $payload = <String, dynamic>{
'Method': method.value,
'Path': path,
if (body != null) 'Body': body,
if (queryParameters != null) 'QueryParameters': queryParameters,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/restapi/${Uri.encodeComponent(name)}',
exceptionFnMap: _exceptionFns,
);
return InvokeRestApiResponse.fromJson(response);
}