Commands in Lily consist of the following fields (see the protocol):
Name | Description | Type |
---|---|---|
Auth | The authentication data. | security.auth.Auth |
Command ID | The command ID. | string |
Arguments | The command arguments. | Any |
Chunks | The chunk data. | Chunks |
Lily commands accept two types of authentication: user and session. User authentication takes a username and password, while session authentication takes a username and session ID. Most commands allow both session and user authentication, however, some commands require only a certain type. For example, login commands require user authentication as they need a username and password.
Responses consist of the following fields:
Name | Description | Type |
---|---|---|
Chunks | The chunk data. | Chunks |
Response Code | The response code. | int |
Response String | A string containing the response message, if necessary. | string |
Data | The response data. | Any |
Ping the server. This command does not require authentication, and clients may provide an empty user authentication object.
Parameters: None
Chunk Arguments: None
Returns: None
Chunk Returns: None
Get basic server information. This command does not require authentication, and clients may provide an empty user authentication object.
Parameters: None
Chunk Arguments: None
Returns:
name
(typestring
)The name of the server.
version
(typestring
)The server version.
drives
(type[]string
)A list of the drives on the server.
defaultSessionExpiration
(typetime.Duration
)The default session expiration time.
allowChangeSessionExpiration
(typebool
)If clients are allowed to modify or specify the expiration time.
allowNonExpiringSessions
(typebool
)If the server allows clients to specify a never-expiring session.
timeout
(typetime.Duration
)The timeout duration for receiving requests.
limit
(typetime.Duration
)The rate limit interval.
maxLimitEvents
(typeint
)The maximum number of events per limit interval.
Chunk Returns: None
Login to the server. This command, if successful, will create a session and return the resultant session ID. This command requires user authentication.
Parameters:
sessionExpiration
(typetime.Duration
)If the server allows clients to specify the expiration time, this argument will specify the expiration time. If the server does not allow clients to set the expiration time, this argument does nothing. If the server allows never-expiring sessions and the value for the session expiration time is 0, the session will never expire. Returns an error if the session expiration time is 0 and the server does not allow it.
Log out of the server. This command, if successful, will remove the associated session. This command requires session authentication.
Parameters: None
Chunk Arguments: None
Returns: None
Chunk Returns: None
These following commands all require administrator privileges to execute.
Get a list of all users.
Parameters: None
Chunk Arguments: None
Returns:
users
(type[]string
)The list of users.
Chunk Returns: None
Get information about users, given a list of users. Returns the user's name, clearance level, and bcrypt password hash as a UserInfo object. If a given user does not exist, the command returns an error.
Parameters:
users
(type[]string
)The list of users.
Chunk Arguments: None
Returns:
info
(type[]UserInfo
)The list of user information.
Chunk Returns: None
Set users' clearance level, given a list of users. If a given user does not exist, it returns an error. If the lengths of the two parameters are not the same, it returns an error.
Parameters:
users
(type[]string
)The list of users to modify.
clearances
(type[]int
)The list of new clearance levels.
Chunk Arguments: None
Returns: None
Chunk Returns: None
Set users' password, given a list of users. If a given user does not exist, it returns an error. If the lengths of the two parameters are not the same, it returns an error.
Parameters:
users
(type[]string
)The list of users to modify.
passwords
(type[]string
)The list of new passwords.
Chunk Arguments: None
Returns: None
Chunk Returns: None
Create users, given a list of users, passwords, and clearance levels. If a given user already exists, it returns an error. If the lengths of the three parameters are not the same, it returns an error.
Parameters:
users
(type[]string
)The list of users to create.
passwords
(type[]string
)The list of passwords for the new users.
clearances
(type[]int
)The list of clearance levels for the new users.
Chunk Arguments: None
Returns: None
Chunk Returns: None
Delete users, given a list of users. If a given user does not exist, it returns an error.
Parameters:
users
(type[]string
)The list of users to delete.
Chunk Arguments: None
Returns: None
Chunk Returns: None
Get a list of all sessions active on the server, returning their IDs.
Parameters: None
Chunk Arguments: None
Returns:
ids
(type[]uuid.UUID
)The list of session IDs.
Chunk Returns: None
Get a list of all sessions for a specific user, returning their IDs.
Parameters:
user
(typestring
)The user to get.
Chunk Arguments: None
Returns:
ids
(type[]uuid.UUID
)The list of session IDs.
Chunk Returns: None
Get information about sessions, given a list of session IDs. Returns the session's ID, username, next expiration time, and default expiration time as a SessionInfo object. If a given session ID does not exist, it returns an error.
Parameters:
ids
(type[]uuid.UUID
)The list of session IDs.
Chunk Arguments: None
Returns:
sessions
(type[]SessionInfo
)The list of session information.
Chunk Returns: None
Expire all expired sessions on the server.
Parameters: None
Chunk Arguments: None
Returns: None
Chunk Returns: None
Expire sessions, given a list of session IDs. If a given session ID does not exist, it returns an error.
Parameters:
ids
(type[]uuid.UUID
)The list of session IDs.
Chunk Arguments: None
Returns: None
Chunk Returns: None
Get all the Lily server settings.
Parameters: None
Chunk Arguments: None
Returns:
host
(typestring
)The host string.
port
(typeint
)The port.
drives
(type[]string
)A list of drives.
driveFiles
(typemap[string]string
)A map of drive names and drive files.
numWorkers
(typeint
)The number of server workers.
mainCronInterval
(typetime.Duration
)The main cron interval duration.
sessionCronInterval
(typetime.Duration
)The session expiration cron interval duration.
networkTimeout
(typetime.Duration
)The network timeout duration.
verbose
(typebool
)If the server is verbose.
logToFile
(typebool
)If the server should log to a file.
logJSON
(typebool
)If the server should log JSON output.
logLevel
(typestring
)The threshold logging level to log.
logFile
(typestring
)The path to the log file. If the server does not log to a file, this is empty.
limit
(typetime.Duration
)The rate limit interval.
maxLimitEvents
(typeint
)The maximum number of events per limit interval.
Chunk Returns: None
Set the Lily server host and port. This WILL NOT update the active server, but will update after the server is restarted.
Parameters:
host
(typestring
)The new host.
port
(typeint
)The new port.
Chunk Arguments: None
Returns: None
Chunk Returns: None
Add a drive to the Lily server. Accepts a drive name and absolute drive file path. If the drive is invalid, this returns an error. If the path is not absolute, this returns an error.
Parameters:
name
(typestring
)The new drive name.
path
(typestring
)The drive file path.
Chunk Arguments: None
Returns: None
Chunk Returns: None
Rename a drive on the Lily server. If the new name is taken or invalid, this returns an error.
Parameters:
drive
(typestring
)The drive to rename.
newName
(typestring
)The new drive name.
Chunk Arguments: None
Returns: None
Chunk Returns: None
Remove a drive on the Lily server. Accepts a drive name. If the drive name is invalid, this returns an error. This DOES NOT remove the drive or drive file from the host filesystem, instead, it removes the drive from the server.
Parameters:
drive
(typestring
)The drive to remove.
Chunk Arguments: None
Returns: None
Chunk Returns: None
Set the number of workers. This does not update the server. If the number of workers is invalid, this returns an error.
Parameters:
numWorkers
(typeint
)
Chunk Arguments: None
Returns: None
Chunk Returns: None
Set the cron intervals (main and session).
Parameters:
mainInterval
(typetime.Duration
)The main interval.
sessionInterval
(typetime.Duration
)The session interval.
Chunk Arguments: None
Returns: None
Chunk Returns: None
Set the timeout interval. If the interval time is invalid, this returns an error.
Parameters:
timeout
(typetime.Duration
)The timeout interval.
Chunk Arguments: None
Returns: None
Chunk Returns: None
Set the logging settings. This WILL NOT update the active server, but will update after the server is restarted. If log level is invalid, this returns an error.
Parameters:
verbose
(typebool
)If the server should log.
logToFile
(typebool
)If the server should log to a file.
logJSON
(typebool
)If the server should log JSON.
logLevel
(typestring
)The threshold logging level. Should be
debug
,info
,warning
, orfatal
.
logPath
(typestring
)The path for the file to log to. If the server does not log to a file, this should be an empty string.
Chunk Arguments: None
Returns: None
Chunk Returns: None
Set the rate limit. This WILL NOT update the active server, but will update after the server is restarted.
Parameters:
limit
(typetime.Duration
)The new rate limit interval.
maxLimitEvents
(typeint
)The max number of events per interval.
Chunk Arguments: None
Returns: None
Chunk Returns: None
Shutdown the Lily server and save.
Parameters: None
Chunk Arguments: None
Returns: None
Chunk Returns: None
Get memory usage stats.
Parameters: None
Chunk Arguments: None
Returns:
alloc
(typeint64
)Total bytes of allocated heap objects.
total
(typeint64
)Total cumulative bytes allocated for heap objects. Does not decrease as objects are freed.
sys
(typeint64
)Total bytes of memory obtained from the OS.
Chunk Returns: None
Set the password for the currently logged in user. Requires user or session authentication.
Parameters:
password
(typestring
)The new password.
Chunk Arguments: None
Returns: None
Chunk Returns: None
Reauthenticate the session. This will update the expiration. This command requires session authentication. If the authentication is invalid, this will return an error.
Parameters: None
Chunk Arguments: None
Returns: None
Chunk Returns: None
Set the expiration time for the session. If the server does not allow setting the expiration time, this command does not return an error, and instead does nothing.
Parameters:
sessionExpiration
(typetime.Duration
)The new expiration time.
Chunk Arguments: None
Returns: None
Chunk Returns: None
Create directories. Requires drive modify clearance.
Parameters:
drive
(typestring
)The name of the drive.
paths
(type[]string
)The directories to create.
settings
(type[]BSONAccessSettings
)Optional. The settings for the paths.
Chunk Arguments: None
Returns: None
Chunk Returns: None
Create a directory tree. Requires drive modify clearance.
Parameters:
drive
(typestring
)The name of the drive.
parent
(typestring
)The parent directory.
paths
(type[]string
)The directories to create. Must be in the parent directory.
parentSettings
(typeBSONAccessSettings
)Optional. The settings for the parent.
settings
(type[]BSONAccessSettings
)Optional. The settings for the paths.
Chunk Arguments: None
Returns: None
Chunk Returns: None
List the contents of a directory.
Parameters:
drive
(typestring
)The name of the drive.
path
(typestring
)The path.
Chunk Arguments: None
Returns:
list
(typemap[string]PathStatus
)The contents of the directory.
Chunk Returns: None
Rename directories within their respective directories.
Parameters:
drive
(typestring
)The name of the drive.
paths
(type[]string
)The paths to rename.
newNames
(type[]string
)The new names for the paths.
Chunk Arguments: None
Returns: None
Chunk Returns: None
Move directories throughout the drive.
Parameters:
drive
(typestring
)The name of the drive.
paths
(type[]string
)The paths to move.
dests
(type[]string
)The new destinations.
Chunk Arguments: None
Returns: None
Chunk Returns: None
Delete directories.
Parameters:
drive
(typestring
)The name of the drive.
paths
(type[]string
)The paths to delete.
Chunk Arguments: None
Returns: None
Chunk Returns: None
Create files. Requires drive modify clearance.
Parameters:
drive
(typestring
)The name of the drive.
paths
(type[]string
)The files to create.
settings
(type[]BSONAccessSettings
)Optional. The settings for the paths.
Chunk Arguments: None
Returns: None
Chunk Returns: None
Read files. Requires access clearance.
Parameters:
drive
(typestring
)The name of the drive.
paths
(type[]string
)The files to read.
Chunk Arguments: None
Returns: None
Chunk Returns: Chunked files.
Write files. Requires modify clearance.
Parameters:
drive
(typestring
)The name of the drive.
paths
(type[]string
)The files to write.
Chunk Arguments: Chunked files.
Returns: None
Chunk Returns: None
Rename files. Requires modify clearance.
Parameters:
drive
(typestring
)The name of the drive.
paths
(type[]string
)The files to rename.
newNames
(type[]string
)The new names.
Chunk Arguments: None
Returns: None
Chunk Returns: None
Move files. Requires modify clearance.
Parameters:
drive
(typestring
)The name of the drive.
paths
(type[]string
)The files to move.
dests
(type[]string
)The destinations.
Chunk Arguments: None
Returns: None
Chunk Returns: None
Delete files. Requires modify clearance.
Parameters:
drive
(typestring
)The name of the drive.
paths
(type[]string
)The files to delete.
Chunk Arguments: None
Returns: None
Chunk Returns: None
Status command. Does not require access clearance.
Parameters:
drive
(typestring
)The name of the drive.
paths
(type[]string
)The files to get the status of.
Chunk Arguments: None
Returns:
stat
(typemap[string]PathInfo
)The statuses of the paths.
Chunk Returns: None
Rehash files. Require modify clearance.
Parameters:
drive
(typestring
)The name of the drive.
paths
(type[]string
)The files to rehash.
Chunk Arguments: None
Returns: None
Chunk Returns: None
Verify hashes for files. Require access clearance.
Parameters:
drive
(typestring
)The name of the drive.
paths
(type[]string
)The files to verify.
Chunk Arguments: None
Returns:
results
(typemap[string]bool
)The hash results.
Chunk Returns: None
Get a path's settings. Requires access clearance. If the path does not exist, this returns an error.
Parameters:
drive
(typestring
)The name of the drive.
path
(typestring
)The path.
Chunk Arguments: None
Returns:
settings
(typeBSONAccessSettings
)The access settings.
Chunk Returns: None
Set the path's access settings. Requires modify clearance.
Parameters:
settings
(typeBSONAccessSettings
)The new access settings.
Chunk Arguments: None
Returns: None
Chunk Returns: None
Set the access and modify clearances for a path. Requires modify clearance. If the clearances are invalid, this returns an error.
Parameters:
drive
(typestring
)The name of the drive.
path
(typestring
)The path.
access
(typeint
)The new access clearance.
modify
(typeint
)The new modify clearance.
Chunk Arguments: None
Returns: None
Chunk Returns: None
Add users to a path's access whitelist. Requires modify clearance. If a given username already exists, it will be skipped.
Parameters:
drive
(typestring
)The name of the drive.
path
(typestring
)The path.
users
(type[]string
)The usernames to add.
Chunk Arguments: None
Returns: None
Chunk Returns: None
Remove users from a path's access whitelist. Requires modify clearance. If a given username does not exist, this returns an error.
Parameters:
drive
(typestring
)The name of the drive.
path
(typestring
)The path.
users
(type[]string
)The usernames to remove.
Chunk Arguments: None
Returns: None
Chunk Returns: None
Add users to a path's access blacklist. Requires modify clearance. If a given username already exists, it will be skipped.
Parameters:
drive
(typestring
)The name of the drive.
path
(typestring
)The path.
users
(type[]string
)The usernames to add.
Chunk Arguments: None
Returns: None
Chunk Returns: None
Remove users from a path's access blacklist. Requires modify clearance. If a given username does not exist, this returns an error.
Parameters:
drive
(typestring
)The name of the drive.
path
(typestring
)The path.
users
(type[]string
)The usernames to remove.
Chunk Arguments: None
Returns: None
Chunk Returns: None
Add users to a path's modify whitelist. Requires modify clearance. If a given username already exists, it will be skipped.
Parameters:
drive
(typestring
)The name of the drive.
path
(typestring
)The path.
users
(type[]string
)The usernames to add.
Chunk Arguments: None
Returns: None
Chunk Returns: None
Remove users from a path's modify whitelist. Requires modify clearance. If a given username does not exist, this returns an error.
Parameters:
drive
(typestring
)The name of the drive.
path
(typestring
)The path.
users
(type[]string
)The usernames to remove.
Chunk Arguments: None
Returns: None
Chunk Returns: None
Add users to a path's modify blacklist. Requires modify clearance. If a given username already exists, it will be skipped.
Parameters:
drive
(typestring
)The name of the drive.
path
(typestring
)The path.
users
(type[]string
)The usernames to add.
Chunk Arguments: None
Returns: None
Chunk Returns: None
Remove users from a path's modify blacklist. Requires modify clearance. If a given username does not exist, this returns an error.
Parameters:
drive
(typestring
)The name of the drive.
path
(typestring
)The path.
users
(type[]string
)The usernames to remove.
Chunk Arguments: None
Returns: None
Chunk Returns: None