Apigee Edge Command Line Interface
A CLI with support for features missing in the Edge UI like managing
environment resource files and target servers as well as advanced proxy deployments.
Useful for CI/CD and offline proxy development.
Reduces number of uploaded proxy revisions by comparing and reusing revisions by checksum.
Tested with Apigee Edge 4.16.05.00 (On-Premise).
Installation
npm install edge-cli -g
Usage
edge help
edge version
edge account list
edge account setup <account-name>
edge account setup <account-name> <url> <username> <password> <org> <env>
edge account set <account-name> url|username|password|org|env <value>
edge account delete <account-name>
edge <command> -c /my/.edge
edge <command> --config /my/.edge
edge <command> -a <account>
edge <command> --account <account>
edge resource list
edge resource get <type>/<name>
edge resource deploy <source> <type>/<name>
edge resource delete <type>/<name>
edge targetServer list
edge targetServer get <name>
edge targetServer deploy <source> <name>
edge targetServer delete <name>
edge proxy validate <source> <name>
edge proxy deploy <source> <name>
edge proxy undeploy <name>
edge proxy updateRevision <source> <name> <revision>
edge proxy deployRevision <name> <revision>
edge proxy remove <name>
edge generate apiPolicy <swagger> <target>
Examples
edge account setup test
edge account setup test http://apiproxy-admin-test:8080 username@md.de secret md dev
edge proxy deploy apiproxy myproxy -a dev
edge proxy deploy apiproxy myproxy -a dev
edge targetServer list -a dev
edge targetServer deploy myTargetServer.json MY_TARGET_SERVER -a dev
See Load balancing across backend servers (Apigee) for details on target servers.
Tests
To run tests you need a real (dev) account set up using edge account setup ...
.
You have to export ACCOUNT
and URL
(the base URL of the Edge environment)
when running the tests, for example:
ACCOUNT=dev URL=http://api-dev.foo.bar npm test
Note: The tests compute checksums over their fixtures
which are only valid if all files in test/apiproxy
are LF-based.
Use git config core.autocrlf input
to pull LFs correctly.