Skip to content

Commit 4323fac

Browse files
committed
updated examples to support -T (--notoken) option
1 parent c6810c5 commit 4323fac

9 files changed

+51
-32
lines changed

examples/createDeveloper.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,20 @@
44
// ------------------------------------------------------------------
55
// provision a developer in Apigee Edge
66
//
7-
// last saved: <2017-May-27 12:40:30>
7+
// last saved: <2017-December-06 12:44:45>
88

99
var fs = require('fs'),
1010
edgejs = require('apigee-edge-js'),
1111
common = edgejs.utility,
1212
apigeeEdge = edgejs.edge,
1313
sprintf = require('sprintf-js').sprintf,
1414
Getopt = require('node-getopt'),
15-
version = '20170324-1906',
15+
version = '20171206-1244',
1616
getopt = new Getopt(common.commonOptions.concat([
1717
['E' , 'email=ARG', 'email address of the developer for which to create the app'],
1818
['F' , 'first=ARG', 'first name for the developer'],
19-
['L' , 'last=ARG', 'last name for the developer']
19+
['L' , 'last=ARG', 'last name for the developer'],
20+
['T' , 'notoken', 'optional. do not try to get a authentication token.']
2021
])).bindHelp();
2122

2223
// ========================================================
@@ -53,6 +54,7 @@ var options = {
5354
org : opt.options.org,
5455
user: opt.options.username,
5556
password: opt.options.password,
57+
no_token: opt.options.notoken,
5658
verbosity: opt.options.verbose || 0
5759
};
5860

examples/createDeveloperApp.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,21 @@
44
// ------------------------------------------------------------------
55
// provision a developer app for an API Product in Apigee Edge
66
//
7-
// last saved: <2017-June-08 13:19:17>
7+
// last saved: <2017-December-06 12:45:16>
88

99
var fs = require('fs'),
1010
edgejs = require('apigee-edge-js'),
1111
common = edgejs.utility,
1212
apigeeEdge = edgejs.edge,
1313
sprintf = require('sprintf-js').sprintf,
1414
Getopt = require('node-getopt'),
15-
version = '20170324-1905',
15+
version = '20171206-1245',
1616
getopt = new Getopt(common.commonOptions.concat([
1717
['p' , 'product=ARG', 'name of the API product to enable on this app'],
1818
['E' , 'email=ARG', 'email address of the developer for which to create the app'],
1919
['N' , 'name=ARG', 'name for the app'],
20-
['x' , 'expiry=ARG', 'expiry for the credential']
20+
['x' , 'expiry=ARG', 'expiry for the credential'],
21+
['T' , 'notoken', 'optional. do not try to get a authentication token.']
2122
])).bindHelp();
2223

2324
// ========================================================
@@ -56,6 +57,7 @@ var options = {
5657
org : opt.options.org,
5758
user: opt.options.username,
5859
password: opt.options.password,
60+
no_token: opt.options.notoken,
5961
verbosity: opt.options.verbose || 0
6062
};
6163

examples/deleteDeveloperApp.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,19 @@
44
// ------------------------------------------------------------------
55
// delete a developer app
66
//
7-
// last saved: <2017-May-18 09:21:15>
7+
// last saved: <2017-December-06 12:44:58>
88

99
var fs = require('fs'),
1010
edgejs = require('apigee-edge-js'),
1111
common = edgejs.utility,
1212
apigeeEdge = edgejs.edge,
1313
sprintf = require('sprintf-js').sprintf,
1414
Getopt = require('node-getopt'),
15-
version = '20170324-1905',
15+
version = '20171206-1244',
1616
getopt = new Getopt(common.commonOptions.concat([
1717
['E' , 'email=ARG', 'email address of the developer for which to create the app'],
18-
['N' , 'appname=ARG', 'name for the app']
18+
['N' , 'appname=ARG', 'name for the app'],
19+
['T' , 'notoken', 'optional. do not try to get a authentication token.']
1920
])).bindHelp();
2021

2122
// ========================================================
@@ -48,6 +49,7 @@ var options = {
4849
org : opt.options.org,
4950
user: opt.options.username,
5051
password: opt.options.password,
52+
no_token: opt.options.notoken,
5153
verbosity: opt.options.verbose || 0
5254
};
5355

examples/exportApi.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// ------------------------------------------------------------------
55
// export one or more Apigee Edge proxy bundles
66
//
7-
// last saved: <2017-August-08 15:52:23>
7+
// last saved: <2017-December-06 12:43:29>
88

