Most likely your header is the issue. You can check messages.log to see.
This worked no problem for me (make sure you fill in credentials, host,
and TSM/SP server name):
curl -X POST -H "Content-Type: application/json" -H "OC-API-Version: 1.0"
-k --user aaa:bbb
https://xxxxxx:11090/oc/api/servers/COMFREY_LXS_SRV2/clients --data
"@register.json"
register.json contains: (you can inline it into the curl, but I'll leave
that to you)
{
"registerclient" : {
"name":"rest",
"authentication":"local",
"password":"rest",
"domain":"standard",
"contact":"rest",
"email":"rest AT rest.us.ibm DOT com"
}}
**My opinions are my own**
Evan Dunn
Spectrum Protect Dev-Test
From: Anderson Douglas <ander.douglas AT GMAIL DOT COM>
To: ADSM-L AT VM.MARIST DOT EDU
Date: 04/01/2016 11:34 AM
Subject: Re: [ADSM-L] Script to register node using Curl and Rest
API
Sent by: "ADSM: Dist Stor Manager" <ADSM-L AT VM.MARIST DOT EDU>
Is it possivel to use this parameters with Curl?
anderson
On Fri, Apr 1, 2016 at 3:28 PM, Del Hoobler <hoobler AT us.ibm DOT com> wrote:
> The REST API is through the Operations Center and its web server.
>
>
> For register node:
>
>
> Register node
> servers/{server name}/clients
> {
> "registerclient" : {
> "name":"<node name>",
> "authentication":"<authentication type>",
> "password":"<password>",
> "domain":"<domain name>",
> "contact":"<contact name>",
> "email":"<email>",
> ["schedule":" <schedule name> ]",
> ["optionset":" <optionset name> ]",
> ["deduplication":" <deduplication> ]",
> ["sslrequired":" <sslrequired> ]",
> ["sessioninitiation":" <sessioninitiation> ]"
> }}
>
>
>
> Thank you,
>
> Del
>
> ---------------------------------------------------
>
> "ADSM: Dist Stor Manager" <ADSM-L AT VM.MARIST DOT EDU> wrote on 04/01/2016
> 01:31:09 PM:
>
> > From: Anderson Douglas <ander.douglas AT GMAIL DOT COM>
> > To: ADSM-L AT VM.MARIST DOT EDU
> > Date: 04/01/2016 01:33 PM
> > Subject: Script to register node using Curl and Rest API
> > Sent by: "ADSM: Dist Stor Manager" <ADSM-L AT VM.MARIST DOT EDU>
> >
> > Hello
> >
> >
> >
> > Here we have started news tests using REST API through Operation
> > center. We adopted Curl to send the commands.
> >
> > Some commands like this below runs normally
> >
> >
> >
> > curl -X GET -H "Accept: application/json" -H "OC-API-Version: 1.0" -k
> > --user aaa:bbb https://xx.xx.xx.xx:11090/oc/api/help
> >
> > curl -X PUT -H "Accept: application/json" -H "OC-API-Version: 1.0" -k
> > --user aaa:bbb https://xx.xx.xx.xx:11090/oc/api/servers/<inst>/
> > clients/<node>/unlock
> >
> >
> >
> > Now we need to implementade a rest command to register a node into
> > TSM, But not able. Does anyone know how to do this?
> >
> >
> >
> > This is a link with REST API supportable commands
> >
> > http://www-01.ibm.com/support/docview.wss?uid=swg21973011
> >
> >
> >
> >
> >
> > Anderson Douglas da Silva
> >
>
--
-----
Anderson
|