enable_disable_datasource_schedule

DatasourcesApi.enable_disable_datasource_schedule(datasource_id, role_id, enable_disable_datasource_schedule_request, content_type=None, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)

Enable or disable datasource schedule

Enables or disables EventBridge schedule for amorphic and jdbc datasources only. Caller needs editor access (else AUTH-1012). Other datasource types or unsupported actions raise a generic Exception (500). Not idempotent: enabling when already enabled or disabling when already disabled returns IPV-1045.

Parameters:
  • datasource_id (str) – UUID of the datasource. Rejected with IPV-1045 if missing or unknown. (required)

  • role_id (str) – Amorphic role ID. Must grant editor access on the datasource. (required)

  • enable_disable_datasource_schedule_request (EnableDisableDatasourceScheduleRequest) – (required)

  • content_type (str) – Must be application/json.

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

EnableDisableDatasourceScheduleResponse

Returns:

Returns the result object.

Request and Response Examples

HTTP: POST /datasources/{datasource_id}/operations

Request

Request / response example

{
  "action": "enable_schedule"
}

Success (HTTP 200)

ScheduleEnabled updated to yes (enable_schedule) or no (disable_schedule). Message includes the datasource name.

Schedule enabled

{
  "Message": "Schedule updated successfully to yes for the datasource sales_jdbc"
}

Schedule disabled

{
  "Message": "Schedule updated successfully to no for the datasource sales_jdbc"
}

Errors

Documented error codes: AUTH-1012, IPV-1045, DB-1002.

HTTP 400

Validation or authorization failure. Body is {“Message”: “<CODE> - <text>”}. Common codes: AUTH-1012 (no editor access), IPV-1045 (unknown datasource, already enabled/disabled, or no ScheduleExpression on enable).

Schedule already enabled

{
  "Message": "IPV-1045 - Schedule is already enabled for this datasource"
}

Missing ScheduleExpression on enable

{
  "Message": "IPV-1045 - Datasource doesn't have schedule configured, please update the datasource with schedule to perform this operation"
}

Schedule already disabled

{
  "Message": "IPV-1045 - Schedule is already disabled for this datasource"
}

HTTP 500

Backend failure. Body is {“Message”: “<CODE> - <text>”} or a raw exception string. DB-1002 if DynamoDB update fails. Non-amorphic/jdbc types return Message “Only Amorphic & Jdbc type of datasources are allowed for this operation”.

Non-amorphic/jdbc datasource

{
  "Message": "Only Amorphic & Jdbc type of datasources are allowed for this operation"
}

DynamoDB update failed

{
  "Message": "DB-1002 - Failed to update entry in the dynamoDB table, please check for errors"
}