Besides the well used ManagementContext vCAC also has some SOAP services for basic infrastructure communication and provisioning. With the ProvisionService, VMPS for short, you get a wrapper around some basic vCAC workflows and helper functions that abstract data manipulation of the MangementContext and others. Using this service with PowerShell is pretty straightforward with the help of the ‘New-WebServiceProxy’ Cmdlet. For short I show you how to initialise the SOAP service and list some SOAP actions you can execute. To further dive into it you can have a look at some of my other blog posts like machine import and Approval/Reject of requested machines. Here is a list of all actions (excluding all async actions):
PS > $VMPS = New-WebServiceProxy -Uri https://vcac52.sharedop.org/VMPS -Class VMPS -Namespace VMPS PS > $VMPS; SoapVersion : Default AllowAutoRedirect : False CookieContainer : ClientCertificates : {} EnableDecompression : False UserAgent : Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 4.0.30319.18063) Proxy : UnsafeAuthenticatedConnectionSharing : False Credentials : UseDefaultCredentials : False ConnectionGroupName : PreAuthenticate : False Url : https://vcac52.sharedop.org/VMPS RequestEncoding : Timeout : 100000 Site : Container : PS > $idTkn = New-Object VMPS.IdentityToken; PS > $idTkn.User = '{0}\{1}' -f $ENV:USERDOMAIN, $ENV:USERNAME; PS > ((($vmps | gm -Type Method).Name -notmatch '^Begin' ) -notmatch '^End') -notmatch 'Async$'; Abort AcceptLeaseExtensionRequests AcceptVirtualMachineRequest CreateObjRef Discover Dispose Equals FireReclamationRequestEvent FireVirtualMachineEvent GetHashCode GetLifetimeService GetType InitializeLifetimeService NotifyGroupAdminOfLeaseExtensionRequest RegisterExistingVirtualMachine RejectLeaseExtensionRequests RejectVirtualMachineRequest RequestVirtualMachine2 SubmitReclamationRequest SubmitVirtualMachineRequests ToString TriggerUpdateMachineNotesEvents TriggerUpdateMachineOwnerEvents
When you execute actions you often have to use an IdentityToken that I always set to the username of the current user. You certainly can choose something else.
2 Comments »