Skip to content

Commit

Permalink
Introducing InvokeRestApi which allows users to invoke the Apache Air…
Browse files Browse the repository at this point in the history
…flow REST API on the webserver with the specified inputs.
  • Loading branch information
aws-sdk-dotnet-automation committed Oct 23, 2024
1 parent 0865de9 commit e33b2bd
Show file tree
Hide file tree
Showing 26 changed files with 1,956 additions and 36 deletions.
22 changes: 22 additions & 0 deletions docgenerator/AWSSDKDocSamples/MWAA.GeneratedSamples.extra.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<docs>
<doc>
<members>
<member name="M:Amazon.MWAA.IAmazonMWAA.InvokeRestApi(Amazon.MWAA.Model.InvokeRestApiRequest)" />
<member name="M:Amazon.MWAA.AmazonMWAAClient.InvokeRestApi(Amazon.MWAA.Model.InvokeRestApiRequest)" />
<member name="T:Amazon.MWAA.Model.InvokeRestApiRequest" />
<member name="T:Amazon.MWAA.Model.InvokeRestApiResponse" />
</members>
<value>
<example>
<para>

</para>
<code
title="Listing Airflow variables."
source=".\AWSSDKDocSamples\MWAA\MWAA.GeneratedSamples.cs"
region="example-1" />
</example>
</value>
</doc>
</docs>
41 changes: 41 additions & 0 deletions docgenerator/AWSSDKDocSamples/MWAA/MWAA.GeneratedSamples.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Amazon.MWAA;
using Amazon.MWAA.Model;

