Raritan / Server Technology Xerus™ PDU JSON-RPC API
Classes | Public Types | Public Member Functions | Public Attributes | List of all members
servermon::ServerMonitor Interface Reference

Server Monitor Interface. More...

import"ServerMonitor.idl";

Classes

struct  Server
 Server Entry. More...
 
struct  ServerAddedEvent
 A new server entry was added. More...
 
struct  ServerDeletedEvent
 A server entry was deleted. More...
 
struct  ServerPowerControlCompletedEvent
 Event: A power control operation was completed. More...
 
struct  ServerPowerControlInitiatedEvent
 Event: A power control operation was initiated. More...
 
struct  ServerPowerSettings
 Settings for controlling and checking power state of the server. More...
 
struct  ServerPowerStateEvent
 Event: ServerPowerState has changed. More...
 
struct  ServerReachabilityEvent
 Event: Reachability status for a monitored server has changed or server continues to be unreachable. More...
 
struct  ServerSettings
 Server Reachability Settings. More...
 
struct  ServerSettingsChangedEvent
 A server entry was changed. More...
 
struct  ServerStatus
 Server Reachability Status. More...
 

Public Types

enum  ServerReachability { WAITING , REACHABLE , UNREACHABLE , ERROR }
 Server Reachability State. More...
 
enum  ServerPowerState { UNKNOWN , ON , OFF , SHUTTING_DOWN }
 Server Power Control State. More...
 
enum  ServerPowerControlResult {
  NO_ERROR , SHUTDOWN_CMD_FAILED , SWITCHING_OFF_FAILED , SWITCHING_ON_FAILED ,
  POWER_CHECK_TIMEOUT
}
 Server Power Control Result. More...
 
enum  ServerPowerCheckMethod { TIMER , POWER_DROP }
 Methods of checking power state. More...
 

Public Member Functions

int addServer (out int id, in ServerSettings settings)
 Add a new server entry. More...
 
int modifyServer (in int id, in ServerSettings settings)
 Modify an existing server entry. More...
 
int deleteServer (in int id)
 Delete a server entry. More...
 
int getServer (out Server server, in int id)
 Retrieve a server entry (settings and status). More...
 
map< int, ServerlistServers ()
 Retrieve a list of server entries (settings and status). More...
 
int powerControl (in int id, in boolean on)
 Control the power state of the outlets the server uses. More...
 

Public Attributes

constant int ERR_NO_SUCH_ID = 1
 No such ID.
 
constant int ERR_INVALID_SETTINGS = 2
 Invalid settings.
 
constant int ERR_DUPLICATE_HOSTNAME = 3
 Duplicate hostname.
 
constant int ERR_MAX_SERVERS_REACHED = 4
 Maximum number of server entries.
 

Detailed Description

Server Monitor Interface.

Member Enumeration Documentation

◆ ServerPowerCheckMethod

Methods of checking power state.

Enumerator
TIMER 

Server is assumed to be off after a time interval.

POWER_DROP 

Server is off if power consumption dropped.

◆ ServerPowerControlResult

Server Power Control Result.

Enumerator
NO_ERROR 

No error, operation may still be in progress.

SHUTDOWN_CMD_FAILED 

Error issuing the shutdown command to the server.

SWITCHING_OFF_FAILED 

Switching the outlet or outlet group off failed.

SWITCHING_ON_FAILED 

Switching the outlet or outlet group on failed.

POWER_CHECK_TIMEOUT 

Checking if power is off timed out.

◆ ServerPowerState

Server Power Control State.

Enumerator
UNKNOWN 

Power state currently not known.

ON 

Server power target is on.

OFF 

Server power target is off.

SHUTTING_DOWN 

Server is being manually shut down.

◆ ServerReachability

Server Reachability State.

Enumerator
WAITING 

Waiting for reliable connection.

REACHABLE 

Server is up and running.

UNREACHABLE 

No response from server.

ERROR 

Error pinging server (e.g. DNS lookup failure)

Member Function Documentation

◆ addServer()

int servermon::ServerMonitor::addServer ( out int  id,
in ServerSettings  settings 
)

Add a new server entry.

Parameters
idNew entry id, automatically assigned
settingsNew server settings
Returns
0 if OK
2 if the settings are invalid
3 if an entry for the given hostname exists
4 if the maximum number of servers is reached
Note
The ServerSettings structure can be "sparse"; fields missing in the JSON representation will be set to default values.

◆ deleteServer()

int servermon::ServerMonitor::deleteServer ( in int  id)

Delete a server entry.

Parameters
idEntry id
Returns
0 if OK
1 if the entry does not exist

◆ getServer()

int servermon::ServerMonitor::getServer ( out Server  server,
in int  id 
)

Retrieve a server entry (settings and status).

Parameters
serverServer settings and status
idEntry id
Returns
0 if OK
1 if the entry does not exist

◆ listServers()

map<int, Server> servermon::ServerMonitor::listServers ( )

Retrieve a list of server entries (settings and status).

Returns
Server list

◆ modifyServer()

int servermon::ServerMonitor::modifyServer ( in int  id,
in ServerSettings  settings 
)

Modify an existing server entry.

Parameters
idEntry id
settingsNew settings
Returns
0 if OK
1 if the entry does not exist
2 if the settings are invalid
3 if an entry for the given hostname exists
Note
The ServerSettings structure can be "sparse"; fields missing in the JSON representation will remain unchanged.

◆ powerControl()

int servermon::ServerMonitor::powerControl ( in int  id,
in boolean  on 
)

Control the power state of the outlets the server uses.

Attempting to switch the power off will issue a graceful shutdown of the server beforehand.

Parameters
idEntry id
onSwitch power on if true, off if false
Returns
0 if OK
1 if the entry does not exist
2 if the settings are invalid

The documentation for this interface was generated from the following file: