This post is more than 5 years old
14 Posts
0
5457
Appsync REST API details
Hello,
It has been mentioned in other threads that all functions in AppSync UI are carried out by REST API.
I have looked at Appsync REST API V2.2.2 reference guide, and found some information but I am looking for REST API or AppSync CLI information on the following items:
- Create service plan
- Subscribe host file system (windows drives) to a service plan
- Set mount options
- Set number of copies
- Assign external scripts to the service plan during desired phases
The reason I need this is for a customer who is planning to migrate from RM to AppSync where there are more than 700 jobs created on 3 or 4 different RM servers.
Any help/guidance will be appreciated.
Thank you.
Nuruddin Bohari | Sr. Solutions Architect | EMC Canada | Cell: 416.540.7816
Nbohari
14 Posts
0
April 1st, 2016 09:00
Thank you, I will look at these.
schifa
82 Posts
1
April 1st, 2016 09:00
Create service plan
Please see the section titled "Post a new Service Plan" it will outline how to "Add a new Service Plan to server repository"
Subscribe host file system (windows drives) to a service plan
Look at the “Posts a new dataset” section on how this can be achieved
Set mount options
Please look at “Update a service plan” for options such as setting mount options
Set number of copies
Please look at “Update a service plan” for options such as setting copy count options
Assign external scripts to the service plan during desired phases
Please look at “Update a service plan” for options such as setting pre/post scripts
Aaron
Nbohari
14 Posts
0
April 13th, 2016 11:00
Hi Aaron,
I tried a few different things with posting a service plan but without any luck.
Is there a sample xml payload available for posting a file system service plan?
I modified the exchange service plan example from the REST API guide to fit into file system but I am doing something wrong that the POST is failing with the following message:
Invoke-RestMethod : Wed Apr 13 14:45:33 EDT 2016500500https://10.5.184.76:8445/appsync/rest/types/servicePlan/instancesNIYArchway
Server1http://schemas.emc.com/msa/common/error/javax.xml.bind.UnmarshalException
At C:\data\proj\Scripts\appsync\AddSP2.ps1:411 char:9
+ $data = Invoke-RestMethod -Uri $uri -Method POST -Body $body -Contenttype "text/ ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
I am using the following URI and method to post it
(All variables are predefined in the script and resolve correctly as I have tested some gets with it)
$uri = "$baseuri/types/servicePlan/instances"
$data = Invoke-RestMethod -Uri $uri -Method POST -Body $body -Contenttype "text/xml" -WebSession $session
The $body variable contents > 100 lines of xml payload for a file system service plan but I think it is not accurate.
I can email it to anyone who wants to take a look at it as I can't seem to attach it here.
Thank you for your help.
schifa
82 Posts
0
April 14th, 2016 10:00
Sorry...every time I try and post the instructions, they get truncated, so I am attaching the document...
1 Attachment
AppSync Service Plan REST Help.docx
Nbohari
14 Posts
0
April 14th, 2016 11:00
Thank you so much.
I will give it a try and let you know.
schifa
82 Posts
0
April 14th, 2016 11:00
Please see the attachment previously posted. It has the specific instructions you need to create a new SP.
Nbohari
14 Posts
0
April 14th, 2016 11:00
Hi Aaron,
I already tried this approach and it didn't work for me.
If you are successful with your method please share either here or to me privately the following:
As always, thank you for your efforts in helping with this.