yaq/daemons/gdrive


Upload files to a specified google drive folder

bugtracker
source

installation

The gdrive daemon can be installed using the following package managers:

PyPI
conda-forge

traits

The gdrive daemon is composed of the following traits:

is-daemon

configuration

authorization_url (string) default: https://accounts.google.com/o/oauth2/v2/auth

client_id (string)

client_secret (string)

create_file_url (string) default: https://www.googleapis.com/upload/drive/v3/files

download_url (string) default: https://drive.google.com/uc?id={file_id}

enable (boolean) default: True
Disable this daemon. The kind entry-point will not attempt to start this daemon.
from is-daemon

generate_ids_url (string) default: https://www.googleapis.com/drive/v3/files/generateIds

log_level ({'name': 'level', 'symbols': ['debug', 'info', 'notice', 'warning', 'error', 'critical', 'alert', 'emergency'], 'type': 'enum'}) default: info
Set daemon log-level.
from is-daemon

log_to_file (boolean) default: False
Optionally force logging to a file.
from is-daemon

make (['null', 'string']) default: None
from is-daemon

model (['null', 'string']) default: None
from is-daemon

open_url (string) default: https://drive.google.com/open?id={file_id}

port (int)
TCP port for daemon to occupy.
from is-daemon

root_folder_id (string)

scopes (array) default: ['https://www.googleapis.com/auth/drive.file']

serial (['null', 'string']) default: None
Serial number for the particular device represented by the daemon
from is-daemon

token_url (string) default: https://www.googleapis.com/oauth2/v4/token

update_file_url (string) default: https://www.googleapis.com/upload/drive/v3/files/{file_id}

state

The gdrive daemon will provide the following state information:

access_token (['null', 'string'])

copy_queue (array)

id_mapping (map)

refresh_token (['null', 'string'])

upload_queue (array)

messages

The gdrive daemon will expose the following public messages:

busy ➜ boolean
Returns true if daemon is currently busy.
from is-daemon

create_file ➜ null
Create a new file on the remote drive
parameters:

path (string)

parent_id (['null', 'string']) default: None

id (['null', 'string']) default: None

create_folder ➜ null
Create a new folder in the remote drive
parameters:

path (string)

parent_id (['null', 'string']) default: None

id (['null', 'string']) default: None

get_config ➜ string
Full configuration for the individual daemon as defined in the TOML file. This includes defaults and shared settings not directly specified in the daemon-specific TOML table.
from is-daemon

get_config_filepath ➜ string
String representing the absolute filepath of the configuration file on the host machine.
from is-daemon

get_state ➜ string
Get version of the running daemon
from is-daemon

id ➜ {'type': 'map', 'values': ['null', 'string']}
JSON object with information to identify the daemon, including name, kind, make, model, serial.
from is-daemon

id_to_download_url ➜ string
Format an id in a url suitable to download the file.
parameters:

id (string)

id_to_open_url ➜ string
Format an id in a url suitable to open the file.
parameters:

id (string)

is_uploaded ➜ boolean
Check if a particular file has been procesed and uploaded
parameters:

id (string)

reserve_id ➜ string
Insert an id mapping into the state
parameters:

client_id (string)

drive_id (['null', 'string']) default: None
If not given use an existing id if possible or retrieve a new one.

shutdown ➜ null
Cleanly shutdown (or restart) daemon.
from is-daemon
parameters:

restart (boolean) default: False

update_file ➜ null
Update the contents of an existing file
parameters:

path (string)

id (['null', 'string']) default: None

upload_folder ➜ null
Upload a folder and its contents, recursively, to the remote drive
parameters:

path (string)

parent_id (['null', 'string']) default: None

id (['null', 'string']) default: None


built 2024-02-09 01:44:16                                      CC0: no copyright