[prev in list] [next in list] [prev in thread] [next in thread] 

List:       esb-java-dev
Subject:    Re: [Dev] [APIM 3.0] [Publisher REST API] Some inconsistancies in resource definitions
From:       Malintha Amarasinghe <malinthaa () wso2 ! com>
Date:       2019-04-30 16:57:39
Message-ID: CACA=-e6toYT6DgjQRS0Memsen64FxcudEtcGryxiVrRQTqC7yQ () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi Ishara,

On Tue, Apr 30, 2019 at 6:28 PM Ishara Cooray <isharac@wso2.com> wrote:

> Hi Malintha,
>
> If we consider Option1 where everything goes under /policies/  it's likely
> that we will have a resource which we can get all type of policies by using
> the /policies
>
Thank you for the feedback. I guess your point is, having a /policies
resource, in the beginning, does not really meaningful and it is not
something we can implement meaningfully as it has a broad scope. Agree on
that.
Someone might see it as a categorization of policies. However, I think it
is not easy to have a clear meaning for what "policy" is, so it will be
difficult to decide a new resource adding in the future should be
categorized as a policy or not. This may again add confusion.

Hence I think my +1 also goes for Option2.
A minor issue I see with option 2 is, it makes the resource names a bit
lengthy.

@All, Please let us know if you have any other feedback or any new
suggestions for the resource definitions.

Thanks!

>
> Hence +1 for option2.
>
> Thanks & Regards,
> Ishara Cooray
> Associate Technical Lead
> Mobile : +9477 262 9512
> WSO2, Inc. | http://wso2.com/
> Lean . Enterprise . Middleware
>
>
> On Tue, Apr 30, 2019 at 10:51 AM Malintha Amarasinghe <malinthaa@wso2.com>
> wrote:
>
>> Hi,
>>
>> In APIM Publisher REST API we have below resources. Those resources are
>> policies related eg: threat protection policies, mediation policies,
>> throttling policies. There is an inconsistency across the API in the way it
>> is defined.
>>
>> For example;
>> 1. We for mediation policies, we have specified the resource as
>> /policies/mediation whereas threat protection policies are defined as
>> /threat-protection-policies.
>> 2. For throttling policies, there is no mention about "throttling" at all
>> in the resource name.
>>
>> As we are redesigning the REST APIs for REST API v1.0 release (so far we
>> are in v0.x versions) this is the ideal time to fix this inconsistency and
>> make it more intuitive.
>>
>> *The list of resources we have this issue:*
>>
>> Global per-API
>> /policies/mediation
>> /policies/mediation/{mediationPolicyId}
>> /policies/{policyLevel}
>> /policies/{policyLevel}/{policyName}
>> /threat-protection-policies
>> /threat-protection-policies/{policyId} /apis/{apiId}/policies/mediation
>> /apis/{apiId}/policies/mediation/{mediationPolicyId}
>> /apis/{apiId}/threat-protection-policies
>> /apis/{apiId}/resource-policies
>> /apis/{apiId}/resource-policies/{resourcePolicyId}
>>
>> *Suggestions:*
>>
>> *Option 1:*
>> Take everything under */policies* resource.
>>
>> *Option 2:*
>> Remove /policies from all the resources and add *-policies* suffix.
>>
>> Option 1 Option 2
>> /policies/mediation
>> /policies/mediation/{mediationPolicyId}
>> /policies/*throttling*/{policyLevel}
>> /policies/*throttling*/{policyLevel}/{policyName}
>> */policies/threat-protection*
>> */policies/threat-protection*/{policyId}
>>
>> /apis/{apiId}/policies/mediation
>> /apis/{apiId}/policies/mediation/{mediationPolicyId}
>> /apis/{apiId}/*policies*/threat-protection
>> .. */mediation-policies*
>> */mediation-policies*/{mediationPolicyId}
>> /*throttling*-policies/{policyLevel}
>> /*throttling*-policies/{policyLevel}/{policyName}
>> /threat-protection-policies
>> /threat-protection-policies/{policyId}
>>
>> /apis/{apiId}/*mediation-policies*
>> /apis/{apiId}/*mediation-policies*/{mediationPolicyId}
>> /apis/{apiId}/threat-protection-policies
>>
>> Please let us know your thoughts
>>
>> Thanks!
>> Malintha
>>
>> --
>> Malintha Amarasinghe
>> *WSO2, Inc. - lean | enterprise | middleware*
>> http://wso2.com/
>>
>> Mobile : +94 712383306
>>
>

