6.0
Table Of Contents
- vSphere SDK for Perl Programming Guide
- Contents
- Getting Started with vSphere SDK for Perl
- Writing vSphere SDK for Perl Scripts
- Refining vSphere SDK for Perl Scripts
- Creating and Using Filters
- Filtering Views Selectively Using Properties
- Retrieving the ServiceInstance Object on a vSphere Host
- Saving and Using Sessions
- Using Multiple Sessions
- Learning About Object Structure Using Data::Dumper
- Specifying Untyped Arguments in Scheduled Tasks and Callbacks
- Using Advanced Subroutines
- vSphere SDK for Perl Subroutine Reference
- Web Services for Management Perl Library
- Credential Store Perl Library
vSphere SDK for Perl Programming Guide
54 VMware, Inc.
UUID–GeneratesUUIDsfortheSOAPmessages.
Table A‐3liststhemethodstheWSBasicclassprovides,whicharediscussedinmoredetailbelow.
WSMan::WSBasic->new
Constructorthattakesahashargumentcontainingkey‐valuepairs.
Arguments
Theconstructortakesthefollowingarguments:
Example
$client = WSMan::WSBasic->new( address => 'http://www.abc.com/',
port => '80',
path => 'wsman',
username => 'wsman',
password => 'secret',
namespace => 'root/cimv2', #optional
timeout => '60' #optional
);
register_xml_ns
RegistersextraXMLnamespacesthatmightberequiredforproprietarytagsintheSOAPmessage.Calling
register_xml_nsisnotusuallyrequired.
Arguments
Ahash.Keysaretheprefixes,valuesaretherelativeURLsasvalues.
Table A-3. Methods in WSMan::WSBasic
Method Description
WSMan::WSBasic‐>new Constructor.
register_xml_ns RegistersextraXMLnamespacesthatmightberequiredforproprietarytagsintheSOAP
message
register_class_ns RegistersextraCIMnamespacesthattheWS‐Managementservermightrequire.
Identify Performsthewsmid:Identify operation,whichcausestheWS‐Managementserverto
identifyitself.
Enumerate Filtersresultsdifferentlydependingontheargumentsyoupass
in.
PullRelease PerformsaPu lloraReleaseoperation(overloadedmethod).
Get Retrievesaninstanceofaclass.
Argument Description
address WS‐ManagementserverURL.Specifythetransportprotocolbyaddinghttp(basic
user‐passwordauthentication)orhttps(HTTPwithSSLencryption).
port PortonwhichtheWS‐Managementserverlistensforrequests.
path PathtotheWS‐Managementserver.Thepathiscombinedwiththeaddressandportarguments
toform
thecompleteURLoftheWS‐Managementserver.TheresultingURLis
http://address:port/path.
username UsernamefortheWS‐Managementserver.
password PasswordfortheWS‐Managementserver.
namespace CIMnamespace.Defaultisroot/cimv2.Ifthenamespaceisnotroot/cimv2,youmustpassin
thenamespaceoftheclassinthis
argument.
timeout (optional) TimeoutfortheHTTPrequest.