Aerta¶
Client¶
-
class
Aerta.
Client
¶ A client object representing ‘Aerta’ Service:
import almdrlib client = almdrlib.client('aerta')
Available methods:
-
create_dlq_replay_request
(**kwargs)¶ Starts Replay of DLQ data for the specified engine
Submits a request to replay limit number of DLQ records for the engine. The API makes a best effort attept to ensure accidentally replay of the same data twice.
Supported engines
aerta_eng
Request Syntax
response = client.create_dlq_replay_request( engine='string' filter='string' limit='string' )
- Parameters
engine (string) – [REQUIRED]
filter (string) –
limit (string) –
- Return type
string
- Returns
Response Syntax
'STARTED'
Response Definitions
-
create_global_rta
(**kwargs)¶ Creates Global RTA Model
Request Syntax
response = client.create_global_rta( customers=[ 'string' ] data_type='string' expression={} path='string' )
- Parameters
customers (list) –
[REQUIRED]
List of customers (String) to apply filter to. Specify [“*”] for all customers.
(string) –
data_type (string) – Data type (iff using Object expressions)
expression (dict) –
[REQUIRED]
Expression SQL-like string or object
path (string) –
[REQUIRED]
RTA Model path. Must be unique.
- Return type
dict
- Returns
Response Syntax
{ 'rta_id': 'string' }
Response Definitions
rta_id (string) –
ID of the created RTA Model
-
create_rta
(**kwargs)¶ Creates RTA Model for a specific account
Request Syntax
response = client.create_rta( account_id='string' customers=[ 'string' ] data_type='string' expression={} path='string' )
- Parameters
account_id (string) –
[REQUIRED]
AIMS Account ID
customers (list) –
[REQUIRED]
List of customers (String) to apply filter to. [“*”] for all customers.
(string) –
data_type (string) – Data type (iff using Object expressions)
expression (dict) –
[REQUIRED]
Expression SQL-like string or object
path (string) –
[REQUIRED]
RTA Model path
- Return type
dict
- Returns
Response Syntax
{ 'rta_id': 'string' }
Response Definitions
rta_id (string) –
ID of newly create RTA Model
-
delete_global_rta
(**kwargs)¶ Deletes Global RTA Model
Request Syntax
response = client.delete_global_rta( path='string' )
- Parameters
path (string) –
[REQUIRED]
url-encoded path (must be unique for a given account ID)
- Return type
dict
- Returns
Response Syntax
{ 'deleted': 'string' }
Response Definitions
deleted (string) –
-
delete_rta
(**kwargs)¶ Deletes RTA Model for a specific customer
Request Syntax
response = client.delete_rta( account_id='string' path='string' )
- Parameters
account_id (string) –
[REQUIRED]
AIMS Account ID
path (string) –
[REQUIRED]
url-encoded path (must be unique for a given account ID)
- Return type
dict
- Returns
Response Syntax
{ 'deleted': 'string' }
Response Definitions
deleted (string) –
-
expire_rta
(**kwargs)¶ Set an rta’s expiration timestamp.
Note that setting expiration is effective immediately, just like if it was set up at the rta’s creation time. This means that queries for the rta having an associated timestamp posterior to the expiration time will suddenly not receive the rta. This is by design and is intended as a way to prevent bad rtas from being used by the ae system as soon as possible.
If the content_id being expired is not the first version of the rta that was posted, the rta will NOT revert to its previous content_id; it will simply disappear (it IS expired) until the next version of the rta is posted. If you find yourself in need of expiring a bad content_id and have a good copy of the rta on hand, you can post it as early as possible: expiring an earlier content_id does not affect newer ones. As to what happen to data that would have been rta by an expired tag, depending if they are processed before or after the expiration is propagated through the AE system, they will see the expired rta or not.
Note that because expiration done after the fact is done outside of regular content updates and because of caching, it may take a few minutes for the expiration to propagate throughout the AE system.
Request Syntax
response = client.expire_rta( data='integer' id='string' )
- Parameters
data (integer) –
id (string) –
[REQUIRED]
RTA Model ID
- Return type
dict
- Returns
Response Syntax
{ 'updated': 'string' }
Response Definitions
updated (string) –
-
fetch_reaggregated_rta_by_id
(**kwargs)¶ Fetch RTA model values and re-aggregate them according to the provided expression. Values are returned for an entire interval expression, even if boundaries (:start_ts and :end_ts) include part of them. In the case where multiple revisions of the RTA exists during the specified interval, separate entries are returned for each of them.
What does re-aggregation allow?
Time intervals can be enlarged to an integer multiple of the original expression time interval ``(SELECT INTERVAL(ts, 300) as i … GROUP BY i ->
SELECT INTERVAL(ts, 900) as i … GROUP BY i)``
GROUP BY dimensions can be reduced
(... GROUP BY a, b -> ... GROUP BY a)
Projections can be omitted
(SELECT a, b, c ... -> SELECT a, c)
Aggregations can be altered
(SELECT AVG(a) ... -> SELECT MAX(a))
Note: alterations can only reduce an aggregation complexity: a larger [l]set is more complex than a smaller [l]sets, a larger [l]ucounts is more complex than smaller [l]ucounts, an [l]set is more complex than an [l]ucount, and an [l]ucount is more complex than a min, a max, a sum, an avg, or a count.
Request Syntax
response = client.fetch_reaggregated_rta_by_id( account_id='string' data_type='string' end_ts='integer' exclusive_field='string' expression='string' group_by='string' group_by_md5='string' id='string' out_format='string' start_ts='integer' )
- Parameters
account_id (string) –
[REQUIRED]
AIMS Account ID
data_type (string) –
[REQUIRED]
Ingest Data type (logmsgs, telemetry …)
end_ts (integer) – RTA end timestamp
exclusive_field (string) – Opaque; provided in telemetry/observations
expression (string) –
group_by (string) – Opaque; provided in telemetry/observations
group_by_md5 (string) – Opaque; provided in telemetry/observations
id (string) –
[REQUIRED]
RTA Physical Id
out_format (string) – Specify output format. Plain Json by default
start_ts (integer) – RTA start timestamp
- Return type
dict
- Returns
Response Syntax
{}
Response Definitions
-
fetch_reaggregated_rta_by_path
(**kwargs)¶ Fetch RTA model values and re-aggregate them according to the provided expression. Values are returned for an entire interval expression, even if boundaries (:start_ts and :end_ts) include part of them. In the case where multiple revisions of the RTA exists during the specified interval, separate entries are returned for each of them.
What does re-aggregation allow?
Time intervals can be enlarged to an integer multiple of the original expression time interval ``(SELECT INTERVAL(ts, 300) as i … GROUP BY i ->
SELECT INTERVAL(ts, 900) as i … GROUP BY i)``
GROUP BY dimensions can be reduced
(... GROUP BY a, b -> ... GROUP BY a)
Projections can be omitted
(SELECT a, b, c ... -> SELECT a, c)
Aggregations can be altered
(SELECT AVG(a) ... -> SELECT MAX(a))
Note: alterations can only reduce an aggregation complexity: a larger [l]set is more complex than a smaller [l]sets, a larger [l]ucounts is more complex than smaller [l]ucounts, an [l]set is more complex than an [l]ucount, and an [l]ucount is more complex than a min, a max, a sum, an avg, or a count.
Request Syntax
response = client.fetch_reaggregated_rta_by_path( account_id='string' continuation='string' data_type='string' end_ts='integer' expression='string' limit='integer' path='string' start_ts='integer' )
- Parameters
account_id (string) –
[REQUIRED]
AIMS Account ID
continuation (string) – Continuation string returned by a previous
get_data_by_path
calldata_type (string) –
[REQUIRED]
Ingest Data type. Refer Ingest Service API for a list of available data types.
end_ts (integer) –
[REQUIRED]
RTA end timestamp
expression (string) –
limit (integer) – Number of records/slices to return.
path (string) –
[REQUIRED]
url-encoded path (must be unique for a given account ID)
start_ts (integer) –
[REQUIRED]
RTA start timestamp
- Return type
dict
- Returns
Response Syntax
{}
Response Definitions
-
fetch_rta_by_id
(**kwargs)¶ Fetch RTA model values using RTA ID. Values are returned for an entire interval, even if boundaries (:start_ts and :end_ts) include part of them.
Request Syntax
response = client.fetch_rta_by_id( account_id='string' data_type='string' end_ts='integer' exclusive_field='string' group_by='string' group_by_md5='string' id='string' out_format='plain'|'new_line' reaggregation='time' start_ts='integer' )
- Parameters
account_id (string) –
[REQUIRED]
AIMS Account ID
data_type (string) –
[REQUIRED]
Ingest Data type (logmsgs, telemetry …)
end_ts (int32) –
[REQUIRED]
RTA end timestamp
exclusive_field (string) – Opaque; provided in telemetry/observations
group_by (string) – Opaque; provided in telemetry/observations
group_by_md5 (string) – Opaque; provided in telemetry/observations
id (string) –
[REQUIRED]
RTA Physical Id
out_format (string) –
Specify output format. Plain Json by default
Valid values:
plain
,new_line
reaggregation (string) –
Special purpose re-aggregations. Currently only support time: re-aggregate all results in a single time interval interval
Valid values:
time
start_ts (int32) –
[REQUIRED]
RTA start timestamp
- Return type
dict
- Returns
Response Syntax
{}
Response Definitions
-
fetch_rta_by_path
(**kwargs)¶ Fetch RTA model values using its path. Values are returned for an entire interval, even if boundaries (:start_ts and :end_ts) include part of them. In the case where multiple revisions of the RTA exists during the specified interval, separate entries are returned for each of them.
Request Syntax
response = client.fetch_rta_by_path( account_id='string' continuation='string' data_type='string' end_ts='integer' exclusive_field='string' group_by='string' group_by_md5='string' limit='integer' out_format='string' path='string' reaggregation='time' start_ts='integer' )
- Parameters
account_id (string) –
[REQUIRED]
AIMS Account ID
continuation (string) – Continuation string returned by a previous
get_data_by_path
calldata_type (string) –
[REQUIRED]
Ingest Data type. Refer Ingest Service API for a list of available data types.
end_ts (int32) –
[REQUIRED]
RTA end timestamp
exclusive_field (string) – Opaque; provided in telemetry/observations
group_by (string) – Opaque; provided in telemetry/observations
group_by_md5 (string) – Opaque; provided in telemetry/observations
limit (int32) – Number of records/slices to return.
out_format (string) – Specify output format. Plain Json by default
path (string) –
[REQUIRED]
url-encoded path (must be unique for a given account ID)
reaggregation (string) –
Special purpose re-aggregations. Currently only support time: re-aggregate all results in a single time interval interval
Valid values:
time
start_ts (int32) –
[REQUIRED]
RTA start timestamp
- Return type
dict
- Returns
Response Syntax
{}
Response Definitions
-
get_aerta_audit
(**kwargs)¶ Return the set of active content items at the give timestamp (or at current time if no timestamp given). For each item, metadata is provided (about upload user & upload channel; creation, deletion, expiration times; content id, path & type) as well as the content itself. Providing a data_type parameter narrows the audit to the given data type.
Request Syntax
response = client.get_aerta_audit( data_type='string' ts='string' )
- Parameters
data_type (string) –
Which data type to return in the audit. Choices: ‘rta’
Default:
all
ts (string) –
A unix epoch timestamp
Default:
now
- Return type
dict
- Returns
Response Syntax
{}
Response Definitions
-
get_dlq_replay_status
(**kwargs)¶ Status for the current running request
Returns the status for the current running request.
Supported engines See create a replay request
Request Syntax
response = client.get_dlq_replay_status( engine='string' )
- Parameters
engine (string) –
- Return type
dict
- Returns
Response Syntax
{ 'count': 'integer', 'finished': 'integer', 'in_progress': 'False|True', 'limit': 'integer', 'started': 'integer' }
Response Definitions
count (integer) –
finished (integer) –
in_progress (boolean) –
limit (integer) –
started (integer) –
-
get_global_rta_by_id
(**kwargs)¶ Get configured RTA definition defined for all customers for id
Request Syntax
response = client.get_global_rta_by_id( id='string' raw='False|True' )
- Return type
dict
- Returns
Response Syntax
{}
Response Definitions
-
get_global_rta_by_path
(**kwargs)¶ Get configured RTA definition defined for all customers by path
Request Syntax
response = client.get_global_rta_by_path( epoch='integer' path='string' raw='False|True' ts='integer' )
- Parameters
epoch (integer) – A positive integer representing an epoch
path (string) –
[REQUIRED]
url-encoded path (must be unique for a given account ID)
raw (boolean) – Default to false. Returns sub-content if true (for internal use only)
ts (integer) – A unix epoch timestamp
- Return type
dict
- Returns
Response Syntax
{}
Response Definitions
-
get_global_rtas
(**kwargs)¶ Get configured RTAs definitions defined for all customers
Request Syntax
response = client.get_global_rtas( epoch='integer' raw='False|True' ts='integer' )
- Parameters
epoch (integer) – A positive integer representing an epoch
raw (boolean) – Default to false. Returns sub-content if true (for internal use only)
ts (integer) – A unix epoch timestamp
- Return type
dict
- Returns
Response Syntax
{}
Response Definitions
-
get_global_rtas_by_data_type
(**kwargs)¶ Get configured RTAs definitions defined for all customers for spefic data type
Request Syntax
response = client.get_global_rtas_by_data_type( data_type='string' epoch='integer' raw='False|True' ts='integer' )
- Parameters
data_type (string) –
[REQUIRED]
Ingest Data type (logmsgs, telemetry …)
epoch (integer) – A positive integer representing an epoch
raw (boolean) – Default to false. Returns sub-content if true (for internal use only)
ts (integer) – A unix epoch timestamp
- Return type
dict
- Returns
Response Syntax
{}
Response Definitions
-
get_rta_by_path
(**kwargs)¶ Get configured RTA definition defined for a specific customer by path
Request Syntax
response = client.get_rta_by_path( account_id='string' epoch='integer' include_parents='False|True' path='string' raw='False|True' ts='integer' )
- Parameters
account_id (string) –
[REQUIRED]
AIMS Account ID
epoch (integer) – A positive integer representing an epoch
include_parents (boolean) – Default to false. Return global RTAs if true
path (string) –
[REQUIRED]
url-encoded path (must be unique for a given account ID)
raw (boolean) – Default to false. Returns sub-content if true (for internal use only)
ts (integer) – A unix epoch timestamp
- Return type
dict
- Returns
Response Syntax
{}
Response Definitions
-
get_rta_expiration
(**kwargs)¶ Return an rta’s expiration timestamp
Request Syntax
response = client.get_rta_expiration( id='string' )
- Parameters
id (string) –
[REQUIRED]
RTA Model ID
- Return type
integer
- Returns
Response Syntax
'integer'
Response Definitions
-
get_rtas
(**kwargs)¶ Gets all configured RTA Model definitions for a specific account
Request Syntax
response = client.get_rtas( account_id='string' epoch='integer' raw='False|True' ts='integer' )
- Parameters
account_id (string) –
[REQUIRED]
AIMS Account ID
epoch (integer) – A positive integer representing an epoch
raw (boolean) – Default to false. Returns sub-content if true (for internal use only)
ts (integer) – A unix epoch timestamp
- Return type
dict
- Returns
Response Syntax
{}
Response Definitions
-
get_rtas_by_data_type
(**kwargs)¶ Get configured RTAs definitions defined for a specific customer for spefic data type
Request Syntax
response = client.get_rtas_by_data_type( account_id='string' data_type='string' epoch='integer' raw='string' ts='integer' )
- Parameters
account_id (string) –
[REQUIRED]
AIMS Account ID
data_type (string) –
[REQUIRED]
Ingest Data type (logmsgs, telemetry …)
epoch (integer) – A positive integer representing an epoch
raw (string) – Default to false. Returns sub-content if true (for internal use only)
ts (integer) – A unix epoch timestamp
- Return type
dict
- Returns
Response Syntax
{}
Response Definitions
-
validate_rta
(**kwargs)¶ Validates an RTA object
Request Syntax
response = client.validate_rta( customers=[ 'string' ] data_type='string' expression={} )
- Parameters
customers (list) –
[REQUIRED]
List of customers (String) to apply filter to. [“*”] for all customers.
(string) –
data_type (string) – Data type (iff using Object expressions)
expression (dict) –
[REQUIRED]
Expression SQL-like string or object
- Returns
None