opsicommon package

Subpackages

Submodules

opsicommon.exceptions module

OPSI Exceptions.

opsicommon.exceptions.BackendAuthenticationError

alias of OpsiServiceAuthenticationError

exception opsicommon.exceptions.BackendBadValueError(message='')

Bases: OpsiError

Exception raised if an invalid value is found.

Parameters:

message (str)

ExceptionShortDescription = 'Backend bad value error'
exception opsicommon.exceptions.BackendConfigurationError(message='')

Bases: OpsiError

Exception raised if a configuration error occurs in the backend.

Parameters:

message (str)

ExceptionShortDescription = 'Backend configuration error'
exception opsicommon.exceptions.BackendError(message='')

Bases: OpsiError

Exception raised if there is an error in the backend.

Parameters:

message (str)

ExceptionShortDescription = 'Backend error'
exception opsicommon.exceptions.BackendIOError(message='')

Bases: OpsiError

Exception raised if there is a read or write error in the backend.

Parameters:

message (str)

ExceptionShortDescription = 'Backend I/O error'
exception opsicommon.exceptions.BackendMissingDataError(message='')

Bases: OpsiError

Exception raised if expected data not found.

Parameters:

message (str)

ExceptionShortDescription = 'Backend missing data error'
exception opsicommon.exceptions.BackendModuleDisabledError(message='')

Bases: OpsiError

Exception raised if a needed module is disabled.

Parameters:

message (str)

ExceptionShortDescription = 'Backend module disabled error'
opsicommon.exceptions.BackendPermissionDeniedError

alias of OpsiServicePermissionError

exception opsicommon.exceptions.BackendReferentialIntegrityError(message='')

Bases: OpsiError

Exception raised if there is a referential integration error occurs in the backend.

Parameters:

message (str)

ExceptionShortDescription = 'Backend referential integrity error'
exception opsicommon.exceptions.BackendTemporaryError(message='')

Bases: OpsiError

Exception raised if a temporary error occurs.

Parameters:

message (str)

ExceptionShortDescription = 'Backend temporary error'
exception opsicommon.exceptions.BackendUnableToConnectError(message='')

Bases: BackendIOError

Exception raised if no connection can be established in the backend.

Parameters:

message (str)

ExceptionShortDescription = 'Backend I/O error'
exception opsicommon.exceptions.BackendUnaccomplishableError(message='')

Bases: OpsiError

Exception raised if an unaccomplishable situation appears.

Parameters:

message (str)

ExceptionShortDescription = 'Backend unaccomplishable error'
exception opsicommon.exceptions.CanceledException

Bases: Exception

ExceptionShortDescription = 'CanceledException'
exception opsicommon.exceptions.LicenseConfigurationError(message='')

Bases: OpsiError

Exception raised if a configuration error occurs in the license data base.

Parameters:

message (str)

ExceptionShortDescription = 'License configuration error'
exception opsicommon.exceptions.LicenseMissingError(message='')

Bases: OpsiError

Exception raised if a license is requested but cannot be found.

Parameters:

message (str)

ExceptionShortDescription = 'License missing error'
exception opsicommon.exceptions.OpsiBackupBackendNotFound(message='')

Bases: OpsiBackupFileError

Parameters:

message (str)

ExceptionShortDescription = 'Opsi backend not found in backup'
exception opsicommon.exceptions.OpsiBackupFileError(message='')

Bases: OpsiError

Parameters:

message (str)

ExceptionShortDescription = 'Opsi backup file error'
exception opsicommon.exceptions.OpsiBackupFileNotFound(message='')

Bases: OpsiBackupFileError

Parameters:

message (str)

ExceptionShortDescription = 'Opsi backup file not found'
exception opsicommon.exceptions.OpsiBadRpcError(message='')

Bases: OpsiError

Parameters:

message (str)

ExceptionShortDescription = 'Opsi bad rpc error'
exception opsicommon.exceptions.OpsiError(message='')

Bases: Exception

Base class for OPSI Backend exceptions.

Parameters:

message (str)

ExceptionShortDescription = 'Opsi error'
exception opsicommon.exceptions.OpsiProductOrderingError(message='', problematicRequirements=None)

Bases: OpsiError

Parameters:
  • message (str)

  • problematicRequirements (list[int] | list[str] | None)

ExceptionShortDescription = 'A condition for ordering cannot be fulfilled'
exception opsicommon.exceptions.OpsiRpcError(message='', response=None)

Bases: OpsiError

Parameters:
  • message (str)

  • response (dict[str, Any] | None)

ExceptionShortDescription = 'Opsi rpc error'
exception opsicommon.exceptions.OpsiServiceAuthenticationError(message='', status_code=None, content=None)

Bases: OpsiServiceError

Parameters:
  • message (str)

  • status_code (int | None)

  • content (str | None)

ExceptionShortDescription = 'Opsi service authentication error'
exception opsicommon.exceptions.OpsiServiceClientCertificateError(message='', status_code=None, content=None)

Bases: OpsiServiceAuthenticationError

Parameters:
  • message (str)

  • status_code (int | None)

  • content (str | None)

ExceptionShortDescription = 'Opsi service client certificate error'
exception opsicommon.exceptions.OpsiServiceConnectionError(message='', status_code=None, content=None)

Bases: OpsiServiceError

Parameters:
  • message (str)

  • status_code (int | None)

  • content (str | None)

ExceptionShortDescription = 'Opsi service connection error'
exception opsicommon.exceptions.OpsiServiceTimeoutError(message='', status_code=None, content=None)

Bases: OpsiServiceConnectionError

Parameters:
  • message (str)

  • status_code (int | None)

  • content (str | None)

ExceptionShortDescription = 'Opsi service timeout error'
exception opsicommon.exceptions.OpsiServiceVerificationError(message='', status_code=None, content=None)

Bases: OpsiServiceConnectionError

Parameters:
  • message (str)

  • status_code (int | None)

  • content (str | None)

ExceptionShortDescription = 'Opsi service verification error'
exception opsicommon.exceptions.RepositoryError(message='')

Bases: OpsiError

Parameters:

message (str)

ExceptionShortDescription = 'Repository error'

opsicommon.license module

License handling

class opsicommon.license.OpsiLicense(*, id=NOTHING, type='standard', schema_version=2, opsi_version='4.2', customer_id=None, customer_name, customer_address=None, customer_unit=None, contract_id=None, service_id=None, module_id, client_number, issued_at=NOTHING, valid_from=NOTHING, valid_until, revoked_ids=[], note=None, additional_data=None, signature=None, license_pool=None, checksum=None, cached_state={}, cached_signature_valid=None)

Bases: object

Parameters:
  • id (str)

  • type (str)

  • opsi_version (str)

  • customer_id (str)

  • customer_name (str)

  • customer_address (str)

  • customer_unit (str)

  • contract_id (str)

  • service_id (str)

  • module_id (str)

  • issued_at (str)

  • valid_from (str)

  • valid_until (str)

  • revoked_ids (list[str])

  • note (str)

  • additional_data (str)

  • signature (str)

  • license_pool (OpsiLicensePool)

  • checksum (str)

  • cached_state (dict[str, str])

  • cached_signature_valid (bool | None)

additional_data: str
clear_cache()
Return type:

None

client_number: int
contract_id: str
customer_address: str
customer_id: str
customer_name: str
customer_unit: str
classmethod from_dict(data_dict)
Parameters:

data_dict (dict)

Return type:

OpsiLicense

classmethod from_json(json_data)
Parameters:

json_data (str)

Return type:

OpsiLicense

get_checksum(with_signature=True)
Parameters:

with_signature (bool)

Return type:

str

get_hash(digest=False, hex_digest=False)
Parameters:
  • digest (bool)

  • hex_digest (bool)

Return type:

MD5Hash | SHA3_512_Hash | str | bytes

get_state(test_revoked=True, at_date=None)
Parameters:
  • test_revoked (bool)

  • at_date (date | None)

Return type:

str

id: str
is_signature_valid()
Return type:

bool

issued_at: date
module_id: str
note: str
opsi_version: str
revoked_ids: list[str]
schema_version: int
service_id: str
set_license_pool(license_pool)
Parameters:

license_pool (OpsiLicensePool)

Return type:

None

sign(private_key)
Parameters:

private_key (RsaKey | str)

Return type:

None

signature: bytes
to_dict(serializable=False, with_state=False)
Parameters:
  • serializable (bool)

  • with_state (bool)

Return type:

dict

to_json(with_state=False)
Parameters:

with_state (bool)

Return type:

str

type: str
valid_from: date
valid_until: date
validate_client_number(attribute, value)
Parameters:
  • attribute (str)

  • value (Any)

Return type:

None

validate_customer_address(attribute, value)
Parameters:
  • attribute (str)

  • value (Any)

Return type:

None

