|
Packit Service |
8a8a03 |
<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 Service |
8a8a03 |
org.freedesktop.Problems2.Entry
|
|
Packit Service |
8a8a03 |
Prev Chapter 2. Interfaces Next
|
|
Packit Service |
8a8a03 |
org.freedesktop.Problems2.Entry
|
|
Packit Service |
8a8a03 |
org.freedesktop.Problems2.Entry — The Entry represents single problem.
|
|
Packit Service |
8a8a03 |
GetSemanticElement
|
|
Packit Service |
8a8a03 |
(IN Array<String> element_names, OUT Dict<String,Variant> values) ;
|
|
Packit Service |
8a8a03 |
SetSemanticElement
|
|
Packit Service |
8a8a03 |
(IN Dict<String,Variant> values) ;
|
|
Packit Service |
8a8a03 |
ReadElements
|
|
Packit Service |
8a8a03 |
(IN Array<String> element_names, IN Int32 flags, OUT Dict<String,Variant> response) ;
|
|
Packit Service |
8a8a03 |
SaveElements
|
|
Packit Service |
8a8a03 |
(IN Dict<String,Variant> elements, IN Int32 flags) ;
|
|
Packit Service |
8a8a03 |
DeleteElements
|
|
Packit Service |
8a8a03 |
(IN Array<String> name) ; PropertiesREAD 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 ;
|
|
Packit Service |
8a8a03 |
org.freedesktop.Problems2.Entry.GetSemanticElement
|
|
Packit Service |
8a8a03 |
|
|
Packit Service |
8a8a03 |
GetSemanticElement
|
|
Packit Service |
8a8a03 |
(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 Service |
8a8a03 |
element_names
|
|
Packit Service |
8a8a03 |
Requested element names.
|
|
Packit Service |
8a8a03 |
values
|
|
Packit Service |
8a8a03 |
A dictionary where keys are element names and values depend on the implementation of 'org.freedesktop.Problems2'.
|
|
Packit Service |
8a8a03 |
org.freedesktop.Problems2.Entry.SetSemanticElement
|
|
Packit Service |
8a8a03 |
|
|
Packit Service |
8a8a03 |
SetSemanticElement
|
|
Packit Service |
8a8a03 |
(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 Service |
8a8a03 |
values
|
|
Packit Service |
8a8a03 |
A dictionary where keys are element names and values depend on the implementation of 'org.freedesktop.Problems2'.
|
|
Packit Service |
8a8a03 |
org.freedesktop.Problems2.Entry.ReadElements
|
|
Packit Service |
8a8a03 |
|
|
Packit Service |
8a8a03 |
ReadElements
|
|
Packit Service |
8a8a03 |
(IN Array<String> element_names, IN Int32 flags, OUT Dict<String,Variant> response) ; Gets a raw value of a problem's element.
|
|
Packit Service |
8a8a03 |
Example 2.5. How to use ReadElements() method to print out a nice list of problems
|
|
Packit Service |
8a8a03 |
|
|
Packit Service |
8a8a03 |
#!/usr/bin/python3
|
|
Packit Service |
8a8a03 |
from sys import stdout
|
|
Packit Service |
8a8a03 |
import dbus
|
|
Packit Service |
8a8a03 |
from datetime import datetime
|
|
Packit Service |
8a8a03 |
|
|
Packit Service |
8a8a03 |
PROBLEMS_BUS="org.freedesktop.problems"
|
|
Packit Service |
8a8a03 |
PROBLEMS_PATH="/org/freedesktop/Problems2"
|
|
Packit Service |
8a8a03 |
PROBLEMS_IFACE="org.freedesktop.Problems2"
|
|
Packit Service |
8a8a03 |
ENTRY_IFACE="org.freedesktop.Problems2.Entry"
|
|
Packit Service |
8a8a03 |
|
|
Packit Service |
8a8a03 |
bus = dbus.SystemBus()
|
|
Packit Service |
8a8a03 |
proxy = bus.get_object(PROBLEMS_BUS, PROBLEMS_PATH)
|
|
Packit Service |
8a8a03 |
problems = dbus.Interface(proxy, dbus_interface=PROBLEMS_IFACE)
|
|
Packit Service |
8a8a03 |
|
|
Packit Service |
8a8a03 |
prblms = problems.GetProblems(0x0, {})
|
|
Packit Service |
8a8a03 |
|
|
Packit Service |
8a8a03 |
for path in prblms:
|
|
Packit Service |
8a8a03 |
prblm_proxy = bus.get_object(PROBLEMS_BUS, path)
|
|
Packit Service |
8a8a03 |
prblm = dbus.Interface(prblm_proxy, dbus_interface=ENTRY_IFACE)
|
|
Packit Service |
8a8a03 |
kv = prblm.ReadElements(["time", "count", "package", "reason"], 0x4)
|
|
Packit Service |
8a8a03 |
|
|
Packit Service |
8a8a03 |
date = datetime.fromtimestamp(float(kv["time"]))
|
|
Packit Service |
8a8a03 |
count = int(kv.get("count", 0))
|
|
Packit Service |
8a8a03 |
package = str(kv.get("package", ""))
|
|
Packit Service |
8a8a03 |
reason = str(kv.get("reason", ""))
|
|
Packit Service |
8a8a03 |
|
|
Packit Service |
8a8a03 |
stdout.write("{0} {1:-3} {2:40} : {3}\n".format(date, count, package, reason))
|
|
Packit Service |
8a8a03 |
|
|
Packit Service |
8a8a03 |
|
|
Packit Service |
8a8a03 |
|
|
Packit Service |
8a8a03 |
element_names
|
|
Packit Service |
8a8a03 |
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 Service |
8a8a03 |
flags
|
|
Packit Service |
8a8a03 |
Enables selection of the allowed type and the type of return values.
|
|
Packit Service |
8a8a03 |
- 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 Service |
8a8a03 |
|
|
Packit Service |
8a8a03 |
response
|
|
Packit Service |
8a8a03 |
Dictionary here the key is a requested element name and the value is the element's value.
|
|
Packit Service |
8a8a03 |
org.freedesktop.Problems2.Entry.SaveElements
|
|
Packit Service |
8a8a03 |
|
|
Packit Service |
8a8a03 |
SaveElements
|
|
Packit Service |
8a8a03 |
(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 Service |
8a8a03 |
elements
|
|
Packit Service |
8a8a03 |
The problem elements and their values of one of the following types:
|
|
Packit Service |
8a8a03 |
- s
text data - ay
binary data - h
file descriptor - will be read in non-blocking mode
|
|
Packit Service |
8a8a03 |
|
|
Packit Service |
8a8a03 |
flags
|
|
Packit Service |
8a8a03 |
This argument is used to define how to recover from errors.
|
|
Packit Service |
8a8a03 |
org.freedesktop.Problems2.Entry.DeleteElements
|
|
Packit Service |
8a8a03 |
|
|
Packit Service |
8a8a03 |
DeleteElements
|
|
Packit Service |
8a8a03 |
(IN Array<String> name) ; Deletes the listed problem's elements.
|
|
Packit Service |
8a8a03 |
name
|
|
Packit Service |
8a8a03 |
The list of deleted problem elements.
|
|
Packit Service |
8a8a03 |
Accessed using the org.freedesktop.DBus.Properties interface.
|
|
Packit Service |
8a8a03 |
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 Service |
8a8a03 |
full name epoch name version release
|
|
Packit Service |
8a8a03 |
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 Service |
8a8a03 |
- 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 Service |
8a8a03 |
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 Service |
8a8a03 |
solution type title URL note_text note_html certainty
|
|
Packit Service |
8a8a03 |
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 Service |
8a8a03 |
org.freedesktop.Problems2
|
|
Packit Service |
8a8a03 |
Home
|
|
Packit Service |
8a8a03 |
org.freedesktop.Problems2.Session
|
|
Packit Service |
8a8a03 |
</body></html>
|