/
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:
-
Navigate to Anypoint Platform > API Manager.
-
In API Administration, click Add API and select Add new API.
-
Select Mule Gateway as your runtime.
-
Select Deploy a proxy application for Proxy type.
-
Select Hybrid for Target type.
-
Click self-managed server link at the bottom of the page.
-
Click Manage API from Exchange. .
-
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. -
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.
-
-
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.
-
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
. -
To secure outbound traffic, in TLS Context for outbound traffic, click Add TLS Context and enter the details in the Select TLS Context window.
-
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 tohttp://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
-
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:
-
Navigate to Anypoint Platform > API Manager.
-
In API Administration, click Add API and select Add new API.
-
Select Mule Gateway as your runtime.
-
Select Deploy a proxy application for Proxy type.
-
Select Hybrid for Target type.
-
Click self-managed server link at the bottom of the page.
-
Click Create new API.
-
Enter a name for your API.
-
Select an asset type.
-
Select a file upload if needed.
-
Click Continue.
-
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.
-
-
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.
-
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
. -
To secure outbound traffic, in TLS Context for outbound traffic, click Add TLS Context and enter the details in the Select TLS Context window.
-
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 tohttp://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
-
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 |
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, |
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. |