validate_customer_id(attribute, value)
Parameters:
  • attribute (str)

  • value (Any)

Return type:

None

validate_customer_name(attribute, value)
Parameters:
  • attribute (str)

  • value (Any)

Return type:

None

validate_revoked_ids(attribute, value)
Parameters:
  • attribute (str)

  • value (Any)

Return type:

None

validate_schema_version(attribute, value)
Parameters:
  • attribute (str)

  • value (Any)

Return type:

None

validate_service_id(attribute, value)
Parameters:
  • attribute (str)

  • value (Any)

Return type:

None

class opsicommon.license.OpsiLicenseFile(filename)

Bases: object

Parameters:

filename (str | None)

add_license(opsi_license)
Parameters:

opsi_license (OpsiLicense)

Return type:

None

property licenses: list[OpsiLicense]
read()
Return type:

None

read_string(data)
Parameters:

data (str)

Return type:

None

write()
Return type:

None

write_string()
Return type:

str

class opsicommon.license.OpsiLicensePool(license_file_path=None, modules_file_path=None, client_info=None, client_limit_warning_percent=95, client_limit_warning_absolute=5)

Bases: object

Parameters:
  • license_file_path (str | Path | None)

  • modules_file_path (str | Path | None)

  • client_info (Union[dict, Callable, None])

  • client_limit_warning_percent (int | None)

  • client_limit_warning_absolute (int | None)

add_license(*opsi_license)
Parameters:

opsi_license (OpsiLicense)

Return type:

None

clear_license_state_cache()
Return type:

None

property client_numbers: dict[str, int]
property enabled_module_ids: list[str]
get_legacy_modules()
Return type:

dict[str, Any] | None

get_licenses(exclude_ids=None, valid_only=False, test_revoked=True, types=None, at_date=None)
Parameters:
  • exclude_ids (list[str] | None)

  • valid_only (bool)

  • test_revoked (bool)

  • types (list[str] | None)

  • at_date (date | None)

Return type:

Generator[OpsiLicense, None, None]

get_licenses_checksum()
Return type:

str

get_modules(at_date=None)
Parameters:

at_date (date | None)

Return type:

dict[str, Any]

get_relevant_dates()
Return type:

list[date]

get_revoked_license_ids(at_date=None)
Parameters:

at_date (date | None)

Return type:

set[str]

property license_files: list[str]
property licenses: list[OpsiLicense]
load()
Return type:

None

modified()
Return type:

bool

property modules_file: str | None
remove_license(*opsi_license)
Parameters:

opsi_license (OpsiLicense)

Return type:

None

class opsicommon.license.OpsiModulesFile(filename)

Bases: object

Parameters:

filename (Path | str)

add_license(opsi_license)
Parameters:

opsi_license (OpsiLicense)

Return type:

None

property licenses: list[OpsiLicense]
read()
Return type:

None

opsicommon.license.generate_key_pair(return_pem=False, bits=2048)
Parameters:
  • return_pem (bool)

  • bits (int)

Return type:

tuple[str, str] | tuple[RsaKey, RsaKey]

opsicommon.license.generate_license_id()
Return type:

str

opsicommon.license.get_default_opsi_license_pool(license_file_path=None, modules_file_path=None, client_info=None, client_limit_warning_percent=95, client_limit_warning_absolute=5)
Parameters:
  • license_file_path (str | Path | None)

  • modules_file_path (str | Path | None)

  • client_info (Union[dict, Callable, None])

  • client_limit_warning_percent (int | None)

  • client_limit_warning_absolute (int | None)

Return type:

OpsiLicensePool

opsicommon.license.get_signature_public_key(schema_version)
Parameters:

schema_version (int)

Return type:

RsaKey

opsicommon.license.get_signature_public_key_schema_version_1()
Return type:

RsaKey

opsicommon.license.get_signature_public_key_schema_version_2()
Return type:

RsaKey

opsicommon.license.set_default_opsi_license_pool(pool)
Parameters:

pool (OpsiLicensePool | None)

Return type:

None

opsicommon.objects module

General classes used in the library.

As an example this contains classes for hosts, products, configurations.

class opsicommon.objects.AuditHardware(hardwareClass, **kwargs)

Bases: Entity

Parameters:
  • hardwareClass (str)

  • kwargs (Any)

backend_method_prefix = 'auditHardware'
foreign_id_attributes: list[str] = []
classmethod fromHash(_hash)
Parameters:

_hash (dict[str, Any])

Return type:

AuditHardware

getHardwareClass()
Return type:

str

getIdentAttributes()
Return type:

tuple[str, ...]

hardware_attributes: dict[str, dict[str, Any]] = {}
setDefaults()
Return type:

None

setHardwareClass(hardwareClass)
Parameters:

hardwareClass (str)

Return type:

None

static setHardwareConfig(hardwareConfig)
Parameters:

hardwareConfig (list[dict[str, Any]])

Return type:

None

sub_classes: dict[str, type] = {}
class opsicommon.objects.AuditHardwareOnHost(hardwareClass, hostId, firstseen=None, lastseen=None, state=None, **kwargs)

Bases: Relationship

Parameters:
  • hardwareClass (str)

  • hostId (str)

  • firstseen (str | None)

  • lastseen (str | None)

  • state (int | None)

  • kwargs (Any)

backend_method_prefix = 'auditHardwareOnHost'
classmethod fromHash(_hash)
Parameters:

_hash (dict[str, Any])

Return type:

AuditHardwareOnHost

getFirstseen()
Return type:

str | None

getHardwareClass()
Return type:

str

getHostId()
Return type:

str

getIdentAttributes()
Return type:

tuple[str, ...]

getLastseen()
Return type:

str | None

getState()
Return type:

int | None

hardware_attributes: dict[str, dict[str, Any]] = {}
setDefaults()
Return type:

None

setFirstseen(firstseen)
Parameters:

firstseen (str)

Return type:

None

setHardwareClass(hardwareClass)
Parameters:

hardwareClass (str)

Return type:

None

static setHardwareConfig(hardwareConfig)
Parameters:

hardwareConfig (list[dict[str, Any]])

Return type:

None

setHostId(hostId)
Parameters:

hostId (str)

Return type:

None

setLastseen(lastseen)
Parameters:

lastseen (str)

Return type:

None

setState(state)
Parameters:

state (int)

Return type:

None

sub_classes: dict[str, type] = {}
toAuditHardware()
Return type:

AuditHardware

class opsicommon.objects.AuditSoftware(name, version, subVersion, language, architecture, windowsSoftwareId=None, windowsDisplayName=None, windowsDisplayVersion=None, installSize=None)

Bases: Entity

Parameters:
  • name (str)

  • version (str)

  • subVersion (str)

  • language (str)

  • architecture (str)

  • windowsSoftwareId (str | None)

  • windowsDisplayName (str | None)

  • windowsDisplayVersion (str | None)

  • installSize (int | None)

backend_method_prefix = 'auditSoftware'
foreign_id_attributes: list[str] = []
getArchitecture()
Return type:

str

getInstallSize()
Return type:

int | None

getLanguage()
Return type:

str

getName()
Return type:

str

getSubVersion()
Return type:

str

getVersion()
Return type:

str

getWindowsDisplayName()
Return type:

str | None

getWindowsDisplayVersion()
Return type:

str | None

getWindowsSoftwareId()
Return type:

str | None

setArchitecture(architecture)
Parameters:

architecture (str)

Return type:

None

setDefaults()
Return type:

None

setInstallSize(installSize)
Parameters:

installSize (int)

Return type:

None

setLanguage(language)
Parameters:

language (str)

Return type:

None

setName(name)
Parameters:

name (str)

Return type:

None

setSubVersion(subVersion)
Parameters:

subVersion (str)

Return type:

None

setVersion(version)
Parameters:

version (str)

Return type:

None

setWindowsDisplayName(windowsDisplayName)
Parameters:

windowsDisplayName (str)

Return type:

None

setWindowsDisplayVersion(windowsDisplayVersion)
Parameters:

windowsDisplayVersion (str)

Return type:

None

setWindowsSoftwareId(windowsSoftwareId)
Parameters:

windowsSoftwareId (str)

Return type:

None

sub_classes: dict[str, type] = {}
class opsicommon.objects.AuditSoftwareOnClient(name, version, subVersion, language, architecture, clientId, uninstallString=None, binaryName=None, firstseen=None, lastseen=None, state=None, usageFrequency=None, lastUsed=None, licenseKey=None)

Bases: Relationship

Parameters:
  • name (str)

  • version (str)

  • subVersion (str)

  • language (str)

  • architecture (str)

  • clientId (str)

  • uninstallString (str | None)

  • binaryName (str | None)

  • firstseen (str | None)

  • lastseen (str | None)

  • state (int | None)

  • usageFrequency (int | None)

  • lastUsed (str | None)

  • licenseKey (str | None)

