VMware Cloud Community
jvm2016
Hot Shot
Hot Shot
Jump to solution

SRM api with powershell_powercli

Hi Luc ,

we had a discussion about  srm api using below

The SRM API Reference is at https://code.vmware.com/web/sdk/8.1/site-recovery-manager

But you need to use an account that is permitted to access it.

i have been granted access for this but what what i have been looking for using invoke-webmetthod and invoke-webrequest .

is it possible using above url.

Reply
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

You can use PS, just not the cmdlets that are intended for use with a REST API.
Xavier did a nice series on how to use the SRM API from PowerShell, see PowerCLI SRM module: How to use it


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

View solution in original post

Reply
0 Kudos
9 Replies
LucD
Leadership
Leadership
Jump to solution

Didn't we already discuss this in invoke-restmethod to use vsphere rest apis ?

Or do you mean something else?

Btw, I do not have access to that API Reference.


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

Reply
0 Kudos
jvm2016
Hot Shot
Hot Shot
Jump to solution

yes in the same line of the post you just mentioned .

however in process of exploring the document .

would you like to have a look if i share my credentials??

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

I can have a look, but be aware that I currently don't have an active SRM setup of that version.
Send me a private mail (here or via my blog)


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

Reply
0 Kudos
jvm2016
Hot Shot
Hot Shot
Jump to solution

ok.

Reply
0 Kudos
jvm2016
Hot Shot
Hot Shot
Jump to solution

i sent through blog .

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Thanks, I'm in


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

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

As far as I can tell, that API is not a REST API, but based on SOAP.

That eliminates the use of Invoke-RestMethod.

It looks as if the methods available after you do a Connect-SrmServer, is currently the only way to access the API.


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

Reply
0 Kudos
jvm2016
Hot Shot
Hot Shot
Jump to solution

that means i cant use them powershell correct??

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

You can use PS, just not the cmdlets that are intended for use with a REST API.
Xavier did a nice series on how to use the SRM API from PowerShell, see PowerCLI SRM module: How to use it


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

Reply
0 Kudos