def RemoveELBInstance(region, instance_id, node_type):
 balancers = GetLoadBalancers(region, node_types=[node_type])
 assert balancers, ('No %s load balancer in region %s' % (node_type, region))
 assert (len(balancers) == 1)
 b = balancers[0]
 balancer_instances = set([i.id for i in b.instances])
 if (instance_id not in balancer_instances):
  print ('Instance %s not found in %s load balancer in regions %s' % (instance_id, node_type, region))
  return
 b.deregister_instances([instance_id])
 print ('Removed instance %s from %s load balancer in region %s' % (instance_id, node_type, region))

def RemoveELBInstance ( region , instance_id , node_type ) : balancers = GetLoadBalancers ( region , node_types = [ node_type ] ) assert balancers , ( 'No %s load balancer in region %s' % ( node_type , region ) ) assert ( len ( balancers ) == 1 ) b = balancers [ 0 ] balancer_instances = set ( [ i . id for i in b . instances ] ) if ( instance_id not in balancer_instances ) : print ( 'Instance %s not found in %s load balancer in regions %s' % ( instance_id , node_type , region ) ) return b . deregister_instances ( [ instance_id ] ) print ( 'Removed instance %s from %s load balancer in region %s' % ( instance_id , node_type , region ) )
add an instance to the load balancer in region .