invoke_rest_api
¶
invoke_rest_api(
name: EnvironmentName,
path: RestApiPath,
method: RestApiMethod,
*,
config_overrides: Optional[MWAAClientConfig] = None,
query_parameters: Optional[object] = None,
body: Optional[RestApiRequestBody] = None,
) -> InvokeRestApiResponse
Invokes the Apache Airflow REST API on the webserver with the specified inputs. To learn more, see Using the Apache Airflow REST API
Parameters:
-
name(EnvironmentName) –The name of the Amazon MWAA environment. For example,
MyMWAAEnvironment. -
path(RestApiPath) –The Apache Airflow REST API endpoint path to be called. For example,
/dags/123456/clearTaskInstances. For more information, see Apache Airflow API -
method(RestApiMethod) –The HTTP method used for making Airflow REST API calls. For example,
POST. -
query_parameters(Optional[object], default:None) –Query parameters to be included in the Apache Airflow REST API call, provided as a JSON object.
-
body(Optional[RestApiRequestBody], default:None) –The request body for the Apache Airflow REST API call, provided as a JSON object.
Raises:
-
AccessDeniedException–Access to the Apache Airflow Web UI or CLI has been denied due to insufficient permissions. To learn more, see Accessing an Amazon MWAA environment.
-
InternalServerException–InternalServerException: An internal error has occurred.
-
ResourceNotFoundException–ResourceNotFoundException: The resource is not available.
-
RestApiClientException–An exception indicating that a client-side error occurred during the Apache Airflow REST API call.
-
RestApiServerException–An exception indicating that a server-side error occurred during the Apache Airflow REST API call.
-
ValidationException–ValidationException: The provided input is not valid.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
Listing Airflow variables.
Source code in docs_src/capo_mwaa/_services/mwaa.py
585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 | |