4.0
Table Of Contents
- Lab Manager SOAP API Reference
- Contents
- About This Book
- Introducing VMware vCenter Lab Manager SOAP API
- Getting Started with the Lab Manager SOAP API
- Lab Manager API Data Types
- Lab Manager API Method Reference
- ConfigurationCapture
- ConfigurationCheckout
- ConfigurationClone
- ConfigurationDelete
- ConfigurationDeploy
- ConfigurationPerformAction
- ConfigurationSetPublicPrivate
- ConfigurationUndeploy
- GetConfiguration
- GetConfigurationByName
- GetCurrentOrganizationName
- GetCurrentWorkspaceName
- GetMachine
- GetMachineByName
- GetSingleConfigurationByName
- ListConfigurations
- ListMachines
- LiveLink
- MachinePerformAction
- SetCurrentOrganizationByName
- SetCurrentWorkspaceByName
- Index
Lab Manager SOAP API Reference
18 VMware, Inc.
{
//
//** Bind to Lab Manager SOAP Web Service
//
LabManagerSoap.LabManagerSOAPinterface binding = GetLMAPI();
LabManagerSoap.Configuration config =
binding.GetSingleConfigurationByName(configname);
if ( perform_capture.Equals("Yes") )
{
Console.WriteLine("Capture configuration "+ configname);
int newConfigCaptureID = binding.ConfigurationCapture(config.id,
configname);
}
Console.WriteLine("Undeploy configuration "+ configname);
binding.ConfigurationUndeploy(config.id);
Console.WriteLine("Undeploy is completed");
}
/// <summary>
///The GetLMAPI() method creates a new binding to the Lab Manager API
///and sets up authentication and other basic parameters. This method
///returns a CertificateAcceptor object.
/// </summary>
static LabManagerSoap.LabManagerSOAPinterface GetLMAPI()
{
//
//** Bind to SOAP interface
//
LabManagerSoap.LabManagerSOAPinterface binding = new
LabManagerSoap.LabManagerSOAPinterface();
//
//**Allocate caller login object
//
binding.AuthenticationHeaderValue = new
LabManagerSoap.AuthenticationHeader();
binding.Url = binding.Url.Replace("https://qa240.VMware.com",
"https:/demo44.VMware.com");
binding.AuthenticationHeaderValue.username = "jaya";
binding.AuthenticationHeaderValue.password = "vlm";
binding.AuthenticationHeaderValue.organizationname = "MyOrg";
binding.AuthenticationHeaderValue.workspacename = "MyWorkspace";
binding.Timeout = 10 * 60 * 1000; // 10 minutes
ServicePointManager.CertificatePolicy = new CertificateAccepter();
return binding; //** return binding reference
}
}
/// <summary>
/// The CertificateAccepter class automatically accepts the SSL
/// certificate sent by Lab Manager with each API call from a client
/// application.
/// </summary>
public class CertificateAccepter : System.Net.ICertificatePolicy
{
public CertificateAccepter() {}
public bool CheckValidationResult(
System.Net.ServicePoint servicePoint,
System.Security.Cryptography.X509Certificates.X509Certificate cert,
System.Net.WebRequest webRequest, int iProblem)
{
return true;
}
}//end CertificateAccepter class declaration
}//end namespace declaration