Computing > 8 - LoadBalancers Management > Remove LoadBalancer Contacts

8.15 Remove LoadBalancer Contacts

By the Aruba WsEndUser method SetRemoveLoadBalancerContacts you can remove a contacts of the load balancer. The method require to specify the LoadBalancerID and the contacts to remove.

Parameters
loadBalancerID
Type: int
Load balancer identification number

contactsID
Type: int
Array of int with the set of if of contact to remove from balancer


/// IWsEndUser.SetRemoveLoadBalancerContacts Method (c# .NET)
public static string SetRemoveLoadBalancerContacts(WsEndUserClient client,
        int loadBalancerID, int[] contactsID)
{
    //specify the account login details 
    client.ClientCredentials.UserName.UserName = "ARU-0000";
    client.ClientCredentials.UserName.Password = "0123456789";

    StringBuilder stringBuilder = new StringBuilder();

    try
    {
        // create the request object
        RemoveLoadBalancerContactsRequest request = 
            new RemoveLoadBalancerContactsRequest();
        request.LoadBalancerID = loadBalancerID;
        request.LoadBalancerContactsID = contactsID;

        // call method SetRemoveLoadBalancerContacts 
        // obtaining a WsResult item
        WsResult result = client.SetRemoveLoadBalancerContacts(request);

        //if the call is Success print value
        if (result.Success)
        {
            // get Value returned from server
            stringBuilder.Append(" Operation ends successfully. Result Code:");
            stringBuilder.Append(result.ResultCode);
        }
        else
        {
            throw new ApplicationException(result.ResultMessage);
        }
    }
    catch (Exception ex)
    {
        // re-run the error
        throw new ApplicationException(ex.Message);
    }

    return stringBuilder.ToString();
}
/// IWsEndUser.SetRemoveLoadBalancerContacts Method (JAVA)
public static String SetRemoveLoadBalancerContacts(IWsEndUser client,
     int loadBalancerID, ArrayOfint contactsID)
{
    //specify the account login details 
    ((BindingProvider) client).getRequestContext()
            .put(BindingProvider.USERNAME_PROPERTY, "ARU-0000");
    ((BindingProvider) client).getRequestContext()
            .put(BindingProvider.PASSWORD_PROPERTY, "0123456789");

    StringBuilder StringBuilder = new StringBuilder();

    try
    {
        // create the request object
        RemoveLoadBalancerContactsRequest request = new RemoveLoadBalancerContactsRequest();
        request.setLoadBalancerID(loadBalancerID);
        request.setLoadBalancerContactsID(contactsID);

        // call method SetModifyLoadBalancer 
        // obtaining a WsResult item
        WsResult result = client.setRemoveLoadBalancerContacts(request);

        //if the call is Success print value
        if (result.isSuccess())
        {
            // get Value returned from server
            StringBuilder.append(" Operation ends successfully. Result Code : ");
            StringBuilder.append(result.getResultCode());
        }
        else
        {
            throw new Exception(result.getResultMessage());
        }
    }
    catch (Exception ex)
    {
        //show error
        System.out.println(ex);
    }

    return StringBuilder.toString();
}
Version
API: v2.8 URL:https://api.dc1.computing.cloud.it/WsEndUser/v2.8/WsEndUser.svc?wsdl