Hi Ishara,

On Tue, Apr 30, 2019 at 6:28 PM Ishara Cooray <isha...@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 <malint...@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
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to