Node Util function
Utility function to work with virtual server nodes.
Request
Method |
URL |
POST |
/smserver/smsadm.NodeUtil |
RAW |
POST /smserver/smsadm.NodeUtil HTTP/1.1 Cache-Control: no-cache Connection: Keep-Alive Pragma: no-cache Content-Type: application/json; charset=UTF-8 Accept: */* Authorization: Bearer XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
[ { "vserver" : "default", "machineid" : "Z5ENP7AZMPRERDQHUEWBSICAKI", "command" : "canaddnode" } ] |
Explained |
Can we add a node to a certain virtual server?
command: canaddnode vserver: ID of the virtual server to check machineid: ID of the machine that we want to add as "node" of the specified vserver |
Response
Method |
URL |
RAW |
Accept-Encoding: synlz,gzip Content-Type: application/json; charset=UTF-8
{"result":[ { "Result" : -1, "ResultMsg" : "Cannot add node" } ],"id":7721} |
Explained |
Result: 1 = success any other value different from 1 = error
ResultMsg: a friendly message (success or error message) explaining what happened |
Response
Method |
URL |
RAW |
Accept-Encoding: synlz,gzip Content-Type: application/json; charset=UTF-8
{"result":[ { "Result" : 1, "ResultMsg" : "Can add node", "AllowMachine" : [ { "MachineId" : "NPFS3SNTFBLUVFJNCLUZPUEB4E", "MachineName" : "WIN-7NU6CONHSM8", "MongoDBHost" : "192.168.172.99", "MongoDBPort" : "28038" } ] } ],"id":7721} |
Explained |
Result: 1 = success any other value different from 1 = error
ResultMsg: a friendly message (success or error message) explaining what happened |
OR
Request
Method |
URL |
POST |
/smserver/smsadm.NodeUtil |
RAW |
POST /smserver/smsadm.NodeUtil HTTP/1.1 Cache-Control: no-cache Connection: Keep-Alive Pragma: no-cache Content-Type: application/json; charset=UTF-8 Accept: */* Authorization: Bearer XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
[ { "vserver" : "default", "machineid" : "Z5ENP7AZMPRERDQHUEWBSICAKI", "command" : "editnode", "Bindings" : [ { "Protocol" : "SSH", "Active" : true, "IPAddr" : "0.0.0.0", "Port" : 22, "IPVer" : 4, "HostName" : "" }, { "Protocol" : "FTP", "Active" : true, "IPAddr" : "0.0.0.0", "Port" : 21, "IPVer" : 4, "HostName" : "" }, { "Protocol" : "FTPData", "Active" : true, "IPAddr" : "0.0.0.0", "Port" : 1020, "IPVer" : 4, "HostName" : "" }, { "Protocol" : "FTPS", "Active" : true, "IPAddr" : "0.0.0.0", "Port" : 990, "IPVer" : 4, "HostName" : "" }, { "Protocol" : "FTPSData", "Active" : true, "IPAddr" : "0.0.0.0", "Port" : 989, "IPVer" : 4, "HostName" : "" } ], "MongoDBHost" : "127.0.0.1", "MongoDBPort" : "28038", "NodeID" : "Z5ENP7AZMPRERDQHUEWBSICAKI", "Name" : "XE10" } ] |
Explained |
This is to modify an existing node.
command: editnode vserver: virtual server ID machineid: ID of the machine that is the vserver node we want to edit |
Response
Method |
URL |
RAW |
Accept-Encoding: synlz,gzip Content-Type: application/json; charset=UTF-8
{"result":[ { "Result" : 1, "ResultMsg" : "Node updated" } ],"id":7721} |
Explained |
Result: 1 = success any other value different from 1 = error
ResultMsg: a friendly message (success or error message) explaining what happened |
OR
Request
Method |
URL |
POST |
/smserver/smsadm.NodeUtil |
RAW |
POST /smserver/smsadm.NodeUtil HTTP/1.1 Cache-Control: no-cache Connection: Keep-Alive Pragma: no-cache Content-Type: application/json; charset=UTF-8 Accept: */* Authorization: Bearer XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
[ { "vserver" : "default", "machineid" : "NPFS3SNTFBLUVFJNCLUZPUEB4E", "command" : "createnode", "Bindings" : [ { "Protocol" : "SSH", "Active" : true, "IPAddr" : "0.0.0.0", "Port" : 22, "IPVer" : 4, "HostName" : "" }, { "Protocol" : "FTP", "Active" : true, "IPAddr" : "0.0.0.0", "Port" : 21, "IPVer" : 4, "HostName" : "" }, { "Protocol" : "FTPData", "Active" : true, "IPAddr" : "0.0.0.0", "Port" : 20, "IPVer" : 4, "HostName" : "" }, { "Protocol" : "FTPS", "Active" : true, "IPAddr" : "0.0.0.0", "Port" : 990, "IPVer" : 4, "HostName" : "" }, { "Protocol" : "FTPSData", "Active" : true, "IPAddr" : "0.0.0.0", "Port" : 989, "IPVer" : 4, "HostName" : "" } ], "MongoDBHost" : "192.168.172.99", "MongoDBPort" : "28038", "NodeID" : "NPFS3SNTFBLUVFJNCLUZPUEB4E", "Name" : "win2012" } ] |
Explained |
This is to ADD a machine as a node to an existing virtual server.
command: createnode vserver: virtual server ID machineid: ID of the machine that we want to add as a node to the vserver |
Response
Method |
URL |
RAW |
Accept-Encoding: synlz,gzip Content-Type: application/json; charset=UTF-8
{"result":[ { "Result" : 1, "ResultMsg" : "Created", "NodeID" : "NPFS3SNTFBLUVFJNCLUZPUEB4E" } ],"id":7721} |
Explained |
Result: 1 = success any other value different from 1 = error
ResultMsg: a friendly message (success or error message) explaining what happened |