4.0

Table Of Contents
VMware, Inc. 27
Chapter 4 Lab Manager API Method Reference
ConfigurationDelete
Thismethoddeletesaconfigurationfromtheworkspace.Youcannotdeleteadeployedconfiguration.
Syntax
ConfigurationDelete(6);
Arguments
Response
Noresponse.
C# Sample Code
try
{
LabManagerSoap.LabManagerSOAPinterface binding = new
LabManagerSoap.LabManagerSOAPinterface();
//** Create login
binding.AuthenticationHeaderValue = new
LabManagerSoap.AuthenticationHeader();
binding.AuthenticationHeaderValue.username = "jaya";
binding.AuthenticationHeaderValue.password = "Lab Manager";
binding.AuthenticationHeaderValue.organizationname = "MyOrg";
binding.AuthenticationHeaderValue.workspacename = "MyWorkspace";
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;
//** Delete configuration if it isn’t deployed
if (!deployed)
{
binding.ConfigurationDelete(configurationId);
}
else
{
//**
//** Must undeploy configuration before deleting it
//**
binding.ConfigurationUndeploy(configurationId);
binding.ConfigurationDelete(configurationId);
}
}
catch (Exception e)
{
Console.WriteLine("Error: " + e.Message);
Console.ReadLine();
}
Field Data Type Description
configurationID int Numericidentifieroftheworkspaceconfiguration.