`org.freedesktop.Problems2.Entry`
Prev | Chapter 2. Interfaces | Next

## `org.freedesktop.Problems2.Entry`

org.freedesktop.Problems2.Entry — The Entry represents single problem.

## Synopsis

### Methods

`GetSemanticElement (` | IN Array<String> element_names,
| OUT Dict<String,Variant> values`)`;

`SetSemanticElement (` | IN Dict<String,Variant> values`)`;

`ReadElements (` | IN Array<String> element_names,
| IN Int32 flags,
| OUT Dict<String,Variant> response`)`;

`SaveElements (` | IN Dict<String,Variant> elements,
| IN Int32 flags`)`;

`DeleteElements (` | IN Array<String> name`)`;

### Properties

##

`READ String ID ;`
`READ UInt32 UID ;`
`READ String User ;`
`READ String Hostname ;`
`READ String Type ;`
`READ UInt64 FirstOccurrence ;`
`READ UInt64 LastOccurrence ;`
`READ UInt32 Count ;`
`READ String Executable ;`
`READ String CommandLineArguments ;`
`READ String Component ;`
`READ Struct<String,String,String,String,String> Package ;`
`READ String UUID ;`
`READ String Duphash ;`
`READ Array<Struct<String,Dict<String,Variant>>> Reports ;`
`READ String Reason ;`
`READ Array<Struct<String,String,String,String,String,Int32>> Solutions ;`
`READ String TechnicalDetails ;`
`READ Array<String> Elements ;`
`READ Array<String> SemanticElements ;`
`READ Boolean IsReported ;`
`READ Boolean CanBeReported ;`
`READ Boolean IsRemote ;`

## Methods

### `org.freedesktop.Problems2.Entry.GetSemanticElement`

`GetSemanticElement (` | IN Array<String> element_names,
| OUT Dict<String,Variant> values`)`;

Gets semantic values of problem's elements. Each implementation of 'org.freedesktop.Problems2' supports their own Semantic Elements. It is an error to call this method with an element that is not listed in the property 'semantic_elements'

`element_names`

  Requested element names.

`values`

  A dictionary where keys are element names and values depend on the implementation of 'org.freedesktop.Problems2'.

### `org.freedesktop.Problems2.Entry.SetSemanticElement`

`SetSemanticElement (` | IN Dict<String,Variant> values`)`;

Sets semantic value of problem's elements. Each implementation of 'org.freedesktop.Problems2' supports their own Semantic Elements. It is an error to call this method with an element that is not listed in the property 'semantic_elements'

`values`

  A dictionary where keys are element names and values depend on the implementation of 'org.freedesktop.Problems2'.

### `org.freedesktop.Problems2.Entry.ReadElements`

`ReadElements (` | IN Array<String> element_names,
| IN Int32 flags,
| OUT Dict<String,Variant> response`)`;

Gets a raw value of a problem's element.

Example 2.5. How to use ReadElements() method to print out a nice list of problems

    #!/usr/bin/python3
    from sys import stdout
    import dbus
    from datetime import datetime

    PROBLEMS_BUS="org.freedesktop.problems"
    PROBLEMS_PATH="/org/freedesktop/Problems2"
    PROBLEMS_IFACE="org.freedesktop.Problems2"
    ENTRY_IFACE="org.freedesktop.Problems2.Entry"

    bus = dbus.SystemBus()
    proxy = bus.get_object(PROBLEMS_BUS, PROBLEMS_PATH)
    problems = dbus.Interface(proxy, dbus_interface=PROBLEMS_IFACE)

    prblms = problems.GetProblems(0x0, {})

    for path in prblms:
        prblm_proxy = bus.get_object(PROBLEMS_BUS, path)
        prblm  = dbus.Interface(prblm_proxy, dbus_interface=ENTRY_IFACE)
        kv = prblm.ReadElements(["time", "count", "package", "reason"], 0x4)

        date = datetime.fromtimestamp(float(kv["time"]))
        count = int(kv.get("count", 0))
        package = str(kv.get("package", ""))
        reason = str(kv.get("reason", ""))

        stdout.write("{0} {1:-3} {2:40} : {3}\n".format(date, count, package, reason))

`element_names`

  A list of names of required info. If type of a requested element does not match the type specified in the argument 'i', the element will be ignored and its value will not be included in the response.

