HomeGuides
Log In
Guides

SFTP Server sessions APIs - NEW 🚀

These APIs can be used to retrieve detailed information about open SFTP server sessions and to terminate a specific session currently open on the SFTP server.

They facilitate effective management of server connections and ensure control over ongoing session activities.

Monitor STENG SFTP server sessions

Endpoint: /infrastructure/clusters/server-sessions/query
Method: POST
Context: /data-one-application/api/v1
Description: To retrieve all SFTP open sessions
Parameters: Json payload. Requested body parameters:

ParameterValueDescriptionData TypeIs it required?
clusterNameName of the clusterstringYes
peerNameName of the peerstringYes
protocolProtocol typestringYes
serverNameName of the serverstringYes
maxItem100Defaul valueintegerNo
sortASCDefaul valuestringNo

Example:

curl -X 'POST' \
  'https://localhost:9443/data-one-application/api/v1/infrastructure/clusters/server-sessions/query' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer {authorization token here}' \
  -H 'Content-Type: application/json' \
  -d '
{   "clusterName": "cluster1",   "peerName": "peer1",   "protocol": "SFTP",   "serverName": "sftp-server",   "maxItem": 100,   "sort": "asc" }' 

Response:

HTTP Status codeDescription
200SUCCESS
401Not authorized (login not performed or token expired)
400Bad request, details in the error message (i.e. mandatory fields not present or with wrong values)

The response is a list of JSON objects, each representing an SFTP session.

[  
   {
        "sessionId": "",  
        "userName": "",  
        "clientIp": "",  
        "clientPort": "",  
        "clientVersion": ""
    }
]  

Example:

[
    {
        "sessionId": "B536CBB1D9D09A3586D642D792BBB98840846CAA1123AD40952739B8FD8BFA61AE6D7FE2394B825524C7B77566C2DD5C9DA956C3223B6BB09787C031E3B6E327",
        "userName": "part1",
        "clientIp": "/10.0.0.2:38666",
        "clientPort": "38666",
        "clientVersion": "SSH-2.0-FileZilla_3.58.0"
    },
    {
        "sessionId": "CE2E5639EE79A86B14CF8D8AAF3C852C8278C05AF17EADAA7F76CF1F7ECA68EBCDCA834DC1A15AA7D10AFF2BAE1084CF6856D332B632313E253AD6EEA7715FE3",
        "userName": "part1",
        "clientIp": "/10.0.0.2:41488",
        "clientPort": "41488",
        "clientVersion": "SSH-2.0-FileZilla_3.58.0"
    },
    {
        "sessionId": "DDD00B8BFE2060D9D143ED78178AFFB34BDC4ABF17D364E95553BB5550F816B85E51E3BDD2DA93C7473A42DDC11A232547F3B9FF22C5E58696BA71F8B308B027",
        "userName": "part1",
        "clientIp": "/10.0.0.2:41470",
        "clientPort": "41470",
        "clientVersion": "SSH-2.0-FileZilla_3.58.0"
    },
    {
        "sessionId": "FF48C9755158EE02E0506266ED50DBA9D7D0B2265CE239AACBF71AEF8EA9465E4DE08D073E50347D6C6D7A7643A38EC517E411FE31FD030261BED9B105349EFB",
        "userName": "part1",
        "clientIp": "/10.0.0.2:41486",
        "clientPort": "41486",
        "clientVersion": "SSH-2.0-FileZilla_3.58.0"
    }
]
 

Terminate STENG SFTP server sessions

Endpoint: /infrastructure/clusters/server-sessions
Method: DELETE
Context: /data-one-application/api/v1
Description: To kill a specific SFTP session by sessionId
Parameters: Json payload. Requested body parameters:

ParameterDescriptionData TypeIs it required?
clusterNameName of the clusterstringYes
peerNameName of the peerstringYes
protocolProtocol type. Use SFTPstringYes
serverNameName of the serverstringYes
sessionIdID of the SFTP server sessionstringYes

Example:

curl -X 'DELETE' \ 'https://localhost:9443/data-one-application/api/v1/infrastructure/clusters/server-sessions' \ 
-H 'accept: */*' \ 
-H 'Authorization: Bearer {authorization token here}' \ 
-H 'Content-Type: application/json' \ 
-d '{  "clusterName": "cluster1",  "peerName": "peer1",  "protocol": "sftp",  "serverName": "sftp-server",  "sessionId": "17B63E2D99659D7B806BC47B866EBDC0F16FDAFE21AF072563EBBB07C0E267AD54D253AAE5F2A49F3D779D0F254630F15030F5D3235A3EF2C45B23C8A7ABEE5E"}'

Response:

HTTP Status codeDescription
200SUCCESS
401Not authorized (login not performed or token expired)
400Bad request, details in the error message (i.e. mandatory fields not present or with wrong values)

The response is a list of JSON objects, with the sessionID.

Example:

{
    "sessionId": "17B63E2D99659D7B806BC47B866EBDC0F16FDAFE21AF072563EBBB07C0E267AD54D253AAE5F2A49F3D779D0F254630F15030F5D3235A3EF2C45B23C8A7ABEE5E",
    "userName": "",
    "clientIp": "",
    "clientPort": "",
    "clientVersion": ""

}