backend_method_prefix = 'auditSoftwareOnClient'
getArchitecture()
Return type:

str

getBinaryName()
Return type:

str | None

getClientId()
Return type:

str

getFirstseen()
Return type:

str | None

getLanguage()
Return type:

str

getLastUsed()
Return type:

str | None

getLastseen()
Return type:

str | None

getLicenseKey()
Return type:

str | None

getName()
Return type:

str

getState()
Return type:

int | None

getSubVersion()
Return type:

str

getUninstallString()
Return type:

str | None

getUsageFrequency()
Return type:

int | None

getVersion()
Return type:

str

setArchitecture(architecture)
Parameters:

architecture (str)

Return type:

None

setBinaryName(binaryName)
Parameters:

binaryName (str)

Return type:

None

setClientId(clientId)
Parameters:

clientId (str)

Return type:

None

setDefaults()
Return type:

None

setFirstseen(firstseen)
Parameters:

firstseen (str)

Return type:

None

setLanguage(language)
Parameters:

language (str)

Return type:

None

setLastUsed(lastUsed)
Parameters:

lastUsed (str)

Return type:

None

setLastseen(lastseen)
Parameters:

lastseen (str)

Return type:

None

setLicenseKey(licenseKey)
Parameters:

licenseKey (str)

Return type:

None

setName(name)
Parameters:

name (str)

Return type:

None

setState(state)
Parameters:

state (int)

Return type:

None

setSubVersion(subVersion)
Parameters:

subVersion (str)

Return type:

None

setUninstallString(uninstallString)
Parameters:

uninstallString (str)

Return type:

None

setUsageFrequency(usageFrequency)
Parameters:

usageFrequency (int)

Return type:

None

setVersion(version)
Parameters:

version (str)

Return type:

None

sub_classes: dict[str, type] = {}
class opsicommon.objects.AuditSoftwareToLicensePool(name, version, subVersion, language, architecture, licensePoolId)

Bases: Relationship

Parameters:
  • name (str)

  • version (str)

  • subVersion (str)

  • language (str)

  • architecture (str)

  • licensePoolId (str)

backend_method_prefix = 'auditSoftwareToLicensePool'
getArchitecture()
Return type:

str

getLanguage()
Return type:

str

getLicensePoolId()
Return type:

str

getName()
Return type:

str

getSubVersion()
Return type:

str

getVersion()
Return type:

str

setArchitecture(architecture)
Parameters:

architecture (str)

Return type:

None

setLanguage(language)
Parameters:

language (str)

Return type:

None

setLicensePoolId(licensePoolId)
Parameters:

licensePoolId (str)

Return type:

None

setName(name)
Parameters:

name (str)

Return type:

None

setSubVersion(subVersion)
Parameters:

subVersion (str)

Return type:

None

setVersion(version)
Parameters:

version (str)

Return type:

None

sub_classes: dict[str, type] = {}
class opsicommon.objects.BaseObject

Bases: object

backendMethodPrefix = ''
backend_method_prefix = ''
clone(identOnly=False)
Parameters:

identOnly (bool)

Return type:

Self

copy_from_hash = False
emptyValues(keepAttributes=None)
Parameters:

keepAttributes (list[str] | None)

Return type:

None

foreignIdAttributes = []
foreign_id_attributes: list[str] = []
classmethod fromHash(_hash)
Parameters:

_hash (dict[str, Any])

Return type:

TypeVar(BaseObjectT, bound= BaseObject)

classmethod from_json(jsonString)
Parameters:

jsonString (str)

Return type:

Any

getBackendMethodPrefix()
Return type:

str

getForeignIdAttributes()
Return type:

list[str]

getIdent(returnType='unicode')
Parameters:

returnType (str)

Return type:

list[str] | tuple[str, ...] | dict[str, str] | str

getIdentAttributes()
Return type:

tuple[str, ...]

getType()
Return type:

str

identSeparator = ';'
ident_separator = ';'
isGeneratedDefault()
Return type:

bool

serialize()
Return type:

dict[str, Any]

setDefaults()
Return type:

None

setGeneratedDefault(flag=True)
Parameters:

flag (bool)

Return type:

None

subClasses = {'Entity': <class 'opsicommon.objects.Entity'>, 'Relationship': <class 'opsicommon.objects.Relationship'>}
sub_classes: dict[str, type] = {'Entity': <class 'opsicommon.objects.Entity'>, 'Relationship': <class 'opsicommon.objects.Relationship'>}
toHash()
Return type:

dict[str, Any]

toJson()
Return type:

str

to_hash()
Return type:

dict[str, Any]

to_json()
Return type:

str

update(updateObject, updateWithNoneValues=True)
Parameters:
  • updateObject (BaseObject)

  • updateWithNoneValues (bool)

Return type:

None

class opsicommon.objects.BoolConfig(id, description=None, defaultValues=None)

Bases: Config

Parameters:
  • id (str)

  • description (str | None)

  • defaultValues (list[bool] | None)

setDefaultValues(defaultValues)
Parameters:

defaultValues (list[bool])

Return type:

None

setDefaults()
Return type:

None

setPossibleValues(possibleValues)
Parameters:

possibleValues (list[bool])

Return type:

None

sub_classes: dict[str, type] = {}
class opsicommon.objects.BoolProductProperty(productId, productVersion, packageVersion, propertyId, description=None, defaultValues=None)

Bases: ProductProperty

Parameters:
  • productId (str)

  • productVersion (str)

  • packageVersion (str)

  • propertyId (str)

  • description (str | None)

  • defaultValues (list[Any] | None)

setDefaultValues(defaultValues)
Parameters:

defaultValues (list[Any])

Return type:

None

setDefaults()
Return type:

None

setEditable(editable)
Parameters:

editable (bool)

Return type:

None

setPossibleValues(possibleValues)
Parameters:

possibleValues (list[Any])

Return type:

None

sub_classes: dict[str, type] = {}
class opsicommon.objects.ConcurrentSoftwareLicense(id, licenseContractId, maxInstallations=None, boundToHost=None, expirationDate=None)

Bases: SoftwareLicense

Parameters:
  • id (str)

  • licenseContractId (str)

  • maxInstallations (int | None)

  • boundToHost (str | None)

  • expirationDate (str | None)

setDefaults()
Return type:

None

sub_classes: dict[str, type] = {}
class opsicommon.objects.Config(id, description=None, possibleValues=None, defaultValues=None, editable=None, multiValue=None)

Bases: Entity

Parameters:
  • id (str)

  • description (str | None)

  • possibleValues (list[Any] | None)

  • defaultValues (list[Any] | None)

  • editable (bool | None)

  • multiValue (bool | None)

backend_method_prefix = 'config'
foreign_id_attributes: list[str] = ['configId']
getDefaultValues()
Return type:

list[Any] | None

getDescription()
Return type:

str | None

getEditable()
Return type:

bool | None

getId()
Return type:

str

getMultiValue()
Return type:

bool | None

getPossibleValues()
Return type:

list[Any] | None

setDefaultValues(defaultValues)
Parameters:

defaultValues (list[Any])

Return type:

None

setDefaults()
Return type:

None

setDescription(description)
Parameters:

description (str)

Return type:

None

setEditable(editable)
Parameters:

editable (bool)

Return type:

None

setId(id)
Parameters:

id (str)

Return type:

None

setMultiValue(multiValue)
Parameters:

multiValue (bool)

Return type:

None

setPossibleValues(possibleValues)
Parameters:

possibleValues (list[Any])

Return type:

None

sub_classes: dict[str, type] = {'BoolConfig': <class 'opsicommon.objects.BoolConfig'>, 'UnicodeConfig': <class 'opsicommon.objects.UnicodeConfig'>}
class opsicommon.objects.ConfigState(configId, objectId, values=None)

Bases: Relationship

Parameters:
  • configId (str)

  • objectId (str)

  • values (list[Any] | None)

backend_method_prefix = 'configState'
getConfigId()
Return type:

str

getObjectId()
Return type:

str

getValues()
Return type:

list[Any] | None

setConfigId(configId)
Parameters:

configId (str)

Return type:

None

setDefaults()
Return type:

None

setObjectId(objectId)
Parameters:

objectId (str)

Return type:

None

setValues(values)
Parameters:

values (list[Any])

Return type:

None

sub_classes: dict[str, type] = {}
class opsicommon.objects.Entity

Bases: BaseObject

clone(identOnly=False)
Parameters:

identOnly (bool)

Return type:

Self

setDefaults()
Return type:

None

