Remove "experimental" API Gateway support. (#67)
Fixes #52
diff --git a/lib/routes.js b/lib/routes.js
index 2e5c214..2de8ab4 100644
--- a/lib/routes.js
+++ b/lib/routes.js
@@ -10,9 +10,7 @@
class Routes extends BaseOperation {
routeMgmtApiPath (path) {
- return this.has_access_token() ?
- `web/whisk.system/apimgmt/${path}.http` :
- `experimental/web/whisk.system/routemgmt/${path}.json`
+ return `web/whisk.system/apimgmt/${path}.http`
}
list (options) {
@@ -76,7 +74,7 @@
return {
name: id,
namespace: namespace,
- backendMethod: this.action_url_method(),
+ backendMethod: `GET`,
backendUrl: this.action_url_path(id, namespace),
authkey: this.client.options.api_key
}
@@ -86,15 +84,7 @@
return params.basepath || '/'
}
- action_url_method () {
- return this.has_access_token() ? 'GET' : 'POST'
- }
-
action_url_path (id, namespace) {
- if (!this.has_access_token()) {
- return this.client.path_url(`namespaces/${namespace}/actions/${id}`)
- }
-
// web action path must contain package identifier. uses default for
// non-explicit package.
if (!id.includes('/')) {
diff --git a/test/unit/routes.test.js b/test/unit/routes.test.js
index b300f27..5e3767c 100644
--- a/test/unit/routes.test.js
+++ b/test/unit/routes.test.js
@@ -6,20 +6,6 @@
const test = require('ava')
const Routes = require('../../lib/routes')
-test('should return experimental api path without api token', t => {
- const client = { options: {} }
- const routes = new Routes(client)
- t.is(routes.routeMgmtApiPath('a'), 'experimental/web/whisk.system/routemgmt/a.json')
-})
-
-test('should return experimental api path with api token', t => {
- const client = { options: {
- apigw_token: true
- }}
- const routes = new Routes(client)
- t.is(routes.routeMgmtApiPath('a'), 'web/whisk.system/apimgmt/a.http')
-})
-
test('should list all routes', t => {
t.plan(2)
const client = { options: {} }
@@ -134,8 +120,8 @@
action: {
name: 'helloAction',
namespace: '_',
- backendMethod: 'POST',
- backendUrl: 'https://openwhisk.ng.bluemix.net/api/v1/namespaces/_/actions/helloAction',
+ backendMethod: 'GET',
+ backendUrl: 'https://openwhisk.ng.bluemix.net/api/v1/web/_/default/helloAction.http',
authkey: api_key }
}
}
@@ -273,8 +259,8 @@
action: {
name: 'helloAction',
namespace: 'global_ns',
- backendMethod: 'POST',
- backendUrl: 'https://openwhisk.ng.bluemix.net/api/v1/namespaces/global_ns/actions/helloAction',
+ backendMethod: 'GET',
+ backendUrl: 'https://openwhisk.ng.bluemix.net/api/v1/web/global_ns/default/helloAction.http',
authkey: api_key }
}
}
@@ -307,8 +293,8 @@
action: {
name: 'helloAction',
namespace: '_',
- backendMethod: 'POST',
- backendUrl: 'https://openwhisk.ng.bluemix.net/api/v1/namespaces/_/actions/helloAction',
+ backendMethod: 'GET',
+ backendUrl: 'https://openwhisk.ng.bluemix.net/api/v1/web/_/default/helloAction.http',
authkey: api_key }
}
}
@@ -341,8 +327,8 @@
action: {
name: 'foo/helloAction',
namespace: 'test',
- backendMethod: 'POST',
- backendUrl: 'https://openwhisk.ng.bluemix.net/api/v1/namespaces/test/actions/foo/helloAction',
+ backendMethod: 'GET',
+ backendUrl: 'https://openwhisk.ng.bluemix.net/api/v1/web/test/foo/helloAction.http',
authkey: api_key }
}
}
@@ -375,8 +361,8 @@
action: {
name: 'helloAction',
namespace: 'test',
- backendMethod: 'POST',
- backendUrl: 'https://openwhisk.ng.bluemix.net/api/v1/namespaces/test/actions/helloAction',
+ backendMethod: 'GET',
+ backendUrl: 'https://openwhisk.ng.bluemix.net/api/v1/web/test/default/helloAction.http',
authkey: api_key }
}
}
@@ -409,8 +395,8 @@
action: {
name: 'helloAction',
namespace: 'test',
- backendMethod: 'POST',
- backendUrl: 'https://openwhisk.ng.bluemix.net/api/v1/namespaces/test/actions/helloAction',
+ backendMethod: 'GET',
+ backendUrl: 'https://openwhisk.ng.bluemix.net/api/v1/web/test/default/helloAction.http',
authkey: api_key }
}
}