adding a policy to a deployed a127 project using management api

Not applicable

I would like to script the following: deploy a nodejs proxy to Edge using a127 project deploy, then I would like to add a oauth2 verify token policy to it using the management apis (The Oauth proxy already exist). What are the steps required to do this? We have an on premises install. When I export a proxy that I set up in the UI I can see references to OAuth in two files: OAuth-v0-1.xml as well as my the main config xml for my api. Thanks.

0 2 186
2 REPLIES 2

Not applicable

Good question @JMalloy2 . a127 leverages apigeetool to deploy API Proxies to Edge, so you can use it to deploy the files that you saw after exploding the API Proxy zip file. So, in oder to import an API proxy with policies modified locally in the filesystem, you need to use apiproxy parameter. e.g:

apigeetool deployproxy  -u sdoe@example.com -o sdoe  -e test -n example-proxy -d .

For more information about apigeetool. Please take a look at this documentation https://github.com/apigee/apigeetool-node#deployproxy.

Let me know if you have any questions.

Hope it helps!

Not applicable

Thank you for the direction @Diego Zuluaga. Your answer is correct but it required a few more steps to make functional.

The steps I followed were:

1- deploy my proxy to Apigee Edge using a127 project deploy (this is a one time step used just to get the correct directory structure and policy files)

2-export that revision from Apigee Edge and unpack it.

3-Delete the contents of: apiproxy\resources\node (Normally a bunch of zip files)

4-Copy your a127 directory structure directly under the node directory (so the package.json file is directly under the node folder)

-You can then use the apigeetool command at from the directory that contains the apiproxy folder to do deploys. You can also still use a127 locally by running the a127 commands at the apiproxy\resouces\node directory.