Skip to content

SecureShell Server API

Version: 1.0.0

Status: ⚫⚪⚪

SecureShellServer interface for Thunder framework.

(Defined by SecureShellServer.json)

Table of Contents

Introduction

Scope

This document describes purpose and functionality of the SecureShellServer interface (version 1.0.0). It includes detailed specification about its methods provided.

Case Sensitivity

All identifiers of the interfaces described in this document are case-sensitive. Thus, unless stated otherwise, all keywords, entities, properties, relations and actions should be treated as such.

Acronyms, Abbreviations and Terms

The table below provides and overview of acronyms used in this document and their definitions.

Acronym Description
API Application Programming Interface
HTTP Hypertext Transfer Protocol
JSON JavaScript Object Notation; a data interchange format
JSON-RPC A remote procedure call protocol encoded in JSON

The table below provides and overview of terms and abbreviations used in this document and their definitions.

Term Description
callsign The name given to an instance of a plugin. One plugin can be instantiated multiple times, but each instance the instance name, callsign, must be unique.

References

Ref ID Description
HTTP HTTP specification
JSON-RPC JSON-RPC 2.0 specification
JSON JSON specification
Thunder Thunder API Reference

Description

SecureShell Server JSON-RPC interface.

Methods

The following methods are provided by the SecureShellServer interface:

SecureShellServer interface methods:

Method Description
getactivesessionscount Get count of currently active SSH client sessions maintained by SecureShell SSH Service
getactivesessionsinfo Get details of currently active SSH client sessions maintained by SecureShell SSH Service
closeclientsession Close and active SSH client session

getactivesessionscount method

Get count of currently active SSH client sessions maintained by SecureShell SSH Service.

Description

With this method SecureShell SSH service shall provide the count of active SSH client sessions.

Parameters

This method takes no parameters.

Result

Name Type M/O Description
result integer mandatory Number of client sessions count

Errors

Message Description
ERROR_GENERAL Failed to get client sessions count
ERROR_UNAVAILABLE Unknown error

Example

Request

{
  "jsonrpc": "2.0",
  "id": 42,
  "method": "<callsign>.1.getactivesessionscount"
}

Response

{
  "jsonrpc": "2.0",
  "id": 42,
  "result": 0
}

getactivesessionsinfo method

Get details of currently active SSH client sessions maintained by SecureShell SSH Service.

Description

With this method SecureShell SSH service shall provide the full details of active SSH client sessions.

Parameters

This method takes no parameters.

Result

Name Type M/O Description
result array mandatory ...
result[#] object mandatory ...
result[#].pid integer mandatory SSH client process ID
result[#].ipaddress string mandatory SSH client connected from this IP address
result[#].timestamp string mandatory SSH client connected at this timestamp

Errors

Message Description
ERROR_GENERAL Failed to get client sessions details
ERROR_UNAVAILABLE Unknown error

Example

Request

{
  "jsonrpc": "2.0",
  "id": 42,
  "method": "<callsign>.1.getactivesessionsinfo"
}

Response

{
  "jsonrpc": "2.0",
  "id": 42,
  "result": [
    {
      "pid": 268,
      "ipaddress": "192.168.33.57",
      "timestamp": "Sun Jun 30 21:49:08 2019"
    }
  ]
}

closeclientsession method

Close and active SSH client session.

Description

With this method SecureShell an active SSH client session shall be closed.

Parameters

Name Type M/O Description
params object mandatory ...
params.clientpid string mandatory SSH client process id (default: 268)

Errors

Message Description
ERROR_GENERAL Failed to close SSH client session
ERROR_UNAVAILABLE Unknown error

Example

Request

{
  "jsonrpc": "2.0",
  "id": 42,
  "method": "<callsign>.1.closeclientsession",
  "params": {
    "clientpid": "268"
  }
}

Response

{
  "jsonrpc": "2.0",
  "id": 42,
  "result": null
}