+

Adding an API Instance on a Self-Managed Server

If you are running an API on a self-managed server, you have two options for adding an API Instance:

  • Manage API from Exchange

  • Create new API

Manage API Instance from Exchange

To manage an API instance from Exchange:

  1. Log in to Anypoint Platform.

  2. In the navigation bar or the Anypoint Platform page, click API Manager.

  3. Click Add API and select Add new API.

  4. Select Mule Gateway as your runtime.

  5. Select Deploy a proxy application for Proxy type.

  6. Select Hybrid for Target type.

  7. Click self-managed server link at the bottom of the page.

  8. Click Manage API from Exchange. .

  9. In API Name, search for the API that you want to manage from the list of available APIs in Exchange.

    The Asset type, API version, and Asset version fields are automatically populated.

    OpenAPI Specification (OAS) 3.0 is supported, with the exception of the callback feature. To work around this issue, handle the callback outside of the Mule runtime engine domain or use an OAS 3.0 specification that does not use callbacks.
  10. For Managing Type, choose the type of API endpoint that you want to create:

    • Basic Endpoint: Use this option if you created your API outside API Manager, but want to apply policies or otherwise manage the API using API Manager. For example, if you created the API using Mule Runtime, you do not need a proxy.

      Select the Application type from the following options:

      • Mule Application: Use this option if you are running a Mule application.

      • Non-Mule Application managed by Anypoint Service Mesh: Use this option if you want to manage Kubernetes-based non-Mule microservices with Anypoint Service Mesh.

    • Endpoint with Proxy: Use this option if you want to provide additional security for your API.

  11. If you want to manage the API using Mule 4 or later (recommended), accept the default selection for Mule version.

    The parameters that you must specify differ based on the Mule version you select. For detailed field descriptions, see parameter details.

  12. In Implementation URI, replace the example by entering the URL of the site that hosts the API.

    For example, you can use the URL of your API asset in Exchange. In this case, the API is consuming the JSONPlaceholder API, so enter http://jsonplaceholder.typicode.com.

  13. To secure outbound traffic, in TLS Context for outbound traffic, click Add TLS Context and enter the details in the Select TLS Context window.

  14. If you are creating an endpoint with proxy, accept the base path / for the proxy endpoint in the Path field, or enter another path.

    For example, if an API is defined with the Implementation URI set to http://jsonplaceholder.typicode.com, the proxy returns the following URIs based on the value you configure in the proxy path:

    Proxy Path Request Response from Proxy

    /

    /api

  15. Optionally, to fine-tune additional configurations for the API, expand Advanced options, specify the details, and click Save.

Create new API

To create a new API Instance and configure the endpoint:

  1. Log in to Anypoint Platform.

  2. In the navigation bar or the Anypoint Platform page, click API Manager.

  3. Click Add API and select Add new API.

  4. Select Mule Gateway as your runtime.

  5. Select Deploy a proxy application for Proxy type.

  6. Select Hybrid for Target type.

  7. Click self-managed server link at the bottom of the page.

  8. Click Create new API.

  9. Enter a name for your API.

  10. Select an asset type.

  11. Select a file upload if needed.

  12. Click Continue.

  13. For Managing Type, choose the type of API endpoint that you want to create:

    • Basic Endpoint: Use this option if you created your API outside API Manager, but want to apply policies or otherwise manage the API using API Manager. For example, if you created the API using Mule Runtime, you do not need a proxy.

      Select the Application type from the following options:

      • Mule Application: Use this option if you are running a Mule application.

      • Non-Mule Application managed by Anypoint Service Mesh: Use this option if you want to manage Kubernetes-based non-Mule microservices with Anypoint Service Mesh.

    • Endpoint with Proxy: Use this option if you want to provide additional security for your API.

  14. If you want to manage the API using Mule 4 or later (recommended), accept the default selection for Mule version.

    The parameters that you must specify differ based on the Mule version you select. For detailed field descriptions, see parameter details.

  15. In Implementation URI, replace the example by entering the URL of the site that hosts the API.

    For example, you can use the URL of your API asset in Exchange. In this case, the API is consuming the JSONPlaceholder API, so enter http://jsonplaceholder.typicode.com.

  16. To secure outbound traffic, in TLS Context for outbound traffic, click Add TLS Context and enter the details in the Select TLS Context window.

  17. If you are creating an endpoint with proxy, accept the base path / for the proxy endpoint in the Path field, or enter another path.

    For example, if an API is defined with the Implementation URI set to http://jsonplaceholder.typicode.com, the proxy returns the following URIs based on the value you configure in the proxy path:

    Proxy Path Request Response from Proxy

    /

    /api

  18. Optionally, to fine-tune additional configurations for the API, expand Advanced options, specify the details, and click Save.

Field Input Reference

The input that you are required to provide when adding an API from Exchange depends on your specific situation, such as whether you want to create an endpoint with proxy, or whether the API was created using Mule 3 or Mule 4:

Field Name Description Required Notes

Implementation URI

The URL to access for the proxy or the API.

Yes

For example, you can use the URL of your API asset in Exchange. In this case, the API is consuming the JSONPlaceholder API, so enter http://jsonplaceholder.typicode.com.

Proxy version

Specifies the version of the proxy to use for the endpoint.

No

Enable Console

Specifies whether you can expose and test your API specification.

No

You can specify a different path in Console Path, for example, "/spec/*".

Validations

Specifies whether to validate inbound requests against a provided specification.

No

You can configure the validations to verify incoming request against provided specifications or by using query parameters.

Scheme

Specifies whether to use HTTP or HTTPS for the validations.

Yes

If you select HTTPS, specify a TLS context for inbound traffic.

API instance label

Specifies a label for the API.

No

If you have multiple managed instances of the same API, add a label to differentiate each instance from the others.

Port

Specifies the number to use if the displayed port is incorrect.

No

Response timeout

Specifies the duration after which a request times out.

No

Reference user domain

Specifies whether to use an API gateway domain.

No

If you chose Hybrid as the proxy deployment target previously in the configuration, ensure that you select this option. You must install the API gateway domain in Mule 3.8 and later.

Was this article helpful? Thanks for your feedback!
View on GitHub