client.imports.post_files
A method of the Imports endpoint.
- post_files(schema: str, name: str, remote_host_id: int, credential_id: int, *, max_errors: int = None, existing_table_rows: str = None, diststyle: str = None, distkey: str = None, sortkey1: str = None, sortkey2: str = None, column_delimiter: str = None, first_row_is_header: bool = None, multipart: bool = None, escaped: bool = None, hidden: bool = None) Response
Initate an import of a tabular file into the platform
API URL:
POST /imports/filesimport civis client = civis.APIClient() response = client.imports.post_files(...)
- Parameters:
- schemastr
The schema of the destination table.
- namestr
The name of the destination table.
- remote_host_idint
The id of the destination database host.
- credential_idint
The id of the credentials to be used when performing the database import.
- max_errorsint, optional
The maximum number of rows with errors to remove from the import before failing.
- existing_table_rowsstr, optional
The behaviour if a table with the requested name already exists. One of “fail”, “truncate”, “append”, or “drop”.Defaults to “fail”.
- diststylestr, optional
The diststyle to use for the table. One of “even”, “all”, or “key”.
- distkeystr, optional
The column to use as the distkey for the table.
- sortkey1str, optional
The column to use as the sort key for the table.
- sortkey2str, optional
The second column in a compound sortkey for the table.
- column_delimiterstr, optional
The column delimiter of the file. If column_delimiter is null or omitted, it will be auto-detected. Valid arguments are “comma”, “tab”, and “pipe”.
- first_row_is_headerbool, optional
A boolean value indicating whether or not the first row is a header row. If first_row_is_header is null or omitted, it will be auto-detected.
- multipartbool, optional
If true, the upload URI will require a multipart/form-data POST request. Defaults to false.
- escapedbool, optional
If true, escape quotes with a backslash; otherwise, escape quotes by double-quoting. Defaults to false.
- hiddenbool, optional
The hidden status of the item.
- Returns:
civis.Response- idint
The id of the import.
- upload_uristr
The URI which may be used to upload a tabular file for import. You must use this URI to upload the file you wish imported and then inform the Civis API when your upload is complete using the URI given by the runUri field of this response.
- run_uristr
The URI to POST to once the file upload is complete. After uploading the file using the URI given in the uploadUri attribute of the response, POST to this URI to initiate the import of your uploaded file into the platform.
- upload_fields
civis.Response If multipart was set to true, these fields should be included in the multipart upload.
- upload_fields