Thứ Năm, 2 tháng 6, 2016

Create a Proxy for Your API

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:
  1. api-gateway-apis
  2. Either click the version number of an existing API or click Add new API to create a new API.
    create an endpoint
  3. Click Configure Endpoint, under API Status.
    api-gateway-configure-endpoint
    The Configure Endpoint menu opens:
    api-gateway-config-endpt-menu
  4. 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.)
  5. Enter the URI of the HTTP Listener in your API, based on your use case:
  6. 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:
  1. Click Deploy Proxy under API Status:
    api-gw-deploy-proxy
  2. If no changes are needed, click Close:
    api-gw-deploy-proxy-menu
    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.
  3. To download a proxy for your API, click Download proxy (for latest gateway version):
    api-gw-download-proxy
    Anypoint Platform automatically downloads the proxy as a .zip file.

1 nhận xét:

  1. 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