sub_classes: dict[str, type] = {'AuditHardware': <class 'opsicommon.objects.AuditHardware'>, 'AuditSoftware': <class 'opsicommon.objects.AuditSoftware'>, 'Config': <class 'opsicommon.objects.Config'>, 'LicenseContract': <class 'opsicommon.objects.LicenseContract'>, 'LicensePool': <class 'opsicommon.objects.LicensePool'>, 'Object': <class 'opsicommon.objects.Object'>, 'Product': <class 'opsicommon.objects.Product'>, 'ProductProperty': <class 'opsicommon.objects.ProductProperty'>, 'User': <class 'opsicommon.objects.User'>}
class opsicommon.objects.Group(id, description=None, notes=None, parentGroupId=None)

Bases: Object

Parameters:
  • id (str)

  • description (str | None)

  • notes (str | None)

  • parentGroupId (str | None)

backend_method_prefix = 'group'
foreign_id_attributes: list[str] = ['objectId', 'groupId']
getId()
Return type:

str

getParentGroupId()
Return type:

str | None

setDefaults()
Return type:

None

setId(id)
Parameters:

id (str)

Return type:

None

setParentGroupId(parentGroupId)
Parameters:

parentGroupId (str)

Return type:

None

sub_classes: dict[str, type] = {'HostGroup': <class 'opsicommon.objects.HostGroup'>, 'ProductGroup': <class 'opsicommon.objects.ProductGroup'>}
class opsicommon.objects.Host(id, description=None, notes=None, hardwareAddress=None, ipAddress=None, inventoryNumber=None, systemUUID=None)

Bases: Object

Parameters:
  • id (str)

  • description (str | None)

  • notes (str | None)

  • hardwareAddress (str | None)

  • ipAddress (str | None)

  • inventoryNumber (str | None)

  • systemUUID (str | None)

backend_method_prefix = 'host'
foreign_id_attributes: list[str] = ['objectId', 'hostId']
getHardwareAddress()
Return type:

str | None

getInventoryNumber()
Return type:

str | None

getIpAddress()
Return type:

str | None

getSystemUUID()
Return type:

str | None

setDefaults()
Return type:

None

setHardwareAddress(hardwareAddress)
Parameters:

hardwareAddress (str)

Return type:

None

setId(id)
Parameters:

id (str)

Return type:

None

setInventoryNumber(inventoryNumber)
Parameters:

inventoryNumber (str)

Return type:

None

setIpAddress(ipAddress)
Parameters:

ipAddress (str)

Return type:

None

setSystemUUID(systemUUID)
Parameters:

systemUUID (str)

Return type:

None

sub_classes: dict[str, type] = {'OpsiClient': <class 'opsicommon.objects.OpsiClient'>, 'OpsiConfigserver': <class 'opsicommon.objects.OpsiConfigserver'>, 'OpsiDepotserver': <class 'opsicommon.objects.OpsiDepotserver'>}
class opsicommon.objects.HostGroup(id, description=None, notes=None, parentGroupId=None)

Bases: Group

Parameters:
  • id (str)

  • description (str | None)

  • notes (str | None)

  • parentGroupId (str | None)

setDefaults()
Return type:

None

sub_classes: dict[str, type] = {}
class opsicommon.objects.LicenseContract(id, description=None, notes=None, partner=None, conclusionDate=None, notificationDate=None, expirationDate=None)

Bases: Entity

Parameters:
  • id (str)

  • description (str | None)

  • notes (str | None)

  • partner (str | None)

  • conclusionDate (str | None)

  • notificationDate (str | None)

  • expirationDate (str | None)

backend_method_prefix = 'licenseContract'
foreign_id_attributes: list[str] = ['licenseContractId']
getConclusionDate()
Return type:

str | None

getDescription()
Return type:

str | None

getExpirationDate()
Return type:

str | None

getId()
Return type:

str

getNotes()
Return type:

str | None

getNotificationDate()
Return type:

str | None

getPartner()
Return type:

str | None

setConclusionDate(conclusionDate)
Parameters:

conclusionDate (str)

Return type:

None

setDefaults()
Return type:

None

setDescription(description)
Parameters:

description (str)

Return type:

None

setExpirationDate(expirationDate)
Parameters:

expirationDate (str)

Return type:

None

setId(id)
Parameters:

id (str)

Return type:

None

setNotes(notes)
Parameters:

notes (str)

Return type:

None

setNotificationDate(notificationDate)
Parameters:

notificationDate (str)

Return type:

None

setPartner(partner)
Parameters:

partner (str)

Return type:

None

sub_classes: dict[str, type] = {}
class opsicommon.objects.LicenseOnClient(softwareLicenseId, licensePoolId, clientId, licenseKey=None, notes=None)

Bases: Relationship

Parameters:
  • softwareLicenseId (str)

  • licensePoolId (str)

  • clientId (str)

  • licenseKey (str | None)

  • notes (str | None)

backend_method_prefix = 'licenseOnClient'
getClientId()
Return type:

str

getLicenseKey()
Return type:

str | None

getLicensePoolId()
Return type:

str

getNotes()
Return type:

str | None

getSoftwareLicenseId()
Return type:

str

setClientId(clientId)
Parameters:

clientId (str)

Return type:

None

setDefaults()
Return type:

None

setLicenseKey(licenseKey)
Parameters:

licenseKey (str)

Return type:

None

setLicensePoolId(licensePoolId)
Parameters:

licensePoolId (str)

Return type:

None

setNotes(notes)
Parameters:

notes (str)

Return type:

None

setSoftwareLicenseId(softwareLicenseId)
Parameters:

softwareLicenseId (str)

Return type:

None

sub_classes: dict[str, type] = {}
class opsicommon.objects.LicensePool(id, description=None, productIds=None)

Bases: Entity

Parameters:
  • id (str)

  • description (str | None)

  • productIds (list[str] | None)

backend_method_prefix = 'licensePool'
foreign_id_attributes: list[str] = ['licensePoolId']
getDescription()
Return type:

str | None

getId()
Return type:

str

getProductIds()
Return type:

list[str] | None

setDefaults()
Return type:

None

setDescription(description)
Parameters:

description (str)

Return type:

None

setId(id)
Parameters:

id (str)

Return type:

None

setProductIds(productIds)
Parameters:

productIds (list[str])

Return type:

None

sub_classes: dict[str, type] = {}
class opsicommon.objects.LocalbootProduct(id, productVersion, packageVersion, name=None, licenseRequired=None, setupScript=None, uninstallScript=None, updateScript=None, alwaysScript=None, onceScript=None, customScript=None, userLoginScript=None, priority=None, description=None, advice=None, changelog=None, productClassIds=None, windowsSoftwareIds=None)

Bases: Product

Parameters:
  • id (str)

  • productVersion (str)

  • packageVersion (str)

  • name (str | None)

  • licenseRequired (bool | None)

  • setupScript (str | None)

  • uninstallScript (str | None)

  • updateScript (str | None)

  • alwaysScript (str | None)

  • onceScript (str | None)

  • customScript (str | None)

  • userLoginScript (str | None)

  • priority (int | None)

  • description (str | None)

  • advice (str | None)

  • changelog (str | None)

  • productClassIds (list[str] | None)

  • windowsSoftwareIds (list[str] | None)

setDefaults()
Return type:

None

sub_classes: dict[str, type] = {}
class opsicommon.objects.NetbootProduct(id, productVersion, packageVersion, name=None, licenseRequired=None, setupScript=None, uninstallScript=None, updateScript=None, alwaysScript=None, onceScript=None, customScript=None, priority=None, description=None, advice=None, changelog=None, productClassIds=None, windowsSoftwareIds=None, pxeConfigTemplate='')

Bases: Product

Parameters:
  • id (str)

  • productVersion (str)

  • packageVersion (str)

  • name (str | None)

  • licenseRequired (bool | None)

  • setupScript (str | None)

  • uninstallScript (str | None)

  • updateScript (str | None)

  • alwaysScript (str | None)

  • onceScript (str | None)

  • customScript (str | None)

  • priority (int | None)

  • description (str | None)

  • advice (str | None)

  • changelog (str | None)

  • productClassIds (list[str] | None)

  • windowsSoftwareIds (list[str] | None)

  • pxeConfigTemplate (str)

getPxeConfigTemplate()
Return type:

str | None

setDefaults()
Return type:

None

setPxeConfigTemplate(pxeConfigTemplate)
Parameters:

pxeConfigTemplate (str)

Return type:

None

sub_classes: dict[str, type] = {}
class opsicommon.objects.OEMSoftwareLicense(id, licenseContractId, maxInstallations=None, boundToHost=None, expirationDate=None)

Bases: SoftwareLicense

Parameters:
  • id (str)

  • licenseContractId (str)

  • maxInstallations (int | None)

  • boundToHost (str | None)

  • expirationDate (str | None)

setBoundToHost(boundToHost)
Parameters:

boundToHost (str)

Return type:

None

setDefaults()
Return type:

None

setMaxInstallations(maxInstallations)
Parameters:

maxInstallations (int)

Return type:

None

