You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by ra...@apache.org on 2019/05/09 05:08:33 UTC

[incubator-openwhisk] branch master updated: Honor skip and limit aparameters in action /whisk.system/apimgmt/getApi (#4295)

This is an automated email from the ASF dual-hosted git repository.

rabbah pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk.git


The following commit(s) were added to refs/heads/master by this push:
     new d2bdcda  Honor skip and limit aparameters in action /whisk.system/apimgmt/getApi (#4295)
d2bdcda is described below

commit d2bdcdab157ac45b938ab6086a80bad694b8d0fa
Author: Lars Andersson <la...@users.noreply.github.com>
AuthorDate: Thu May 9 07:08:27 2019 +0200

    Honor skip and limit aparameters in action /whisk.system/apimgmt/getApi (#4295)
---
 core/routemgmt/common/apigw-utils.js | 4 ++--
 core/routemgmt/getApi/getApi.js      | 4 +++-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/core/routemgmt/common/apigw-utils.js b/core/routemgmt/common/apigw-utils.js
index d66ac3c..8ed07e6 100644
--- a/core/routemgmt/common/apigw-utils.js
+++ b/core/routemgmt/common/apigw-utils.js
@@ -287,7 +287,7 @@ function deleteApiFromGateway(gwInfo, spaceGuid, apiId) {
 /**
  * Return an array of APIs
  */
-function getApis(gwInfo, spaceGuid, bpOrApiName) {
+function getApis(gwInfo, spaceGuid, bpOrApiName, limit, skip) {
   var qsBasepath = { 'basePath' : bpOrApiName };
   var qsApiName = { 'title' : bpOrApiName };
   var qs;
@@ -302,7 +302,7 @@ function getApis(gwInfo, spaceGuid, bpOrApiName) {
   }
   var options = {
     followAllRedirects: true,
-    url: gwInfo.gwUrl+'/'+encodeURIComponent(spaceGuid)+'/apis',
+    url: gwInfo.gwUrl+'/'+encodeURIComponent(spaceGuid)+'/apis?limit='+limit+'&skip='+skip,
     headers: {
       'Accept': 'application/json',
       'User-Agent': UserAgent
diff --git a/core/routemgmt/getApi/getApi.js b/core/routemgmt/getApi/getApi.js
index 198b820..c349d90 100644
--- a/core/routemgmt/getApi/getApi.js
+++ b/core/routemgmt/getApi/getApi.js
@@ -81,6 +81,8 @@ function main(message) {
   console.log('tenantInstance: '+message.tenantInstance+' / '+tenantInstance);
   console.log('accesstoken   : '+message.accesstoken);
   console.log('spaceguid     : '+message.spaceguid);
+  console.log('limit         : '+message.limit);
+  console.log('skip          : '+message.skip);
   console.log('basepath/name : '+message.basepath);
   console.log('relpath       : '+message.relpath);
   console.log('operation     : '+message.operation);
@@ -91,7 +93,7 @@ function main(message) {
     gwInfo.gwUrl = message.gwUrlV2;
     gwInfo.gwAuth = message.accesstoken;
     // Obtain the API from the API GW
-    return utils2.getApis(gwInfo, message.spaceguid, message.basepath)
+    return utils2.getApis(gwInfo, message.spaceguid, message.basepath, message.limit, message.skip)
     .then(function(endpointDocs) {
       console.log('Got '+endpointDocs.length+' APIs');
       if (endpointDocs.length === 0) {