Nav

API Auto-Discovery Reference (Nov 2017)

The configuration.xml of a project that includes auto-discovery references the main flow, where you configure the HTTP listener. From the auto-discovery configuration, API Manager obtains the information necessary to manage the APIs described by the global elements.

api-platform-gw Attributes

The api-platform-gw global element contains the information needed to register an API in Anypoint Platform. The global element includes the description and tag attributes. The api-platform-gw attributes include the flowRef attribute. In an APIkit project, the global element includes an apikitRef that references the APIkit global configuration.

The Nov 2017 API Manager doesn’t support the create attribute. You need to create an API in API Manager before using auto-discovery.

API Manager and Mule 3.x

The following table lists the api-platform-gw attributes when you use the Nov 2017 API Manager and Mule 3.x:

Attribute Required Description

apiId

Yes

The friendly API name that appears on API Manager and in Studio on Global Element Properties.

flowRef

Yes

A reference to the main flow of your project. It triggers the agent to discover this flow and use it when performing the auto-registration.

apikitRef

No

A reference to the APIkit configuration. Used to upload the RAML file to Anypoint Platform after API registration completes and for resource level policies.

apiName

Yes

The friendly API name that appears on API Manager and in Studio on Global Element Properties.

version

Yes

The version number. Management breaks if you change the version in API Portal.

API Manager generates the apiName and version of new APIs managed by API Manager. The name and version are displayed on the API instance dashboard:

name version

If you upgraded a managed API, the existing name and version are preserved to maintain backward compatibility. The following configuration.xml is an example of an API configured for auto-discovery:

Mule Runtime 3.x


          
       
1
2
3
4
<api-platform-gw:api apiName="${apiName}" version="${apiVersion}" flowRef="proxy" create="true" apikitRef="api-config" doc:name="API Autodiscovery">
  <api-platform-gw:description>Consume site statistics and perform Q3 computations</api-platform-gw:description>
  <api-platform-gw:tag>Q3results</api-platform-gw:tag>
</api-platform-gw:api>

API Manager and Mule 4

The following table lists the api-platform-gw attributes when you use the Nov 2017 API Manager and Mule 4:

Attribute Required Description

apiId

Yes

The friendly API name that appears on API Manager and in Studio on Global Element Properties.

flowRef

Yes

A reference to the main flow of your project. It triggers the agent to discover this flow and use it when performing the auto-registration.

apikitRef

No

A reference to the APIkit configuration. Used to upload the RAML file to Anypoint Platform after API registration completes and for resource level policies.

API Manager generates the apiId of new APIs managed by API Manager. The API ID is displayed on the API instance dashboard:

api id

The following configuration.xml is an example of an API configured for auto-discovery in Mule Runtime 4.x:

Mule Runtime 4.x


          
       
1
<api-gateway:autodiscovery apiId="${api.id}" flowRef="proxy" doc:name="API Autodiscovery"/>

In Mule Runtime 4.x, create, apikitRef attributes and description, tag elements were removed.

New API Manager and Mule 3.x or Mule 4

The other auto-discovery elements are consistent from Mule releases 3.x to 4.

api-platform-gw Nested Elements

The following attributes list the api-platform-gw nested elements.

Nested Element Required Description

api-platform-gw:description

No

A description of the API that appears on the API version details page when Anypoint Platform discovers and registers the API.

api-platform-gw:tag

No

The tag is searchable metadata in the API Manager and API that appears on the API version details page when Anypoint Platform discovers and registers the API.

Auto-Discovery Namespace, Schema, and Dependency Information

xmlns:api-gateway="http://www.mulesoft.org/schema/mule/api-gateway"
http://www.mulesoft.org/schema/mule/api-gateway http://www.mulesoft.org/schema/mule/api-gateway/current/mule-api-gateway.xsd

Auto-Discovery Dependency Information

<dependency>
  <groupId>com.mulesoft.anypoint</groupId>
  <artifactId>mule-module-autodiscovery</artifactId>
  <version>4.0.0</version>
</dependency>