Automated tool to download the api proxy from APIGE Edge to a Local folder

Hi All,

I am looking for any tool to download the deployed version of the particular API Proxy, from specific environment, into my local folder.

I tried with Management API: https://api.enterprise.apigee.com/v1/organizations/MyOrg/apis/MyAPIProxy/revisions/2

but my project configuration is not allowing me to call Managment API. I am getting SSL Error.

Therefore I am looking for a tool which I can run locally on my machine to download the deployed verion of a specific proxy from specifc environment.

It would be a great help if you can help me with one such tool.

Thank You.

Solved Solved
0 10 406
1 ACCEPTED SOLUTION

10 REPLIES 10

Thanks for your reply.

Do we need nodejs installed on our machine to use these tools?

Yes, NodeJs is the runtime for those tools. If for some reason you cannot install or do not want to install it on your computer due to your organisation security policies, you can either use docker nodejs image or use any virtual machine you have an access to.

Hi Dino,

To download a specific proxy I am using below command

./exportApi.js -n -v -o $ORG -N runload -R 3

is $ORG a variable here? where to mention organization name and proxy name in the above command? please share a sample command.

yes ORG is a shell variable.

ORG=my-apigee-organization
API=my-apiproxy-name
REVISION=3
APIGEEUSER=my-apigee-user@example.com
./exportApi.js -v -u $APIGEEUSER -o $ORG -N $API -R $REVISION

Below is the command I am using to export api proxy

./exportApi.js -v -o myTestOrg -N MyTestAPIProxy -u dchiesa@google.com -p MyPwd

but MyTestAPIProxy expects Basic Authentication i.e., Authorization header with Basic <<base64 key:secret>>. Please tell me how to pass request header Authorization in the above command.

Hi Ravi

First, You are using -u dchiesa@google.com . That's MY username. Obviously you don't have my password, and you cannot authenticate to the Apigee administrative APIs using that username. You should not be using my username in your commands.

Second, I don't understand your comment :

MyTestAPIProxy expects Basic Authentication

That is irrelevant. The command I showed does not invoke the API proxy. It DOWNLOADS the proxy. The command uses the Apigee Administrative APIs to download the proxy bundle. It therefore requires authentication to the Apigee Administrative APIs. The configuration of security in your API proxy is irrelevant, because the command does not invoke the API Proxy.

The way you authenticate to the Apigee Admin APIs is via the -u option, and possibly the -p option. If you don't pass the -p option, the command will prompt you for a password. (Unless there is a valid token for the Apigee Admin APIs already in the stash)

Hi Dino,

the above command with your username was just as an example. I used my own id..!!

as per authenticate,in my project we are not allowed to access management apis directly,instead we have to create a wrapper proxy with admin team and call that proxy which intern ccalls management api. To call the wrapper proxy we need Basic auth. But I resolved it and with curl command I a able to download proxy file. Not recommending apigee-tool as we are using onpremise APIGEE Edge.

Thanks for your help.

ahhh

ok , that's good information.

Curl works just fine. The exportApi.js might also work, if you use the -M option to specify the URL of the management server.

but anyway it sounds like you have solved your problem.