Layer7 API Management

  • 1.  Is it possible to query services by UrlPattern through Restman?

    Posted Jan 18, 2017 02:15 PM

    Hi,


    Does restman provides any feature to query a service using the url pattern?

    For example, we can make GET call to get service by its name,
    https://gateway:port/restman/1.0/services?name=Test.Service1

    As this name need not be unique, its not very useful to get specific service properties.

     

    Thanks,

    Anand



  • 2.  Re: Is it possible to query services by UrlPattern through Restman?

    Broadcom Employee
    Posted Jan 19, 2017 11:30 AM

    Hi Anand,

     

    Can you clarify the question? Are you just looking to use Restman to pull the details for a single service?

    If so, the example you provided will work. If I have misunderstood please let me know.

     

    /restman/1.0/doc/restDoc.html

     

     

    Regards,

    Joe



  • 3.  Re: Is it possible to query services by UrlPattern through Restman?

    Posted Jan 19, 2017 03:11 PM

    Hi Joe,

     

    It does work with the service name. But as i understand, the service name is not a unique value and there can be duplicates. I believe the only unique identifier for a published service is its routing_uri as there is a check for service resolution while policy creation.

     

    Thanks,

    Anand



  • 4.  Re: Is it possible to query services by UrlPattern through Restman?

    Broadcom Employee
    Posted Jan 20, 2017 10:12 AM

    Thank for you clarifying. You are correct, the service display name does not need to be unique. The only workaround to this problem I can think of would be to specify additional parameters such as the parent folder id. Though this is not as clean and easy to use if you do not have these ID's. It would also present the same issue if both services were under the same parent.

     

    I will have to defer to the other communities members to weigh in here. Perhaps we can get some other suggestions to help you out.

     

    /restman/1.0/services?name=Test&parentFolder.id=587179C7A8CB0A0A02937C64DCAD80F8

     

    Regards,

    Joe



  • 5.  Re: Is it possible to query services by UrlPattern through Restman?
    Best Answer

    Posted Jan 20, 2017 11:56 AM

    Thank you Joe,

     

    As of now i found a workaround for this. I created a small policy that queries the ssg database with the resolution path and outputs the goid. Once i have the goid, i could get all the details i wanted about the service.

    select HEX(goid) as Id from ssg.published_service where routing_uri='${serviceuri}' and disabled=0;

     

     

    Regards,

    Anand