Powertrain Event Service API Client
Bases: BasePowertrainAPIClient
Powertrain Event Service API Client.
Source code in reportconnectors/api_client/powertrain/event_service/__init__.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 | |
get_event_comments(event_id)
Gets the event related comments.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
event_id
|
int
|
Identifier of the event |
required |
Returns:
| Type | Description |
|---|---|
EventCommentsResponse
|
Asset properties. |
Source code in reportconnectors/api_client/powertrain/event_service/__init__.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 | |
get_events(asset_ids, start_date, end_date, use_cursor=False, page_size=100, **kwargs)
Returns the events for the given asset ids and date range.
It's based on the Event/Search endpoint.
It also allows to filter events by severity, status, cause, existence of comments, binary logger, data loggers, parameter backup, and message text.
Results are paginated with a default page size of 100.
However, if you set use_cursor=True, it will fetch all the events,
by using the cursor returned in the response.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
asset_ids
|
Union[int, Sequence[int]]
|
Asset identifier or list of asset identifiers. |
required |
start_date
|
datetime
|
Start date of the search. |
required |
end_date
|
datetime
|
End date of the search. |
required |
use_cursor
|
bool
|
If True, it will fetch all the events using the cursor returned in the response. Otherwise,
it will fetch only the first page with the results. Default: |
False
|
page_size
|
int
|
Number of events per page. Default: |
100
|
Other Parameters:
| Name | Type | Description |
|---|---|---|
severity_codes |
List[str]
|
List of severity codes to filter the events. |
status_codes |
List[str]
|
List of status codes to filter the events. |
cause_codes |
List[str]
|
List of cause codes to filter the events. |
has_comments |
bool
|
If True, it will filter the events that have comments. |
has_binary_logger |
bool
|
If True, it will filter the events that have binary logger. |
has_data_loggers |
bool
|
If True, it will filter the events that have data loggers. |
has_parameter_backup |
bool
|
If True, it will filter the events that have parameter backup. |
message_text_contains |
str
|
Text to search in the message text. |
cursor |
str
|
Cursor that points to a specific results page. |
Returns:
| Type | Description |
|---|---|
EventSearchResponse
|
EventSearchResponse object, that has the list of events and the next cursor. |
Source code in reportconnectors/api_client/powertrain/event_service/__init__.py
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 | |