Create a Proxy for Your API
This step in the walkthrough assumes that you have either designed, built, and deployed a new API or a RAML layer for an existing legacy API to a Mule runtime, or you chose to proxy an existing legacy API without creating a RAML layer for it. In either case, you want to create a proxy for your API’s inbound endpoint so that you can govern the API with SLAs and runtime policies. The proxy endpoint is the one that you expose to your API users.
You must be an API Version Owner of the T-Shirt Service API to complete these steps.
Some controls on the API version details page might not be visible or accessible to you, depending on entitlements you purchased.
Create an Endpoint
The first step is to create an endpoint for your API on the API Version Details page.
To get to this page:
- sign in to the Anypoint Platform for APIs and click APIs:
- Either click the version number of an existing API or click Add new API to create a new API.
- Click Configure Endpoint, under API Status.The Configure Endpoint menu opens:
- In the Type field, select the type of endpoint from the list, based on your use case:
- If you are entering the endpoint of an API which was built out using APIkit, select HTTP URL.
- If you proceeded straight here because you want to follow the path of managing an existing API without RAML, select WSDL (in our example we use a SOAP API.)
- Enter the URI of the HTTP Listener in your API, based on your use case:
- If you selected RAML spec, enter the address of the HTTP Listener of your deployed APIkit application, which may be running on-premises or on CloudHub. For example:
http://localhost:8086/api
orhttp://ab-tshirt-orders.cloudhub.io
- If you selected WSDL, enter this address:
http://tshirt-service.cloudhub.io/?wsdl
- Click Save.
Download the Proxy
This step is only needed if you’re planning to deploy your proxy on premises or to deploy to CloudHub manually.
If you plan to deploy to CloudHub automatically, then there’s no need to download this deployable file.
|
Now that you have registered an endpoint for your API version, note that it is tagged as "Not registered". At the bottom of the page,
There are no registered applications for this API Version
displays.
In order to manage the API behind this endpoint with SLAs and policies, the Anypoint Platform for APIs needs to register the endpoint with the agent.
The way to do this for an already implemented API is:
- Click Deploy Proxy under API Status:
- If no changes are needed, click Close:This menu gives you the option to create a new API Gateway instance on your computer and manage the instance using the Servers feature. For more information, see Add a Server.
- To download a proxy for your API, click Download proxy (for latest gateway version):Anypoint Platform automatically downloads the proxy as a .zip file.
Nice and good article. It is very useful for me to learn and understand easily. Thanks for sharing your valuable information and time. Please keep updating mulesoft training
Trả lờiXóa