VMware Cloud Community
ikiris
Enthusiast
Enthusiast

Can't find addfoldermapping mething after using connect-srmserver

I do the following

connect-viserver vcenter

connect-srmserver -user XX -password XX -remoteuser XX -remotepassword XX

$api = $global:DefaultSrmServers[0].ExtensionData

Based on the documentation, I was expecting to access $api.inventorymapping.addfoldermapping() but there is no inventorymapping right under api. If I go to $api.content.inventorymapping it's just a MoREF, no functions. If I go to $api.retrievecontent().inventorymappin it's a MoREF as well.

How do I access the inventory mapping api?

I am using SRM 6.1 with PowerCLI 6.3 R1

-Chris- http://www.twitter.com/ikiris http://blog.chrischua.net
Tags (1)
Reply
0 Kudos
2 Replies
LucD
Leadership
Leadership

Isn't that method named ListInventoryMappings?

If you do $api | gm you should see the available methods


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
ikiris
Enthusiast
Enthusiast

Thanks for the response, unfortunately I have been using the $api | gm approach and haven't found the functions.

The listinventorymappings is unfortunately not what I was looking for, it only returns the inventory mappings. It could be found at $api.protection.listinventorymappings()

$api | gm

   TypeName: VMware.VimAutomation.Srm.Views.SrmServiceInstance

Name                          MemberType Definition                                                                                                      

----                          ---------- ----------                                                                                                      

Equals                        Method     bool Equals(System.Object obj)                                                                                  

GetHashCode                   Method     int GetHashCode()                                                                                               

GetPairedSite                 Method     VMware.VimAutomation.Srm.Views.SrmRemoteSite GetPairedSite()                                                    

GetPairedSiteSolutionUserInfo Method     VMware.VimAutomation.Srm.Views.SrmSolutionUserInfo GetPairedSiteSolutionUserInfo()                              

GetSiteName                   Method     string GetSiteName()                                                                                            

GetSolutionUserInfo           Method     VMware.VimAutomation.Srm.Views.SrmSolutionUserInfo GetSolutionUserInfo()                                        

GetType                       Method     type GetType()                                                                                                  

LoginLocale                   Method     void LoginLocale(string username, string password, string locale)                                               

LoginRemoteSite               Method     void LoginRemoteSite(string remoteUsername, string remotePassword, string locale)                               

LoginRemoteSiteByToken        Method     void LoginRemoteSiteByToken(string remoteSamlToken, string locale)                                              

LogoutLocale                  Method     void LogoutLocale()                                                                                             

RetrieveContent               Method     VMware.VimAutomation.Srm.Views.SrmServiceInstanceContent RetrieveContent()                                      

SrmLoginByTokenLocale         Method     void SrmLoginByTokenLocale(string samlToken, string locale)                                                     

SrmLoginSites                 Method     void SrmLoginSites(string username, string password, string remoteUsername, string remotePassword, string locale)

SrmLoginSitesByToken          Method     void SrmLoginSitesByToken(string samlToken, string remoteSamlToken, string locale)                              

ToString                      Method     string ToString()                                                                                               

Content                       Property   VMware.VimAutomation.Srm.Views.SrmServiceInstanceContent Content {get;}                                         

MoRef                         Property   VMware.Vim.ManagedObjectReference MoRef {get;set;}                                                              

Protection                    Property   VMware.VimAutomation.Srm.Views.SrmProtection Protection {get;}                                                  

Recovery                      Property   VMware.VimAutomation.Srm.Views.SrmRecovery Recovery {get;}                                                      

$api.Protection | gm

   TypeName: VMware.VimAutomation.Srm.Views.SrmProtection

Name                               MemberType Definition                                                                                                                                                                                    

----                               ---------- ----------                                                                                                                                                                                    

CreateAbrProtectionGroup           Method     VMware.VimAutomation.Srm.Views.SrmCreateProtectionGroupTask CreateAbrProtectionGroup(VMware.Vim.ManagedObjectReference location, string name, string description, VMware.Vim.ManagedObjectRe...

CreateHbrProtectionGroup           Method     VMware.VimAutomation.Srm.Views.SrmCreateProtectionGroupTask CreateHbrProtectionGroup(VMware.Vim.ManagedObjectReference location, string name, string description, VMware.Vim.ManagedObjectRe...

Equals                             Method     bool Equals(System.Object obj)                                                                                                                                                                

GetHashCode                        Method     int GetHashCode()                                                                                                                                                                             

GetProtectionGroupRootFolder       Method     VMware.VimAutomation.Srm.Views.SrmProtectionGroupFolder GetProtectionGroupRootFolder()                                                                                                        

GetType                            Method     type GetType()                                                                                                                                                                                

ListInventoryMappings              Method     VMware.VimAutomation.Srm.Views.SrmProtectionInventoryMappingInfo ListInventoryMappings()                                                                                                      

ListProtectedDatastores            Method     System.Collections.Generic.List[VMware.Vim.Datastore] ListProtectedDatastores()                                                                                                               

ListProtectedVms                   Method     System.Collections.Generic.List[VMware.Vim.VirtualMachine] ListProtectedVms()                                                                                                                 

ListProtectionGroups               Method     System.Collections.Generic.List[VMware.VimAutomation.Srm.Views.SrmProtectionGroup] ListProtectionGroups()                                                                                     

ListReplicatedDatastores           Method     System.Collections.Generic.List[VMware.Vim.Datastore] ListReplicatedDatastores()                                                                                                              

ListUnassignedReplicatedDatastores Method     System.Collections.Generic.List[VMware.Vim.Datastore] ListUnassignedReplicatedDatastores()                                                                                                    

ListUnassignedReplicatedVms        Method     System.Collections.Generic.List[VMware.Vim.VirtualMachine] ListUnassignedReplicatedVms(string replicationType)                                                                                

ToString                           Method     string ToString()                                                                                                                                                                             

MoRef                              Property   VMware.Vim.ManagedObjectReference MoRef {get;set;}                                                                                                                                            

$api.Content | gm

   TypeName: VMware.VimAutomation.Srm.Views.SrmServiceInstanceContent

Name             MemberType Definition                                                                                                                                

----             ---------- ----------                                                                                                                                

Equals           Method     bool Equals(System.Object obj)                                                                                                            

GetHashCode      Method     int GetHashCode()                                                                                                                         

GetType          Method     type GetType()                                                                                                                            

LoadFromWsdl     Method     void LoadFromWsdl(VMware.VimAutomation.Srm.WsdlTypes.SrmServiceInstanceContent wsdlObject, VMware.VimAutomation.Srm.Views.SrmClient client)

ToString         Method     string ToString()                                                                                                                         

About            Property   VMware.Vim.AboutInfo About {get;set;}                                                                                                     

ApiVersion       Property   string ApiVersion {get;set;}                                                                                                              

InventoryMapping Property   VMware.Vim.ManagedObjectReference InventoryMapping {get;set;}                                                                             

Protection       Property   VMware.Vim.ManagedObjectReference Protection {get;set;}                                                                                   

Recovery         Property   VMware.Vim.ManagedObjectReference Recovery {get;set;}                                                                                     

SrmApi           Property   VMware.Vim.ManagedObjectReference SrmApi {get;set;}                                                                                       

-Chris- http://www.twitter.com/ikiris http://blog.chrischua.net
Reply
0 Kudos