sub_classes: dict[str, type] = {}
class opsicommon.objects.Object(id, description=None, notes=None)

Bases: Entity

Parameters:
  • id (str)

  • description (str | None)

  • notes (str | None)

foreign_id_attributes: list[str] = ['objectId']
getDescription()
Return type:

str | None

getId()
Return type:

str

getNotes()
Return type:

str | None

setDefaults()
Return type:

None

setDescription(description)
Parameters:

description (str)

Return type:

None

setId(id)
Parameters:

id (str)

Return type:

None

setNotes(notes)
Parameters:

notes (str)

Return type:

None

sub_classes: dict[str, type] = {'Group': <class 'opsicommon.objects.Group'>, 'Host': <class 'opsicommon.objects.Host'>}
class opsicommon.objects.ObjectToGroup(groupType, groupId, objectId)

Bases: Relationship

Parameters:
  • groupType (str)

  • groupId (str)

  • objectId (str)

backend_method_prefix = 'objectToGroup'
getGroupId()
Return type:

str

getGroupType()
Return type:

str

getObjectId()
Return type:

str

setDefaults()
Return type:

None

setGroupId(groupId)
Parameters:

groupId (str)

Return type:

None

setGroupType(groupType)
Parameters:

groupType (str)

Return type:

None

setObjectId(objectId)
Parameters:

objectId (str)

Return type:

None

sub_classes: dict[str, type] = {}
class opsicommon.objects.OpsiClient(id, opsiHostKey=None, description=None, notes=None, hardwareAddress=None, ipAddress=None, inventoryNumber=None, oneTimePassword=None, created=None, lastSeen=None, systemUUID=None)

Bases: Host

Parameters:
  • id (str)

  • opsiHostKey (str | None)

  • description (str | None)

  • notes (str | None)

  • hardwareAddress (str | None)

  • ipAddress (str | None)

  • inventoryNumber (str | None)

  • oneTimePassword (str | None)

  • created (str | None)

  • lastSeen (str | None)

  • systemUUID (str | None)

foreign_id_attributes: list[str] = ['objectId', 'hostId', 'clientId']
getCreated()
Return type:

str | None

getLastSeen()
Return type:

str | None

getOneTimePassword()
Return type:

str | None

getOpsiHostKey()
Return type:

str | None

setCreated(created)
Parameters:

created (str)

Return type:

None

setDefaults()
Return type:

None

setLastSeen(lastSeen)
Parameters:

lastSeen (str)

Return type:

None

setOneTimePassword(oneTimePassword)
Parameters:

oneTimePassword (str)

Return type:

None

setOpsiHostKey(opsiHostKey)
Parameters:

opsiHostKey (str)

Return type:

None

sub_classes: dict[str, type] = {}
class opsicommon.objects.OpsiConfigserver(id, opsiHostKey=None, depotLocalUrl=None, depotRemoteUrl=None, depotWebdavUrl=None, repositoryLocalUrl=None, repositoryRemoteUrl=None, description=None, notes=None, hardwareAddress=None, ipAddress=None, inventoryNumber=None, networkAddress=None, maxBandwidth=None, isMasterDepot=None, masterDepotId=None, workbenchLocalUrl=None, workbenchRemoteUrl=None, systemUUID=None)

Bases: OpsiDepotserver

Parameters:
  • id (str)

  • opsiHostKey (str | None)

  • depotLocalUrl (str | None)

  • depotRemoteUrl (str | None)

  • depotWebdavUrl (str | None)

  • repositoryLocalUrl (str | None)

  • repositoryRemoteUrl (str | None)

  • description (str | None)

  • notes (str | None)

  • hardwareAddress (str | None)

  • ipAddress (str | None)

  • inventoryNumber (str | None)

  • networkAddress (str | None)

  • maxBandwidth (int | None)

  • isMasterDepot (bool | None)

  • masterDepotId (str | None)

  • workbenchLocalUrl (str | None)

  • workbenchRemoteUrl (str | None)

  • systemUUID (str | None)

foreign_id_attributes: list[str] = ['objectId', 'hostId', 'depotId', 'serverId']
setDefaults()
Return type:

None

sub_classes: dict[str, type] = {}
class opsicommon.objects.OpsiDepotserver(id, opsiHostKey=None, depotLocalUrl=None, depotRemoteUrl=None, depotWebdavUrl=None, repositoryLocalUrl=None, repositoryRemoteUrl=None, description=None, notes=None, hardwareAddress=None, ipAddress=None, inventoryNumber=None, networkAddress=None, maxBandwidth=None, isMasterDepot=None, masterDepotId=None, workbenchLocalUrl=None, workbenchRemoteUrl=None, systemUUID=None)

Bases: Host

Parameters:
  • id (str)

  • opsiHostKey (str | None)

  • depotLocalUrl (str | None)

  • depotRemoteUrl (str | None)

  • depotWebdavUrl (str | None)

  • repositoryLocalUrl (str | None)

  • repositoryRemoteUrl (str | None)

  • description (str | None)

  • notes (str | None)

  • hardwareAddress (str | None)

  • ipAddress (str | None)

  • inventoryNumber (str | None)

  • networkAddress (str | None)

  • maxBandwidth (int | None)

  • isMasterDepot (bool | None)

  • masterDepotId (str | None)

  • workbenchLocalUrl (str | None)

  • workbenchRemoteUrl (str | None)

  • systemUUID (str | None)

foreign_id_attributes: list[str] = ['objectId', 'hostId', 'depotId']
getDepotLocalUrl()
Return type:

str | None

getDepotRemoteUrl()
Return type:

str | None

getDepotWebdavUrl()
Return type:

str | None

getIsMasterDepot()
Return type:

bool | None

getMasterDepotId()
Return type:

str | None

getMaxBandwidth()
Return type:

int | None

getNetworkAddress()
Return type:

str | None

getOpsiHostKey()
Return type:

str | None

getRepositoryLocalUrl()
Return type:

str | None

getRepositoryRemoteUrl()
Return type:

str | None

getWorkbenchLocalUrl()
Return type:

str | None

getWorkbenchRemoteUrl()
Return type:

str | None

setDefaults()
Return type:

None

setDepotLocalUrl(depotLocalUrl)
Parameters:

depotLocalUrl (str)

Return type:

None

setDepotRemoteUrl(depotRemoteUrl)
Parameters:

depotRemoteUrl (str)

Return type:

None

setDepotWebdavUrl(depotWebdavUrl)
Parameters:

depotWebdavUrl (str)

Return type:

None

setIsMasterDepot(isMasterDepot)
Parameters:

isMasterDepot (bool)

Return type:

None

setMasterDepotId(masterDepotId)
Parameters:

masterDepotId (str)

Return type:

None

setMaxBandwidth(maxBandwidth)
Parameters:

maxBandwidth (int)

Return type:

None

setNetworkAddress(networkAddress)
Parameters:

networkAddress (str)

Return type:

None

setOpsiHostKey(opsiHostKey)
Parameters:

opsiHostKey (str)

Return type:

None

setRepositoryLocalUrl(repositoryLocalUrl)
Parameters:

repositoryLocalUrl (str)

Return type:

None

setRepositoryRemoteUrl(repositoryRemoteUrl)
Parameters:

repositoryRemoteUrl (str)

Return type:

None

setWorkbenchLocalUrl(value)
Parameters:

value (str)

Return type:

None

setWorkbenchRemoteUrl(value)
Parameters:

value (str)

Return type:

None

sub_classes: dict[str, type] = {'OpsiConfigserver': <class 'opsicommon.objects.OpsiConfigserver'>}
class opsicommon.objects.Product(id, productVersion, packageVersion, name=None, licenseRequired=None, setupScript=None, uninstallScript=None, updateScript=None, alwaysScript=None, onceScript=None, customScript=None, userLoginScript=None, priority=None, description=None, advice=None, changelog=None, productClassIds=None, windowsSoftwareIds=None)

Bases: Entity

Parameters:
  • id (str)

  • productVersion (str)

  • packageVersion (str)

  • name (str | None)

  • licenseRequired (bool | None)

  • setupScript (str | None)

  • uninstallScript (str | None)

  • updateScript (str | None)

  • alwaysScript (str | None)

  • onceScript (str | None)

  • customScript (str | None)

  • userLoginScript (str | None)

  • priority (int | None)

  • description (str | None)

  • advice (str | None)

  • changelog (str | None)

  • productClassIds (list[str] | None)

  • windowsSoftwareIds (list[str] | None)

backend_method_prefix = 'product'
foreign_id_attributes: list[str] = ['productId']
getAdvice()
Return type:

str | None

getAlwaysScript()
Return type:

str | None

getChangelog()
Return type:

str | None

getCustomScript()
Return type:

str | None

getDescription()
Return type:

str | None

getId()
Return type:

str

