Libosinfo.Resources

g GObject.Object GObject.Object Libosinfo.Entity Libosinfo.Entity GObject.Object->Libosinfo.Entity Libosinfo.Resources Libosinfo.Resources Libosinfo.Entity->Libosinfo.Resources

Subclasses:

None

Methods

Inherited:

Libosinfo.Entity (15), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new (id, architecture)

get_architecture ()

get_cpu ()

get_n_cpus ()

get_ram ()

get_storage ()

set_cpu (cpu)

set_n_cpus (n_cpus)

set_ram (ram)

set_storage (storage)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Inherited:

Libosinfo.Entity (1)

Name

Type

Flags

Short Description

architecture

str

r/w/co

CPU Architecture

cpu

int

r/w

CPU frequency in hertz (Hz)

n-cpus

int

r/w

Number of CPUs

ram

int

r/w

Amount of Random Access Memory (RAM) in bytes

storage

int

r/w

Amount of storage space in bytes

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

Libosinfo.Entity

r

Class Details

class Libosinfo.Resources(**kwargs)
Bases:

Libosinfo.Entity

Abstract:

No

Structure:

Libosinfo.ResourcesClass

classmethod new(id, architecture)
Parameters:
  • id (str) –

  • architecture (str) –

Return type:

Libosinfo.Resources

get_architecture()
Returns:

the hardware architecture.

Return type:

str

Retrieves the target hardware architecture to which self applies. Some operating systems specify the same requirements and recommendations for all architectures. In such cases, the string returned by this call will be Libosinfo.ARCHITECTURE_ALL.

get_cpu()
Returns:

the CPU frequency, or -1.

Return type:

int

Retrieves the CPU frequency in hertz (Hz). Divide the value by Libosinfo.MEGAHERTZ if you need this value in megahertz (MHz).

get_n_cpus()
Returns:

the number of CPUs, or -1.

Return type:

int

Retrieves the number of CPUs.

get_ram()
Returns:

the amount of RAM, or -1.

Return type:

int

Retrieves the amount of Random Access Memory (RAM) in bytes. Divide the value by Libosinfo.MEBIBYTES if you need this value in mebibytes.

get_storage()
Returns:

the amount of storage, or -1.

Return type:

int

Retrieves the amount of storage space in bytes. Divide the value by Libosinfo.GIBIBYTES if you need this value in gibibytes.

set_cpu(cpu)
Parameters:

cpu (int) – the CPU frequency in hertz (Hz)

Sets the CPU frequency.

set_n_cpus(n_cpus)
Parameters:

n_cpus (int) – the number of CPUs

Sets the number of CPUs.

set_ram(ram)
Parameters:

ram (int) – the amount of ram in bytes

Sets the amount of RAM in bytes.

set_storage(storage)
Parameters:

storage (int) – the amount of storage in bytes

Sets the amount of storage space.

Property Details

Libosinfo.Resources.props.architecture
Name:

architecture

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The target hardware architecture to which these resources applies.

Libosinfo.Resources.props.cpu
Name:

cpu

Type:

int

Default Value:

-1

Flags:

READABLE, WRITABLE

The CPU frequency in hertz (Hz).

Libosinfo.Resources.props.n_cpus
Name:

n-cpus

Type:

int

Default Value:

-1

Flags:

READABLE, WRITABLE

The number of CPUs.

Libosinfo.Resources.props.ram
Name:

ram

Type:

int

Default Value:

-1

Flags:

READABLE, WRITABLE

The amount of Random Access Memory (RAM) in bytes.

Libosinfo.Resources.props.storage
Name:

storage

Type:

int

Default Value:

-1

Flags:

READABLE, WRITABLE

The amount of storage space in bytes.