2.5

Table Of Contents
VMware, Inc. 41
Chapter 4 Lab Manager API Method Reference
Sample Code: C#
try
{
LabManagerSoap.VMwareLabManagerSOAPinterface binding = new
LabManagerSoap.VMwareLabManagerSOAPinterface();
//** Create login
binding.AuthenticationHeaderValue = new
LabManagerSoap.AuthenticationHeader();
binding.AuthenticationHeaderValue.username = "jaya";
binding.AuthenticationHeaderValue.password = "Lab Manager";
ServicePointManager.CertificatePolicy = new CertificateAccepter();
//** Get Configuration object
LabManagerSoap.Configuration Config =
binding.GetSingleConfigurationByName("Config24");
//** Get configuration identifier and deployed status from object
int configurationId = Config.id;
bool deployed = Config.isDeployed;
//** Deploy configuration if it isn’t already.
if (!deployed)
{
//** Deploy in fenced mode and run from Managed Servers
binding.ConfigurationDeploy(configurationId, true, 1);
}
}
catch (Exception e)
{
Console.WriteLine("Error: " + e.Message);
Console.ReadLine();
}
ConfigurationPerformAction
Thismethodperformsoneofthefollowingconfigurationactionsasindicatedbythe
actionidentifier:
1—PowerOn.Turnsonaconfiguration.
2—PowerOff.Turnsoffaconfiguration.Nothingissaved.
3—Suspend.FreezestheCPUandstateofaconfiguration.
4—Resume.Resumesasuspendedconfiguration.
5—Reset.Rebootsaconfiguration.