Edge for Private Cloud v4.18.05
This section explains the removal of organizations, environments, and virtual hosts. Note that the order of API calls is very important– that means, for example, the step to remove an organization can only be executed after you remove all associated environments in the organization.
Delete a Virtual Host
Before you can delete a virtual host from an environment, you must update any API proxies that reference the virtual host to remove the reference. See Virtual hosts for more.
Use the following API to delete a virtual host:
curl -u <admin user>:<admin passwd> -X DELETE \ "http://ms_IP:8080/v1/organizations/org_name/environments/env_name/virtualhosts/virtualhost_name"
Delete an Environment
You can only delete an environment after you have:
- Deleted all virtual hosts in the environment as described above.
- Disassociated the environment from all Message Processors.
- Cleaned up analytics.
Disassociate an Environment from Message Processor
Use the following API to remove an association of an environment with a Message Processor. If you want to delete the environment, you must disassociate it from all Message Processors:
curl -H "Content-Type: application/x-www-form-urlencoded" \ -u ADMIN_USERNAME:ADMIN_PASSWORD -X POST \ "http://ms_IP:8080/v1/organizations/org_name/environments/env_name/servers" \ -d "action=remove&uuid=uuid"
Where uuid is the UUID of Message Processor.
curl http://mp_IP:8082/v1/servers/self
Where mp_IP is the IP address of the Message Processor.
Cleanup analytics
Remove analytics information about the organization:
curl -u ADMIN_EMAIL:ADMIN_PASSWORD -X DELETE \ http://ms_IP:8080/v1/analytics/groups/ax/analytics_group/scopes?org=org_name&env=env_name
Where analytics_group defaults to "analytics-001".
If you are unsure of the name of the analytics group, use the following command to display it:
apigee-adminapi.sh analytics groups list --admin ADMIN_EMAIL --pwd ADMIN_PASSWORD --host localhost
This command returns the analytics group name in the name
field.
Delete the environment
Use the following API to delete an environment:
curl -u ADMIN_EMAIL:ADMIN_PASSWORD \ http://ms_IP:8080/v1/organizations/org_name/environments/env_name \ -X DELETE
Delete an Organization
You can only delete an organization after you have:
- Deleted all virtual hosts in all environments in the organization as described above.
- Deleted all environments in the organization as described above.
- Disassociated the organization from all pods.
Disassociate an Organization from Pod
Use the following API to delete disassociate an organization from a pod:
curl -H "Content-Type: application/x-www-form-urlencoded" \ -u ADMIN_EMAIL:ADMIN_PASSWORD -X POST \ "http://ms_IP:8080/v1/organizations/org_name/pods" \ -d "action=remove®ion=region_name&pod=pod_name"
curl -u ADMIN_EMAIL:ADMIN_PASSWORD \ "http://ms_IP:8080/v1/organizations/org_name/pods"
Delete the organization
Use the following API to delete an organization:
curl -u ADMIN_EMAIL:ADMIN_PASSWORD -X DELETE \ "http://ms_IP:8080/v1/organizations/org_name"