DockerObject

Description

The DockerObject object provides common properties and methods for all kinds of Docker resources such as DockerMount, DockerNetwork and DockerVolume.

› Inherits:Object
› Inherited by:DockerNetwork, DockerVolume

Properties

driver

This property holds the name of the driver used to provide this object. This depends on the type of the defined object. See the object-specific documentation for details.

› Type:String
› Signal:driverChanged()
› Attributes:Writable

error

This property holds the most recently occurred error or DockerObject.NoError if no error occurred. If the same error occurs multiple times this property does not change. Use the errorOccurred() signal to detect multiple occurrences of the same error.

› Type:Error
› Signal:errorChanged()
› Attributes:Readonly

errorString

This property holds the current human readable error string corresponding to the current value in the error property. It may include additional information such as failure reasons or locations.

› Type:String
› Signal:errorStringChanged()
› Attributes:Readonly

name

This property holds the name of the object to define. This identifier usually may only consist of alphanumeric identifiers.

› Type:String
› Signal:nameChanged()
› Attributes:Writable

options

This property holds a list of options used by the driver. This depends on the type of the defined object and driver. See the object-specific documentation for details.

› Type:StringList
› Signal:optionsChanged()
› Attributes:Writable

Methods

create()

This method creates the described object, e.g. a Docker volume or network. Returns true on success. Otherwise it returns false if the object could not be created. In this case the error property indicates the failure reason.

› Returns:Boolean

remove()

This method removes the described object, e.g. a Docker volume or network. Returns true on success. Otherwise it returns false if the object could not be removed. In this case the error property indicates the failure reason.

› Returns:Boolean

Signals

errorOccurred()

This signal is emitted whenever an error has occurred, regardless of whether the error property has changed or not. In contrast to the change notification signal of the error property this signal is also emitted several times if a certain error occurs several times in succession.

Enumerations

Error

This enumeration describes all errors which can occur in DockerObject objects. The most recently occurred error is stored in the error property.

Name Value Description
DockerObject.NoError 0 No error occurred or was detected.
DockerObject.ServiceNotFound 1 Service not found (parent is not a DockerService).
DockerObject.ServiceNotRunning 2 DockerService not enabled or not running.
DockerObject.InvalidName 3 The name property is empty or invalid.
DockerObject.ObjectCreationError 4 Failed to create the object.