TrueCommand API

Tasmana

Dabbler
Joined
Jul 26, 2020
Messages
25
Hi all!


Someone work whith API TrueCommand?
Who has examples?
I only have troubles, bad requests go when requested(
 

aervin

iXsystems
iXsystems
Joined
Jun 13, 2018
Messages
114
Hey @Tasmana ! Have you tried the API docs hosted by your instance? They can be found from the login page. Just click the "?" icon.

docs.PNG


I can share a simple script we use for registering test systems via the HTTP API (using curl):

Code:
#!/bin/bash
# Usage: register_vipers.sh
tchost="localhost:${1}"
export TC_USER="test"
export TC_PASS="test"

dnsname="sys.your.nas.com"
nickname="yournickname"
# Register the IP
echo "Registering System: ${nickname}"
curl -u "${TC_USER}:${TC_PASS}" --data '{"ip" : "'${dnsname}'", "login_user" : "root", "login_password" : "helloworld", "nickname" : "'${nickname}'"}' "http://${tchost}/api/servers/add"
 
Top