apigeetool
Advanced tools
Comparing version 0.6.6 to 0.7.0
@@ -55,3 +55,3 @@ /* jshint node: true */ | ||
load: function(){ | ||
return require('./createcache') | ||
return require('./createcache'); | ||
} | ||
@@ -62,3 +62,3 @@ }, | ||
load: function(){ | ||
return require('./deletecache') | ||
return require('./deletecache'); | ||
} | ||
@@ -69,3 +69,3 @@ }, | ||
load: function(){ | ||
return require('./createproduct.js') | ||
return require('./createproduct.js'); | ||
} | ||
@@ -76,3 +76,3 @@ }, | ||
load: function(){ | ||
return require('./deleteproduct.js') | ||
return require('./deleteproduct.js'); | ||
} | ||
@@ -83,3 +83,3 @@ }, | ||
load: function(){ | ||
return require('./createdeveloper.js') | ||
return require('./createdeveloper.js'); | ||
} | ||
@@ -90,3 +90,3 @@ }, | ||
load: function(){ | ||
return require('./deletedeveloper.js') | ||
return require('./deletedeveloper.js'); | ||
} | ||
@@ -97,3 +97,3 @@ }, | ||
load: function(){ | ||
return require('./createapp.js') | ||
return require('./createapp.js'); | ||
} | ||
@@ -104,6 +104,35 @@ }, | ||
load: function(){ | ||
return require('./deleteapp.js') | ||
return require('./deleteapp.js'); | ||
} | ||
}, | ||
deploySharedflow: { | ||
description: 'Deploy SharedFlow', | ||
load: function () { | ||
return require('./deploysharedflow.js'); | ||
} | ||
}, | ||
undeploySharedflow: { | ||
description: "Undeploy SharedFlow", | ||
load: function () { | ||
return require('./undeploysharedflow.js'); | ||
} | ||
}, | ||
fetchSharedflow: { | ||
description: "Download SharedFlow bundle", | ||
load: function () { | ||
return require('./fetchsharedflow.js'); | ||
} | ||
}, | ||
listSharedflowDeployments: { | ||
description: "List SharedFlow deployments", | ||
load: function () { | ||
return require('./listsharedflowdeployments'); | ||
} | ||
}, | ||
deleteSharedflow: { | ||
description: "Delete undeployed SharedFlow", | ||
load: function () { | ||
return require('./deletesharedflow.js'); | ||
} | ||
} | ||
}; | ||
@@ -110,0 +139,0 @@ |
@@ -42,4 +42,4 @@ 'use strict'; | ||
module.exports.parseDeploymentResult = function(d) { | ||
if (!(d && d.aPIProxy)) { | ||
// Not even a proxy | ||
if (!(d && (d.aPIProxy || d.sharedFlow))) { | ||
// Not even a proxy (or a sharedFlow) | ||
return null; | ||
@@ -49,3 +49,3 @@ } | ||
var r = { | ||
name: d.aPIProxy | ||
name: d.aPIProxy || d.sharedFlow | ||
}; | ||
@@ -77,3 +77,3 @@ | ||
r.state = deployed.state; | ||
r.basePath = deployed.configuration.basePath; | ||
r.basePath = _.has(deployed, 'configuration') && _.has(deployed.configuration, 'basePath') ? deployed.configuration.basePath : 'N/A'; | ||
@@ -80,0 +80,0 @@ // Now figure out if there are partial failures |
@@ -15,3 +15,3 @@ /* jshint node: true */ | ||
return require('./promisesdk') | ||
} | ||
}; | ||
@@ -75,3 +75,3 @@ ApigeeTool.defaults = function(newDefaults) { | ||
runCommand(cmd, opts, cb); | ||
} | ||
}; | ||
@@ -86,3 +86,3 @@ ApigeeTool.createDeveloper = function(opts, cb) { | ||
runCommand(cmd, opts, cb); | ||
} | ||
}; | ||
@@ -97,3 +97,3 @@ ApigeeTool.createApp = function(opts, cb) { | ||
runCommand(cmd, opts, cb); | ||
} | ||
}; | ||
@@ -108,3 +108,3 @@ ApigeeTool.createTargetServer = function(opts, cb) { | ||
runCommand(cmd, opts, cb); | ||
} | ||
}; | ||
@@ -119,3 +119,3 @@ ApigeeTool.createKVM = function(opts, cb) { | ||
runCommand(cmd, opts, cb); | ||
} | ||
}; | ||
@@ -125,5 +125,29 @@ ApigeeTool.deleteKVM = function(opts,cb){ | ||
runCommand(cmd, opts, cb); | ||
} | ||
}; | ||
ApigeeTool.deploySharedflow = function (opts, cb) { | ||
var cmd = require('./commands/deploysharedflow.js'); | ||
runCommand(cmd, opts, cb); | ||
}; | ||
ApigeeTool.undeploySharedflow= function (opts, cb) { | ||
var cmd = require('./commands/undeploysharedflow.js'); | ||
runCommand(cmd, opts, cb); | ||
}; | ||
ApigeeTool.fetchSharedflow = function (opts, cb) { | ||
var cmd = require('./commands/fetchsharedflow.js'); | ||
runCommand(cmd, opts, cb); | ||
}; | ||
ApigeeTool.listSharedflowDeployments = function (opts, cb) { | ||
var cmd = require('./commands/listsharedflowdeployments.js'); | ||
runCommand(cmd, opts, cb); | ||
}; | ||
ApigeeTool.deleteSharedflow = function (opts, cb) { | ||
var cmd = require('./commands/deletesharedflow.js'); | ||
runCommand(cmd, opts, cb); | ||
}; | ||
function runCommand(cmd, opts, cb) { | ||
@@ -130,0 +154,0 @@ options.validate(opts, cmd.descriptor, function(err) { |
@@ -57,3 +57,3 @@ /* jshint node: true */ | ||
var shortArgName = shortArg[1]; | ||
var longName; | ||
var longName = undefined; | ||
var des; | ||
@@ -86,3 +86,6 @@ for (var sd in descriptor) { | ||
} | ||
} else { | ||
badArg(argv[i]) | ||
} | ||
} else { | ||
@@ -89,0 +92,0 @@ badArg(argv[i]); |
{ | ||
"name": "apigeetool", | ||
"version": "0.6.6", | ||
"version": "0.7.0", | ||
"description": "A CLI for Apigee Edge", | ||
@@ -33,3 +33,3 @@ "main": "lib/main.js", | ||
"underscore": "^1.8.3", | ||
"netrc" : "^0.1.3", | ||
"netrc": "^0.1.3", | ||
"q": "*" | ||
@@ -36,0 +36,0 @@ }, |
165
README.md
@@ -98,2 +98,7 @@ # apigeetool | ||
* [delete](#delete) | ||
* [deploySharedflow](#deploySharedflow) | ||
* [undeploySharedflow](#undeploySharedflow) | ||
* [listSharedflowDeployments](#listSharedflowDeployments) | ||
* [fetchSharedflow](#fetchSharedflow) | ||
* [deleteSharedflow](#deleteSharedflow) | ||
* [createdeveloper](#createdeveloper) | ||
@@ -411,2 +416,162 @@ * [deletedeveloper](#deletedeveloper) | ||
## <a name="deploySharedflow"></a>deploySharedflow | ||
Deploys a sharedFlow to Apigee Edge. If the sharedFlow is currently deployed, it will be undeployed first, and the newly deployed sharedflow's revision number is incremented. | ||
#### Example | ||
Deploys a SharedFlow called example-sf to Apigee Edge. Per the `-d` flag, the command is executed in the root directory of the sharedflow bundle. | ||
apigeetool deploySharedflow -u sdoe@example.com -o sdoe -e test -n example-sf -d . | ||
#### Required parameters | ||
The following parameters are required. However, if any are left unspecified | ||
on the command line, and if apigeetool is running in an interactive shell, | ||
then apigeetool will prompt for them. | ||
See [Common Parameters](#commonargs) for a list of additional parameters, including | ||
the "-u" and "-p" parameters for username and password, and the "-o" parameter | ||
for organization name, all of which are required. | ||
`--name -n` | ||
(required) The name of the SharedFlow. Note: The name of the SharedFlow must be unique within an organization. The characters you are allowed to use in the name are restricted to the following: `A-Z0-9._\-$ %`. | ||
`--environments -e` | ||
(required) The name(s) of the environment(s) to deploy to (comma delimited). | ||
#### Optional parameters | ||
`--directory -d` | ||
(optional) The path to the root directory of the sharedflow on your local system. Will attempt to use current directory is none is specified. | ||
`--import-only -i` | ||
(optional) Imports the sharedflow to Apigee Edge but does not deploy it. | ||
## <a name="undeploySharedflow"></a>undeploySharedflow | ||
Undeploys a named API proxy or Node.js app deployed on Apigee Edge. | ||
#### Example | ||
Undeploy the proxy named "example-sf". | ||
apigeetool undeploySharedflow -u sdoe@example.com -o sdoe -n example-sf -e test -D | ||
#### Required parameters | ||
The following parameters are required. However, if any are left unspecified | ||
on the command line, and if apigeetool is running in an interactive shell, | ||
then apigeetool will prompt for them. | ||
See [Common Parameters](#commonargs) for a list of additional parameters, including | ||
the "-u" and "-p" parameters for username and password, and the "-o" parameter | ||
for organization name, all of which are required. | ||
`--name -n` | ||
(required) The name of the sharedflow to undeploy. | ||
`--environment -e` | ||
(required) The environment on Apigee Edge where the sharedflow is currently deployed. | ||
#### Optional parameters | ||
`--revision -r` | ||
(optional) Specify the revision number of the sharedflow to undeploy. | ||
## <a name="listSharedflowDeployments"></a>listSharedflowDeployments | ||
Lists the sharedflows deployed on Apigee Edge for the specified organization. Lets you filter the result by API proxy name or environment. | ||
#### Examples | ||
List all Sharedflows in an organization: | ||
$ apigeetool listSharedflowDeployments -u sdoe@example.com -o sdoe -e test` #Won't work due to missing API | ||
List Sharedflows named "example-sf": | ||
$ apigeetool listSharedflowDeployments -u sdoe@example.com -o sdoe -n example-sf | ||
#### Required parameters | ||
See [Common Parameters](#commonargs) for a list of additional parameters, including | ||
the "-u" and "-p" parameters for username and password, and the "-o" parameter | ||
for organization name, all of which are required. | ||
#### Required, mutually exclusive parameters | ||
`--name -n` | ||
(You must specify either `name` or `environment` in this command) The name of the Sharedflow to list. | ||
`--environment -e` | ||
(You must specify either `name` or `environment` in this command) The environment for which you want to list deployments. When `-e` is specified, the command lists all deployed proxies in the environment. | ||
#### Optional parameters | ||
`--revision -r` | ||
(optional) Filters the list by the specified revision number. | ||
## <a name="fetchSharedflow"></a>fetchSharedFlow | ||
Fetches a sharedFlow from Apigee Edge. The | ||
result will be a ZIP file that contains the contents of the entire | ||
sharedflow.The resulting ZIP file may be "unzipped" and re-deployed using "deploySharedflow." | ||
#### Example | ||
Fetch the deployed proxy named "example-proxy". | ||
apigeetool fetchSharedflow -u sdoe@example.com -o sdoe -n example-proxy -r 1 | ||
#### Required parameters | ||
The following parameters are required. However, if any are left unspecified | ||
on the command line, and if apigeetool is running in an interactive shell, | ||
then apigeetool will prompt for them. | ||
See [Common Parameters](#commonargs) for a list of additional parameters, including | ||
the "-u" and "-p" parameters for username and password, and the "-o" parameter | ||
for organization name, all of which are required. | ||
`--name -n` | ||
(required) The name of the sharedflow or app to undeploy. | ||
`--revision -r` | ||
(required) Specifies the revision to retrieve. | ||
#### Optional parameters | ||
`--file -f` | ||
(optional) The name of the file to write as the result. If not specified, | ||
then the file name will be the same as the name passed to the "name" | ||
parameter. | ||
## <a name="deleteSharedflow"></a>deleteSharedflow | ||
Delete all revisions of a sharedflow from Apigee Edge. | ||
It is an error to delete a proxy that still has deployed revisions. Revisions | ||
must be undeployed using "undeploySharedflow" before this command may be used. | ||
#### Example | ||
Delete the proxy named "example-sf". | ||
apigeetool deleteSharedflow -u sdoe@example.com -o sdoe -n example-sf | ||
#### Required parameters | ||
The following parameters are required. However, if any are left unspecified | ||
on the command line, and if apigeetool is running in an interactive shell, | ||
then apigeetool will prompt for them. | ||
See [Common Parameters](#commonargs) for a list of additional parameters, including | ||
the "-u" and "-p" parameters for username and password, and the "-o" parameter | ||
for organization name, all of which are required. | ||
`--name -n` | ||
(required) The name of the API proxy or app to undeploy. | ||
# <a name="sdkreference"></a>SDK Reference | ||
@@ -413,0 +578,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
170731
39
4872
741
19
2