>
> I think you can do something like following. here GET /books resource
> should return all the books in the system and HEAD /books resource can
> return some metadata of the system. Similar way you can check the
> connectivity of the system.
>
> HEAD /books
>
Since what you need is a health check for /books service, as Rukshan
suggested using a HEAD resource will be the best option

On Sat, Jan 20, 2018 at 1:01 PM, Malintha Amarasinghe <[email protected]>
wrote:

>
>
> On Sat, Jan 20, 2018 at 9:25 AM, Rukshan Premathunga <[email protected]>
> wrote:
>
>> Hi Nishadi,
>>
>> In APIM you cannot grantee the behavior when you have conflict resources.
>> Also i don't think your rest implementation is comply with restful service.
>>
>> GET /books/{book-id}
>>
>> GET /books/healthcheck
>>
>> After the path/books it should represent book's id or something. So we
>> cannot have a sub resource with /healthcheck after resource /books.
>>
>> I think you can do something like following. here GET /books resource
>> should return all the books in the system and HEAD /books resource can
>> return some metadata of the system. Similar way you can check the
>> connectivity of the system.
>>
>
>> HEAD /books
>>
>> +1
>
> Or you can use a proper base-path for the API and introduce the heathcheck
> resource.
>
> GET */books-api/v1*/books
> GET */books-api/v1*/books/{book-id}
> GET */books-api/v1*/health-check
>
>
>>
>> Thanks and Regards
>>
>> On Fri, Jan 19, 2018 at 3:55 PM, Nadeeshaan Gunasinghe <
>> [email protected]> wrote:
>>
>>> Hi Nishadi,
>>>
>>> Since this model has the conflict as you have mentioned, IMO I think it
>>> would be better to use a query parameter for the book-id instead of using
>>> the path parameter.
>>>
>>> Cheers,
>>> *Nadeeshaan Gunasinghe*
>>> Senior Software Engineer, WSO2 Inc. http://wso2.com
>>> +94770596754 | [email protected] | Skype: nadeeshaan.gunasinghe
>>> <#m_4167265291945318572_m_8103465610204754456_m_-965835132707708105_>
>>> <http://www.facebook.com/nadeeshaan.gunasinghe>
>>> <http://lk.linkedin.com/in/nadeeshaan> <http://twitter.com/Nadeeshaan>
>>> <http://nadeeshaan.blogspot.com/>
>>> Get your own email signature
>>> <https://wisestamp.com/email-install?utm_source=promotion&utm_medium=signature&utm_campaign=get_your_own>
>>>
>>> On Fri, Jan 19, 2018 at 3:33 PM, Nishadi Kirielle <[email protected]>
>>> wrote:
>>>
>>>> Hi all,
>>>>
>>>> I have several REST APIs that need to be exposed via API Manager 2.1.0.
>>>> For example, I have a micro service that manages books and in that micro
>>>> service the following two APIs need to be exposed via the API manager.
>>>>
>>>>    - GET /books/{book-id}
>>>>       - Retrieve the information of a particular book
>>>>    - GET /books/healthcheck
>>>>       - Checks the health status of the books micro service
>>>>
>>>> (In here, /books is the base path of the micro service)
>>>>
>>>> I exposed these two resources via API manager locally and without any
>>>> conflict the APIs got resolved.
>>>> I need to get verified whether this is the expected behavior such that
>>>> when the user calls to the /books/healthcheck API it always get resolved to
>>>> /books/healthcheck API in the internal micro service rather than the
>>>> /books/{book-id} considering the 'healthcheck' keyword as a book id.
>>>>
>>>> Thank you and regards,
>>>> Nishadi
>>>>
>>>>
>>>> --
>>>> *Nishadi Kirielle*
>>>> Software Engineer
>>>> WSO2, Inc.
>>>>
>>>> Mobile : +94 70 204 5934 <+94%2070%20204%205934>
>>>> Blog : nishadikirielle.wordpress.com
>>>>
>>>> <http://wso2.com/signature>
>>>>
>>>> _______________________________________________
>>>> Dev mailing list
>>>> [email protected]
>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>>
>>>>
>>>
>>> _______________________________________________
>>> Dev mailing list
>>> [email protected]
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>> Rukshan Chathuranga.
>> Software Engineer.
>> WSO2, Inc.
>> +94711822074 <+94%2071%20182%202074>
>>
>> _______________________________________________
>> Dev mailing list
>> [email protected]
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> Malintha Amarasinghe
> *WSO2, Inc. - lean | enterprise | middleware*
> http://wso2.com/
>
> Mobile : +94 712383306 <+94%2071%20238%203306>
>
> _______________________________________________
> Dev mailing list
> [email protected]
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 

*Praminda Jayawardana*
Software Engineer
WSO2 Inc.; http://wso2.com
Mobile : +94 (0) 716 590918
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to