getLicenseRequired()
Return type:

bool | None

getName()
Return type:

str | None

getOnceScript()
Return type:

str | None

getPackageVersion()
Return type:

str

getPriority()
Return type:

int | None

getProductClassIds()
Return type:

list[str] | None

getProductVersion()
Return type:

str

getSetupScript()
Return type:

str | None

getUninstallScript()
Return type:

str | None

getUpdateScript()
Return type:

str | None

getUserLoginScript()
Return type:

str | None

getWindowsSoftwareIds()
Return type:

list[str] | None

setAdvice(advice)
Parameters:

advice (str)

Return type:

None

setAlwaysScript(alwaysScript)
Parameters:

alwaysScript (str)

Return type:

None

setChangelog(changelog)
Parameters:

changelog (str)

Return type:

None

setCustomScript(customScript)
Parameters:

customScript (str)

Return type:

None

setDefaults()
Return type:

None

setDescription(description)
Parameters:

description (str)

Return type:

None

setId(id)
Parameters:

id (str)

Return type:

None

setLicenseRequired(licenseRequired)
Parameters:

licenseRequired (bool)

Return type:

None

setName(name)
Parameters:

name (str)

Return type:

None

setOnceScript(onceScript)
Parameters:

onceScript (str)

Return type:

None

setPackageVersion(packageVersion)
Parameters:

packageVersion (str)

Return type:

None

setPriority(priority)
Parameters:

priority (int)

Return type:

None

setProductClassIds(productClassIds)
Parameters:

productClassIds (list[str])

Return type:

None

setProductVersion(productVersion)
Parameters:

productVersion (str)

Return type:

None

setSetupScript(setupScript)
Parameters:

setupScript (str)

Return type:

None

setUninstallScript(uninstallScript)
Parameters:

uninstallScript (str)

Return type:

None

setUpdateScript(updateScript)
Parameters:

updateScript (str)

Return type:

None

setUserLoginScript(userLoginScript)
Parameters:

userLoginScript (str)

Return type:

None

setWindowsSoftwareIds(windowsSoftwareIds)
Parameters:

windowsSoftwareIds (list[str])

Return type:

None

sub_classes: dict[str, type] = {'LocalbootProduct': <class 'opsicommon.objects.LocalbootProduct'>, 'NetbootProduct': <class 'opsicommon.objects.NetbootProduct'>}
property version: str | None
class opsicommon.objects.ProductDependency(productId, productVersion, packageVersion, productAction, requiredProductId, requiredProductVersion=None, requiredPackageVersion=None, requiredAction=None, requiredInstallationStatus=None, requirementType=None)

Bases: Relationship

Parameters:
  • productId (str)

  • productVersion (str)

  • packageVersion (str)

  • productAction (str)

  • requiredProductId (str)

  • requiredProductVersion (str | None)

  • requiredPackageVersion (str | None)

  • requiredAction (str | None)

  • requiredInstallationStatus (str | None)

  • requirementType (str | None)

backend_method_prefix = 'productDependency'
getPackageVersion()
Return type:

str

getProductAction()
Return type:

str

getProductId()
Return type:

str

getProductVersion()
Return type:

str

getRequiredAction()
Return type:

str | None

getRequiredInstallationStatus()
Return type:

str | None

getRequiredPackageVersion()
Return type:

str | None

getRequiredProductId()
Return type:

str | None

getRequiredProductVersion()
Return type:

str | None

getRequirementType()
Return type:

str | None

setDefaults()
Return type:

None

setPackageVersion(packageVersion)
Parameters:

packageVersion (str)

Return type:

None

setProductAction(productAction)
Parameters:

productAction (str)

Return type:

None

setProductId(productId)
Parameters:

productId (str)

Return type:

None

setProductVersion(productVersion)
Parameters:

productVersion (str)

Return type:

None

setRequiredAction(requiredAction)
Parameters:

requiredAction (str)

Return type:

None

setRequiredInstallationStatus(requiredInstallationStatus)
Parameters:

requiredInstallationStatus (str)

Return type:

None

setRequiredPackageVersion(requiredPackageVersion)
Parameters:

requiredPackageVersion (str)

Return type:

None

setRequiredProductId(requiredProductId)
Parameters:

requiredProductId (str)

Return type:

None

setRequiredProductVersion(requiredProductVersion)
Parameters:

requiredProductVersion (str)

Return type:

None

setRequirementType(requirementType)
Parameters:

requirementType (str)

Return type:

None

sub_classes: dict[str, type] = {}
class opsicommon.objects.ProductGroup(id, description=None, notes=None, parentGroupId=None)

Bases: Group

Parameters:
  • id (str)

  • description (str | None)

  • notes (str | None)

  • parentGroupId (str | None)

setDefaults()
Return type:

None

sub_classes: dict[str, type] = {}
class opsicommon.objects.ProductOnClient(productId, productType, clientId, targetConfiguration=None, installationStatus=None, actionRequest=None, lastAction=None, actionProgress=None, actionResult=None, productVersion=None, packageVersion=None, modificationTime=None, actionSequence=None)

Bases: Relationship

Parameters:
  • productId (str)

  • productType (str)

  • clientId (str)

  • targetConfiguration (str | None)

  • installationStatus (str | None)

  • actionRequest (str | None)

  • lastAction (str | None)

  • actionProgress (str | None)

  • actionResult (str | None)

  • productVersion (str | None)

  • packageVersion (str | None)

  • modificationTime (str | None)

  • actionSequence (int | None)

backend_method_prefix = 'productOnClient'
getActionProgress()
Return type:

str | None

getActionRequest()
Return type:

str | None

getActionResult()
Return type:

str | None

getActionSequence()
Return type:

int | None

getClientId()
Return type:

str

getInstallationStatus()
Return type:

str | None

getLastAction()
Return type:

str | None

getModificationTime()
Return type:

str | None

getPackageVersion()
Return type:

str | None

getProductId()
Return type:

str

getProductType()
Return type:

str | None

getProductVersion()
Return type:

str | None

getTargetConfiguration()
Return type:

str | None

setActionProgress(actionProgress)
Parameters:

actionProgress (str)

Return type:

None

setActionRequest(actionRequest)
Parameters:

actionRequest (str)

Return type:

None

setActionResult(actionResult)
Parameters:

actionResult (str)

Return type:

None

setActionSequence(actionSequence)
Parameters:

actionSequence (int)

Return type:

None

setClientId(clientId)
Parameters:

clientId (str)

Return type:

None

setDefaults()
Return type:

None

setInstallationStatus(installationStatus)
Parameters:

installationStatus (str)

Return type:

None

setLastAction(lastAction)
Parameters:

lastAction (str)

Return type:

None

setModificationTime(modificationTime)
Parameters:

modificationTime (str)

Return type:

None

setPackageVersion(packageVersion)
Parameters:

packageVersion (str)

Return type:

None

setProductId(productId)
Parameters:

productId (str)

Return type:

None

setProductType(productType)
Parameters:

productType (str)

Return type:

None

setProductVersion(productVersion)
Parameters:

productVersion (str)

Return type:

None

setTargetConfiguration(targetConfiguration)
Parameters:

targetConfiguration (str)

Return type:

None

sub_classes: dict[str, type] = {}
property version: str
class opsicommon.objects.ProductOnDepot(productId, productType, productVersion, packageVersion, depotId, locked=None)

Bases: Relationship

Parameters:
  • productId (str)

  • productType (str)

  • productVersion (str)

  • packageVersion (str)

  • depotId (str)

  • locked (bool | None)

backend_method_prefix = 'productOnDepot'
getDepotId()
Return type:

str

getLocked()
Return type:

bool | None

getPackageVersion()
Return type:

str | None

getProductId()
Return type:

str

getProductType()
Return type:

str | None

getProductVersion()
Return type:

str | None

setDefaults()
Return type:

None

setDepotId(depotId)
Parameters:

depotId (str)

Return type:

None

setLocked(locked)
Parameters:

locked (bool)

Return type:

None

setPackageVersion(packageVersion)
Parameters:

packageVersion (str)

Return type:

None

setProductId(productId)
Parameters:

productId (str)

Return type:

None

setProductType(productType)
Parameters:

productType (str)

Return type:

None

setProductVersion(productVersion)
Parameters:

productVersion (str)

Return type:

None

sub_classes: dict[str, type] = {}
property version: str
class opsicommon.objects.ProductProperty(productId, productVersion, packageVersion, propertyId, description=None, possibleValues=None, defaultValues=None, editable=None, multiValue=None)

Bases: Entity

Parameters:
  • productId (str)

  • productVersion (str)

  • packageVersion (str)

  • propertyId (str)

  • description (str | None)

  • possibleValues (list[Any] | None)

  • defaultValues (list[Any] | None)

  • editable (bool | None)

  • multiValue (bool | None)

