4.0

Table Of Contents
VMware, Inc. 17
Chapter 2 Getting Started with the Lab Manager SOAP API
testlist = tsf.NewList("");
foreach ( TSTest test in testlist)
{
TDAPIOLELib.Run r= (Run) test.LastRun;
if (r != null)
{
Console.WriteLine(test.Name + " " + r.Name + " " +
r.Status.ToString());
}
} //** end foreach
break;
} //** end if
} //** end foreach
} //** end if
} //** end RunQCTestset
///<summary>
///The CheckoutDeployConfiguration() method obtains the configuration
///from the Lab Manager Library and deploys it to the Lab Manager
///Workspace.
///</summmary>
static string CheckoutDeployConfiguration( string version)
{
//
//** Check out a configuration and deploy it to the Workspace
string srcconfig = "ProofOfBuild-R2"; //** Configuration name
System.DateTime time = System.DateTime.Now;
string configname = version+"-"+
time.ToString().Replace(" ", "_").Replace("/","-");
//
//** Bind to Lab Manager SOAP Web service
//
LabManagerSoap.LabManagerSOAPinterface binding = GetLMAPI();
//
//** Get configuration information -- Configuration object
//
LabManagerSoap.Configuration config =
binding.GetSingleConfigurationByName(srcconfig);
Console.WriteLine("Checkout configuratioin "+ srcconfig);
//
//** Check configuration out of Configuration Library and
//** name it(configname)
//
int newCheckoutID = binding.ConfigurationCheckout(config.id, configname);
Console.WriteLine("Deploy configuratioin "+ srcconfig);
//
//** Deploy Configuration
//** false = Do not run images from ESX host
//** 1 = Fenced mode, traffic blocked in and out
//
binding.ConfigurationDeploy(newCheckoutID, false, 1);
Console.WriteLine("Deploy is completed");
return configname;
}
///<summary>
/// The CaptureUndeployConfiguration() method saves the configuration
/// to the Lab Manager Library and undeploys it from the workspace.
///</summary>
static void CaptureUndeployConfiguration(string configname)