UAPI Functions - Ftp::list_sessions

Description

This function lists the FTP server's active sessions.

Examples 


 cPanel or Webmail Session URL

https://hostname.example.com:2083/cpsess##########/execute/Ftp/list_sessions

 LiveAPI PHP Class

$cpanel new CPANEL(); // Connect to cPanel - only do this once.
  
// List current active FTP sessions.
$list_active_sessions $cpanel->uapi(
    'Ftp''list_sessions'
);

 LiveAPI Perl Module

my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
  
# List current active FTP sessions.
my $list_active_sessions $cpliveapi->uapi(
    'Ftp''list_sessions',
);

 cPanel Template Toolkit

<!-- List current active FTP sessions. -->
[% execute( 'Ftp', 'list_sessions' ); %]

 Command Line

uapi --user=username Ftp list_sessions

 

Notes:

  • You must URI-encode values.
  • username represents your account-level username.

 Output (JSON)

{
  "messages": null,
  "errors": null,
  "status": 1,
  "data": [
    {
      "pid": "6735",
      "status": "IDLE",
      "file": "",
      "user": "username@example.com",
      "cmdline": "pure-ftpd (IDLE)",
      "host": "localhost",
      "login": "Tue Apr 23 16:23:23 2013"
    }
  ],
  "metadata": {
    "transformed": 1
  }
}

 

Note:

Use cPanel's API Shell interface (Home >> Advanced >> API Shell) to directly test cPanel API calls.

 

Parameters

This function does not accept parameters.

Returns

Return

Type

Description

Possible values

Example

pid

string

The session's PID.

An integer value that represents the FTP session's process ID.

6735

status

string

The session's status.

  • IDLE — The session is connected, but idle.
  • DL — A download is in progress.
  • UL — An upload is in progress.

IDLE

file

string

The file that the session is processing.

  • A valid filename.
  • A blank value, if the session is idle.

file.txt

user

string

The FTP account username.

The username for an FTP account on the cPanel account.

ftpaccount

 cmdline 

string

Process information.

 Information about the FTP process, from the ps(process status) command. 

pure-ftpd (IDLE)

host

 string 

 The hostname that connected to the FTP server. 

A valid hostname.

localhost

login

string

The FTP session login time.

The time at which the FTP session started, in human-readable format.

 Tue Apr 23 16:23:23 2013 

 

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

The cPanel Interface

For  cPanel  &  WHM  version  58 Overview The cPanel interface is...

User Preferences

For cPanel & WHM version 58 Overview This document outlines how to access your cPanel...

Manage External Authentications

For cPanel & WHM version 58 Overview Manage credentials Additional documentation...

What is cPanelID?

In This Article:  Overview ServicesHow to get a cPanelID cPanelID External...

Guide to cPanel Interface Customization - cPanel Style Development

Introduction You can develop custom styles that modify the appearance of the cPanel interface....