namespace AWSSDKDocSamples.Amazon.MWAA.Generated
{
class MWAASamples : ISample
{
public void MWAAInvokeRestApi()
{
#region example-1

var client = new AmazonMWAAClient();
var response = client.InvokeRestApi(new InvokeRestApiRequest
{
Method = "GET",
Name = "MyEnvironment",
Path = "/variables"
});

RestApiResponse restApiResponse = response.RestApiResponse;
int restApiStatusCode = response.RestApiStatusCode;

#endregion
}


# region ISample Members
public virtual void Run()
{

}
# endregion

}
}
105 changes: 105 additions & 0 deletions generator/ServiceModels/mwaa/mwaa-2020-07-01.api.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"version":"2.0",
"metadata":{
"apiVersion":"2020-07-01",
"auth":["aws.auth#sigv4"],
"endpointPrefix":"airflow",
"protocol":"rest-json",
"protocols":["rest-json"],
Expand Down Expand Up @@ -93,6 +94,25 @@
],
"endpoint":{"hostPrefix":"api."}
},
"InvokeRestApi":{
"name":"InvokeRestApi",
"http":{
"method":"POST",
"requestUri":"/restapi/{Name}",
"responseCode":200
},
"input":{"shape":"InvokeRestApiRequest"},
"output":{"shape":"InvokeRestApiResponse"},
"errors":[
{"shape":"RestApiClientException"},
{"shape":"AccessDeniedException"},
{"shape":"ResourceNotFoundException"},
{"shape":"ValidationException"},
{"shape":"InternalServerException"},
{"shape":"RestApiServerException"}
],
"endpoint":{"hostPrefix":"env."}
},
"ListEnvironments":{
"name":"ListEnvironments",
"http":{
Expand Down Expand Up @@ -366,6 +386,12 @@
"deprecated":true,
"deprecatedMessage":"This type is for internal use and not meant for public use. Data set for this type will be ignored."
},
"Document":{
"type":"structure",
"members":{
},
"document":true
},
"Double":{
"type":"double",
"box":true
Expand Down Expand Up @@ -504,6 +530,32 @@
"exception":true,
"fault":true
},
"InvokeRestApiRequest":{
"type":"structure",
"required":[
"Name",
"Path",
"Method"
],
"members":{
"Name":{
"shape":"EnvironmentName",
"location":"uri",
"locationName":"Name"
},
"Path":{"shape":"RestApiPath"},
"Method":{"shape":"RestApiMethod"},
"QueryParameters":{"shape":"Document"},
"Body":{"shape":"RestApiRequestBody"}
}
},
"InvokeRestApiResponse":{
"type":"structure",
"members":{
"RestApiStatusCode":{"shape":"Integer"},
"RestApiResponse":{"shape":"RestApiResponse"}
}
},
"KmsKey":{
"type":"string",
"max":1224,
Expand Down Expand Up @@ -714,6 +766,59 @@
},
"exception":true
},
"RestApiClientException":{
"type":"structure",
"members":{
"RestApiStatusCode":{"shape":"Integer"},
"RestApiResponse":{"shape":"RestApiResponse"}
},
"error":{
"httpStatusCode":400,
"senderFault":true
},
"exception":true
},
"RestApiMethod":{
"type":"string",
"enum":[
"GET",
"PUT",
"POST",
"PATCH",
"DELETE"
]
},
"RestApiPath":{
"type":"string",
"max":64,
"min":1
},
"RestApiRequestBody":{
"type":"structure",
"members":{
},
"document":true,
"sensitive":true
},
"RestApiResponse":{
"type":"structure",
"members":{
},
"document":true,
"sensitive":true
},
"RestApiServerException":{
"type":"structure",
"members":{
"RestApiStatusCode":{"shape":"Integer"},
"RestApiResponse":{"shape":"RestApiResponse"}
},
"error":{
"httpStatusCode":400,
"senderFault":true
},
"exception":true
},
"S3BucketArn":{
"type":"string",
"max":1224,
Expand Down
71 changes: 64 additions & 7 deletions generator/ServiceModels/mwaa/mwaa-2020-07-01.docs.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
{
"version": "2.0",
"service": "<p><fullname>Amazon Managed Workflows for Apache Airflow</fullname> <p>This section contains the Amazon Managed Workflows for Apache Airflow (MWAA) API reference documentation. For more information, see <a href=\"https://docs.aws.amazon.com/mwaa/latest/userguide/what-is-mwaa.html\">What is Amazon MWAA?</a>.</p> <p> <b>Endpoints</b> </p> <ul> <li> <p> <code>api.airflow.{region}.amazonaws.com</code> - This endpoint is used for environment management.</p> <ul> <li> <p> <a href=\"https://docs.aws.amazon.com/mwaa/latest/API/API_CreateEnvironment.html\">CreateEnvironment</a> </p> </li> <li> <p> <a href=\"https://docs.aws.amazon.com/mwaa/latest/API/API_DeleteEnvironment.html\">DeleteEnvironment</a> </p> </li> <li> <p> <a href=\"https://docs.aws.amazon.com/mwaa/latest/API/API_GetEnvironment.html\">GetEnvironment</a> </p> </li> <li> <p> <a href=\"https://docs.aws.amazon.com/mwaa/latest/API/API_ListEnvironments.html\">ListEnvironments</a> </p> </li> <li> <p> <a href=\"https://docs.aws.amazon.com/mwaa/latest/API/API_ListTagsForResource.html\">ListTagsForResource</a> </p> </li> <li> <p> <a href=\"https://docs.aws.amazon.com/mwaa/latest/API/API_TagResource.html\">TagResource</a> </p> </li> <li> <p> <a href=\"https://docs.aws.amazon.com/mwaa/latest/API/API_UntagResource.html\">UntagResource</a> </p> </li> <li> <p> <a href=\"https://docs.aws.amazon.com/mwaa/latest/API/API_UpdateEnvironment.html\">UpdateEnvironment</a> </p> </li> </ul> </li> <li> <p> <code>env.airflow.{region}.amazonaws.com</code> - This endpoint is used to operate the Airflow environment.</p> <ul> <li> <p> <a href=\"https://docs.aws.amazon.com/mwaa/latest/API/API_CreateCliToken.html \">CreateCliToken</a> </p> </li> <li> <p> <a href=\"https://docs.aws.amazon.com/mwaa/latest/API/API_CreateWebLoginToken.html\">CreateWebLoginToken</a> </p> </li> </ul> </li> </ul> <p> <b>Regions</b> </p> <p>For a list of supported regions, see <a href=\"https://docs.aws.amazon.com/general/latest/gr/mwaa.html\">Amazon MWAA endpoints and quotas</a> in the <i>Amazon Web Services General Reference</i>.</p></p>",
"service": "<p><fullname>Amazon Managed Workflows for Apache Airflow</fullname> <p>This section contains the Amazon Managed Workflows for Apache Airflow (MWAA) API reference documentation. For more information, see <a href=\"https://docs.aws.amazon.com/mwaa/latest/userguide/what-is-mwaa.html\">What is Amazon MWAA?</a>.</p> <p> <b>Endpoints</b> </p> <ul> <li> <p> <code>api.airflow.{region}.amazonaws.com</code> - This endpoint is used for environment management.</p> <ul> <li> <p> <a href=\"https://docs.aws.amazon.com/mwaa/latest/API/API_CreateEnvironment.html\">CreateEnvironment</a> </p> </li> <li> <p> <a href=\"https://docs.aws.amazon.com/mwaa/latest/API/API_DeleteEnvironment.html\">DeleteEnvironment</a> </p> </li> <li> <p> <a href=\"https://docs.aws.amazon.com/mwaa/latest/API/API_GetEnvironment.html\">GetEnvironment</a> </p> </li> <li> <p> <a href=\"https://docs.aws.amazon.com/mwaa/latest/API/API_ListEnvironments.html\">ListEnvironments</a> </p> </li> <li> <p> <a href=\"https://docs.aws.amazon.com/mwaa/latest/API/API_ListTagsForResource.html\">ListTagsForResource</a> </p> </li> <li> <p> <a href=\"https://docs.aws.amazon.com/mwaa/latest/API/API_TagResource.html\">TagResource</a> </p> </li> <li> <p> <a href=\"https://docs.aws.amazon.com/mwaa/latest/API/API_UntagResource.html\">UntagResource</a> </p> </li> <li> <p> <a href=\"https://docs.aws.amazon.com/mwaa/latest/API/API_UpdateEnvironment.html\">UpdateEnvironment</a> </p> </li> </ul> </li> <li> <p> <code>env.airflow.{region}.amazonaws.com</code> - This endpoint is used to operate the Airflow environment.</p> <ul> <li> <p> <a href=\"https://docs.aws.amazon.com/mwaa/latest/API/API_CreateCliToken.html \">CreateCliToken</a> </p> </li> <li> <p> <a href=\"https://docs.aws.amazon.com/mwaa/latest/API/API_CreateWebLoginToken.html\">CreateWebLoginToken</a> </p> </li> <li> <p> <a href=\"https://docs.aws.amazon.com/mwaa/latest/API/API_InvokeRestApi.html\">InvokeRestApi</a> </p> </li> </ul> </li> </ul> <p> <b>Regions</b> </p> <p>For a list of supported regions, see <a href=\"https://docs.aws.amazon.com/general/latest/gr/mwaa.html\">Amazon MWAA endpoints and quotas</a> in the <i>Amazon Web Services General Reference</i>.</p></p>",
"operations": {
"CreateCliToken": "<p>Creates a CLI token for the Airflow CLI. To learn more, see <a href=\"https://docs.aws.amazon.com/mwaa/latest/userguide/call-mwaa-apis-cli.html\">Creating an Apache Airflow CLI token</a>.</p>",
"CreateEnvironment": "<p>Creates an Amazon Managed Workflows for Apache Airflow (MWAA) environment.</p>",
"CreateEnvironment": "<p>Creates an Amazon Managed Workflows for Apache Airflow (Amazon MWAA) environment.</p>",
"CreateWebLoginToken": "<p>Creates a web login token for the Airflow Web UI. To learn more, see <a href=\"https://docs.aws.amazon.com/mwaa/latest/userguide/call-mwaa-apis-web.html\">Creating an Apache Airflow web login token</a>.</p>",
"DeleteEnvironment": "<p>Deletes an Amazon Managed Workflows for Apache Airflow (MWAA) environment.</p>",
"DeleteEnvironment": "<p>Deletes an Amazon Managed Workflows for Apache Airflow (Amazon MWAA) environment.</p>",
"GetEnvironment": "<p>Describes an Amazon Managed Workflows for Apache Airflow (MWAA) environment.</p>",
"InvokeRestApi": "<p>Invokes the Apache Airflow REST API on the webserver with the specified inputs. To learn more, see <a href=\"https://docs.aws.amazon.com/mwaa/latest/userguide/access-mwaa-apache-airflow-rest-api.html\">Using the Apache Airflow REST API</a> </p>",
"ListEnvironments": "<p>Lists the Amazon Managed Workflows for Apache Airflow (MWAA) environments.</p>",
"ListTagsForResource": "<p>Lists the key-value tag pairs associated to the Amazon Managed Workflows for Apache Airflow (MWAA) environment. For example, <code>\"Environment\": \"Staging\"</code>. </p>",
"PublishMetrics": "<p> <b>Internal only</b>. Publishes environment health metrics to Amazon CloudWatch.</p>",
Expand Down Expand Up @@ -37,9 +38,9 @@
"AirflowVersion": {
"base": null,
"refs": {
"CreateEnvironmentInput$AirflowVersion": "<p>The Apache Airflow version for your environment. If no value is specified, it defaults to the latest version. For more information, see <a href=\"https://docs.aws.amazon.com/mwaa/latest/userguide/airflow-versions.html\">Apache Airflow versions on Amazon Managed Workflows for Apache Airflow (MWAA)</a>.</p> <p>Valid values: <code>1.10.12</code>, <code>2.0.2</code>, <code>2.2.2</code>, <code>2.4.3</code>, <code>2.5.1</code>, <code>2.6.3</code>, <code>2.7.2</code> <code>2.8.1</code> </p>",
"Environment$AirflowVersion": "<p>The Apache Airflow version on your environment.</p> <p>Valid values: <code>1.10.12</code>, <code>2.0.2</code>, <code>2.2.2</code>, <code>2.4.3</code>, <code>2.5.1</code>, <code>2.6.3</code>, <code>2.7.2</code>, <code>2.8.1</code>.</p>",
"UpdateEnvironmentInput$AirflowVersion": "<p>The Apache Airflow version for your environment. To upgrade your environment, specify a newer version of Apache Airflow supported by Amazon MWAA.</p> <p>Before you upgrade an environment, make sure your requirements, DAGs, plugins, and other resources used in your workflows are compatible with the new Apache Airflow version. For more information about updating your resources, see <a href=\"https://docs.aws.amazon.com/mwaa/latest/userguide/upgrading-environment.html\">Upgrading an Amazon MWAA environment</a>.</p> <p>Valid values: <code>1.10.12</code>, <code>2.0.2</code>, <code>2.2.2</code>, <code>2.4.3</code>, <code>2.5.1</code>, <code>2.6.3</code>, <code>2.7.2</code>, <code>2.8.1</code>.</p>"
"CreateEnvironmentInput$AirflowVersion": "<p>The Apache Airflow version for your environment. If no value is specified, it defaults to the latest version. For more information, see <a href=\"https://docs.aws.amazon.com/mwaa/latest/userguide/airflow-versions.html\">Apache Airflow versions on Amazon Managed Workflows for Apache Airflow (Amazon MWAA)</a>.</p> <p>Valid values: <code>1.10.12</code>, <code>2.0.2</code>, <code>2.2.2</code>, <code>2.4.3</code>, <code>2.5.1</code>, <code>2.6.3</code>, <code>2.7.2</code>, <code>2.8.1</code>, <code>2.9.2</code>, and <code>2.10.1</code>.</p>",
"Environment$AirflowVersion": "<p>The Apache Airflow version on your environment.</p> <p>Valid values: <code>1.10.12</code>, <code>2.0.2</code>, <code>2.2.2</code>, <code>2.4.3</code>, <code>2.5.1</code>, <code>2.6.3</code>, <code>2.7.2</code>, <code>2.8.1</code>, <code>2.9.2</code>, and <code>2.10.1</code>.</p>",
"UpdateEnvironmentInput$AirflowVersion": "<p>The Apache Airflow version for your environment. To upgrade your environment, specify a newer version of Apache Airflow supported by Amazon MWAA.</p> <p>Before you upgrade an environment, make sure your requirements, DAGs, plugins, and other resources used in your workflows are compatible with the new Apache Airflow version. For more information about updating your resources, see <a href=\"https://docs.aws.amazon.com/mwaa/latest/userguide/upgrading-environment.html\">Upgrading an Amazon MWAA environment</a>.</p> <p>Valid values: <code>1.10.12</code>, <code>2.0.2</code>, <code>2.2.2</code>, <code>2.4.3</code>, <code>2.5.1</code>, <code>2.6.3</code>, <code>2.7.2</code>, <code>2.8.1</code>, <code>2.9.2</code>, and <code>2.10.1</code>.</p>"
}
},
"CeleryExecutorQueue": {
Expand Down Expand Up @@ -77,7 +78,7 @@
}
},
"CreateEnvironmentInput": {
"base": "<p>This section contains the Amazon Managed Workflows for Apache Airflow (MWAA) API reference documentation to create an environment. For more information, see <a href=\"https://docs.aws.amazon.com/mwaa/latest/userguide/get-started.html\">Get started with Amazon Managed Workflows for Apache Airflow</a>.</p>",
"base": "<p>This section contains the Amazon Managed Workflows for Apache Airflow (Amazon MWAA) API reference documentation to create an environment. For more information, see <a href=\"https://docs.aws.amazon.com/mwaa/latest/userguide/get-started.html\">Get started with Amazon Managed Workflows for Apache Airflow</a>.</p>",
"refs": {
}
},
Expand Down Expand Up @@ -124,6 +125,12 @@
"MetricDatum$Dimensions": "<p> <b>Internal only</b>. The dimensions associated with the metric.</p>"
}
},
"Document": {
"base": null,
"refs": {
"InvokeRestApiRequest$QueryParameters": "<p>Query parameters to be included in the Apache Airflow REST API call, provided as a JSON object. </p>"
}
},
"Double": {
"base": null,
"refs": {
Expand Down Expand Up @@ -181,6 +188,7 @@
"Environment$Name": "<p>The name of the Amazon MWAA environment. For example, <code>MyMWAAEnvironment</code>.</p>",
"EnvironmentList$member": null,
"GetEnvironmentInput$Name": "<p>The name of the Amazon MWAA environment. For example, <code>MyMWAAEnvironment</code>.</p>",
"InvokeRestApiRequest$Name": "<p>The name of the Amazon MWAA environment. For example, <code>MyMWAAEnvironment</code>.</p>",
"PublishMetricsInput$EnvironmentName": "<p> <b>Internal only</b>. The name of the environment.</p>",
"UpdateEnvironmentInput$Name": "<p>The name of your Amazon MWAA environment. For example, <code>MyMWAAEnvironment</code>.</p>"
}
Expand Down Expand Up @@ -238,6 +246,9 @@
"Integer": {
"base": null,
"refs": {
"InvokeRestApiResponse$RestApiStatusCode": "<p>The HTTP status code returned by the Apache Airflow REST API call.</p>",
"RestApiClientException$RestApiStatusCode": "<p>The HTTP status code returned by the Apache Airflow REST API call.</p>",
"RestApiServerException$RestApiStatusCode": "<p>The HTTP status code returned by the Apache Airflow REST API call.</p>",
"StatisticSet$SampleCount": "<p> <b>Internal only</b>. The number of samples used for the statistic set.</p>"
}
},
Expand All @@ -246,6 +257,16 @@
"refs": {
}
},
"InvokeRestApiRequest": {
"base": null,
"refs": {
}
},
"InvokeRestApiResponse": {
"base": null,
"refs": {
}
},
"KmsKey": {
"base": null,
"refs": {
Expand Down Expand Up @@ -421,6 +442,42 @@
"refs": {
}
},
"RestApiClientException": {
"base": "<p>An exception indicating that a client-side error occurred during the Apache Airflow REST API call.</p>",
"refs": {
}
},
"RestApiMethod": {
"base": null,
"refs": {
"InvokeRestApiRequest$Method": "<p>The HTTP method used for making Airflow REST API calls. For example, <code>POST</code>. </p>"
}
},
"RestApiPath": {
"base": null,
"refs": {
"InvokeRestApiRequest$Path": "<p>The Apache Airflow REST API endpoint path to be called. For example, <code>/dags/123456/clearTaskInstances</code>. For more information, see <a href=\"https://airflow.apache.org/docs/apache-airflow/stable/stable-rest-api-ref.html\">Apache Airflow API</a> </p>"
}
},
"RestApiRequestBody": {
"base": null,
"refs": {
"InvokeRestApiRequest$Body": "<p>The request body for the Apache Airflow REST API call, provided as a JSON object.</p>"
}
},
"RestApiResponse": {
"base": null,
"refs": {
"InvokeRestApiResponse$RestApiResponse": "<p>The response data from the Apache Airflow REST API call, provided as a JSON object.</p>",
"RestApiClientException$RestApiResponse": "<p>The error response data from the Apache Airflow REST API call, provided as a JSON object.</p>",
"RestApiServerException$RestApiResponse": "<p>The error response data from the Apache Airflow REST API call, provided as a JSON object.</p>"
}
},
"RestApiServerException": {
"base": "<p>An exception indicating that a server-side error occurred during the Apache Airflow REST API call.</p>",
"refs": {
}
},
"S3BucketArn": {
"base": null,
"refs": {
Expand Down
24 changes: 24 additions & 0 deletions generator/ServiceModels/mwaa/mwaa-2020-07-01.examples.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
{
"version": "1.0",
"examples": {
"InvokeRestApi": [
{
"input": {
"Method": "GET",
"Name": "MyEnvironment",
"Path": "/variables"
},
"output": {
"RestApiResponse": {
"total_entries": 1,
"variables": [
{
"key": "test-variable",
"value": "123",
"description": "Example variable"
}
]
},
"RestApiStatusCode": 200
},
"id": "example-1",
"title": "Listing Airflow variables."
}
]
}
}
Loading

0 comments on commit e33b2bd

Please sign in to comment.