`flags`

  Enables selection of the allowed type and the type of return values.

  0x0 : NO_FLAGS

    Do not check element types and return text elements as D-Bus strings, big text elements as UNIX file descriptors and binary elements as UNIX file descriptors too.

  0x1 : ALL_FD

    The returned values will be file descriptors for all element types (text, big text and binary)

  0x2 : ALL_TYPES

    (TODO : I am not sure what I had on mind. I will remove this term later.)

  0x4 : ONLY_TEXT

    Only those elements that are of text type are read and their contents are returned as D-Bus strings by default.

  0x8 : ONLY_BIG_TEXT

    Only those elements that are of binary type are read and their contents are returned as UNIX file descriptors

  0x10 : ONLY_BINARY

    Only those elements that are of big text type are read and their contents are returned as UNIX file descriptors

  0x20 : ALL_NO_FD

    Return binary data as fixed byte array

`response`

  Dictionary here the key is a requested element name and the value is the element's value.

### `org.freedesktop.Problems2.Entry.SaveElements`

`SaveElements (` | IN Dict<String,Variant> elements,
| IN Int32 flags`)`;

Creates or updates raw values of the given problem elements. See org.freedesktop.Problems2.NewProblem for more details about element naming rules.

`elements`

  The problem elements and their values of one of the following types:

  s

    text data

  ay

    binary data

  h

    file descriptor - will be read in non-blocking mode

`flags`

  This argument is used to define how to recover from errors.

### `org.freedesktop.Problems2.Entry.DeleteElements`

`DeleteElements (` | IN Array<String> name`)`;

Deletes the listed problem's elements.

`name`

  The list of deleted problem elements.

## D-Bus Properties

Accessed using the org.freedesktop.DBus.Properties interface.

`READ String ID ;`

The UNIX time when the collection was created.

`READ UInt32 UID ;`

The UID of the crashed program.

`READ String User ;`

The user name associated with the uid.

`READ String Hostname ;`

Name of the host where the problem occurred

`READ String Type ;`

The type of the problem (CCpp, Python, Kerneloops, Java, Ruby, ...).

`READ UInt64 FirstOccurrence ;`

The UNIX time when the problem entry was created.

`READ UInt64 LastOccurrence ;`

The UNIX time when the problem entry was seen for the last time.

`READ UInt32 Count ;`

The number of observed problem's occurrences.

`READ String Executable ;`

The file system path to crashed program.

`READ String CommandLineArguments ;`

The command line arguments used run the crashed program.

`READ String Component ;`

The component which the package belongs to.

`READ Struct<String,String,String,String,String> Package ;`

Information about the package which the crashed program belongs to:

1. full name

2. epoch

3. name

4. version

5. release

`READ String UUID ;`

A local scope, unique identifier for similar problems to the problem.

`READ String Duphash ;`

A global scope, unique identifier for similar problems to the problem.

`READ Array<Struct<String,Dict<String,Variant>>> Reports ;`

The list of reports of the problem in the form of a dictionary where the key is the report type (e.g. Bugzilla, ABRT Server) and the value is another dictionary with the report information ("URL", "https://bugzilla.redhat.com/1000000"). Known information types are the following:

URL

  An URL

BTHASH

  An indentifier of the problem returned by ABRT server

MSG

  A message

CERTAINTY

  This type can appear only together with a entry of the "URL" type. Its value is an integer and represents percentual relevance to of the URL to the problem.

`READ String Reason ;`

A brief description of what caused the problem.

`READ Array<Struct<String,String,String,String,String,Int32>> Solutions ;`

List of solutions that are a structrure with these members (which are self-explanatory):

1. solution type

2. title

3. URL

4. note_text

5. note_html

6. certainty

`READ String TechnicalDetails ;`

Technical details about the problem usually containing explanation for the not-reporatiblity of the problem (e.g tainted Kernel oopses).

`READ Array<String> Elements ;`

List of all elements the problem data contains.

`READ Array<String> SemanticElements ;`

List of all semantic elements that can be handled by GetSemanticElement and SetSemanticElement methods.

`READ Boolean IsReported ;`

True if someone took the time to file a ticket in the OS's default bug tracking system.

`READ Boolean CanBeReported ;`

TRUE if it is possible to file a ticket in the OS's default bug tracking system.

`READ Boolean IsRemote ;`

TRUE if the problem data has been uploaded by another host.

Prev | Up | Next
`org.freedesktop.Problems2` | Home | `org.freedesktop.Problems2.Session`