deploy api proxy thru curl is not working.

Hi,

I am able to deploy proxy thru this url

http://apigee.com/docs/management/apis/post/organizations/%7Borg_name%7D/environments/%7Benv_name%7D/apis/%7Bapi_name%7D/revisions/%7Brevision_number%7D/deployments

where as when I tired the same thru curl cmd on my linux machine is not working. here is the curl cmd I used

curl -X POST -u davana.gongadi@abc.com:xxxx https://api.enterprise.apigee.com/v1/organizations/gd_satish/environments/test/pis/weatherapi/revisions/5/deployments?delay=1&override=true

output of the curl cmd is:

{ “code” : “distribution.DeploymentPathConflict”, “message” : “Path /v0/weather conflicts with existing deployment path for revision 4 of the APIProxy weatherapi in organization gd_satish”, “contexts” : }

what did I miss in curl cmd? Can someone please suggest me.

thanks,

Davana

To override, you need to pass the Content-Type header along with your curl - this will undeploy the previous revision and deploy the current revision

try this,

curl -X POST -u davana.gongadi@abc.com:xxxx https://api.enterprise.apigee.com/v1/organizations/gd_satish/environments/test/pis/weatherapi/revisions/5/deployments?delay=1&override=true -H ‘Content-Type: application/x-www-form-urlencoded’

Thanks

2 Likes

thanks for quick response Mukundha!.

Passing content-type header worked but we should pass -H next to post instead of at the end.

this curl cmd worked..

curl -X POST -H “Content-Type: application/x-www-form-urlencoded” -u davana.gongadi@abc.com:xxxx https://api.enterprise.apigee.com/v1/organizations/gd_satish/environments/test/apis/weatherapi/revisions/5/deployments?delay=1&override=true

Thanks.

@Davana -H option should work anywhere. The reason why it is not working at the end is that curl thinks it is part of the URL. If you want to append other curl flags after URL, you will need to enclose the url with quotes to show curl where URL finishes.