99
var fs = require('fs'),
1010
path = require('path'),
@@ -15,14 +15,15 @@ var fs = require('fs'),
1515
sprintf = require('sprintf-js').sprintf,
1616
async = require('async'),
1717
Getopt = require('node-getopt'),
18-
version = '20170808-1510',
18+
version = '20171206-1242',
1919
defaults = { destination : 'exported' },
2020
getopt = new Getopt(common.commonOptions.concat([
2121
['N' , 'name=ARG', 'name of existing API proxy or shared flow'],
2222
['P' , 'pattern=ARG', 'regex pattern for name of existing API proxy or shared flow; this always exports the latest revision.'],
2323
['D' , 'destination=ARG', 'directory for export. Default: exported'],
24-
['T' , 'trial', 'trial only. Do not actually export'],
25-
['R' , 'revision=ARG', 'revision of the asset to export. Default: latest']
24+
['t' , 'trial', 'trial only. Do not actually export'],
25+
['R' , 'revision=ARG', 'revision of the asset to export. Default: latest'],
26+
['T' , 'notoken', 'optional. do not try to get a authentication token.']
2627
])).bindHelp();
2728

2829
function exportOneProxyRevision(org, name, revision, cb) {
@@ -120,6 +121,7 @@ var options = {
120121
org : opt.options.org,
121122
user: opt.options.username,
122123
password: opt.options.password,
124+
no_token: opt.options.notoken,
123125
verbosity: opt.options.verbose || 0
124126
};
125127

examples/findPoliciesWithKvmAccess.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// In an Apigee Edge organization, find all policies in all proxies that reference a KVM.
66
// This uses a brute-force client-side search, so it will take a while to run on an org that has many proxies.
77
//
8-
// last saved: <2017-June-15 16:38:47>
8+
// last saved: <2017-December-06 12:43:59>
99

1010
var fs = require('fs'),
1111
async = require('async'),
@@ -14,10 +14,11 @@ var fs = require('fs'),
1414
apigeeEdge = edgejs.edge,
1515
sprintf = require('sprintf-js').sprintf,
1616
Getopt = require('node-getopt'),
17-
version = '20170615-1537',
17+
version = '20171206-1243',
1818
getopt = new Getopt(common.commonOptions.concat([
1919
['M' , 'kvm=ARG', 'Optional. KVM name to find.'],
20-
['S' , 'scope=ARG', 'Optional. Scope to match. Should be one of: (organization, environment, apiproxy)']
20+
['S' , 'scope=ARG', 'Optional. Scope to match. Should be one of: (organization, environment, apiproxy)'],
21+
['T' , 'notoken', 'optional. do not try to get a authentication token.']
2122
])).bindHelp();
2223

2324
// ========================================================
@@ -101,7 +102,8 @@ var options = {
101102
org: opt.options.org,
102103
user: opt.options.username,
103104
password: opt.options.password,
104-
verbosity: 0
105+
no_token: opt.options.notoken,
106+
verbosity: opt.options.verbose || 0
105107
};
106108

107109
apigeeEdge.connect(options, function(e, org) {

examples/generateAndLoadKeysIntoKvm.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// ------------------------------------------------------------------
55
// generate an RSA 256-bit keypair and load into Apigee Edge KVM
66
//
7-
// last saved: <2017-June-15 13:39:15>
7+
// last saved: <2017-December-06 12:44:23>
88

99
var fs = require('fs'),
1010
edgejs = require('apigee-edge-js'),
@@ -15,13 +15,14 @@ var fs = require('fs'),
1515
NodeRSA = require('node-rsa'),
1616
uuidV4 = require('uuid-v4'),
1717
Getopt = require('node-getopt'),
18-
version = '20170615-1153',
18+
version = '20171206-1244',
1919
defaults = { privkeysmap : 'PrivateKeys', pubkeysmap: 'NonSecrets', kidmap: 'NonSecrets' },
2020
getopt = new Getopt(common.commonOptions.concat([
2121
['e' , 'env=ARG', 'the Edge environment for which to store the KVM data'],
2222
['b' , 'keystrength=ARG', 'strength in bits of the RSA keypair. Default: 2048'],
2323
['K' , 'privkeysmap=ARG', 'name of the KVM in Edge for keys. Will be created if nec. Default: ' + defaults.privkeysmap],
24-
['I' , 'kidmap=ARG', 'name of the KVM in Edge for Key IDs. Will be created if nec. Default: ' + defaults.kidmap]
24+
['I' , 'kidmap=ARG', 'name of the KVM in Edge for Key IDs. Will be created if nec. Default: ' + defaults.kidmap],
25+
['T' , 'notoken', 'optional. do not try to get a authentication token.']
2526
])).bindHelp();
2627

2728
// ========================================================
@@ -119,7 +120,9 @@ var options = {
119120
mgmtServer: opt.options.mgmtserver,
120121
org : opt.options.org,
121122
user: opt.options.username,
122-
password: opt.options.password
123+
password: opt.options.password,
124+
no_token: opt.options.notoken,
125+
verbosity: opt.options.verbose || 0
123126
};
124127

125128
apigeeEdge.connect(options, function(e, org) {

examples/importAndDeploy.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,23 @@
44
// ------------------------------------------------------------------
55
// import and deploy an Apigee Edge proxy bundle or shared flow.
66
//
7-
// last saved: <2017-November-10 11:34:21>
7+
// last saved: <2017-December-06 12:42:38>
88

99
var fs = require('fs'),
1010
edgejs = require('apigee-edge-js'),
1111
common = edgejs.utility,
1212
apigeeEdge = edgejs.edge,
1313
sprintf = require('sprintf-js').sprintf,
1414
Getopt = require('node-getopt'),
15-
version = '20171110-1106',
15+
version = '20171206-1242',
1616
defaults = { basepath : '/' },
1717
getopt = new Getopt(common.commonOptions.concat([
1818
['d' , 'source=ARG', 'source directory for the proxy files. Should be parent of dir "apiproxy" or "sharedflowbundle"'],
1919
['N' , 'name=ARG', 'override the name for the API proxy or shared flow. By default it\'s extracted from the XML file.'],
2020
['e' , 'env=ARG', 'the Edge environment(s) to which to deploy the asset. Separate multiple environments with a comma.'],
2121
['b' , 'basepath=ARG', 'basepath for deploying the API Proxy. Default: ' + defaults.basepath + ' Does not apply to sf.'],
22-
['S' , 'sharedflow', 'import and deploy as a sharedflow. Default: import + deploy a proxy.']
22+
['S' , 'sharedflow', 'import and deploy as a sharedflow. Default: import + deploy a proxy.'],
23+
['T' , 'notoken', 'optional. do not try to get a authentication token.']
2324
])).bindHelp();
2425

2526
// ========================================================
@@ -69,6 +70,7 @@ var options = {
6970
org : opt.options.org,
7071
user: opt.options.username,
7172
password: opt.options.password,
73+
no_token: opt.options.notoken,
7274
verbosity: opt.options.verbose || 0
7375
};
7476

examples/listAndQueryDevelopers.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,19 @@
44
// ------------------------------------------------------------------
55
// list and query developers in Apigee Edge
66
//
7-
// last saved: <2017-May-27 12:53:22>
7+
// last saved: <2017-December-06 12:42:46>
88

99
var fs = require('fs'),
1010
edgejs = require('apigee-edge-js'),
1111
common = edgejs.utility,
1212
apigeeEdge = edgejs.edge,
13-
async = require('async'),
13+
async = require('async'),
1414
sprintf = require('sprintf-js').sprintf,
1515
Getopt = require('node-getopt'),
16-
version = '20170527-1251',
16+
version = '20171206-1242',
1717
getopt = new Getopt(common.commonOptions.concat([
18-
['E' , 'expand', 'expand for each developer']
18+
['E' , 'expand', 'expand for each developer'],
19+
['T' , 'notoken', 'optional. do not try to get a authentication token.']
1920
])).bindHelp();
2021

2122
// ========================================================
@@ -35,6 +36,7 @@ var options = {
3536
org : opt.options.org,
3637
user: opt.options.username,
3738
password: opt.options.password,
39+
no_token: opt.options.notoken,
3840
verbosity: opt.options.verbose || 0
3941
};
4042

@@ -61,7 +63,7 @@ apigeeEdge.connect(options, function(e, org) {
6163
return cb(null, result);
6264
});
6365
};
64-
66+
6567
async.map(result, inquireOneDev, function (e, results) {
6668
if (e) {
6769
common.logWrite(JSON.stringify(e, null, 2));

examples/provisionApiProduct.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,22 @@
44
// ------------------------------------------------------------------
55
// provision an Apigee Edge API Product
66
//
7-
// last saved: <2017-June-20 11:00:25>
7+
// last saved: <2017-December-06 12:42:29>
88

99
var fs = require('fs'),
1010
edgejs = require('apigee-edge-js'),
1111
common = edgejs.utility,
1212
apigeeEdge = edgejs.edge,
1313
sprintf = require('sprintf-js').sprintf,
1414
Getopt = require('node-getopt'),
15-
version = '20170620-1100',
15+
version = '20171206-1242',
1616
getopt = new Getopt(common.commonOptions.concat([
1717
['p' , 'proxy=ARG', 'Required. name of API proxy to include in the API Product'],
1818
['N' , 'productname=ARG', 'Required. name for API product'],
1919
['A' , 'approvalType=ARG', 'Optional. either manual or auto. (default: auto)'],
2020
['S' , 'scopes=ARG', 'Optional. comma-separated list of possible scopes for the API product'],
21-
['e' , 'env=ARG', 'Optional. the Edge environment on which to enable the Product (default: all)']
21+
['e' , 'env=ARG', 'Optional. the Edge environment on which to enable the Product (default: all)'],
22+
['T' , 'notoken', 'optional. do not try to get a authentication token.']
2223
])).bindHelp();
2324

2425
// ========================================================
@@ -51,6 +52,7 @@ var options = {
5152
org : opt.options.org,
5253
user: opt.options.username,
5354
password: opt.options.password,
55+
no_token: opt.options.notoken,
5456
verbosity: opt.options.verbose || 0
5557
};
5658

0 commit comments

Comments
 (0)