pyunraid.models package

Submodules

pyunraid.models.container module

class pyunraid.models.container.Container

Bases: pyunraid.models.model.Model

Represents a Docker container on the Unraid server.

Variables
  • name – Container name

  • id – Container image ID

  • image – Container image (e.g. simsemand/chronos)

  • dockerhub_url – Dockerhub URL to image

  • state – Container state (running, stopped)

  • update_status – Whether container has any updates available

  • tag – The image tag installed (e.g. latest)

  • network – Container network (e.g. br0)

  • port_mappings – Array of port mappings (e.g. [[‘5050’, ‘5000’],

[‘80’, ‘81’]]) :ivar path_mappings: Array of path mappings (e.g. [[‘/chronos’, ‘/mnt/user/appdata/chronos’]]) :ivar startup_delay: Startup delay for the container :ivar uptime: Uptime in hours :ivar age: Age in hours

action(action)

Send action to Unraid for specific container.

Params action

Action to send (e.g. start, restart, stop)

disable_autostart()

Disables autostart.

enable_autostart()

Enables autostart.

remove(remove_image=False)

Removes container from Unraid.

Parameters

remove_image – Whether to also remove Docker image or leave it orphaned.

restart()

Restarts the Docker container.

start()

Starts the Docker container.

stop()

Stops the Docker container.

pyunraid.models.disk module

class pyunraid.models.disk.Disk

Bases: pyunraid.models.model.Model

The Disk class represents a harddrive, SSD or flash drive connected to the Unraid server

Variables
  • disk_type – Whether disk is HDD, SSD or USB

  • status – The status of the disk (active, inactive, emulated, disabled,

new, empty) :ivar name: The name of the disk :ivar type: The array the disk is in (array, cache or boot) :ivar identification: The identification string for the disk, usually includes the serial number :ivar mount: The UNIX mount (e.g. /dev/sdc) :ivar size: The size in bytes :ivar temperature: The temperature in Celsius :ivar current_read_speed: The current read speed in bytes per second :ivar current_read_count: The current read count :ivar current_write_speed: The current write speed in bytes per second :ivar current_write_count: The current write count :ivar errors: Read/write errors :ivar filesystem: The filesystem used (e.g. xfs, btrfs) :ivar space_used: Space used in bytes :ivar space_available: Space available in bytes

pyunraid.models.notification module

class pyunraid.models.notification.Notification

Bases: pyunraid.models.model.Model

The Notification class represents a notification on the Unraid server

Variables
  • timestamp – The timestamp of the notification (e.g. 19-10-2019 00:26)

  • event – The event

  • subject – The subject

  • description – The description

  • importance – Importance of the notification

  • file – File that emitted the notification

dismiss()

Dismiss the notification.

Returns

void

pyunraid.models.plugin module

class pyunraid.models.plugin.Plugin

Bases: pyunraid.models.model.Model

The Plugin class represents a plugin on the Unraid server

Variables
  • name – The name of the plugin

  • description – Description of the plugin

  • author – Plugin author

  • image – The image/icon of the plugin

  • support_thread – The support thread for the plugin

  • update_status – Whether there is an update or not

  • version – The installed version of the plugin

pyunraid.models.setting module

class pyunraid.models.setting.Setting

Bases: object

The Setting class represents a setting on the Unraid server.

Warning

THIS DOES NOT EXIST YET, DO NOT ATTEMPT TO USE IT.

pyunraid.models.share module

class pyunraid.models.share.Share

Bases: pyunraid.models.model.Model

The Share class represents a share on the Unraid server.

Variables
  • type – User share or disk share

  • status – The parity status of the share

  • name – The name of the share

  • comment – The comment attached to the share

  • smb_security – Public, hidden or private SMB security. None if no

security set. :ivar nfs_security: Public, hidden or private NFS security. None if no security set. :ivar afp_security: None, AFP security will be removed in Unraid 6.9 and thus not supported :ivar free_size: Free size of share in bytes

path(path='/')

List the directory in the share

Returns

directory

Return type

list

rename(name)

Rename the share.

Parameters

name – The new name.

set_allocation_method(method)

Set the allocation method for the share.

Parameters

comment – The new comment.

set_cache_disk(use_cache='no')

Set whether cache disk should be used for share.

Parameters

use_cache – ‘yes’ for yes and ‘no’ for no

set_comment(comment)

Set the comment for the share.

Parameters

comment – The new comment.

set_minimum_free_space(floor=0)

Set minimum free space for the share.

Parameters

floor – Minimum free space in bytes

set_split_level(split=None)

Set split level for the share.

Parameters

split – The split level where None is automatic splitting, 1 is

only split top level dir and 0 is no splitting.

pyunraid.models.user module

class pyunraid.models.user.User

Bases: pyunraid.models.model.Model

The User class represents a user on the Unraid server

Variables
  • name – The name of the user

  • description – The description of the user

  • image – The image of the user

delete()

Delete the user.

set_description(description)

Set the description of the user.

Parameters

description – The new description.

set_image(image)

Set the profile picture of the user.

set_password(password)

Set a new password

Parameters

password – The new password to be set

pyunraid.models.vm module

class pyunraid.models.vm.VM

Bases: pyunraid.models.model.Model

The VM class represents a VM on the Unraid server.

Variables
  • uuid – The UUID of the VM

  • name – The friendly name of the VM

  • description – The description of the VM

  • cpu_count – Assigned CPU count

  • memory – Allocated memory size

  • vdisks – An array of vdisks

  • vnc_port – The VNC port, if any

  • autostart – Whether autostart is enabled

  • state – The state of the VM (e.g. started, stopped)

action(action)

Send action to Unraid for specific VM.

Parameters

action – Action to send (e.g. start, stop)

Warning

Please check you’re sending a supported action, ‘start’ is

not correct, ‘domain-start’ is.

destroy()

Remove the VM and delete the vidsks.

disable_autostart()

Disable autostart of the VM.

enable_autostart()

Enabled autostart of the VM.

force_stop()

Force stop the VM.

hibernate()

Hibernate the VM.

remove()

Remove the VM, but leave the vdisks.

restart()

Restart the VM.

start()

Start the VM.

stop()

Stop the VM.

Module contents