get_rule_details¶
- EventRulesApi.get_rule_details(rule_name, role_id, metrics=None, duration=None, limit=None, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
Get event rule details or metrics
Returns the EventBridge rule, or metrics when the metrics query key is present. Requires system-settings.view. Rule name must include this environment prefix.
- Parameters:
rule_name (str) – EventBridge rule name. Must contain the environment prefix or IPV-1002 is returned. (required)
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)
metrics (str) – When this key is present (any value), return metrics instead of rule details.
duration (str) – Metrics window in minutes. Used only when metrics is present. Defaults to 30. Must be 1-525600 (IPV-1019). Non-numeric values fail with HTTP 500.
limit (str) – BDAExtractor ExecutionHistory page size. Used only when metrics is present and the rule name contains BDAExtractor. Defaults to 5. Must be 1-200; out of range returns IPV-1019 (message still says 1-525600 minutes). Non-numeric values fail with HTTP 500.
_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/{rule_name}
Success (HTTP 200)¶
Rule details when metrics is omitted; metrics payload when the metrics query key is present.
Rule details (no metrics query key)
{
"Name": "amorphic-dev-DataCleanup",
"State": "ENABLED",
"Description": "Nightly cleanup",
"ScheduleExpression": "cron(0 2 * * ? *)",
"EventBusName": "default",
"Type": "Scheduled Standard",
"Targets": [
{
"Id": "1"
}
]
}
Metrics for the last 30 minutes
{
"RuleMetrics": {
"RuleName": "amorphic-dev-DataCleanup",
"StartTime": "2026-08-13 13:15:00",
"EndTime": "2026-08-13 13:45:00",
"Invocations": {
"Label": "Invocations",
"Datapoints": [
{
"Timestamp": "2026-08-13 13:30:00",
"Average": 1.0,
"Unit": "Count"
}
]
},
"TriggeredRules": {
"Label": "TriggeredRules",
"Datapoints": []
}
}
}
BDAExtractor metrics with execution history
{
"RuleMetrics": {
"RuleName": "amorphic-dev-BDAExtractorJob",
"StartTime": "2026-08-13 13:15:00",
"EndTime": "2026-08-13 13:45:00",
"Invocations": {
"Label": "Invocations",
"Datapoints": []
},
"TriggeredRules": {
"Label": "TriggeredRules",
"Datapoints": []
},
"ExecutionHistory": [
{
"jobRunId": "jr_abc123",
"datasetIds": [
"a2f7d3b1-8e5c-4a6f-9d1e-2b3c4d5e6f7a"
],
"state": "SUCCEEDED",
"startedOn": "2026-08-13 12:00:00",
"completedOn": "2026-08-13 12:10:00",
"processingMode": "all",
"triggeredBy": "user1",
"errorMessage": null
}
]
}
}
Errors¶
Documented error codes: IPV-1002, IPV-1019, AUTH-1001, AUTH-1030, RTE-1001.
HTTP 400
Validation or authorization failure. Body is {“Message”: “<CODE> - <text>”}. Codes: IPV-1002 (rule not for this environment), IPV-1019 (duration or BDA limit), AUTH-1001, AUTH-1030 (missing system-settings.view).
Rule name missing environment prefix
{
"Message": "IPV-1002 - Rule is not specific to this environment. Please enter a valid rule name."
}
duration outside 1-525600
{
"Message": "IPV-1019 - Invalid parameter - MetricDuration, valid values should be between 1 - 525600 (whole numbers in minutes)."
}
BDA ExecutionHistory limit outside 1-200
{
"Message": "IPV-1019 - Invalid parameter - Limit, valid values should be between 1 - 525600 (whole numbers in minutes)."
}
Caller lacks system-settings.view
{
"Message": "AUTH-1030 - User is not authorized to get rule details due to the following missing permission(s) - {'System Settings': ['view']}"
}
HTTP 500
Details failures use {“Message”: “Unable to get rule details, error - <text>”}. Metrics failures use {“Message”: “Unable to retrieve metrics, error - <text>”} (including non-numeric duration/limit). Uncaught handler errors use {“Message”: “RTE-1001 - <text>.”}.
EventBridge describe_rule failure
{
"Message": "Unable to get rule details, error - An error occurred (ResourceNotFoundException) when calling the DescribeRule operation"
}
Non-numeric duration
{
"Message": "Unable to retrieve metrics, error - invalid literal for int() with base 10: 'abc'"
}