
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
REST API to add remote servers
Hello, I am trying to use the REST API to add remote servers to my sitescope install. I followed the documentation and I am getting the error that my JSON is invalid on POST. I am not sure where I am going wrong, although I am just using curl at this point to get my request correct then move on to scripting it.
my curl request is `curl -XPOST -k "https://sitescope:8443/SiteScope/api/remoteserver/configdata" -H 'Content-Type: application/json' -d '@siteScopeTest'`
with the contents of file siteScopeTest being
{
"RemoteServerConfig": [{
"UNIX": [{
"_host": "server01",
"_name": "server01",
"_os": "RHESLinux",
"_disableCache": "",
"_keyFile": "",
"_password": "",
"_sshAuthMethod": "password",
"_sshConnectionsLimit": "3",
"_remoteEncoding": "UTF-8",
"_credentials": "1131488408",
"_description": "",
"_keepalive": "",
"_login": "",
"_version2": "true",
"_trace": "",
"_sshPort": "22",
"_method": "ssh"
}, {
"_host": "server02",
"_name": "server02",
"_os": "RHESLinux",
"_disableCache": "",
"_keyFile": "",
"_password": "",
"_sshAuthMethod": "password",
"_sshConnectionsLimit": "3",
"_remoteEncoding": "UTF-8",
"_credentials": "1131488408",
"_description": "",
"_keepalive": "",
"_login": "",
"_version2": "true",
"_trace": "",
"_sshPort": "22",
"_method": "ssh"
}, {
"_name": "server03",
"_host": "server03",
"_os": "RHESLinux",
"_disableCache": "",
"_keyFile": "",
"_password": "",
"_sshAuthMethod": "password",
"_sshConnectionsLimit": "3",
"_remoteEncoding": "UTF-8",
"_credentials": "1131488408",
"_description": "",
"_keepalive": "",
"_login": "",
"_version2": "true",
"_trace": "",
"_sshPort": "22",
"_method": "ssh"
}]
}]
}
The response from the API call is Failed to import Remote Server Configuration. Invalid config file. and in the error.log file
ERROR - Failed to import Remote Server Configuration : java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hello NickRad,
I hope you are fine.
Checking the information provided, I would like to know if you have tried the Postman tool to check the response and the functionality of the API.
Best Regards,