AMQP messages/structures

This module contains all communication structures used in AMQP communication.

Classes from Requests are used to manipulate FTP users.

Requests

User management requests

../_images/user_management.png
class ftp.structures.AddUser[source]

Add new user to the ProFTPD server.

Parameters:
  • username (str) – Alloed characters: a-zA-Z0-9._-.
  • password (str) – Password for the new user. Only hash is stored.
class ftp.structures.RemoveUser[source]

Remove user from the ProFTPD server.

Parameters:username (str) – Alloed characters: a-zA-Z0-9._-.
class ftp.structures.ChangePassword[source]

Change password for the user.

Parameters:
  • username (str) – Alloed characters: a-zA-Z0-9._-.
  • new_password (str) – New password for user.

User requests

../_images/list_registered_users.png
class ftp.structures.ListRegisteredUsers[source]

List all registered users.

See also

Userlist.

Settings management

../_images/set_get_settings.png
class ftp.structures.SetUserSettings[source]

Set settings for the user. UserSettings is returned as response.

See also

UserSettings.

CREATE_IMPORT_LOG

Alias for field number 4

ISBN_PAIRING

Alias for field number 3

LEAVE_BAD_FILES

Alias for field number 5

SAME_DIR_PAIRING

Alias for field number 2

SAME_NAME_DIR_PAIRING

Alias for field number 1

username

Alias for field number 0

class ftp.structures.GetUserSettings[source]

Get settings for given username.

UserSettings is returned as response.

See also

UserSettings.

Responses

class ftp.structures.Userlist[source]

Response containing names of all users.

users

list

List of registered users.

class ftp.structures.UserSettings[source]

All user settings, that user can set himself.

CREATE_IMPORT_LOG

Alias for field number 4

ISBN_PAIRING

Alias for field number 3

LEAVE_BAD_FILES

Alias for field number 5

SAME_DIR_PAIRING

Alias for field number 2

SAME_NAME_DIR_PAIRING

Alias for field number 1

username

Alias for field number 0

Import request

Import request are sent by monitor itself, without need of programmer interaction.

../_images/importrequest.png
class ftp.structures.ImportRequest[source]

User’s import request - mix of files, metadata and metadata-files pairs.

This request is sent asynchronously when user triggers the upload request.

username

str

Name of the user who sent an import request.

requests

list

List of MetadataFile/EbookFile/ DataPair objects.

import_log

str

Protocol about import.

error_log

str

Protocol about errors.

File structures

Following structures may be present in ImportRequest.requests.

class ftp.structures.MetadataFile[source]

Structure used to represent Metadata files.

filename

str

Name of the parsed file.

raw_data

str

Content of the parsed file.

parsed_data

EPublication

EPublication structure.

class ftp.structures.EbookFile[source]

Structure used to represent data (ebook) files.

filename

str

Path to the ebook file.

raw_data

str

Content of the file.

class ftp.structures.DataPair[source]

Structure used to repesent MetadataFile - EbookFile pairs.

metadata_file

MetadataFile

Metadata.

ebook_file

EbookFile

Data.