2.5

Table Of Contents
VMware, Inc. 57
Chapter 4 Lab Manager API Method Reference
MachinePerformAction
Thismethodperformsoneofthefollowingmachineactionsasindicatedbytheaction
identifier:
1—PowerOn.Turnsonamachine.
2—PowerOff.Turnsoffamachine.Nothingissaved.
3—Suspend.FreezesamachineCPUandstate.
4—Resume.Resumesasuspendedmachine.
5—Reset.Rebootsamachine.
6—Snapshot.Saveamachinestateataspecificpointintime.
7—Revert.Returnsamachinetoasnapshotstate.
8—Shutdown.Shutsdownamachinebeforeturningoff.
Syntax
MachinePerformAction(3);
Arguments
Response
none
Sample Code: C#
try
{
LabManagerSoap.VMwareLabManagerSOAPinterface binding = new
LabManagerSoap.VMwareLabManagerSOAPinterface();
binding.AuthenticationHeaderValue = new
LabManagerSoap.AuthenticationHeader();
binding.AuthenticationHeaderValue.username = "jaya";
binding.AuthenticationHeaderValue.password = "Lab Manager";
ServicePointManager.CertificatePolicy = new CertificateAccepter();
Table 4-29. Arguments
Field Data Type Description
machineID int Machineidentifier.
action int Actiontotakeonthemachine.