Hallo Jose and Jakob.
The Rest API exists for the OC and the CMS.
If you use the OC REST API connection and would like to register a node, please
try the following example which i
developed for my 3 - day TSM/IBM Spectrum Protect 7.1.7 Update Workshop.
node name: node_black_rest
1.) create a file with the following content (my test target path/file name is
C:\scripts\spec713g\sql\batch_register_node.txt)
{
“registerclient” : {
“name”:“node_black_rest”,
“authentication”:“local”,
“password”:“node_black_rest”,
“domain”:“standard”,
“contact”:“class_716_update”,
“email”:"[email protected]"
}}
2.) and then use the following CURL statement (TSM user id and PW is admin1):
curl -X POST -H "Content-Type: application/json“ -H ”OC-API-Version: 0" -k
--user admin1:admin1 https://TSM1:11090/oc/api/servers/SERVER_BLACK/clients
--data "@C:\scripts\spec713g\sql\batch_register_node.txt"
hope this helps......
kind rgds Michael Malitz
>
> Robert Jose <[email protected]> hat am 22. November 2016 um 23:07
> geschrieben:
>
>
> Hello Jakob
> I do not know the curl application very well, but I did notice that when
> using the -data option, it sets the consume type to
> "application/x-www-form-urlencoded". Unfortunately, the OC REST API does
> not support this consumption. You will need to change it to consume
> "text/plain".
>
> Sorry I couldn't be more help.
>
> Rob Jose
> Spectrum Protect OC UI Developer / L3 Support
>
> -----Original Message-----
> From: "Jakob Jóhannes Sigurðsson" [mailto:[email protected]]
> Sent: Friday, November 18, 2016 3:13 AM
> To: [email protected]
> Subject: [ADSM-L] Help running commands via the TSM REST api
>
> Hi all.
>
> I saw a message here regarding running registration of clients against the
> REST API.
> I am not able to get this working and the user did not include his fix in
> his reply.
>
> Has anyone successfully tried this? I keep getting Internal Server error
> replies and the OC log says:
>
> [11/18/16 11:08:42:206 GMT] 0001eeaf
> org.apache.wink.server.internal.registry.ResourceRegistry I The system
> cannot find any method in the com.ibm.tsm.gui.rest.CliResource class that
> consumes application/x-www-form-urlencoded media type. Verify that a
> method
> exists that consumes the media type specified.
>
> Here is my command:
> [jakob@centos-minimal ~]$ curl -s -X POST -H "OC-API-Version: 1.0" -H
> "Accept: application/json" --insecure --user jakob:foobar
> https://192.168.1.10:11090/oc/api/cli/issueCommand --data "query option"
> Response:
> {"error":{"httpStatus":"Internal Server
> Error","errorCode":500,"message":null}}
>
> Regards, Jakob
> [email protected]
>