Brocade Virtual ADX XML API Programmer’s Guide (Supporting ADX v03.1.00) User Manual

Page 876

Advertising
background image

866

Brocade Virtual ADX XML API Programmer’s Guide

53-1003248-01

Example: Unbinding a real server from a VIP

B

//Close the log file

objUtils.OpenRCloseLog(false);

}

catch (Exception ex)

{

objUtils.WL("EXCEPTION Raised in UnbindRSfromVIP", ex.Message);

//Close the log file

objUtils.OpenRCloseLog(false);

WriteObject(ex.Message);

}

}

/////////////////////////////////////////////////////////////////////////////

// Name: ShowAllVirtualServers

//

// Description: Displays all the virtual servers present in the given ADX

BOX.

//

// Parameters: -

//

/////////////////////////////////////////////////////////////////////////////

public void ShowAllVirtualServers()

{

//Get the utils class object

Utils objUtils = Unbinding.Utils.GetUtilsInstance();

//retrieve all the virtual servers

slb_service.Server[] objVirtualServerArray = null;

objUtils.GetSLBObject().getAllVirtualServers(0, false, 0, false, out

objVirtualServerArray);

int nLength = 0;

nLength = objVirtualServerArray.Length;

if (nLength <= 0)

{

objUtils.WL("No Virtual Server found in the given ADX Box", "");

throw (new Exception("No Virtual Server found in the given ADX

Box"));

}

WriteObject("\r\n*******************************************\r\n");

WriteObject("\r\nThe following virtual servers are currently

configured on ADX BOX\r\n");

string sVirtualServer;

WriteObject("\r\nIP Address \tName");

WriteObject("---------- \t----");

//Display all the virtual server to the user

for (int nIter = 0; nIter < nLength; nIter++)

{

Unbinding.slb_service.Server objVirtualServer =

objVirtualServerArray[nIter];

sVirtualServer = String.Format("{0} \t{1}", objVirtualServer.IP,

objVirtualServer.Name);

WriteObject(sVirtualServer);

}

}

/////////////////////////////////////////////////////////////////////////////

// Name: ShowAllVirtualServerPorts

//

// Description: Displays all the virtual server ports associated with the

selected

Advertising