Libosinfo.Db¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
None
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class Libosinfo.Db(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod new()¶
- Returns:
the new database
- Return type:
- add_datamap(datamap)¶
- Parameters:
datamap (
Libosinfo.Datamap
) – an install datamap
New in version 0.2.3.
- add_deployment(deployment)¶
- Parameters:
deployment (
Libosinfo.Deployment
) – a deployment
- add_device(device)¶
- Parameters:
device (
Libosinfo.Device
) – a device
- add_install_script(script)¶
- Parameters:
script (
Libosinfo.InstallScript
) – an install script
New in version 0.2.0.
- add_os(os)¶
- Parameters:
os (
Libosinfo.Os
) – an operating system
- add_platform(platform)¶
- Parameters:
platform (
Libosinfo.Platform
) – an platform
- find_deployment(os, platform)¶
- Parameters:
os (
Libosinfo.Os
) – the operating system to findplatform (
Libosinfo.Platform
) – the virtualization platform
- Returns:
the deployment, or
None
- Return type:
Find the deployment for os on platform, if any.
- get_datamap(id)¶
- Parameters:
id (
str
) – the unique operating system identifier- Returns:
the install datamap, or
None
if none is found- Return type:
New in version 0.2.3.
- get_datamap_list()¶
- Returns:
the list of install datamaps
- Return type:
New in version 0.2.3.
- get_deployment(id)¶
- get_deployment_list()¶
- Returns:
the list of deployments
- Return type:
- get_device(id)¶
- get_device_list()¶
- Returns:
the list of devices
- Return type:
- get_install_script(id)¶
- Parameters:
id (
str
) – the unique operating system identifier- Returns:
the install script, or
None
if none is found- Return type:
New in version 0.2.0.
- get_install_script_list()¶
- Returns:
the list of install scripts
- Return type:
New in version 0.2.0.
- get_os(id)¶
- get_os_list()¶
- Returns:
the list of operating systems
- Return type:
- get_platform(id)¶
- get_platform_list()¶
- Returns:
the list of platforms
- Return type:
- guess_os_from_media(media)¶
- Parameters:
media (
Libosinfo.Media
) – the installation media- Returns:
the operating system, or
None
if guessing failed- matched_media:
the matched operating system media
- Return type:
(
Libosinfo.Os
, matched_media:Libosinfo.Media
)
Guess operating system given an
Libosinfo.Media
object.Deprecated since version 0.2.3: Use
Libosinfo.Db.identify_media
() instead.
- guess_os_from_tree(tree)¶
- Parameters:
tree (
Libosinfo.Tree
) – the installation tree- Returns:
the operating system, or
None
if guessing failed- matched_tree:
the matched operating system tree
- Return type:
(
Libosinfo.Os
, matched_tree:Libosinfo.Tree
)
Guess operating system given an
Libosinfo.Tree
object.Deprecated since version 1.6.0: Use
Libosinfo.Db.identify_tree
() instead.
- identify_media(media)¶
- Parameters:
media (
Libosinfo.Media
) – the installation media data- Returns:
- Return type:
Try to match a newly created media with a media description from self. If found, media will be filled with the corresponding information stored in self. In particular, after a call to
Libosinfo.Db.identify_media
(), if the media could be identified, its OsinfoEntify::id andLibosinfo.Media
::os
properties will be set.The match for media in self is not guaranteed to be unique and this method will only return the first match found. The order in which matches are identified is not guaranteed, so when there are multiple matches, the returned match may vary over time. Applications are recommended to use the #osinfo_db_identify_all_media method instead to receive all matched media.
New in version 0.2.3.
- identify_medialist(media)¶
- Parameters:
media (
Libosinfo.Media
) – the installation media data- Returns:
a list containing any matches for media found in self
- Return type:
Try to match a newly created media with a media description from self. The return list will contain any
Libosinfo.Media
instances from self that matched media. Usuaully there will only be one match returned, but applications should be prepared to deal with multiple matches. The returnedLibosinfo.Media
instances will have their OsinfoEntify::id andLibosinfo.Media
::os
properties will be set, while media is left unmodified.New in version 1.10.0.
- identify_tree(tree)¶
- Parameters:
tree (
Libosinfo.Tree
) – the installation tree data- Returns:
- Return type:
Try to match a newly created tree with a tree description from self. If found, tree will be filled with the corresponding information stored in self. In particular, after a call to
Libosinfo.Db.identify_tree
(), if the tree could be identified, its OsinfoEntify::id andLibosinfo.Media
::os
properties will be set.The match for tree in self is not guaranteed to be unique and this method will only return the first match found. The order in which matches are identified is not guaranteed, so when there are multiple matches, the returned match may vary over time. Applications are recommended to use the #osinfo_db_identify_all_tree method instead to receive all matched tree.
New in version 1.6.0.
- identify_treelist(tree)¶
- Parameters:
tree (
Libosinfo.Tree
) – the installation tree data- Returns:
a list containing any matches for tree found in self
- Return type:
Try to match a newly created tree with a tree description from self. The return list will contain any
Libosinfo.Tree
instances from self that matched tree. Usuaully there will only be one match returned, but applications should be prepared to deal with multiple matches. The returnedLibosinfo.Tree
instances will have their OsinfoEntify::id andLibosinfo.Tree
::os
properties will be set, while tree is left unmodified.New in version 1.10.0.
- unique_values_for_os_relationship(relshp)¶
- Parameters:
relshp (
Libosinfo.ProductRelationship
) – the product relationship- Returns:
a list of operating systems
- Return type:
Get all operating systems that are the referee in an operating system relationship.
- unique_values_for_platform_relationship(relshp)¶
- Parameters:
relshp (
Libosinfo.ProductRelationship
) – the product relationship- Returns:
a list of virtualization platforms
- Return type:
Get all platforms that are the referee in an platform relationship.
- unique_values_for_property_in_deployment(propName)¶
-
Get all unique values for a named property amongst all deployments in the database
- unique_values_for_property_in_device(propName)¶
-
Get all unique values for a named property amongst all devices in the database
- unique_values_for_property_in_os(propName)¶
-
Get all unique values for a named property amongst all operating systems in the database