client.imports.patch
A method of the Imports endpoint.
- patch(id: int, *, name: str = None, source: dict = None, destination: dict = None, running_as_id: int = None, schedule: dict = None, next_run_at: str = None, notifications: dict = None, time_zone: str = None) Response
Update some attributes of this import
API URL:
PATCH /imports/{id}import civis client = civis.APIClient() response = client.imports.patch(...)
- Parameters:
- idint
The ID for the import.
- namestr, optional
The name of the import.
- sourcedict, optional
remote_host_id : int
credential_id : int
- additional_credentialsList[int]
Array that holds additional credentials used for specific imports. For DB Syncs, the first element is an SSL private key credential id, and the second element is the corresponding public key credential id.
- destinationdict, optional
remote_host_id : int
credential_id : int
- additional_credentialsList[int]
Array that holds additional credentials used for specific imports. For DB Syncs, the first element is an SSL private key credential id, and the second element is the corresponding public key credential id.
- running_as_idint, optional
The ID of the runner of this import.
- scheduledict, optional
- scheduledbool
If the item is scheduled.
- scheduled_daysList[int]
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hoursList[int]
Hours of the day it is scheduled on.
- scheduled_minutesList[int]
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourint
Deprecated in favor of scheduled minutes.
- scheduled_days_of_monthList[int]
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- next_run_atstr (time), optional
The time of the next scheduled run.
- notificationsdict, optional
- urlsList[str]
URLs to receive a POST request at job completion
- success_email_subjectstr
Custom subject line for success e-mail.
- success_email_bodystr
Custom body text for success e-mail, written in Markdown.
- success_email_addressesList[str]
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestr
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostr
Address for replies to success emails; defaults to the author of the job.
- failure_email_addressesList[str]
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesint
Stall warning emails will be sent after this amount of minutes.
- success_onbool
If success email notifications are on. Defaults to user’s preferences.
- failure_onbool
If failure email notifications are on. Defaults to user’s preferences.
- time_zonestr, optional
The time zone of this import.
- Returns:
civis.Response- idint
The ID for the import.
- namestr
The name of the import.
- source
civis.Response remote_host_id : int
credential_id : int
- additional_credentialsList[int]
Array that holds additional credentials used for DB Syncs. The first element is an SSL private key credential id, and the second element is the corresponding public key credential id.
name : str
- source
- destination
civis.Response remote_host_id : int
credential_id : int
- additional_credentialsList[int]
Array that holds additional credentials used for DB Syncs. The first element is an SSL private key credential id, and the second element is the corresponding public key credential id.
name : str
- destination
- sync_typestr
The type of sync to perform; one of Dbsync, AutoImport, GdocImport, and GdocExport.
- parent_idint
Parent id to trigger this import from
is_outbound : bool
- job_typestr
The job type of this import.
- syncsList[
civis.Response] List of syncs.
id : int
- source
civis.Response - idint
The ID of the table or file, if available.
- database_table
civis.Response - schemastr
The database schema name.
- tablestr
The database table name.
- use_without_schemabool
This attribute is no longer available; defaults to false but cannot be used.
- database_table
- file
civis.Response - idint
The file id.
- namestr
The file name.
- file
- google_worksheet
civis.Response - spreadsheetstr
The spreadsheet document name.
- spreadsheet_idstr
The spreadsheet document id.
- worksheetstr
The worksheet tab name.
- worksheet_idint
The worksheet tab id.
- google_worksheet
- pathstr
The path of the dataset to sync from; for a database source, schema.tablename. If you are doing a Google Sheet export, this can be blank. This is a legacy parameter, it is recommended you use one of the following: databaseTable, file, googleWorksheet
- source
- destination
civis.Response - database_table
civis.Response - schemastr
The database schema name.
- tablestr
The database table name.
- use_without_schemabool
This attribute is no longer available; defaults to false but cannot be used.
- database_table
- google_worksheet
civis.Response - spreadsheetstr
The spreadsheet document name.
- spreadsheet_idstr
The spreadsheet document id.
- worksheetstr
The worksheet tab name.
- worksheet_idint
The worksheet tab id.
- google_worksheet
- pathstr
The schema.tablename to sync to. If you are doing a Google Sheet export, this is the spreadsheet and sheet name separated by a period. i.e. if you have a spreadsheet named “MySpreadsheet” and a sheet called “Sheet1” this field would be “MySpreadsheet.Sheet1”. This is a legacy parameter, it is recommended you use one of the following: databaseTable, googleWorksheet
- destination
- advanced_options
civis.Response - max_errorsint
For Google Doc and Auto Imports. The maximum number of errors that can occur without the job failing.
- existing_table_rowsstr
For Google Doc and Auto Imports. The behavior if a table with the requested name already exists. One of “fail”, “truncate”, “append”, or “drop”. Defaults to “fail”.
- first_row_is_headerbool
For Google Doc and Auto Imports. A boolean value indicating whether or not the first row is a header row.
- diststylestr
For Auto Imports. The diststyle to use for a Redshift table.
- distkeystr
For Auto Imports. The distkey to use for a Redshift table.
- sortkey1str
For Auto Imports. The first sortkey to use for a Redshift table.
- sortkey2str
For Auto Imports. The second sortkey to use for a Redshift table.
- column_delimiterstr
For Auto Imports. The column delimiter for the file. Valid arguments are “comma”, “tab”, and “pipe”. If column_delimiter is null or omitted, it will be auto-detected.
- column_overrides
civis.Response For Auto Imports. Hash used for overriding auto-detected names and types, with keys being the index of the column being overridden.
- column_overrides
- escapedbool
For Auto Imports. If true, escape quotes with a backslash; otherwise, escape quotes by double-quoting. Defaults to false.
- identity_columnstr
For DB Syncs. The column or columns to use as primary key for incremental syncs. Should be a unique identifier. If blank, primary key columns will be auto-detected. If more than one identity column is specified, an identity column must be specified for each table. We recommend the primary key be a sequential data type such as an integer, double, timestamp, date, or float. If using a primary key that is a string data type, we recommend having a last_modified_column to ensure all data is synced to the destination table.
- last_modified_columnstr
For DB Syncs. The column to use to detect recently modified data for incremental syncs. Defaults to “Auto-Detect”, which will use the first column it finds containing either “modif” or “update” in the name. When specified, only rows where last_modified_column in the source >= last_modified_column in the destination will be synced.
- row_chunk_sizeint
For DB Syncs. If specified, will split the sync into chunks of this size.
- wipe_destination_tablebool
For DB Syncs. If true, will perform a full table refresh.
- truncate_long_linesbool
For DB Syncs to Redshift. When true, truncates column data to fit the column specification.
- invalid_char_replacementstr
For DB Syncs to Redshift. If specified, will replace each invalid UTF-8 character with this character. Must be a single ASCII character.
- verify_table_row_countsbool
For DB Syncs. When true, an error will be raised if the destination table does not have the same number of rows as the source table after the sync.
- partition_column_namestr
This parameter is deprecated
- partition_schema_namestr
This parameter is deprecated
- partition_table_namestr
This parameter is deprecated
- partition_table_partition_column_min_namestr
This parameter is deprecated
- partition_table_partition_column_max_namestr
This parameter is deprecated
- mysql_catalog_matches_schemabool
This attribute is no longer available; defaults to true but cannot be used.
- chunking_methodstr
This parameter is deprecated
- export_actionstr
For Google Doc Exports. The kind of export action you want to have the export execute. Set to “newsprsht” if you want a new worksheet inside a new spreadsheet. Set to “newwksht” if you want a new worksheet inside an existing spreadsheet. Set to “updatewksht” if you want to overwrite an existing worksheet inside an existing spreadsheet. Set to “appendwksht” if you want to append to the end of an existing worksheet inside an existing spreadsheet. Default is set to “newsprsht”
- sql_querystr
For Google Doc Exports. The SQL query for the export.
- contact_listsstr
This parameter is deprecated
- soql_querystr
This parameter is deprecated
- include_deleted_recordsbool
This parameter is deprecated
- advanced_options
- syncsList[
state : str
created_at : str (date-time)
updated_at : str (date-time)
- last_run
civis.Response id : int
- statestr
The state of the run. One of queued, running, succeeded, failed or cancelled.
- created_atstr (time)
The time that the run was queued.
- started_atstr (time)
The time that the run started.
- finished_atstr (time)
The time that the run completed.
- errorstr
The error message for this run, if present.
- last_run
- user
civis.Response - idint
The ID of this user.
- namestr
This user’s name.
- usernamestr
This user’s username.
- initialsstr
This user’s initials.
- onlinebool
Whether this user is online.
- user
- running_as
civis.Response - idint
The ID of this user.
- namestr
This user’s name.
- usernamestr
This user’s username.
- initialsstr
This user’s initials.
- onlinebool
Whether this user is online.
- running_as
- schedule
civis.Response - scheduledbool
If the item is scheduled.
- scheduled_daysList[int]
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hoursList[int]
Hours of the day it is scheduled on.
- scheduled_minutesList[int]
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourint
Deprecated in favor of scheduled minutes.
- scheduled_days_of_monthList[int]
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- schedule
- next_run_atstr (time)
The time of the next scheduled run.
- notifications
civis.Response - urlsList[str]
URLs to receive a POST request at job completion
- success_email_subjectstr
Custom subject line for success e-mail.
- success_email_bodystr
Custom body text for success e-mail, written in Markdown.
- success_email_addressesList[str]
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestr
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostr
Address for replies to success emails; defaults to the author of the job.
- failure_email_addressesList[str]
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesint
Stall warning emails will be sent after this amount of minutes.
- success_onbool
If success email notifications are on. Defaults to user’s preferences.
- failure_onbool
If failure email notifications are on. Defaults to user’s preferences.
- notifications
- time_zonestr
The time zone of this import.
- hiddenbool
The hidden status of the item.
- archivedbool
The archival status of the requested item(s).
- my_permission_levelstr
Your permission level on the object. One of “read”, “write”, or “manage”.