Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sequence as backend #8470

Merged
merged 2 commits into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions en/docs/design/endpoints/endpoint-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ An Endpoint is a specific destination for a message such as an address, WSDL, a
</tr>
<tr><td>AWS Lambda</td><td>An AWS Lambda endpoint can be used to invoke AWS Lambda functions through WSO2 API Gateway. For more information on creating APIs with AWS Lambda endpoint, see <a href="{{base_path}}/tutorials/create-and-publish-awslambda-api/">Create and Publish an AWS Lambda API</a>.</td>
</tr>
<tr><td>Sequence Backend</td><td>A Sequence Backend can be used to provide a custom mediation logic which works as a backend to REST API and invoke through WSO2 API Gateway. For more information on creating APIs withSequence Backend endpoint, see <a href="{{base_path}}/tutorials/create-and-publish-a-sequencebackend-api/">Create and Publish an Sequence Backend API</a>.</td>
</tr>
</table>

**Note the following:**
Expand Down
59 changes: 59 additions & 0 deletions en/docs/tutorials/create-and-publish-a-sequencebackend-api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Create and Publish an API with Sequence as a Backend

When using a sequence as a backend, you can execute any mediation logic which acts as a backend to the **REST API**.
WSO2 API Manager has integrated the support for invoking **REST API** with custom mediation logic through WSO2 API Gateway. Follow the steps below to create and publish an API with Sequence as a Backend.

## Step 1 - Create a REST API

1. Sign in to the API Publisher Portal `https://<hostname>:9443/publisher`.

2. Click **CREATE API** and then click **Start From Scrach**.

[![Create a new REST API]({{base_path}}/assets/img/learn/create-lambda-api.png)]({{base_path}}/assets/img/learn/create-lambda-api.png)

3. Enter the API details without an endpoint URL and click **Create**.

[![Create a test API]({{base_path}}/assets/img/learn/create-sequence-backend-api.png)]({{base_path}}/assets/img/learn/create-sequence-backend-api.png)

## Step 2 - Add Sequence Backend Endpoint

1. Click **Endpoints** to navigate to Endpoints page.

2. Navigate to the **Sequence Backend Endpoint** type and click **ADD**.

[![Select Sequence Backend endpoint]({{base_path}}/assets/img/learn/endpoint-select-sequence-backend-endpoint.png)]({{base_path}}/assets/img/learn/endpoint-select-sequence-backend-endpoint.png)

You will be redirected to the sequence backend page.
[![Select Sequence Backend endpoint page]({{base_path}}/assets/img/learn/endpoint-sequence-backend-page.png)]({{base_path}}/assets/img/learn/endpoint-sequence-backend-page.png)

3. Upload a sequence file to the preferred **Key Type**

To upload, first the key type (SANDBOX or PRODUCTION) should be selected.
Sequence Backend endpoint configuration needs to have atleast one sequence for the API (either for SANDBOX or PRODUCTION).
[![Upload Sequence Backend]({{base_path}}/assets/img/learn/upload-sequence-backend-file.png)]({{base_path}}/assets/img/learn/upload-sequence-backend-file.png)

!!!note
In both key types, only one sequence is allowed to be added. If a developer wants to replace, then the uploaded one should be deleted from the preferred key type.

4. Click **Save**
[![Save the Sequence Uploaded]({{base_path}}/assets/img/learn/endpoint-sequence-backend-save.png)]({{base_path}}/assets/img/learn/endpoint-sequence-backend-save.png)

This lists the uploaded sequences for the preferred key types.
[![List Sequence Backends Uploaded]({{base_path}}/assets/img/learn/list-sequence-backends-uploaded.png)]({{base_path}}/assets/img/learn/list-sequence-backends-uploaded.png)


4. Download sequence uploaded of the preferred key type. This will download the sequence uploaded by the user.
[![Download Sequence Backend]({{base_path}}/assets/img/learn/sequence-backend-operations.png)]({{base_path}}/assets/img/learn/sequence-backend-operations.png)

5. Delete sequence uploaded from the preferred key type
If there's only one item to be deleted, you will not be permitted to perform the operation as atleast one sequence should be provided under the "Sequence Backend" endpoint type.

6. Click **Save**.

[![Save the Endpoint Configuration]({{base_path}}/assets/img/learn/endpoint-config-sequence-backend-save.png)]({{base_path}}/assets/img/learn/endpoint-config-sequence-backend-save.png)

!!!note
Button will not be enable if there's no sequence provided under the Sequence Backend endpoint configuration.

!!!note
Sequence Backend endpoint type only applicable for REST APIs and can be deployed only in Synapse Gateway.
1 change: 1 addition & 0 deletions en/docs/tutorials/tutorials-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ The following list of tutorials guide you to use the API-first approach when cre
<li><a href="{{base_path}}/tutorials/create-and-publish-a-graphql-api">Create and Publish a GraphQL API<a></li>
<li><a href="{{base_path}}/tutorials/create-and-publish-awslambda-api">Create and Publish an AWS Lambda API<a></li>
<li><a href="{{base_path}}/tutorials/expose-a-soap-service-as-a-rest-api">Expose a SOAP Service as a REST API<a></li>
<li><a href="{{base_path}}/tutorials/create-and-publish-a-sequencebackend-api">Expose a REST API with a custom mediation logic<a></li>
</ul>
</td>
<td>
Expand Down
2 changes: 2 additions & 0 deletions en/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1565,6 +1565,7 @@ nav:
- Create and Publish a WebSub/WebHook API: tutorials/streaming-api/create-and-publish-websub-api.md
- Create and Publish a SSE API: tutorials/streaming-api/create-and-publish-sse-api.md
- Create and Publish an AWS Lambda API: tutorials/create-and-publish-awslambda-api.md
- Create and Publish a Sequence Backend API: tutorials/create-and-publish-a-sequencebackend-api.md
- Expose a SOAP Service as a REST API: tutorials/expose-a-soap-service-as-a-rest-api.md
- Edit an API by Modifying the API Definition: tutorials/edit-an-api-by-modifyng-the-api-definition.md
- Integrating API Manager with an External Broker and Gateway: tutorials/integrating-with-solace.md
Expand Down Expand Up @@ -1792,6 +1793,7 @@ plugins:
'learn/api-security/oauth2/oauth2-scopes/scope-allowlisting.md': 'https://apim.docs.wso2.com/en/4.2.0/design/api-security/oauth2/oauth2-scopes/scope-whitelisting/'
'learn/tutorials/create-and-publish-a-graphql-api.md': 'https://apim.docs.wso2.com/en/4.2.0/tutorials/create-and-publish-a-graphql-api/'
'learn/tutorials/create-and-publish-awslambda-api.md': 'https://apim.docs.wso2.com/en/4.2.0/tutorials/create-and-publish-awslambda-api/'
'learn/tutorials/create-and-publish-a-sequencebackend-api.md': 'https://apim.docs.wso2.com/en/4.2.0/tutorials/create-and-publish-a-sequencebackend-api/'
'learn/tutorials/expose-a-soap-service-as-a-rest-api.md': 'https://apim.docs.wso2.com/en/4.2.0/tutorials/expose-a-soap-service-as-a-rest-api/'
'learn/tutorials/edit-an-api-by-modifyng-the-api-definition.md': 'https://apim.docs.wso2.com/en/4.2.0/tutorials/edit-an-api-by-modifyng-the-api-definition/'
'learn/tutorials/create-and-publish-websocket-api.md': 'https://apim.docs.wso2.com/en/4.2.0/tutorials/streaming-api/create-and-publish-websocket-api/'
Expand Down