########################################################################## # Category/actions/arguments file # # # Except for general_arguments, this file contains 3 levels # as in this sample command line: # # yunohost monitor info --cpu --ram # ^ ^ ^ ^ # (script) | category | action | parameters # # # Above example will lead to the function 'monitor_info(args)' # in the file 'yunohost_monitor.py' with 'cpu' and 'ram' # stored in an 'args' dictionnary. # # Usage: # You can add a category at the first level, action at the second one, # and arguments at the third one. # If a connexion is needed for the action, don't forget to add it to # the action parameters (ldap, repo, dns or firewall). # # Documentation: # You can see all arguments settings at the argparse documentation: # http://docs.python.org/dev/library/argparse.html # #argparse.ArgumentParser.add_argument # # Don't forget to turn argument yaml style (setting: value) # ########################################################################## ############################# # General args # ############################# general_arguments: -v: full: --version help: Display YunoHost version action: version version: YunoHost 2.0 beta1 ############################# # User # ############################# user: category_help: Manage users actions: ### user_list() list: action_help: List users arguments: --fields: help: fields to fetch nargs: "+" -f: full: --filter help: LDAP filter used to search -l: full: --limit help: Maximum number of user fetched -o: full: --offset help: Starting number for user fetching ### user_create() create: action_help: Create user arguments: -u: full: --username help: Must be unique ask: "Username" pattern: '^[a-z0-9_]+$' -f: full: --firstname ask: "Firstname" -l: full: --lastname ask: "Lastname" -m: full: --mail help: Main mail address must be unique ask: "Mail address" pattern: '^[\w.-]+@[\w.-]+\.[a-zA-Z]{2,6}$' -p: full: --password ask: "User password" password: yes ### user_delete() delete: action_help: Delete user arguments: -u: full: --users help: Username of users to delete ask: "Users to delete" pattern: '^[a-z0-9_]+$' nargs: "*" --purge: action: store_true ### user_update() update: action_help: Update user informations arguments: username: help: Username of user to update -f: full: --firstname -l: full: --lastname -m: full: --mail -p: full: --change-password help: New password to set metavar: PASSWORD --add-mailforward: help: Mailforward addresses to add nargs: "+" metavar: MAIL --remove-mailforward: help: Mailforward addresses to remove nargs: "+" metavar: MAIL --add-mailalias: help: Mail aliases to add nargs: "+" metavar: MAIL --remove-mailalias: help: Mail aliases to remove nargs: "+" metavar: MAIL ### user_info() info: action_help: Get user informations arguments: user-or-mail: help: Username or mail to get informations ############################# # Domain # ############################# domain: category_help: Manage domains actions: ### domain_list() list: action_help: List domains arguments: -f: full: --filter help: LDAP filter used to search -l: full: --limit help: Maximum number of domain fetched -o: full: --offset help: Starting number for domain fetching ### domain_add() add: action_help: Create a custom domain arguments: domains: help: Domain name to add nargs: '*' ask: "New domain" pattern: '^([a-zA-Z0-9]{1}([a-zA-Z0-9\-]*[a-zA-Z0-9])*)(\.[a-zA-Z0-9]{1}([a-zA-Z0-9\-]*[a-zA-Z0-9])*)*(\.[a-zA-Z]{1}([a-zA-Z0-9\-]*[a-zA-Z0-9])*)$' ### domain_remove() remove: action_help: Delete domains arguments: domains: help: Domain(s) to delete nargs: "*" ask: "Domain to remove" pattern: '^([a-zA-Z0-9]{1}([a-zA-Z0-9\-]*[a-zA-Z0-9])*)(\.[a-zA-Z0-9]{1}([a-zA-Z0-9\-]*[a-zA-Z0-9])*)*(\.[a-zA-Z]{1}([a-zA-Z0-9\-]*[a-zA-Z0-9])*)$' ### domain_info() info: action_help: Get domain informations arguments: domain: help: "" pattern: '^([a-zA-Z0-9]{1}([a-zA-Z0-9\-]*[a-zA-Z0-9])*)(\.[a-zA-Z0-9]{1}([a-zA-Z0-9\-]*[a-zA-Z0-9])*)*(\.[a-zA-Z]{1}([a-zA-Z0-9\-]*[a-zA-Z0-9])*)$' ### domain_renewcert() renewcert: action_help: Renew domain certificate arguments: domain: help: "" pattern: '^([a-zA-Z0-9]{1}([a-zA-Z0-9\-]*[a-zA-Z0-9])*)(\.[a-zA-Z0-9]{1}([a-zA-Z0-9\-]*[a-zA-Z0-9])*)*(\.[a-zA-Z]{1}([a-zA-Z0-9\-]*[a-zA-Z0-9])*)$' ############################# # App # ############################# app: category_help: Manage apps actions: ### app_updatelist() updatelist: action_help: Fetch application list from app server arguments: -u: full: --url help: URL of remote JSON list (default http://fapp.yunohost.org/app/list/raw) ### app_list() list: action_help: List apps arguments: --fields: help: fields to fetch nargs: "+" -f: full: --filter help: LDAP filter used to search -l: full: --limit help: Maximum number of app fetched -o: full: --offset help: Starting number for app fetching ### app_install() TODO: Write help install: action_help: Install apps arguments: app: help: App to install -d: full: --domain -p: full: --path -l: full: --label --public: action: store_true --protected: action: store_true ### app_remove() TODO: Write help remove: action_help: Remove app arguments: app: help: App(s) to delete nargs: "+" ### app_upgrade() upgrade: action_help: Upgrade app arguments: app: help: App(s) to upgrade (default all) nargs: "*" ### app_info() TODO: Write help info: action_help: Get app informations arguments: app: help: "" ### app_addaccess() TODO: Write help addaccess: action_help: Grant access right to users (everyone by default) arguments: app: nargs: "+" -u: full: --user nargs: "+" ### app_removeaccess() TODO: Write help removeaccess: action_help: Revoke access right to users (everyone by default) arguments: app: nargs: "+" -u: full: --user nargs: "+" ############################# # Repository # ############################# repo: category_help: Manage app repositories actions: ### repo_list() list: action_help: List repositories arguments: -f: full: --filter help: LDAP filter used to search -l: full: --limit help: Maximum number of repository fetched -o: full: --offset help: Starting number for repository fetching ### repo_add() add: action_help: Add app repository arguments: url: help: URL of the repository -n: full: --name help: Unique name of the repository ### repo_remove() remove: action_help: Remove repository arguments: repo: help: Name or URL of the repository ### repo_update() update: action_help: Update app list from the repositories ############################# # Monitor # ############################# monitor: category_help: Monitoring functions actions: ### monitor_info() info: action_help: Check System arguments: -m: full: --memory help: Check Memory action: store_true -c: full: --cpu help: Check CPU action: store_true -d: full: --disk help: Check Disk action: store_true -i: full: --ifconfig help: Show Ip and MAC Adress action: store_true -u: full: --uptime help: Show Uptime action: store_true -p: full: --public help: Show IP public action: store_true process: action_help: Check Process arguments: -e: full: --enable help: Enable process metavar: PROCESS -d: full: --disable help: Disable process metavar: PROCESS --start: help: Start process metavar: PROCESS --stop: help: Stop process metavar: PROCESS -c: full: --check help: Check process metavar: PORT -i: full: --info help: Process info action: store_true ############################# # Firewall # ############################# firewall: category_help: Manage firewall rules actions: ### firewall_list() list: action_help: List all firewall rules ### firewall_allow() allow: action_help: Allow connection port/protocol arguments: port: help: Port to open protocol: help: Protocol associated with port choices: - UDP - TCP - Both name: help: Reference name of the rule ### firewall_disallow() disallow: action_help: Disallow connection arguments: name: help: Reference name of the rule to delete ############################# # Tools # ############################# tools: category_help: Specific tools actions: ### tools_ldapinit() ldapinit: action_help: YunoHost LDAP initialization arguments: -d: full: --domain help: YunoHost main domain pattern: '^([a-zA-Z0-9]{1}([a-zA-Z0-9\-]*[a-zA-Z0-9])*)(\.[a-zA-Z0-9]{1}([a-zA-Z0-9\-]*[a-zA-Z0-9])*)*(\.[a-zA-Z]{1}([a-zA-Z0-9\-]*[a-zA-Z0-9])*)$' ### tools_adminpw() adminpw: action_help: Change admin password arguments: -o: full: --old-password ask: "Actual admin password" password: yes -n: full: --new-password ask: "New admin password" password: yes ### tools_maindomain() maindomain: action_help: Main domain change tool arguments: -o: full: --old-domain pattern: '^([a-zA-Z0-9]{1}([a-zA-Z0-9\-]*[a-zA-Z0-9])*)(\.[a-zA-Z0-9]{1}([a-zA-Z0-9\-]*[a-zA-Z0-9])*)*(\.[a-zA-Z]{1}([a-zA-Z0-9\-]*[a-zA-Z0-9])*)$' -n: full: --new-domain ask: "New main domain" pattern: '^([a-zA-Z0-9]{1}([a-zA-Z0-9\-]*[a-zA-Z0-9])*)(\.[a-zA-Z0-9]{1}([a-zA-Z0-9\-]*[a-zA-Z0-9])*)*(\.[a-zA-Z]{1}([a-zA-Z0-9\-]*[a-zA-Z0-9])*)$' ### tools_postinstall() postinstall: action_help: YunoHost post-install arguments: -d: full: --domain help: YunoHost main domain ask: "Main domain" pattern: '^([a-zA-Z0-9]{1}([a-zA-Z0-9\-]*[a-zA-Z0-9])*)(\.[a-zA-Z0-9]{1}([a-zA-Z0-9\-]*[a-zA-Z0-9])*)*(\.[a-zA-Z]{1}([a-zA-Z0-9\-]*[a-zA-Z0-9])*)$' -p: full: --password help: YunoHost admin password ask: "New admin password" password: yes