list_event_rules¶
- EventRulesApi.list_event_rules(role_id, limit=None, offset=None, sortorder=None, sortby=None, projection_expression=None, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
List scheduled EventBridge rules
Returns scheduled EventBridge rules for this environment (event-pattern rules are omitted). Requires system-settings.view. Pagination is in-memory after the full list is loaded: last page when next_available is no.
- Parameters:
role_id (str) – Amorphic role ID the request is authorized against. Must be a role the user belongs to. Also recorded in audit logs. (required)
limit (str) – Page size. Defaults to 100. Maximum 1000 (GE-1028 if higher). Non-numeric values fail with HTTP 500.
offset (str) – 1-based item offset (1 is the first rule, not a page number). Omitted starts at item 1. Non-numeric values fail with HTTP 500.
sortorder (str) – Sort direction. Defaults to desc. Any other value (including asc) sorts ascending.
sortby (str) – Rule attribute to sort by. Defaults to Name. The attribute must exist on every returned rule or the call fails with HTTP 500.
projection_expression (str) – Comma-separated attributes to keep. When omitted, all EventBridge list fields are returned. DataProfiling and BDAExtractor extras are added after this only if Name is still on the item.
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
- Returns:
Returns the result object.
Request and Response Examples¶
HTTP: GET /events
Success (HTTP 200)¶
Page of rules plus next_available (yes/no), count (this page), and total_count (all matching rules). Fetch the next page with offset += limit until next_available is no.
First page, more results available
{
"rules": [
{
"Name": "amorphic-dev-DataCleanup",
"State": "ENABLED",
"Description": "Nightly cleanup",
"ScheduleExpression": "cron(0 2 * * ? *)",
"EventBusName": "default"
},
{
"Name": "amorphic-dev-DataProfiling",
"State": "ENABLED",
"ScheduleExpression": "rate(1 day)",
"EventBusName": "default",
"NumberOfWorkers": 2,
"Timeout": 2880
}
],
"next_available": "yes",
"count": 2,
"total_count": 15
}
Last page
{
"rules": [
{
"Name": "amorphic-dev-BDAExtractor",
"State": "DISABLED",
"ScheduleExpression": "cron(0 4 * * ? *)",
"EventBusName": "default",
"MaxCapacity": 2.0,
"Timeout": 2880,
"Modalities": [
"document"
],
"ModalityConfigs": {
"document": {
"maxPages": 10
}
}
}
],
"next_available": "no",
"count": 1,
"total_count": 3
}
Errors¶
Documented error codes: GE-1028, AUTH-1001, AUTH-1030, RTE-1001.
HTTP 400
Validation or authorization failure. Body is {“Message”: “<CODE> - <text>”}. Codes: GE-1028 (limit over 1000), AUTH-1001 (missing role_id), AUTH-1030 (missing system-settings.view).
limit greater than 1000
{
"Message": "GE-1028 - Out of range for items per page, Limit is 1000"
}
role_id header missing
{
"Message": "AUTH-1001 - Missing role information in event header"
}
Caller lacks system-settings.view
{
"Message": "AUTH-1030 - User is not authorized to list all event rules due to the following missing permission(s) - {'System Settings': ['view']}"
}
HTTP 500
Backend failure. Listing errors use {“Message”: “Unable to list event rules, error - <text>”} (non-numeric offset/limit, missing sortby key, EventBridge or Glue failures). Uncaught handler errors use {“Message”: “RTE-1001 - <text>.”}.
Non-numeric offset
{
"Message": "Unable to list event rules, error - invalid literal for int() with base 10: 'abc'"
}
Uncaught handler failure
{
"Message": "RTE-1001 - 'Authorization'."
}