Deleting a Shared Load Balancer
Scenarios
Call the API to delete a dedicated load balancer.
Before you delete a load balancer, delete all resources associated with the load balancer. Figure 1 shows the associated resources.
Prerequisites
The token obtained from IAM is valid for only 24 hours. If you want to use a token for authentication, you can cache it to avoid frequent calling.
Procedure
Skip the corresponding step if the associated resources do not exist. For example, skip step 1 if no health check is configured for the backend server group associated with the load balancer.
- Delete the health check configured for each associated backend server group.
- Send DELETE https://{elb_endpoint}/v2/{project_id}/elb/healthmonitors/{healthmonitor_id}. project_id indicates the project ID, and healthmonitor_id indicates the health check ID.
- Add X-Auth-Token to the request header.
- Check the response.
- If the request is successful, 204 is returned, and the response body is empty.
- If the request is abnormal, rectify the fault by referring to HTTP Status Codes of Shared Load Balancers.
- Remove backend servers from each associated backend server group.
- Send DELETE https://{elb_endpoint}/v2/{project_id}/elb/pools/{pool_id}/members/{member_id}. project_id indicates the project ID, pool_id indicates the backend server group ID, and member_id indicates the backend server ID.
- Add X-Auth-Token to the request header.
- Check the response.
- If the request is successful, 204 is returned, and the response body is empty.
- If the request is abnormal, rectify the fault by referring to HTTP Status Codes of Shared Load Balancers.
- Delete each associated backend server group.
- Send DELETE https://{elb_endpoint}/v2/{project_id}/elb/pools/{pool_id}. project_id indicates the project ID, and pool_id indicates the backend server group ID.
- Add X-Auth-Token to the request header.
- Check the response.
- If the request is successful, 204 is returned, and the response body is empty.
- If the request is abnormal, rectify the fault by referring to HTTP Status Codes of Shared Load Balancers.
- Delete the forwarding rules added to each listener.
- Send DELETE https://{elb_endpoint}/v2/{project_id}/elb/l7policies/{{policy_id}}/rules/{{rule_id}}". project_id indicates the project ID, policy_id indicates the forwarding policy ID, and rule_id indicates the forwarding rule ID.
- Add X-Auth-Token to the request header.
- Check the response.
- If the request is successful, 204 is returned, and the response body is empty.
- If the request is abnormal, rectify the fault by referring to HTTP Status Codes of Shared Load Balancers.
- Delete the forwarding policies added to each listener.
- Send DELETE https://{elb_endpoint}/v2/{project_id}/elb/l7policies/{{policy_id}}. project_id indicates the project ID, and policy_id indicates the forwarding policy ID.
- Add X-Auth-Token to the request header.
- Check the response.
- If the request is successful, 204 is returned, and the response body is empty.
- If the request is abnormal, rectify the fault by referring to HTTP Status Codes of Shared Load Balancers.
- Delete each listener added to the load balancer.
- Send DELETE https://{elb_endpoint}/v2/{project_id}/elb/listeners/{{listener_id}}. project_id indicates the project ID, and listener_id indicates the listener ID.
- Add X-Auth-Token to the request header.
- Check the response.
- If the request is successful, 204 is returned, and the response body is empty.
- If the request is abnormal, rectify the fault by referring to HTTP Status Codes of Shared Load Balancers.
- Delete a load balancer.
- Send DELETE https://{elb_endpoint}/v2/{project_id}/elbloadbalancers/{{loadbalancer_id}}. project_id indicates the project ID, and loadbalancer_id indicates the load balancer ID.
- Add X-Auth-Token to the request header.
- Check the response.
- If the request is successful, 204 is returned, and the response body is empty.
- If the request is abnormal, rectify the fault by referring to HTTP Status Codes of Shared Load Balancers.
Last Article: Add a Listener to a Shared Load Balancer
Next Article: Querying the ID of an ECS Used as a Backend Server

Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.