Package: austrakka
AusTrakka CLICommand line interface for AusTrakka V2.InstallationThe AusTrakka CLI requires Python to run. Installation into a conda environment (see below) is the recommended method.To install without conda, simply install withpython -m pip install austrakkaYou will need to set the environment variableAT_URIto the value provided by the AusTrakka team.
You may wish to add this to your.bashrcor.zshrcfile.To use the CLI, you must log in by setting theAT_TOKENenvironment variable using theaustrakka auth usercommand (see User Authentication, below). You may wish to configure
a login command for convenience:alias at-login="export AT_TOKEN=\$(austrakka auth user)"You may wish to add this to your.bashrcor.zshrcfile.Install into a conda environment (optional but recommended)If you wish to create a conda environment namedaustrakkawith the necessary environment
variables set and theat-loginalias, run:conda create -n austrakka python=3.9
conda activate austrakka
python -m pip install austrakka
conda env config vars set AT_URI="[value provided by AusTrakka team]"
mkdir -p ${CONDA_PREFIX}/etc/conda/activate.d
echo "alias at-login=\"export AT_TOKEN=\\\$(austrakka auth user)\"" > ${CONDA_PREFIX}/etc/conda/activate.d/austrakka-alias.shNote that the last two lines are valid only for Linux/Mac and will not work on Windows.You can then useconda activate austrakka
at-loginin order to use the CLI. SeeUser Authenticationbelow for alternative login methods.Updating the CLITo update to the latest version, runpython -m pip install --upgrade austrakkaIf you have installed the CLI into a conda environment, you should first activate it withconda activate austrakka.Running the CLIBefore you can use the CLI, you must log in as described below, to allow the CLI to use your AusTrakka credentials.
Your authorisation will expire after a period and you will need to log in again.User AuthenticationMost users will want to use the CLI this way.Set the following environment variable:export AT_TOKEN=$(austrakka auth user)If you have configured a login command as described above, you can instead runat-loginIn Windows, you can set the AT_TOKEN environment variable by first runningaustrakka auth userto obtain a token string, and then runningset AT_TOKEN=<output of previous command>to set the environment variable.For any of these methods, you should be directed to log in via a browser and enter a code to authorise the CLI.Process AuthenticationThis authentication mode is intended for long-term automated processes. Most users will not need it.To authenticate a process, you'll need to set the following environment variables:AT_AUTH_PROCESS_ID
AT_AUTH_PROCESS_SECRETValues forAT_AUTH_PROCESS_IDandAT_AUTH_PROCESS_SECRETwill be provided to you by the AusTrakka team. Note that the secret value is sensitive.Once these variables are set, run the following to authorise:export AT_TOKEN=$(austrakka auth process)Using the CLIThe CLI has a subcommand structure. Runaustrakka -hto see available subcommands.Run e.g.austrakka metadata -hto see available commands to manipulate metadata.Run e.g.austrakka metadata add -hto see the usage of themetadata addcommand to upload metadata files.Environment Variables ReferenceNameDescriptionAT_TOKENAusTrakka auth tokenAT_URIURI for API endpointAT_LOG_LEVELLevel of loggingAT_LOGSet tofileto redirecting logging to a temp fileAT_CMD_SETSet toaustrakka-adminto display admin commands (these will not actually run successfully unless you have an appropriate role on the server)AT_VERIFY_CERTVerifies the cert used by the AusTrakka backendAT_USE_HTTP2Uses HTTP2 (experimental)All commands requireAT_URIandAT_TOKENto be set, except forauthcommands.Project StructureEach logical component of the system has its own package underaustrakka/. Eg.austrakka/job.
Components that are children of another component are nested beneath. Eg.austrakka/job/instance.Each component package contains the following files:FilePurpose__init__.pyContains the Click commands offered by the component. Note that even if a component does not have any commands associated with it, this file must exist for the final build to include it.funcs.pyAny functions associated with the component.opts.pyClick command line options associated with the component. Defined here so they can be reused across the CLI. Eg.--speciesis used for multiple commands. The species CLI option is defined here and imported to all commands that use it.enums.pyAny enumerations associated with the component.