Click or drag to resize

IWsEndUserSetEnqueueLoadBalancerAddInstances Method

By the method SetEnqueueLoadBalancerAddInstances you can add the IP addresses to load balancer. The method require to specify the LoadBalancerID and the IP addresses to add.

Namespace:  Aruba.Cloud.WsEndUser
Assembly:  Aruba.Cloud.WsEndUser (in Aruba.Cloud.WsEndUser.dll) Version: (
WsResult SetEnqueueLoadBalancerAddInstances(
	LoadBalancerInstancesRequest request


Type: Aruba.Cloud.Provisioning.Entities.LoadBalancerLoadBalancerInstancesRequest

Return Value

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

    StringBuilder stringBuilder = new StringBuilder();

        // create the request object
        LoadBalancerInstancesRequest request = new LoadBalancerInstancesRequest();
        request.LoadBalancerID = loadBalancerID;
        request.Instances =  new LoadBalancerInstance[ipAddresses.Length];
        for(int i=0; i < ipAddresses.Length; i++)
            LoadBalancerInstance item  = new LoadBalancerInstance();
            item.IPAddress = ipAddresses[i];
            request.Instances[i] = item;

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

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

    return stringBuilder.ToString();
See Also