n00b REST Questions

RESTful knowledge exchange

n00b REST Questions

Veeam Logoby jimboefx » Thu May 15, 2014 9:39 am

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.
jimboefx
Service Provider
 
Posts: 2
Liked: never
Joined: Sat Jun 27, 2009 7:55 am
Full Name: James Montgomery

Re: n00b REST Questions

Veeam Logoby hatari » Thu May 15, 2014 12:30 pm

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
hatari
Novice
 
Posts: 9
Liked: 3 times
Joined: Tue Jun 18, 2013 10:06 am
Full Name: Alexey Rostovskiy

Re: n00b REST Questions

Veeam Logoby jimboefx » Fri May 16, 2014 1:28 pm

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? :)
jimboefx
Service Provider
 
Posts: 2
Liked: never
Joined: Sat Jun 27, 2009 7:55 am
Full Name: James Montgomery

Re: n00b REST Questions

Veeam Logoby v.Eremin » Fri May 16, 2014 1:42 pm

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.
v.Eremin
Veeam Software
 
Posts: 13285
Liked: 971 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin


Return to RESTful API



Who is online

Users browsing this forum: No registered users and 4 guests