apigee-deploy
v2.1.3
Published
Deploy the API proxy
Downloads
9
Maintainers
Readme
Sure, let's integrate the examples along with the commands.
apigee-deploy
apigee-deploy
is a package designed to deploy API proxies, shared flows, target servers, developers, products, environments, flow hooks, and apps to Apigee X or Apigee hybrid.
Installation
To install apigee-deploy
globally as a command-line tool, use:
npm install -g apigee-deploy
For using it as a library in your Node.js project:
npm install apigee-deploy
Usage
Importing the Package
const apigee = require("apigee-deploy");
API Usage
Deploy API proxies:
apigee.proxyDeploy(path, token, organization, environment, proxy);
Deploy shared flows:
apigee.sharedFlowDeploy(path, token, organization, environment, sharedFlow);
Command Line Usage
Deploy a proxy:
apigee-deploy [path] -r proxy -t [token] -o [organization] -p [proxy] -e [environment]
Deploy a shared flow:
apigee-deploy [path] -r sharedflow -t [token] -o [organization] -s [sharedFlow] -e [environment]
Other Operations
Commands for target servers, developers, products, environments, flow hooks, and apps are available. Here are some examples:
- Create a target server:
apigee-targetserver-create -d '{ "host": "test2.com", "port": 443, "name": "test22", "isEnabled": true, "description": "testing"}' -t $(gcloud auth print-access-token) -o organizationName -e eval -n test22
- Delete a target server:
apigee-targetserver-delete -t $(gcloud auth print-access-token) -o organizationName -e eval -n test4
- Update a target server:
apigee-targetserver-update -d '{ "host": "test2.com", "port": 443, "name": "test4", "isEnabled": true, "description": "testing"}' -t $(gcloud auth print-access-token) -o organizationName -e eval -n test4
- Update target server list:
apigee-targetserver-list-update -nf "$(cat /home/karthik/new.json)" -of "$(cat /home/karthik/old.json)" -t $(gcloud auth print-access-token) -o organizationName -e eval
- Create a developer app:
apigee-app-create -t $(gcloud auth print-access-token) -o organizationName -d '{"name": "Test"}' -de [email protected]
- Deploy a proxy:
apigee-deploy "/home/karthik/apigee-ci-cd-repo1/src/main/apigee/apiproxies/ECHO-proxy" -r proxy -t $(gcloud auth print-access-token) -o organizationName -e eval -p helloWorld
- Update developer details:
apigee-developer-update -t $(gcloud auth print-access-token) -o organizationName -de '[email protected]' -d '{"email": "[email protected]","userName": "nkl963","firstName": "Nikhil","lastName": "D K"}'
- Delete a developer:
apigee-developer-delete -t $(gcloud auth print-access-token) -o organizationName -de '[email protected]'
- Create a developer:
apigee-developer-create -t $(gcloud auth print-access-token) -o organizationName -d '{"email": "[email protected]","userName": "nkl963","firstName": "Nikhil","lastName": "D K"}'
- Get a list of developers:
apigee-developer-get-list -t $(gcloud auth print-access-token) -o organizationName
- Compare and update developer list:
apigee-developer-list-update -nf "$(cat ./curr_developers.json)" -of "$(cat ./prev_developers.json)" -t $(gcloud auth print-access-token) -o organizationName
- Create a product:
apigee-product-create -t $(gcloud auth print-access-token) -o organizationName -d '{ "approvalType": "auto", "displayName": "myProduct", "environments": [ "eval" ], "apiResources": [], "createdAt": 0, "attributes": [], "description": "", "name": "myProduct", "quotaCounterScope": "PROXY" } '
- Get a list of products:
apigee-product-get-list -t $(gcloud auth print-access-token) -o organizationName
- Update a product:
apigee-product-update -t $(gcloud auth print-access-token) -o organizationName -d '{ "approvalType": "auto", "displayName": "changeName", "environments": [ "eval" ], "apiResources": [], "createdAt": 0, "attributes": [], "description": "", "name": "myProduct", "quotaCounterScope": "PROXY" } ' -n myProduct
- Delete a product:
apigee-product-delete -t $(gcloud auth print-access-token) -o organizationName -n myProduct
- Compare and update product list:
apigee-product-list-update -nf "$(cat /home/testVal/development/new.json)" -of "$(cat /home/testVal/development/old.json)" -t $(gcloud auth print-access-token) -o organizationName
- Create an environment:
apigee-environment-create -t $(gcloud auth print-access-token) -o organizationName -d '{ "apiProxyType": "Programmable", "deploymentType": "DEPLOYMENT_TYPE_UNSPECIFIED", "description": "", "displayName": "Eval-01", "forwardProxyUri": "", "hasAttachedFlowHooks": false, "name": "dev", "properties": {}, "type": "ENVIRONMENT_TYPE_UNSPECIFIED" } '
- Get a list of environments:
apigee-environment-get-list -t $(gcloud auth print-access-token) -o organizationName
- Update an environment:
apigee-environment-update -t $(gcloud auth print-access-token) -o organizationName -d '{ "apiProxyType": "Programmable", "deploymentType": "DEPLOYMENT_TYPE_UNSPECIFIED", "description": "",
"displayName": "newName", "forwardProxyUri": "", "hasAttachedFlowHooks": false, "name": "dev", "properties": {}, "type": "ENVIRONMENT_TYPE_UNSPECIFIED" } ' -n dev
- Delete an environment:
apigee-environment-delete -t $(gcloud auth print-access-token) -o organizationName -n dev
- Get flow hook details:
apigee-flowHook-get-details -t $(gcloud auth print-access-token) -o organizationName -e eval -fn PreProxyFlowHook
- Attach a flow hook:
apigee-flowHook-attach -t $(gcloud auth print-access-token) -o organizationName -e eval -fn PreProxyFlowHook -d '{ "continueOnError": false, "description": "this is test", "sharedFlow": "new-sharedflow" }'
- Detach a flow hook:
apigee-flowHook-detach -t $(gcloud auth print-access-token) -o organizationName -e eval -fn PreProxyFlowHook
- Compare and update flow hooks:
apigee-flowHook-update -t $(gcloud auth print-access-token) -o organizationName -e "eval"
- Create an app:
apigee-app-create
- Get a list of apps:
apigee-app-getList -t $(gcloud auth print-access-token) -o organizationName -de "[email protected]"
- Update an app:
apigee-app-update -t $(gcloud auth print-access-token) -o organizationName -de "[email protected]" -an "test" -d '{"apiProducts":["changeProduct","test"],"name":"Test"}'
- Delete an app:
apigee-app-delete -t $(gcloud auth print-access-token) -o organizationName -de "[email protected]" -an "Test"
License
This project is licensed under the MIT License. See the LICENSE file for details.
Issues
If you encounter any issues or have any questions, please create an issue on the GitHub repository.
Authors
This package was created by K.V.Rao and Nikhil D.