Brocade Virtual ADX XML API Programmer’s Guide (Supporting Manuel d'utilisateur Page 841

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 878
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 840
Brocade Virtual ADX XML API Programmer’s Guide 831
53-1003248-01
Example: Adding and binding a real server and a VIP
B
/////////////////////////////////////////////////////////////////////////////
// Name: ConfigureLoadBalancing
//
// Description: This function create the virtual server and real server and
binds the same
// as per the input given by the user
//
// Parameters: -
//
/////////////////////////////////////////////////////////////////////////////
public void ConfigureLoadBalancing()
{
string sSaveConfig = null;
//Get the utils class object
Utils objUtils = ConfigureSLB.Utils.GetUtilsInstance();
ServerPort objVirtualServerPort = null;
ServerPort objRealServerPort = null;
//Creates the virtual server and virtual server port
objVirtualServerPort = CreateVirtualServer();
//Creates the real server and real server port
objRealServerPort = CreateRealServer();
WriteObject("Binding real server port with virtual server port...");
//Bind the realserver port with virtualserver port
objUtils.GetSLBObject().bindRealServerPortToVipPort(objVirtualServerPort,
objRealServerPort);
objUtils.WL("Virtual server and RealServer has been configured
successfully", "");
WriteObject("\r\nDo you want to save the configuration(y/n):");
sSaveConfig = Console.ReadLine();
if (sSaveConfig == "y" || sSaveConfig == "Y")
{
objUtils.GetSYSObject().writeConfig();
}
WriteObject("\r\nVirtual server and RealServer has been configured
successfully\r\n");
}
/////////////////////////////////////////////////////////////////////////////
// Name: CreateVirtualServer
//
// Description: This function creates the virtual server and virtual
server port
// by calling the appropriate WSDL API
//
// Parameters: -
//
/////////////////////////////////////////////////////////////////////////////
public ServerPort CreateVirtualServer()
{
//Gets the utils object
Utils objUtils = ConfigureSLB.Utils.GetUtilsInstance();
string sVIPName, sVIPAddress, sVIPPort;
WriteObject("\nSpecify inputs for creating virtual server: ");
WriteObject("\r\nEnter the VIP Name:");
sVIPName = Console.ReadLine();
WriteObject("\r\nEnter the VIP Address:");
Vue de la page 840
1 2 ... 836 837 838 839 840 841 842 843 844 845 846 ... 877 878

Commentaires sur ces manuels

Pas de commentaire