|
4 | 4 | // library of functions for Apigee Edge.
|
5 | 5 | //
|
6 | 6 | // created: Mon Jun 6 17:32:20 2016
|
7 |
| -// last saved: <2017-December-07 18:22:37> |
| 7 | +// last saved: <2017-December-07 18:42:58> |
8 | 8 |
|
9 | 9 | (function (){
|
10 | 10 | var path = require('path'),
|
|
81 | 81 | this.kvms = new Kvm(conn);
|
82 | 82 | this.developers = new Developer(conn);
|
83 | 83 | this.developerapps = new DeveloperApp(conn);
|
| 84 | + this.apps = new App(conn); |
84 | 85 | this.sharedflows = new SharedFlow(conn);
|
85 | 86 | this.products = new ApiProduct(conn);
|
86 | 87 | this.appcredentials = new AppCredential(conn);
|
|
1002 | 1003 | Developer.prototype.get = function(options, cb) {
|
1003 | 1004 | var conn = this.conn;
|
1004 | 1005 | mergeRequestOptions(conn, function(requestOptions) {
|
1005 |
| - requestOptions.url = (options.developerEmail) ? |
1006 |
| - urljoin(conn.urlBase, 'developers', options.developerEmail) : |
1007 |
| - urljoin(conn.urlBase, 'developers'); |
| 1006 | + if (options.developerEmail || options.email) { |
| 1007 | + requestOptions.url = urljoin(conn.urlBase, 'developers', options.developerEmail || options.email); |
| 1008 | + } |
| 1009 | + else if (options.developerId || options.id) { |
| 1010 | + requestOptions.url = urljoin(conn.urlBase, 'developers', options.developerId || options.id); |
| 1011 | + } |
| 1012 | + else { |
| 1013 | + requestOptions.url = urljoin(conn.urlBase, 'developers'); |
| 1014 | + } |
| 1015 | + if (conn.verbosity>0) { |
| 1016 | + utility.logWrite(sprintf('GET %s', requestOptions.url)); |
| 1017 | + } |
| 1018 | + request.get(requestOptions, commonCallback(conn, [200], cb)); |
| 1019 | + }); |
| 1020 | + }; |
| 1021 | + |
| 1022 | + function App(conn) {this.conn = conn;} |
| 1023 | + |
| 1024 | + App.prototype.get = function(options, cb) { |
| 1025 | + // GET :mgmtserver/v1/o/:orgname/apps |
| 1026 | + // or |
| 1027 | + // GET :mgmtserver/v1/o/:orgname/apps/ID_OF_APP |
| 1028 | + if ( ! cb) { cb = options; options = {}; } |
| 1029 | + var conn = this.conn; |
| 1030 | + mergeRequestOptions(conn, function(requestOptions) { |
| 1031 | + requestOptions.url = (options.id) ? |
| 1032 | + urljoin(conn.urlBase, 'apps', options.id) : |
| 1033 | + urljoin(conn.urlBase, 'apps') + (options.expand ? '?expand=true' : ''); |
1008 | 1034 | if (conn.verbosity>0) {
|
1009 | 1035 | utility.logWrite(sprintf('GET %s', requestOptions.url));
|
1010 | 1036 | }
|
|
1677 | 1703 | // proxies { get, deploy, undeploy, del, importFromDir, importFromZip }
|
1678 | 1704 | // caches { get, create, del }
|
1679 | 1705 | // kvms { get, create, put, del }
|
| 1706 | + // apps { get } |
1680 | 1707 | // sharedflows { deploy, undeploy, importFromDir, importFromZip }
|
1681 | 1708 | // products { get, create, del}
|
1682 | 1709 | // developers { get, create, del }
|
|
0 commit comments