backend_method_prefix = 'productProperty'
getDefaultValues()
Return type:

list[Any] | None

getDescription()
Return type:

str | None

getEditable()
Return type:

bool | None

getMultiValue()
Return type:

bool | None

getPackageVersion()
Return type:

str

getPossibleValues()
Return type:

list[Any] | None

getProductId()
Return type:

str

getProductVersion()
Return type:

str

getPropertyId()
Return type:

str

setDefaultValues(defaultValues)
Parameters:

defaultValues (list[Any])

Return type:

None

setDefaults()
Return type:

None

setDescription(description)
Parameters:

description (str)

Return type:

None

setEditable(editable)
Parameters:

editable (bool)

Return type:

None

setMultiValue(multiValue)
Parameters:

multiValue (bool)

Return type:

None

setPackageVersion(packageVersion)
Parameters:

packageVersion (str)

Return type:

None

setPossibleValues(possibleValues)
Parameters:

possibleValues (list[Any])

Return type:

None

setProductId(productId)
Parameters:

productId (str)

Return type:

None

setProductVersion(productVersion)
Parameters:

productVersion (str)

Return type:

None

setPropertyId(propertyId)
Parameters:

propertyId (str)

Return type:

None

sub_classes: dict[str, type] = {'BoolProductProperty': <class 'opsicommon.objects.BoolProductProperty'>, 'UnicodeProductProperty': <class 'opsicommon.objects.UnicodeProductProperty'>}
class opsicommon.objects.ProductPropertyState(productId, propertyId, objectId, values=None)

Bases: Relationship

Parameters:
  • productId (str)

  • propertyId (str)

  • objectId (str)

  • values (list[Any] | None)

backend_method_prefix = 'productPropertyState'
getObjectId()
Return type:

str

getProductId()
Return type:

str

getPropertyId()
Return type:

str

getValues()
Return type:

list[Any] | None

setDefaults()
Return type:

None

setObjectId(objectId)
Parameters:

objectId (str)

Return type:

None

setProductId(productId)
Parameters:

productId (str)

Return type:

None

setPropertyId(propertyId)
Parameters:

propertyId (str)

Return type:

None

setValues(values)
Parameters:

values (list[Any])

Return type:

None

sub_classes: dict[str, type] = {}
class opsicommon.objects.Relationship

Bases: BaseObject

clone(identOnly=False)
Parameters:

identOnly (bool)

Return type:

Self

serialize()
Return type:

dict[str, Any]

setDefaults()
Return type:

None

sub_classes: dict[str, type] = {'AuditHardwareOnHost': <class 'opsicommon.objects.AuditHardwareOnHost'>, 'AuditSoftwareOnClient': <class 'opsicommon.objects.AuditSoftwareOnClient'>, 'AuditSoftwareToLicensePool': <class 'opsicommon.objects.AuditSoftwareToLicensePool'>, 'ConfigState': <class 'opsicommon.objects.ConfigState'>, 'LicenseOnClient': <class 'opsicommon.objects.LicenseOnClient'>, 'ObjectToGroup': <class 'opsicommon.objects.ObjectToGroup'>, 'ProductDependency': <class 'opsicommon.objects.ProductDependency'>, 'ProductOnClient': <class 'opsicommon.objects.ProductOnClient'>, 'ProductOnDepot': <class 'opsicommon.objects.ProductOnDepot'>, 'ProductPropertyState': <class 'opsicommon.objects.ProductPropertyState'>, 'SoftwareLicenseToLicensePool': <class 'opsicommon.objects.SoftwareLicenseToLicensePool'>}
class opsicommon.objects.RetailSoftwareLicense(id, licenseContractId, maxInstallations=None, boundToHost=None, expirationDate=None)

Bases: SoftwareLicense

Parameters:
  • id (str)

  • licenseContractId (str)

  • maxInstallations (int | None)

  • boundToHost (str | None)

  • expirationDate (str | None)

setDefaults()
Return type:

None

sub_classes: dict[str, type] = {}
class opsicommon.objects.SoftwareLicense(id, licenseContractId, maxInstallations=None, boundToHost=None, expirationDate=None)

Bases: Entity

Parameters:
  • id (str)

  • licenseContractId (str)

  • maxInstallations (int | None)

  • boundToHost (str | None)

  • expirationDate (str | None)

backend_method_prefix = 'softwareLicense'
foreign_id_attributes: list[str] = ['softwareLicenseId']
getBoundToHost()
Return type:

str | None

getExpirationDate()
Return type:

str | None

getId()
Return type:

str

getLicenseContractId()
Return type:

str

getMaxInstallations()
Return type:

int | None

setBoundToHost(boundToHost)
Parameters:

boundToHost (str)

Return type:

None

setDefaults()
Return type:

None

setExpirationDate(expirationDate)
Parameters:

expirationDate (str)

Return type:

None

setId(id)
Parameters:

id (str)

Return type:

None

setLicenseContractId(licenseContractId)
Parameters:

licenseContractId (str)

Return type:

None

setMaxInstallations(maxInstallations)
Parameters:

maxInstallations (int)

Return type:

None

sub_classes: dict[str, type] = {'ConcurrentSoftwareLicense': <class 'opsicommon.objects.ConcurrentSoftwareLicense'>, 'OEMSoftwareLicense': <class 'opsicommon.objects.OEMSoftwareLicense'>, 'RetailSoftwareLicense': <class 'opsicommon.objects.RetailSoftwareLicense'>, 'VolumeSoftwareLicense': <class 'opsicommon.objects.VolumeSoftwareLicense'>}
class opsicommon.objects.SoftwareLicenseToLicensePool(softwareLicenseId, licensePoolId, licenseKey=None)

Bases: Relationship

Parameters:
  • softwareLicenseId (str)

  • licensePoolId (str)

  • licenseKey (str | None)

backend_method_prefix = 'softwareLicenseToLicensePool'
getLicenseKey()
Return type:

str | None

getLicensePoolId()
Return type:

str

getSoftwareLicenseId()
Return type:

str

setDefaults()
Return type:

None

setLicenseKey(licenseKey)
Parameters:

licenseKey (str)

Return type:

None

setLicensePoolId(licensePoolId)
Parameters:

licensePoolId (str)

Return type:

None

setSoftwareLicenseId(softwareLicenseId)
Parameters:

softwareLicenseId (str)

Return type:

None

sub_classes: dict[str, type] = {}
class opsicommon.objects.UnicodeConfig(id, description='', possibleValues=None, defaultValues=None, editable=None, multiValue=None)

Bases: Config

Parameters:
  • id (str)

  • description (str)

  • possibleValues (list[Any] | None)

  • defaultValues (list[Any] | None)

  • editable (bool | None)

  • multiValue (bool | None)

setDefaultValues(defaultValues)
Parameters:

defaultValues (list[Any])

Return type:

None

setPossibleValues(possibleValues)
Parameters:

possibleValues (list[Any])

Return type:

None

sub_classes: dict[str, type] = {}
class opsicommon.objects.UnicodeProductProperty(productId, productVersion, packageVersion, propertyId, description=None, possibleValues=None, defaultValues=None, editable=None, multiValue=None)

Bases: ProductProperty

Parameters:
  • productId (str)

  • productVersion (str)

  • packageVersion (str)

  • propertyId (str)

  • description (str | None)

  • possibleValues (list[Any] | None)

  • defaultValues (list[Any] | None)

  • editable (bool | None)

  • multiValue (bool | None)

setDefaultValues(defaultValues)
Parameters:

defaultValues (list[Any])

Return type:

None

setPossibleValues(possibleValues)
Parameters:

possibleValues (list[Any])

Return type:

None

sub_classes: dict[str, type] = {}
class opsicommon.objects.VolumeSoftwareLicense(id, licenseContractId, maxInstallations=None, boundToHost=None, expirationDate=None)

Bases: SoftwareLicense

Parameters:
  • id (str)

  • licenseContractId (str)

  • maxInstallations (int | None)

  • boundToHost (str | None)

  • expirationDate (str | None)

setDefaults()
Return type:

None

sub_classes: dict[str, type] = {}
opsicommon.objects.decode_ident(_class, _hash)
Parameters:
  • _class (Type[BaseObject])

  • _hash (dict[str, Any])

Return type:

dict[str, Any]

opsicommon.objects.get_backend_method_prefix(_class)
Parameters:

_class (Type[BaseObject])

Return type:

Any

opsicommon.objects.get_foreign_id_attributes(_class)
Parameters:

_class (Type[BaseObject])

Return type:

Any

opsicommon.objects.get_ident_attributes(_class)
Parameters:

_class (Type[BaseObject])

Return type:

tuple[str, ...]

opsicommon.objects.get_possible_class_attributes(_class)

Returns the possible attributes of a class.

Parameters:

_class (Type[BaseObject])

Return type:

