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
VMware, Inc. 43
Chapter 4 Lab Manager API Method Reference
string organizationName = GetCurrentOrganizationName();
Console.WriteLine("Current organization I am logged in: " + organizationName);
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine("Error: " + e.Message);
Console.ReadLine();
}
SetCurrentWorkspaceByName
Setstheworkspacetobeusedforeachsuccessivelogin.Thismethodworkswhentheworkspacenameis
emptyintheauthorizationheader.
Syntax
SetCurrentWorkspaceByName(“MyOrganization“, “MyWorkspace”);
Arguments
C# Sample Code
try
{
LabManagerSoap.LabManagerSOAPinterface binding = new
LabManagerSoap.LabManagerSOAPinterface();
binding.AuthenticationHeaderValue = new
LabManagerSoap.AuthenticationHeader();
binding.AuthenticationHeaderValue.username = "jaya";
binding.AuthenticationHeaderValue.password = "Lab Manager";
// The following authorization header fields must be empty or absent
// for the SetCurrentOrganization and SetCurrentWorkspace to work
binding.AuthenticationHeaderValue.organizationname = "";
binding.AuthenticationHeaderValue.workspacename = "";
ServicePointManager.CertificatePolicy = new CertificateAccepter();
SetCurrentOrganizationByName(“MyOrganization”);
SetCurrentWorkspaceByName(“MyOrganization“, “MyWorkspace”);
string organizationName = GetCurrentOrganizationName();
string workspaceName = GetCurrentWorkspaceName();
Console.WriteLine("Current organization I am logged in: " + organizationName);
Console.WriteLine("Current workspace I am logged in: " + workspaceName);
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine("Error: " + e.Message);
Console.ReadLine();
}
Field Data Type Description
orgName string organizationofwhichyouareamember
workspaceName sting workspaceofwhichyouareamember