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/org/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\":{\" > description\":\"\"}},\"parameters\":[{\"name\":\"id\",\"in\":\"path\",\" > allowMultiple\":false,\"required\":true,\"type\":\" > string\"}],\"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\",\"version\":\"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
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