set[str]

opsicommon.objects.mandatory_constructor_args(_class)
Parameters:

_class (Type[BaseObject])

Return type:

list[str]

opsicommon.objects.objects_differ(obj1, obj2, exclude_attributes=None)
Parameters:
  • obj1 (Any)

  • obj2 (Any)

  • exclude_attributes (list[str] | None)

Return type:

bool

opsicommon.types module

Type forcing features.

This module contains various methods to ensure force a special type on an object.

opsicommon.types.args(*vars, **typeVars)

Function to populate an object with passed on keyword args. This is intended to be used as a decorator. Classes using this decorator must explicitly inherit from object or a subclass of object.

@args()                 #works
class Foo(object):
        pass

@args()                 #works
class Bar(Foo):
        pass

@args()                 #does not work
class Foo():
        pass

@args()                 #does not work
class Foo:
        pass
Parameters:
  • vars (Any)

  • typeVars (Any)

Return type:

Callable

opsicommon.types.forceActionProgress(var)
Parameters:

var (Any)

Return type:

str

opsicommon.types.forceActionRequest(var)
Parameters:

var (Any)

Return type:

str

opsicommon.types.forceActionRequestList(var)
Parameters:

var (Any)

Return type:

list[str]

opsicommon.types.forceActionResult(var)
Parameters:

var (Any)

Return type:

Optional[str]

opsicommon.types.forceArchitecture(var)
Parameters:

var (Any)

Return type:

str

opsicommon.types.forceArchitectureList(var)
Parameters:

var (Any)

Return type:

list[str]

opsicommon.types.forceAuditState(var)
Parameters:

var (Any)

Return type:

int

opsicommon.types.forceBool(var)
Parameters:

var (Any)

Return type:

bool

opsicommon.types.forceBoolList(var)
Parameters:

var (Any)

Return type:

list[bool]

opsicommon.types.forceConfigId(var)
Parameters:

var (Any)

Return type:

str

opsicommon.types.forceDict(var)
Parameters:

var (Any)

Return type:

dict

opsicommon.types.forceDictList(var)
Parameters:

var (Any)

Return type:

list[dict]

opsicommon.types.forceDomain(var)
Parameters:

var (Any)

Return type:

str

opsicommon.types.forceEmailAddress(var)
Parameters:

var (Any)

Return type:

str

opsicommon.types.forceFilename(var)
Parameters:

var (Any)

Return type:

str

opsicommon.types.forceFloat(var)
Parameters:

var (Any)

Return type:

float

opsicommon.types.forceFqdn(var)
Parameters:

var (Any)

Return type:

str

opsicommon.types.forceGroupId(var)
Parameters:

var (Any)

Return type:

str

opsicommon.types.forceGroupIdList(var)
Parameters:

var (Any)

Return type:

list[str]

opsicommon.types.forceGroupType(var)
Parameters:

var (Any)

Return type:

str

opsicommon.types.forceGroupTypeList(var)
Parameters:

var (Any)

Return type:

list[str]

opsicommon.types.forceHardwareAddress(var)
Parameters:

var (Any)

Return type:

str

opsicommon.types.forceHardwareDeviceId(var)
Parameters:

var (Any)

Return type:

str

opsicommon.types.forceHardwareVendorId(var)
Parameters:

var (Any)

Return type:

str

opsicommon.types.forceHostAddress(var)
Parameters:

var (Any)

Return type:

str

opsicommon.types.forceHostId(var)
Parameters:

var (Any)

Return type:

str

opsicommon.types.forceHostIdList(var)
Parameters:

var (Any)

Return type:

list[str]

opsicommon.types.forceHostname(var)
Parameters:

var (Any)

Return type:

str

opsicommon.types.forceIPAddress(var)
Parameters:

var (Any)

Return type:

str

opsicommon.types.forceInstallationStatus(var)
Parameters:

var (Any)

Return type:

str

opsicommon.types.forceInt(var)
Parameters:

var (Any)

Return type:

int

opsicommon.types.forceIntList(var)
Parameters:

var (Any)

Return type:

list[int]

opsicommon.types.forceIpAddress(var)
Parameters:

var (Any)

Return type:

str

opsicommon.types.forceLanguageCode(var)
Parameters:

var (Any)

Return type:

str

opsicommon.types.forceLanguageCodeList(var)
Parameters:

var (Any)

Return type:

list[str]

opsicommon.types.forceLicenseContractId(var)
Parameters:

var (Any)

Return type:

str

opsicommon.types.forceLicenseContractIdList(var)
Parameters:

var (Any)

Return type:

list[str]

opsicommon.types.forceLicensePoolId(var)
Parameters:

var (Any)

Return type:

str

opsicommon.types.forceLicensePoolIdList(var)
Parameters:

var (Any)

Return type:

list[str]

opsicommon.types.forceList(var)
Parameters:

var (Any)

Return type:

list[Any]

opsicommon.types.forceNetmask(var)
Parameters:

var (Any)

Return type:

str

opsicommon.types.forceNetworkAddress(var)
Parameters:

var (Any)

Return type:

str

opsicommon.types.forceObjectClass(var, objectClass)
Parameters:
  • var (Any)

  • objectClass (Type[TypeVar(BaseObjectT, bound= BaseObject)])

Return type:

TypeVar(BaseObjectT, bound= BaseObject)

opsicommon.types.forceObjectClassList(var, objectClass)
Parameters:
  • var (Any)

  • objectClass (Type[TypeVar(BaseObjectT, bound= BaseObject)])

Return type:

list[TypeVar(BaseObjectT, bound= BaseObject)]

opsicommon.types.forceObjectId(var)
Parameters:

var (Any)

Return type:

str

opsicommon.types.forceObjectIdList(var)
Parameters:

var (Any)

Return type:

list[str]

opsicommon.types.forceOct(var)
Parameters:

var (Any)

Return type:

int

opsicommon.types.forceOpsiHostKey(var)
Parameters:

var (Any)

Return type:

str

opsicommon.types.forceOpsiTimestamp(var)

Make var an opsi-compatible timestamp.

This is a string with the format “YYYY-MM-DD HH:MM:SS”.

If a conversion is not possible a ValueError will be raised.

Parameters:

var (Any)

Return type:

str

opsicommon.types.forcePackageCustomName(var)
Parameters:

var (Any)

Return type:

str

opsicommon.types.forcePackageVersion(var)
Parameters:

var (Any)

Return type:

str

opsicommon.types.forcePackageVersionList(var)
Parameters:

var (Any)

Return type:

list[str]

opsicommon.types.forceProductId(var)
Parameters:

var (Any)

Return type:

str

opsicommon.types.forceProductIdList(var)
Parameters:

var (Any)

Return type:

list[str]

opsicommon.types.forceProductPriority(var)
Parameters:

var (Any)

Return type:

int

opsicommon.types.forceProductPropertyId(var)
Parameters:

var (Any)

Return type:

str

opsicommon.types.forceProductPropertyType(var)
Parameters:

var (Any)

Return type:

str

opsicommon.types.forceProductTargetConfiguration(var)
Parameters:

var (Any)

Return type:

str

opsicommon.types.forceProductType(var)
Parameters:

var (Any)

Return type:

str

opsicommon.types.forceProductVersion(var)
Parameters:

var (Any)

Return type:

str

opsicommon.types.forceProductVersionList(var)
Parameters:

var (Any)

Return type:

list[str]

opsicommon.types.forceRequirementType(var)
Parameters:

var (Any)

Return type:

Optional[str]

opsicommon.types.forceSoftwareLicenseId(var)
Parameters:

var (Any)

Return type:

str

opsicommon.types.forceSoftwareLicenseIdList(var)
Parameters:

var (Any)

Return type:

list[str]

opsicommon.types.forceTime(var)

Convert var to a time.struct_time.

If no conversion is possible a ValueError will be raised.

Parameters:

var (Any)

Return type:

Union[struct_time, datetime]

opsicommon.types.forceUnicode(var)
Parameters:

var (Any)

Return type:

str

opsicommon.types.forceUnicodeList(var)
Parameters:

var (Any)

Return type:

list[str]

opsicommon.types.forceUnicodeLower(var)
Parameters:

var (Any)

Return type:

str

opsicommon.types.forceUnicodeLowerList(var)
Parameters:

var (Any)

Return type:

list[str]

opsicommon.types.forceUnicodeUpper(var)
Parameters:

var (Any)

Return type:

str

opsicommon.types.forceUniqueList(_list)
Parameters:

_list (list[Any])

Return type:

list[Any]

opsicommon.types.forceUnsignedInt(var)
Parameters:

var (Any)

Return type:

int

opsicommon.types.forceUrl(var)

Forces var to be an valid URL.

Return type:

str

Parameters:

var (Any)

Module contents

This file is part of opsi - https://www.opsi.org