Using Powershell to connect to EMC AppSync via REST?
Hello,
This is a question for you developer type people out there.
Since Appsync does not allow any remote scripting I'm trying to dive in using powershell 4.0 and Invoke-RestMethod. I've read the AppSync 1.6.0 REST API Reference and i'm stuck at the authentication part.
I understand that i have to authenticate to the CAS server and then use that sessionID throughout my use of the script, that's fine. However, I can't figure out how to connect to the AppSync CAS server properly.
This guy is showing how (in EMC Prosphere) a Powershell user can authenticate using Invoke-Webrequest and get the session variable.
function Get-ProSphereSession {
param(
## ProSphere virtual machine FQDN
[string] $psfqdn = "",
## ProSphere username
[string] $username = "appadmin",
## ProSphere username
[string] $password = "Changeme1!"
)
#Get a web session variable for the ProSphere instance
Here it is, Engineering was nice enough to help me get authentication working. This script below will authenticate to AppSync and then list the service plans on the AppSync server.
Accessing the XML is pretty easy ($result.feed.entry) but I've not yet tried a POST. Will take a look at that one.$result.feed.entry
$appsyncServer = 'myServer'
add-type @"
using System.Net;
using System.Security.Cryptography.X509Certificates;
public class TrustAllCertsPolicy : ICertificatePolicy {
I still have not performed any POST operations. I have been using existing service plans and controlling them with the ESI PowerShell modules. Unfortunately, there are no CMDLETS to create service plans.
If you get something working with REST please post back to this thread to share with the community!
benconrad1
105 Posts
1680
0
Posted November 13th, 2014 20:00
Here it is, Engineering was nice enough to help me get authentication working. This script below will authenticate to AppSync and then list the service plans on the AppSync server.
Accessing the XML is pretty easy ($result.feed.entry) but I've not yet tried a POST. Will take a look at that one.$result.feed.entry