-- 
Malintha Amarasinghe
*WSO2, Inc. - lean | enterprise | middleware*
http://wso2.com/

Mobile : +94 712383306

[Attachment #5 (text/html)]

<div dir="ltr"><div>Hi Ishara,</div><br><div class="gmail_quote"><div dir="ltr" \
class="gmail_attr">On Tue, Apr 30, 2019 at 6:28 PM Ishara Cooray &lt;<a \
href="mailto:isharac@wso2.com">isharac@wso2.com</a>&gt; wrote:<br></div><blockquote \
class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi \
Malintha,</div><div><br></div><div>If we consider Option1 where everything goes under \
/policies/   it&#39;s likely that we will have a resource which we can get all type \
of policies by using the /policies</div></div></blockquote><div>Thank you for the \
feedback. I guess your point is, having a /policies resource, in the beginning, does \
not really meaningful and it is not something we can implement meaningfully as it has \
a broad scope. Agree on that.  </div><div>Someone might see it as a categorization of \
policies. However, I think it is not easy to have a clear meaning for what \
&quot;policy&quot; is, so it will be difficult to decide a new resource adding in the \
future should be categorized as a policy or not. This may again add \
confusion.</div><div><br></div><div>Hence I think my  +1 also goes for \
Option2.</div><div>A minor issue I see with option 2 is, it makes the resource names \
a bit lengthy.</div><div><br></div><div>@All, Please let us know if you have any \
other feedback or any new suggestions for the resource \
definitions.<br></div><div><br></div><div>Thanks!</div><blockquote \
class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><br></div><div>Hence +1 for \
option2.</div><div><br></div><div><div><div dir="ltr" \
class="gmail-m_3275747696180358755gmail_signature"><div dir="ltr"><div><div \
dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div \
dir="ltr"><div><div>Thanks &amp; Regards,<br>Ishara Cooray<br></div><span \
style="color:rgb(153,153,153)">Associate Technical Lead<br></span></div><span \
style="color:rgb(153,153,153)">Mobile : +9477 262 9512</span><br><span><font \
color="#888888">WSO2, Inc. | <a href="http://wso2.com/" \
target="_blank">http://wso2.com/</a><br>Lean . Enterprise . \
Middleware</font></span></div></div></div></div></div></div></div></div></div></div></div><br></div></div><br><div \
class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Apr 30, 2019 at 10:51 \
AM Malintha Amarasinghe &lt;<a href="mailto:malinthaa@wso2.com" \
target="_blank">malinthaa@wso2.com</a>&gt; wrote:<br></div><blockquote \
class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div \
dir="ltr">Hi,<div><br></div><div>In APIM Publisher REST API we have below resources. \
Those resources are policies related eg: threat protection policies, mediation \
policies, throttling policies. There is an inconsistency across the API in the way it \
is defined.</div><div><br></div><div>For example;  </div><div>1. We for mediation \
policies, we have specified the resource as /policies/mediation whereas threat \
protection policies are defined as /threat-protection-policies.  </div><div>2. For \
throttling policies, there is no mention about &quot;throttling&quot; at all in the \
resource name.  </div><div><br></div><div>As we are redesigning the REST APIs for \
REST API v1.0 release (so far we are in v0.x versions) this is the ideal time to fix \
this inconsistency and make it more intuitive.</div><div><br></div><div><u>The list \
of resources we have this issue:</u></div><div><u><br></u></div><div><table dir="ltr" \
style="table-layout:fixed;font-size:10pt;font-family:arial,sans,sans-serif;width:0px;border-collapse:collapse;border:medium \
none" cellspacing="0" cellpadding="0" border="1"><colgroup><col width="380"><col \
width="471"></colgroup><tbody><tr style="height:21px"><td style="border:1px solid \
rgb(0,0,0);overflow:hidden;padding:2px \
3px;vertical-align:bottom;font-weight:bold">Global</td><td \
style="border-width:1px;border-style:solid;border-color:rgb(0,0,0) rgb(0,0,0) \
rgb(0,0,0) rgb(204,204,204);overflow:hidden;padding:2px \
3px;vertical-align:bottom;font-weight:bold">per-API</td></tr><tr \
style="height:21px"><td \
style="border-width:1px;border-style:solid;border-color:rgb(204,204,204) rgb(0,0,0) \
rgb(0,0,0);overflow:hidden;padding:2px \
3px;vertical-align:top">/policies/mediation<br>/policies/mediation/{mediationPolicyId} \
<br>/policies/{policyLevel}<br>/policies/{policyLevel}/{policyName}<br>/threat-protection-policies<br>/threat-protection-policies/{policyId}</td><td \
style="border-width:1px;border-style:solid;border-color:rgb(204,204,204) rgb(0,0,0) \
rgb(0,0,0) rgb(204,204,204);overflow:hidden;padding:2px \
3px;vertical-align:top">/apis/{apiId}/policies/mediation<br>/apis/{apiId}/policies/med \
iation/{mediationPolicyId}<br>/apis/{apiId}/threat-protection-policies<br>/apis/{apiId \
}/resource-policies<br>/apis/{apiId}/resource-policies/{resourcePolicyId}</td></tr></t \
body></table></div><div><div><u><br></u></div><div><u>Suggestions:</u><br></div><div><br></div><div><u>Option \
1:</u></div><div>Take everything under <b>/policies</b> \
resource.</div><div><br></div><div><div><u>Option 2:</u></div><div>Remove /policies \
from all the resources and add  <b>-policies</b>  \
suffix.</div></div><div><br></div><div><table dir="ltr" \
style="table-layout:fixed;font-size:10pt;font-family:arial,sans,sans-serif;width:0px;border-collapse:collapse;border:medium \
none" cellspacing="0" cellpadding="0" border="1"><colgroup><col width="380"><col \
width="471"></colgroup><tbody><tr style="height:21px"><td style="border:1px solid \
rgb(0,0,0);overflow:hidden;padding:2px \
3px;vertical-align:bottom;font-weight:bold">Option 1</td><td \
style="border-width:1px;border-style:solid;border-color:rgb(0,0,0) rgb(0,0,0) \
rgb(0,0,0) rgb(204,204,204);overflow:hidden;padding:2px \
3px;vertical-align:bottom;font-weight:bold">Option 2</td></tr><tr \
style="height:21px"><td \
style="border-width:1px;border-style:solid;border-color:rgb(204,204,204) rgb(0,0,0) \
rgb(0,0,0);overflow:hidden;padding:2px \
3px;vertical-align:top">/policies/mediation<br>/policies/mediation/{mediationPolicyId} \
<br>/policies/<b>throttling</b>/{policyLevel}<br>/policies/<b>throttling</b>/{policyLe \
vel}/{policyName}<br><b>/policies/threat-protection</b><br><b>/policies/threat-protect \
ion</b>/{policyId}<br><br>/apis/{apiId}/policies/mediation<br>/apis/{apiId}/policies/m \
ediation/{mediationPolicyId}<br>/apis/{apiId}/<b>policies</b>/threat-protection<br>..</td><td \
style="border-width:1px;border-style:solid;border-color:rgb(204,204,204) rgb(0,0,0) \
rgb(0,0,0) rgb(204,204,204);overflow:hidden;padding:2px \
3px;vertical-align:top"><b>/mediation-policies</b><br><b>/mediation-policies</b>/{medi \
ationPolicyId}<br>/<b>throttling</b>-policies/{policyLevel}<br>/<b>throttling</b>-poli \
cies/{policyLevel}/{policyName}<br>/threat-protection-policies<br>/threat-protection-p \
olicies/{policyId}<br><br>/apis/{apiId}/<b>mediation-policies</b><br>/apis/{apiId}/<b> \
mediation-policies</b>/{mediationPolicyId}<br>/apis/{apiId}/threat-protection-policies<br></td></tr></tbody></table></div><div><br></div><div>Please \
let us know your thoughts</div><div><br></div><div>Thanks!</div><div>Malintha</div><div><br></div><div>-- \
<br></div><div dir="ltr" \
class="gmail-m_3275747696180358755gmail-m_-738355941168657504gmail-m_8281603049238929218m_8908728355343974135gmail_signature"><div \
dir="ltr"><div><div dir="ltr"><div>Malintha Amarasinghe</div><div><i>WSO2, Inc. - \
lean | enterprise | middleware</i></div><div><a href="http://wso2.com/" \
style="color:rgb(17,85,204);font-size:12.8px" \
target="_blank">http://wso2.com/</a><br></div><div><br></div><div>Mobile : +94 \
712383306<br></div></div></div></div></div></div></div></div> </blockquote></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" \
class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Malintha \
Amarasinghe</div><div><i>WSO2, Inc. - lean | enterprise | middleware</i></div><div><a \
href="http://wso2.com/" style="color:rgb(17,85,204);font-size:12.8px" \
target="_blank">http://wso2.com/</a><br></div><div><br></div><div>Mobile : +94 \
712383306</div></div></div></div></div></div>



_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic