Blame doc/problems-service/html/re02.html

Packit 8ea169
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>org.freedesktop.Problems2.Entry</title><link rel="stylesheet" type="text/css" href="style.css"><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot"><link rel="home" href="index.html" title="Problems API"><link rel="up" href="ch02.html" title="Chapter 2. Interfaces"><link rel="prev" href="re01.html" title="org.freedesktop.Problems2"><link rel="next" href="re03.html" title="org.freedesktop.Problems2.Session"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
Packit 8ea169
          org.freedesktop.Problems2.Entry
Packit 8ea169
        Prev Chapter 2. Interfaces Next

Packit 8ea169
          org.freedesktop.Problems2.Entry
Packit 8ea169
        

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

Synopsis

Methods

Packit 8ea169
                GetSemanticElement
Packit 8ea169
              (IN Array<String> element_names,  OUT Dict<String,Variant> values);
 
Packit 8ea169
                SetSemanticElement
Packit 8ea169
              (IN Dict<String,Variant> values);
 
Packit 8ea169
                ReadElements
Packit 8ea169
              (IN Array<String> element_names,  IN Int32 flags,  OUT Dict<String,Variant> response);
 
Packit 8ea169
                SaveElements
Packit 8ea169
              (IN Dict<String,Variant> elements,  IN Int32 flags);
 
Packit 8ea169
                DeleteElements
Packit 8ea169
              (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

Packit 8ea169
            org.freedesktop.Problems2.Entry.GetSemanticElement
Packit 8ea169
          
Packit 8ea169
                GetSemanticElement
Packit 8ea169
              (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'

Packit 8ea169
                element_names
Packit 8ea169
              

Requested element names.

Packit 8ea169
                values
Packit 8ea169
              

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

Packit 8ea169
            org.freedesktop.Problems2.Entry.SetSemanticElement
Packit 8ea169
          
Packit 8ea169
                SetSemanticElement
Packit 8ea169
              (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'

Packit 8ea169
                values
Packit 8ea169
              

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

Packit 8ea169
            org.freedesktop.Problems2.Entry.ReadElements
Packit 8ea169
          
Packit 8ea169
                ReadElements
Packit 8ea169
              (IN Array<String> element_names,  IN Int32 flags,  OUT Dict<String,Variant> response);
 

Gets a raw value of a problem's element.

Packit 8ea169
                    

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

Packit 8ea169
Packit 8ea169
#!/usr/bin/python3
Packit 8ea169
from sys import stdout
Packit 8ea169
import dbus
Packit 8ea169
from datetime import datetime
Packit 8ea169
Packit 8ea169
PROBLEMS_BUS="org.freedesktop.problems"
Packit 8ea169
PROBLEMS_PATH="/org/freedesktop/Problems2"
Packit 8ea169
PROBLEMS_IFACE="org.freedesktop.Problems2"
Packit 8ea169
ENTRY_IFACE="org.freedesktop.Problems2.Entry"
Packit 8ea169
Packit 8ea169
bus = dbus.SystemBus()
Packit 8ea169
proxy = bus.get_object(PROBLEMS_BUS, PROBLEMS_PATH)
Packit 8ea169
problems = dbus.Interface(proxy, dbus_interface=PROBLEMS_IFACE)
Packit 8ea169
Packit 8ea169
prblms = problems.GetProblems(0x0, {})
Packit 8ea169
Packit 8ea169
for path in prblms:
Packit 8ea169
    prblm_proxy = bus.get_object(PROBLEMS_BUS, path)
Packit 8ea169
    prblm  = dbus.Interface(prblm_proxy, dbus_interface=ENTRY_IFACE)
Packit 8ea169
    kv = prblm.ReadElements(["time", "count", "package", "reason"], 0x4)
Packit 8ea169
Packit 8ea169
    date = datetime.fromtimestamp(float(kv["time"]))
Packit 8ea169
    count = int(kv.get("count", 0))
Packit 8ea169
    package = str(kv.get("package", ""))
Packit 8ea169
    reason = str(kv.get("reason", ""))
Packit 8ea169
Packit 8ea169
    stdout.write("{0} {1:-3} {2:40} : {3}\n".format(date, count, package, reason))
Packit 8ea169
Packit 8ea169
                        


Packit 8ea169
                

Packit 8ea169
                element_names
Packit 8ea169
              

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.

Packit 8ea169
                flags
Packit 8ea169
              

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

Packit 8ea169
                        

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

Packit 8ea169
                    

Packit 8ea169
                response
Packit 8ea169
              

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

Packit 8ea169
            org.freedesktop.Problems2.Entry.SaveElements
Packit 8ea169
          
Packit 8ea169
                SaveElements
Packit 8ea169
              (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.

Packit 8ea169
                elements
Packit 8ea169
              

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

Packit 8ea169
                    

s

text data

ay

binary data

h

file descriptor - will be read in non-blocking mode

Packit 8ea169
                   

Packit 8ea169
                flags
Packit 8ea169
              

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

Packit 8ea169
            org.freedesktop.Problems2.Entry.DeleteElements
Packit 8ea169
          
Packit 8ea169
                DeleteElements
Packit 8ea169
              (IN Array<String> name);
 

Deletes the listed problem's elements.

Packit 8ea169
                name
Packit 8ea169
              

The list of deleted problem elements.

D-Bus Properties

Packit 8ea169
            Accessed using the org.freedesktop.DBus.Properties interface.
Packit 8ea169
          

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:

Packit 8ea169
                

  1. full name

  2. epoch

  3. name

  4. version

  5. release

Packit 8ea169
                

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:

Packit 8ea169
                    

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.

Packit 8ea169
                

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):

Packit 8ea169
                    

  1. solution type

  2. title

  3. URL

  4. note_text

  5. note_html

  6. certainty

Packit 8ea169
                

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.

Packit 8ea169
          org.freedesktop.Problems2
Packit 8ea169
         Home 
Packit 8ea169
          org.freedesktop.Problems2.Session
Packit 8ea169
        </body></html>