perform_rule_operation

EventRulesApi.perform_rule_operation(rule_name, rule_action, role_id, wait_for_completion=None, event_rule_put_request=None, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)

Enable, disable, run, or reconfigure a rule

Requires system-settings.manage and rule_action. Body is unused for enable/disable. run-job and update-config need a body only for some rules. A rule that is not allowed for that action returns IPV-1002, except update-config on an unsupported name returns no body.

Parameters:
  • rule_name (str) – EventBridge rule name. enable-rule, disable-rule, and run-job match a substring in this name. update-config requires the exact {project}-{env}-DataProfilingJob or {project}-{env}-BDAExtractorJob name. Disallowed names return IPV-1002, except update-config on any other name returns no body. (required)

  • rule_action (str) – Required by the handler. Omitted or any other value returns IPV-1002. (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)

  • wait_for_completion (str) – Only honoured with rule_action=run-job and a rule_name of exactly RSServerlessKeepAliveJob or {project}-{env}-RSServerlessKeepAliveJob (the EventBridge rule name); ignored everywhere else. Selects the response mode and nothing else - it has no bearing on authorization. “true” runs the check synchronously and reports whether the cluster is accepting queries: 200 when it is active, 400 with RS-1017 when it is idle, warming up or paused, and an API Gateway 504 if the check exceeds the 29 second limit (treat that the same as RS-1017). “false”, or omitting the key, returns immediately after triggering the job. Only “true” and “false” are accepted, case-insensitively; anything else returns IPV-1002 rather than quietly falling back to fire-and-forget. Note that run-job on these rule names needs only the base access every user has at signup, rather than the system-settings.manage that other rule_action values on this resource require.

  • event_rule_put_request (EventRulePutRequest)

  • _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:

PerformEventRuleOperationResponse

Returns:

Returns the result object.

Request and Response Examples

HTTP: PUT /events/{rule_name}

Request

The request body is optional.

enable-rule / disable-rule (no body)

{}

run-job for DataProfiling

{
  "DatasetIds": [
    "a2f7d3b1-8e5c-4a6f-9d1e-2b3c4d5e6f7a"
  ],
  "NumberOfWorkers": 2,
  "Timeout": 60,
  "autoMLRequest": false
}

run-job for BDAExtractor

{
  "FileProcessingMode": "all",
  "DatasetIds": [
    "a2f7d3b1-8e5c-4a6f-9d1e-2b3c4d5e6f7a"
  ],
  "FileIds": [],
  "FromTime": "N/A",
  "ToTime": "N/A",
  "TargetDatasetProvided": false
}

run-job for Observability or CloudwatchLogsToS3

{
  "startDate": "2026-08-01",
  "endDate": "2026-08-10"
}

update-config for DataProfilingJob

{
  "NumberOfWorkers": 5,
  "Timeout": 240
}

update-config for BDAExtractorJob

{
  "Timeout": 240,
  "MaxCapacity": 1,
  "Modalities": [
    "Document"
  ],
  "DocumentOutputFormat": [
    "PLAIN_TEXT"
  ],
  "ModalityConfigs": {
    "Document": {
      "Granularity": [
        "DOCUMENT"
      ],
      "BoundingBoxes": "DISABLED",
      "GenerativeFields": "DISABLED"
    }
  }
}

Success (HTTP 200)

enable-rule: “Successfully enabled rule: {name}”. disable-rule: “Successfully disabled rule: {name}”. run-job: “Triggered the job {name}”. update-config: “Updated the {name} parameters.”. enable/disable may still return 200 after an AWS failure if the success Message was already set.

enable-rule

{
  "Message": "Successfully enabled rule: amorphic-dev-ResourceSync"
}

disable-rule

{
  "Message": "Successfully disabled rule: amorphic-dev-ResourceSync"
}

run-job

{
  "Message": "Triggered the job amorphic-dev-DataProfilingJob"
}

update-config

{
  "Message": "Updated the amorphic-dev-DataProfilingJob parameters."
}

Errors

Documented error codes: IPV-1002, IPV-1008, IPV-1005, IPV-1062, GE-1034, LOG-1008, AUTH-1001, AUTH-1030, RTE-1001.

HTTP 400

{“Message”: “<CODE> - <text>”}. IPV-1002 (bad rule_action or rule not allowed for that action), IPV-1008 (missing/extra body key), IPV-1005 (BDA region), IPV-1062 (wrong types), GE-1034 (job/backfill limits; HTTP 400 here), LOG-1008 (older than log retention), AUTH-1001, AUTH-1030 (system-settings.manage).

Missing or invalid rule_action

{
  "Message": "IPV-1002 - Invalid rule action received, valid ones are ['enable-rule', 'disable-rule', 'run-job', 'update-config']"
}

Rule cannot be enabled/disabled

{
  "Message": "IPV-1002 - Backend schedule: amorphic-dev-DataCleanup cannot be toggled on/off, toggleable backend schedules are ['ResourceSync', 'UpdateCWLogsRetention', 'DataProfiling', 'BDAExtractorJob', 'RSServerlessKeepAlive']"
}

Rule cannot be run on demand

{
  "Message": "IPV-1002 - Backend schedule: amorphic-dev-DataCleanup cannot be triggered manually, adhoc trigger supported backend schedules are ['AlertHighCostingResource', 'AutoTerminateResource', 'CloudwatchLogsToS3', 'Observability', 'ResourceSync', 'DataProfiling', 'DataPipelines', 'BDAExtractor', 'RSServerlessKeepAlive']"
}

DataProfiling run-job missing datasetIds

{
  "Message": "IPV-1008 - Invalid request body, missing key(s) - datasetIds"
}

BDAExtractor already running

{
  "Message": "GE-1034 - Only one concurrent run is allowed for BDAExtractor job. Please try again later."
}

Caller lacks system-settings.manage

{
  "Message": "AUTH-1030 - User is not authorized to perform actions on scheduled backend jobs due to the following missing permission(s) - {'System Settings': ['manage']}"
}

HTTP 500

enable/disable environment-prefix failure becomes RTE-1001 (message unset). Other uncaught errors use {“Message”: “RTE-1001 - <text>.”}. Invalid JSON body for update-config is also this path.

enable/disable validate_rule UnboundLocalError

{
  "Message": "RTE-1001 - local variable 'message' referenced before assignment."
}

Uncaught handler failure

{
  "Message": "RTE-1001 - 'Authorization'."
}