Click or drag to resize

IJsonpWsEndUserSetAddLoadBalancerRule Method

By the method SetAddLoadBalancerRule you can add a rule to load balancer. The method require to specify the rule’s 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]
[WebGetAttribute(ResponseFormat = WebMessageFormat.Json, UriTemplate = "SetAddLoadBalancerRule/{jsonp}/{userName}/{token}?loadBalancerID={loadBalancerID}&newLoadBalancerRule={newLoadBalancerRule}")]
Stream SetAddLoadBalancerRule(
	string jsonp,
	string userName,
	string token,
	int loadBalancerID,
	string newLoadBalancerRule
)

Parameters

jsonp
Type: SystemString
userName
Type: SystemString
token
Type: SystemString
loadBalancerID
Type: SystemInt32
newLoadBalancerRule
Type: SystemString

Return Value

Type: Stream
Examples
/// IWsEndUser.SetAddLoadBalancerRule Method (c# .NET)
public static string SetAddLoadBalancerRule(WsEndUserClient client,
    int loadBalancerID, LoadBalancerRule newRule)
{
    //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
        AddLoadBalancerRuleRequest request = 
            new AddLoadBalancerRuleRequest();
        request.LoadBalancerID = loadBalancerID;
        request.NewLoadBalancerRule = newRule;

        // call method SetAddLoadBalancerRule 
        // obtaining a WsResult item
        WsResult result = client.SetAddLoadBalancerRule(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