Layer7 API Management

  • 1.  Handling resources

    Posted Dec 13, 2018 06:49 AM

    I have rest services which has four resources like this /services/{id}/{resources}. They support different methods(POST,GET) . Whats the best way to handle/redirect it to target service?



  • 2.  Re: Handling resources
    Best Answer

    Broadcom Employee
    Posted Dec 13, 2018 02:58 PM

    Hello,

     

    For the URI you can publish a service using wildcards so  /services/{id}/{resources} would be published  /services/*/*

    and you would need to use some policy logic to determine which URI was hit.

     

    Published Service Properties - CA API Gateway - 9.4 - CA Technologies Documentation 

     

    To determine the method used, this is exposed via the built-in context variable ${request.http.method}.

    You can retrieve this value and use a compare expression assertion to reject or approve the request based on the method used.

     

    Regards,

    Joe



  • 3.  Re: Handling resources

    Posted Dec 17, 2018 03:28 AM

    Thanks for the response. I have one more requirement that i need to extract the ID in the url path and validate.

    Say for example, my url path is /services/user/{id}/accounts. How do i extract the id and validate it? If suppose data to be extracted (id) from the url path may differ for each operations of my service and how should i handle it?



  • 4.  Re: Handling resources

    Broadcom Employee
    Posted Dec 17, 2018 08:58 AM

    Hi Giridharan,

     

    It looks like this was carried over to the below post. I have added a reply to that question. Please let me know if this helps.

     

    validate request url 

     

    Regards,

    Joe