RESTful knowledge exchange
Post Reply
jimboefx
Service Provider
Posts: 2
Liked: never
Joined: Jun 27, 2009 7:55 am
Full Name: James Montgomery
Contact:

n00b REST Questions

Post by jimboefx »

1)Is anyone successfully using Powershell invoke-restmethod to successfully interact with EM? My personal issue is that I can login fine with the initial POST, but I do not know how to grab the X-RestSvcSessionId value in the response. This is possibly a knowledge gap on my part - my workaround is to use Wireshark to view the attribute and then I paste it in subsequent commands. Which works OK but I need to know how to capture it in my scripts/workflows. Powershell is not a firm requirement but it is preferred.

2)The edition comparison states Ent+ only for REST support. Does anyone know if this support is hard and fast in the code? i.e. if you try to interact with Veeam Std edition will you get access denied, or is this just a soft support statement (don't log a call and expect support, but it works)?

The reason for 2 is that I get access denied on an existing Std edition (case 00567629 for any Veeam people lurking) but when I try the same on a brand new Ent+ trial I do not get access denied. I don't know at this stage if the error is related to the license or the installation. Any information welcome.
hatari
Novice
Posts: 9
Liked: 3 times
Joined: Jun 18, 2013 10:06 am
Full Name: Alexey Rostovskiy
Contact:

Re: n00b REST Questions

Post by hatari »

About Q1:

Code: Select all

get header
$header = @{}
$response = Invoke-WebRequest -Uri $url -Credential $cred -Method POST
$header.Add('X-RestSvcSessionId', $response.Headers['X-RestSvcSessionId'])
than use it

Code: Select all

Invoke-RestMethod -Uri $url -Headers ($header) -Method $method
jimboefx
Service Provider
Posts: 2
Liked: never
Joined: Jun 27, 2009 7:55 am
Full Name: James Montgomery
Contact:

Re: n00b REST Questions

Post by jimboefx »

Hi Hatari,

Thanks for this, I can grab the X-RestSvcSessionId grand now.

Struggling with the next step but I'll persevere and see how I get on.

Anybody fancy taking on 2? :)
veremin
Product Manager
Posts: 20283
Liked: 2258 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: n00b REST Questions

Post by veremin »

Anybody fancy taking on 2?
The RestAPI service works only when Enterprise Plus license is installed. So, you can consider this as a hard-coded limitation. Thanks.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests