Package: transfer-client
# Transfer clientThis package provides functions for communication with the Restful TransferServer.## InstallationVia [pypi](https://pypi.python.org/pypi/transfer-client):pip install transfer_clientFrom source:git clone https://git.lumc.nl/apis/transfer_client.gitcd transfer_clientpip install .### Server certificateIf the server uses a self-signed certificate, the administrator of the serverneeds to add this certificate to the list of trusted authorities (change`server_name` and `domain`):openssl s_client -connect server_name.domain:443 < /dev/null | \openssl x509 > /usr/local/share/ca-certificates/server_name.crtupdate-ca-certificates## ConfigurationThe client creates a configuration file named`.config/transfer_client/config.yml`. The `config` subcommand is used tomanipulate this file.In the following example, we set the server to `server_name.domain`, add aproject named `test` and set this project as the default project.transfer_client config set server server_name.domaintransfer_client config add test "This is a placeholder."transfer_client config set project testBy default, JSON is used as output format, but YAML is supported as well.transfer_client config set output_format yamlIf the server certificate can not be installed, it might be convenient todisable the SSL certificate check by default.transfer_client config set ssl_check falseList of all configuration variables:transfer_client config defaultsList all projects:transfer_client config projects## Command line interfaceUse the command `transfer_client -h` for a list of subcommands. For everysubcommand a separate help is available, e.g.,```$ transfer_client users -husage: transfer_client users [-h] [-o OUTPUT] SERVER USERGives a JSON object of a user together with its transfers.positional arguments:SERVER      server nameUSER        user idoptional arguments:-h, --help  show this help message and exit-o OUTPUT   output file-n          disable ssl certificate check```### Typical usageThe following high level subcommands are probably the only ones needed.To transfer a list of files, use the `transfer` subcommand. We assume that theserver name is `server_name.domain` and the user ID is `xxxxxxxx`.transfer_client transfer server_name.domain xxxxxxxx *.gzA directory including its subdirectories can be transferred as a gzippedtarfile in chunks of 10G with the `transfer_dir` command. The receiver will seethese chunks as files, together with a `README.md` containing unpackinginstructions.transfer_client transfer_dir server_name.domain xxxxxxxx directoryAny (possibly required) additional metadata can be passed to these functionsvia the `-a` parameter.transfer_client transfer -a other.json server_name.domain xxxxxxxx *.gzIf a transfer is interrupted for some reason, it can be resumed with the`resume` subcommand.transfer_client resume server_name.domain xxxxxxxxTo cancel an interrupted transfer, the `cancel` subcommand can be used.transfer_client cancel server_name.domain xxxxxxxx### Other JSON schemasThe client assumes the minimal JSON schema can be used. If this is not thecase, the metadata needs to be generated beforehand. This metadata is used in aseparate step to initiate the transfer with the `transfers` subcommand.tranfer_client transfers server_name.domain xxxxxxxx meta.jsonNow the `resume` command can be used to upload the data.transfer_client resume server_name.domain xxxxxxxx## LibraryThe library implements an interface to the API of the Restful Transfer server.Full documentation can be found [here](https://git.lumc.nl/j.k.vis/transfer).### UsageTo use the interface, we first make a class instance of `TransferClient`, thenwe can use the API endpoints.```python>>> from transfer_client import TransferClient>>>>>> # Create a class instance for a server running on server_name.domain.>>> tc = TransferClient('server_name.domain')>>>>>> # Get user information together with its transfers.>>> tc.users('xxxxxxxx'){ ... }```