Yes, according to the REST API documentation <https://docs.wso2.com/display/AM210/apidocs/publisher/#!/models#API>, tiers are required. Hence the validation is needed at the API creation.
On Thu, Feb 1, 2018 at 12:51 PM, Uvindra Dias Jayasinha <[email protected]> wrote: > If someone tries to create a new API via REST API specifying a tier that > does not exist we should simply reject the creation of that API. We need to > validate that the specified tiers are valid in the API creation request > > On 1 February 2018 at 12:41, Irham Iqbal <[email protected]> wrote: > >> I have added an additional parameter to pass the api level throttling >> policy, so if that parameter has a value it will be saved in to the AM_API >> table so the throttling policy will be API level other wise that column >> will be null so it will be per resource policy. >> >> My question is, what if a request has a value for the above parameter >> which is not valid. As an example, if a value ABC has received and we >> don't have a policy with that name in our DB. In that case do we need to >> set the policy as "Unlimited" or null in the DB. Setting null will make >> the API as resource level policy. >> >> >> On Tue, Jan 30, 2018 at 10:48 AM, Anuruddha Liyanarachchi < >> [email protected]> wrote: >> >>> [+ Irham] >>> >>> On Tue, Jan 16, 2018 at 2:41 PM, Sanjeewa Malalgoda <[email protected]> >>> wrote: >>> >>>> Can we address this and fix it for 2.2.0? >>>> >>>> Thanks, >>>> sanjeewa. >>>> >>>> On Fri, Jan 12, 2018 at 4:23 PM, Kavitha Subramaniyam <[email protected] >>>> > wrote: >>>> >>>>> Thanks Rajith to pointing out! >>>>> >>>>> @Harsha, please find the github issue created on [1] >>>>> [1] https://github.com/wso2/product-apim/issues/2388 >>>>> >>>>> Thanks, >>>>> >>>>> On Fri, Jan 12, 2018 at 3:59 PM, Harsha Kumara <[email protected]> >>>>> wrote: >>>>> >>>>>> Yes, it seems like we have missed it. Please create a github issue. >>>>>> >>>>>> On Fri, Jan 12, 2018 at 3:44 PM, Rajith Roshan <[email protected]> >>>>>> wrote: >>>>>> >>>>>>> Hi, >>>>>>> >>>>>>> It seems like API level policy is not included in the APIDTO >>>>>>> object[1]. Hence this is not supported with rest api >>>>>>> >>>>>>> [1] - https://github.com/wso2/carbon-apimgt/blob/6.x/components/ >>>>>>> apimgt/org.wso2.carbon.apimgt.rest.api.store/src/gen/java/or >>>>>>> g/wso2/carbon/apimgt/rest/api/store/dto/APIDTO.java >>>>>>> >>>>>>> Thanks! >>>>>>> Rajith >>>>>>> >>>>>>> On Fri, Jan 12, 2018 at 12:13 PM, Kavitha Subramaniyam < >>>>>>> [email protected]> wrote: >>>>>>> >>>>>>>> Hi all, >>>>>>>> >>>>>>>> While am trying to update API for my scenario using publisher rest >>>>>>>> api, I need to add a throttling policy (advance policy created from >>>>>>>> admin >>>>>>>> dashboard) specifically for API (Apply to API). By following this >>>>>>>> doc[1], I >>>>>>>> couldn't find a specific parameter to do this. >>>>>>>> >>>>>>>> Observation: >>>>>>>> I have modified API from UI and added api level throttling policy >>>>>>>> (change2.jpeg) and retrieved api details, but the response doesn't >>>>>>>> return a >>>>>>>> value for relevant field in api object[2]. Same way when I change API >>>>>>>> to >>>>>>>> add resource level policy (change1.jpeg) response values are returned >>>>>>>> in >>>>>>>> API definition. >>>>>>>> >>>>>>>> Appreciate your insight on this please. >>>>>>>> >>>>>>>> [1] https://docs.wso2.com/display/AM210/apidocs/publisher/#! >>>>>>>> /operations#APIIndividual#apisApiIdPut >>>>>>>> [2] >>>>>>>> { >>>>>>>> "id": "47027dad-12ff-4e31-84ce-4d574a8caa1b", >>>>>>>> "name": "Mobile_stock_API", >>>>>>>> "description": "This is the api description", >>>>>>>> "context": "/stocks", >>>>>>>> "version": "1.0.0", >>>>>>>> "provider": "admin", >>>>>>>> "apiDefinition": "{\"swagger\":\"2.0\",\"paths\ >>>>>>>> ":{\"/stock/{id}\":{\"get\":{\"responses\":{\"200\":{\"descr >>>>>>>> iption\":\"\"}},\"parameters\":[{\"name\":\"id\",\"in\":\"pa >>>>>>>> th\",\"allowMultiple\":false,\"required\":true,\"type\":\"st >>>>>>>> ring\"}],\"x-auth-type\":\"Application & Application >>>>>>>> User\",\"x-throttling-tier\":\"headerPolicy\"}},\"/stocks\": >>>>>>>> {\"get\":{\"responses\":{\"200\":{\"description\":\"\"}},\"x-auth-type\":\"Application >>>>>>>> & Application User\",\"x-throttling-tier\":\ >>>>>>>> "ipPolicy\"}}},\"info\":{\"title\":\"Mobile_stock_API\",\"ve >>>>>>>> rsion\":\"1.0.0\"}}", >>>>>>>> "wsdlUri": null, >>>>>>>> "status": "PUBLISHED", >>>>>>>> "responseCaching": "Disabled", >>>>>>>> "cacheTimeout": 300, >>>>>>>> "destinationStatsEnabled": null, >>>>>>>> "isDefaultVersion": false, >>>>>>>> "type": "HTTP", >>>>>>>> "transport": [ >>>>>>>> "https" >>>>>>>> ], >>>>>>>> "tags": [], >>>>>>>> "tiers": [ >>>>>>>> "Gold", >>>>>>>> "Unlimited" >>>>>>>> ], >>>>>>>> "maxTps": { >>>>>>>> "production": 500, >>>>>>>> "sandbox": null >>>>>>>> }, >>>>>>>> "thumbnailUri": null, >>>>>>>> "visibility": "PUBLIC", >>>>>>>> "visibleRoles": [], >>>>>>>> "accessControl": "NONE", >>>>>>>> "accessControlRoles": [], >>>>>>>> "visibleTenants": [], >>>>>>>> "endpointConfig": "{\n \"production_endpoints\": {\n \"url\": \" >>>>>>>> http://localhost:9763/sample-data-backend/rservice/stockservice/\",\n >>>>>>>> \"config\": null,\n \"template_not_supported\": false\n },\n >>>>>>>> \"endpoint_type\": \"http\"\n}", >>>>>>>> "endpointSecurity": null, >>>>>>>> "gatewayEnvironments": "Production and Sandbox", >>>>>>>> "sequences": [], >>>>>>>> "subscriptionAvailability": "current_tenant", >>>>>>>> "subscriptionAvailableTenants": [], >>>>>>>> "businessInformation": { >>>>>>>> "technicalOwnerEmail": null, >>>>>>>> "businessOwnerEmail": null, >>>>>>>> "businessOwner": null, >>>>>>>> "technicalOwner": null >>>>>>>> }, >>>>>>>> "corsConfiguration": { >>>>>>>> "accessControlAllowOrigins": [], >>>>>>>> "accessControlAllowCredentials": false, >>>>>>>> "corsConfigurationEnabled": false, >>>>>>>> "accessControlAllowHeaders": [], >>>>>>>> "accessControlAllowMethods": [] >>>>>>>> }, >>>>>>>> "additionalProperties": {} >>>>>>>> } >>>>>>>> >>>>>>>> >>>>>>>> Thanks, >>>>>>>> Kavitha >>>>>>>> >>>>>>>> -- >>>>>>>> Kavitha.S >>>>>>>> *Software Engineer -QA* >>>>>>>> email : [email protected] >>>>>>>> Mobile : +94 (0) 771538811 <%2B94%20%280%29%20773%20451194> >>>>>>>> >>>>>>>> >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> Rajith Roshan >>>>>>> Senior Software Engineer, WSO2 Inc. >>>>>>> Mobile: +94-7 <%2B94-71-554-8430>17-064-214 >>>>>>> >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> Harsha Kumara >>>>>> Software Engineer, WSO2 Inc. >>>>>> Mobile: +94775505618 <+94%2077%20550%205618> >>>>>> Blog:harshcreationz.blogspot.com >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> Kavitha.S >>>>> *Software Engineer -QA* >>>>> email : [email protected] >>>>> Mobile : +94 (0) 771538811 <%2B94%20%280%29%20773%20451194> >>>>> >>>>> >>>> >>>> >>>> -- >>>> >>>> *Sanjeewa Malalgoda* >>>> WSO2 Inc. >>>> Mobile : +94713068779 <+94%2071%20306%208779> >>>> >>>> <http://sanjeewamalalgoda.blogspot.com/>blog >>>> :http://sanjeewamalalgoda.blogspot.com/ >>>> <http://sanjeewamalalgoda.blogspot.com/> >>>> >>>> >>>> >>> >>> >>> -- >>> *Thanks and Regards,* >>> Anuruddha Lanka Liyanarachchi >>> Senior Software Engineer - WSO2 >>> Mobile : +94 (0) 712762611 >>> Tel : +94 112 145 345 >>> a <[email protected]>[email protected] >>> >> >> >> >> -- >> Irham Iqbal >> Software Engineer >> WSO2 >> phone: +94 777888452 >> <http://wso2.com/signature> >> >> > > > -- > Regards, > Uvindra > > Mobile: 777733962 > -- Chamin Dias Mobile : 0716097455 Email : [email protected] LinkedIn : https://www.linkedin.com/in/chamindias
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
