# MeganServer commands

All commands are prefixed by "megan6server/" (or similar prefix).

## General:

help | Get this help
about | Get version and general info
isReadOnly | At present, always true

## Files:

list | List all datasets, optional parameters: readCount=bool, matchCount=bool, metadata=bool
getAuxiliary?file=name | Get auxiliary data for file. Optional parameter: binary=bool
getNumberOfReads?file=name | Get number of reads for file
getNumberOfMatches?file=name | Get number of matches for file
getClassificationNames?file=name | Get list of all classifications for file
download?file=name | Download dataset

## Reads and matches:

getRead?file=name&readId=num | Get read and optionally all matches for given file and readId. Optional parameters: header=bool, sequence=bool, matches=bool
getReads?file=name | Get all reads for a given file; returns first page and page-id for next. Optional parameters: readIds=bool, headers=bool, sequences=bool, matches=bool
getReadsForClass?file=name&classification=name&classId=num,... | Get all reads for a given file, classification and one or more classes. Returns first page and page-id for next. Optional parameters: readIds=bool, headers=bool, sequences=bool, matches=bool
getNext?pageId=num | Get the next page of reads

## Classifications:

getClassificationBlock?file=name&classification=name | Get the classifications block for a named file and classification. Optional parameter: binary=bool
getClassSize?file=name&classification=nameclassId=num | Get the number reads for a given file, classification and classId. Optional parameter: sum=bool

## Admin:

admin/update | Update server after files have been added to root directory
admin/listUsers | List all defined users
admin/addUser?name=name&password=pwd&isAdmin=bool | Add a new user. Optional parameter: replace=bool
admin/removeUser?name=name | Remove a user
admin/addRole?user=name&role=role | Add a role to a user (UE)
admin/removeRole?user=name&role=role | Remove a role from a user (UE)
admin/getLog | Get log entries
admin/clearLog | Clear log entries