6.0

Table Of Contents
vSphere SDK for Perl Programming Guide
58 VMware, Inc.
WSMan::GenericOps->new
Constructorthattakesahashargumentcontainingkeyvaluepairsinthefollowingform:
$client = WSMan::GenericOps->new(( address => 'http://www.abc.com/',
port => '80',
path => 'wsman',
username => 'wsman',
password => 'secret',
namespace => 'root/cimv2', #optional
timeout => ‘60’ #optional
));
Arguments
Theconstructorhasthefollowingarguments:
register_xml_ns
RegistersextraXMLnamespacesthatmightberequiredforproprietarytagsintheSOAPmessage.Calling
register_xml_nsisnotrequiredunlessyouaretryingtoextendtheclassitself.
Arguments
Ahash.Keysaretheprefixes,valuesaretherelativeURLsasvalues.
Example
$client->register_xml_ns((wsen => 'http://www.dmtf.org/wsen'));
DeclaresaprefixwsenwiththeURLhttp://www.dmtf.org/wsenintheglobalXMLnamespace.
register_class_ns
RegistersextraResourceURIsthattheWSManagementservermightrequire.Bydefault,theconstructor
providesasetofResourceURIsonlyforclassesintheCIMschema.Classeswithotherschemanames,suchas
VMware_*classes,requireadifferentResourceURIwhenenumeratedusingthevSphereSDKforPerl.
Youcanfindthe
ResourceURIscorrespondingtoothersupportedschemasintheOpenWSManconfiguration
file,whichislocatedintheserverʹsfilesystemat/etc/openwsman/openwsman.conf.TheResourceURIsare
listedinthevalueofthevendor_namespacesconfigurationparameter.
EnumerateAssociationInstanceNames Returnsobjectscontainingkeyvaluesoftheassociationinstancesofwhichtheclassis
apart.
GetInstance Retrievesaparticularinstanceofaclass.
Table A-4. Methods in WSMan::GenericOps (Continued)
Method Description
Argument Description
address URLoftheWSManagementserver.Specifythetransportprotocolbyaddingthehttpprefixfor
HTTP(basicuserpasswordauthentication)orthehttpsprefixforHTTPwithSSLencryption.
port PortonwhichWSManagementlistensforrequests.
path PathtotheWSManagementserver.Thepathiscombinedwith
theaddressandportargumentsto
formthecomp leteURLoftheWSManagementserverinhttp://address:port/pathorder.
username UsernamefortheWSManagementserver.
password Passw ordfortheWSManagementserver.
namespace DefaultCIMnamespace.Defaultisroot/cimv2.
Ifthenamespaceisnotroot/cimv2,youmustpassinthe
namespaceoftheclassinthisargument.
timeout
(optional)
TimeoutfortheHTTPrequest,incaseofslowservers.