Click or drag to resize

IWsEndUserSetAddLoadBalancerContacts Method

By the method SetAddLoadBalancerContacts you can add a contact to the load balancer. The method require to specify the LoadBalancerID and the contact parameters.

Namespace:  Aruba.Cloud.WsEndUser
Assembly:  Aruba.Cloud.WsEndUser (in Aruba.Cloud.WsEndUser.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
[OperationContractAttribute]
WsResult SetAddLoadBalancerContacts(
	AddLoadBalancerContactsRequest request
)

Parameters

request
Type: Aruba.Cloud.Provisioning.Entities.LoadBalancerAddLoadBalancerContactsRequest

Return Value

Type: WsResult
Examples
        /// IWsEndUser.SetAddLoadBalancerContacts Method (c# .NET)
public static string SetAddLoadBalancerContacts(WsEndUserClient client,
        int loadBalancerID, NotificationContact[] notificationContacts)
{
    //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
        AddLoadBalancerContactsRequest request = new AddLoadBalancerContactsRequest();
        request.LoadBalancerID = loadBalancerID;
        request.NotificationContacts = notificationContacts;

        // call method SetAddLoadBalancerContacts 
        // obtaining a WsResult item
        WsResult result = client.SetAddLoadBalancerContacts(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();
}
See Also