Curl Commands

Not applicable

Can someone please provide me the curl commands to do following tasks :

1. curl commands to create organisation ,environment ,virtual hosts

2. curl commands to list organisation,encironment and virtual hosts

Solved Solved
0 2 2,042
1 ACCEPTED SOLUTION

akoo
New Member

Hi @Arpit Sharma,

On a related-topic, you may also find this Postman collection particularly helpful for all of your Apigee Management Server API needs.

https://github.com/apigee/apigee-management-api-postman

View solution in original post

2 REPLIES 2

@Arpit Sharma

I am assuming that you have apigee EDGE on premise.

Go through the script

/<inst-root>/apigee4/bin/create-org.sh

Also, you can use the below API CALL

curl -u <GLOBAL ADMIN ID> -H "Content-Type:application/xml" -X POST http://localhost:8080/v1/organizations \ -d '<Organization name="<org-name>" type="paid"/>'

After creating the ORG, you need to associate the ORG with the POD

curl -u <GLOBAL ADMIN ID> -H "Content-Type:application/x-www-form-urlencoded" \ -u -X POST \ http://localhost:8080/v1/organizations/$ORGNAME/pods \ -d "region=default&pod=gateway"

Local host means = IP Address of Management Server

You can use the below script to create an Environment in the existing ORG

/<inst-root>/apigee4/bin/add-env.sh

You can use the below API CALL for creating the ENV

curl -u <GLOBAL ADMIN ID> -H "Content-Type:application/xml" -u -X POST http://localhost:8080/v1/organizations/$ORGNAME>/environments \ -d '<Environment name="<env-name>"/>'

Its better to use the script shared by APIGEE to create this.

Creating Virtual host

curl -H "Content-Type:application/xml" -u <admin user>:<admin passwd> \ -X POST \ http://<ms-ip>:8080/v1/organizations/<org-name>/environments/<env-name>/virtualhosts \ -d '<VirtualHost name="default"> \ <HostAliases> \ <HostAlias>abcde.company.com</HostAlias> \ </HostAliases> \ <Interfaces/> \ <Port>443</Port>

You can remove -X post and -d value from all the above commands to get the details for ORG, ENV and virtual host

akoo
New Member

Hi @Arpit Sharma,

On a related-topic, you may also find this Postman collection particularly helpful for all of your Apigee Management Server API needs.

https://github.com/apigee/apigee-management-api-postman