Esempio n. 1
0
def delete_slb():
    request = DeleteLoadBalancerRequest.DeleteLoadBalancerRequest()
    request.set_accept_format('json')
    request.set_LoadBalancerId('')
    response = json.loads(client.do_action_with_exception(request),
                          encoding='utf-8')
    print json.dumps(response, sort_keys=True, indent=4, separators=(',', ':'))
Esempio n. 2
0
 def delete_load_balancer(self, params):
     try:
         request = DeleteLoadBalancerRequest.DeleteLoadBalancerRequest()
         request.set_LoadBalancerId(params["load_balancer_id"])
         response = self.client.do_action_with_exception(request)
         response_json = json.loads(response)
         return response_json
     except ServerException as e:
         ExceptionHandler.server_exception(e)
     except ClientException as e:
         ExceptionHandler.client_exception(e)
def delete_load_balancer(load_balancer_id):
    '''
    delete_load_balancer:删除slb实例
    官网API参考链接:https://help.aliyun.com/document_detail/27579.html
    '''
    try:
        request = DeleteLoadBalancerRequest.DeleteLoadBalancerRequest()
        # 负载均衡实例的ID
        request.set_LoadBalancerId(load_balancer_id)
        response = ACS_CLIENT.do_action_with_exception(request)
        response_json = json.loads(response)
        return response_json
    except ServerException as e:
        ExceptionHandler.server_exception(e)
    except ClientException as e:
        ExceptionHandler.client_exception(e)