Module AnalyticsClient :: Class AnalyticsClient :: Class BulkAPI
[hide private]
[frames] | no frames]

Class BulkAPI

source code

BulkAPI contains data operations.

Instance Methods [hide private]
 
__init__(self, ac, org_id, workspace_id) source code
dictionary
import_data_in_new_table(self, table_name, file_type, auto_identify, file_path, config={})
Create a new table and import the data contained in the mentioned file into the created table.
source code
string
import_data_in_new_table_as_batches(self, table_name, auto_identify, file_path, batch_size, config={}, tool_config={})
Create a new table and import the data contained in the mentioned file into the created table.
source code
dictionary
import_raw_data_in_new_table(self, table_name, file_type, auto_identify, data, config={})
Create a new table and import the raw data provided into the created table.
source code
dictionary
import_data(self, view_id, import_type, file_type, auto_identify, file_path, config={})
Import the data contained in the mentioned file into the table.
source code
dictionary
import_raw_data(self, view_id, import_type, file_type, auto_identify, data, config={})
Import the raw data provided into the table.
source code
string
import_bulk_data_in_new_table(self, table_name, file_type, auto_identify, file_path, config={})
Asynchronously create a new table and import the data contained in the mentioned file into the created table.
source code
string
import_bulk_data(self, view_id, import_type, file_type, auto_identify, file_path, config={})
Asynchronously import the data contained in the mentioned file into the table.
source code
string
import_data_as_batches(self, view_id, import_type, auto_identify, file_path, batch_size, config={}, tool_config={})
Asynchronously import the data contained in the mentioned file into the table.
source code
dictionary
get_import_job_details(self, job_id)
Returns the details of the import job.
source code
 
export_data(self, view_id, response_format, file_path, config={})
Export the mentioned table (or) view data.
source code
string
initiate_bulk_export(self, view_id, response_format, config={})
Initiate asynchronous export for the mentioned table (or) view data.
source code
string
initiate_bulk_export_using_sql(self, sql_query, response_format, config={})
Initiate asynchronous export with the given SQL Query.
source code
dictionary
get_export_job_details(self, job_id)
Returns the details of the export job.
source code
 
export_bulk_data(self, job_id, file_path)
Download the exported data for the mentioned job id.
source code
Method Details [hide private]

import_data_in_new_table(self, table_name, file_type, auto_identify, file_path, config={})

source code 

Create a new table and import the data contained in the mentioned file into the created table.

Parameters:
  • table_name (string) - Name of the new table to be created.
  • file_type (string) - Type of the file to be imported.
  • auto_identify (string) - Used to specify whether to auto identify the CSV format. Allowable values - true/false.
  • file_path (string) - Path of the file to be imported.
  • config (dictionary) - Contains any additional control parameters. Can be None.
Returns: dictionary
Raises:
  • ServerError - If the server has received the request but did not process the request due to some error.
  • ParseError - If the server has responded but client was not able to parse the response. @return Import result

import_data_in_new_table_as_batches(self, table_name, auto_identify, file_path, batch_size, config={}, tool_config={})

source code 

Create a new table and import the data contained in the mentioned file into the created table.

Parameters:
  • table_name (string) - Name of the new table to be created.
  • auto_identify (string) - Used to specify whether to auto identify the CSV format. Allowable values - true/false.
  • file_path (string) - Path of the file to be imported.
  • batch_size (int) - Number of lines per batch.
  • config (dictionary) - Contains any additional control parameters. Can be None.
  • tool_config (dictionary) - Contains any additional control parameters for the library. Can be None.
Returns: string
Raises:
  • ServerError - If the server has received the request but did not process the request due to some error.
  • ParseError - If the server has responded but client was not able to parse the response. @return Import job id

import_raw_data_in_new_table(self, table_name, file_type, auto_identify, data, config={})

source code 

Create a new table and import the raw data provided into the created table.

Parameters:
  • table_name (string) - Name of the new table to be created.
  • file_type (string) - Type of the file to be imported.
  • auto_identify (string) - Used to specify whether to auto identify the CSV format. Allowable values - true/false.
  • data (string) - Raw data to be imported.
  • config (dictionary) - Contains any additional control parameters. Can be None.
Returns: dictionary
Raises:
  • ServerError - If the server has received the request but did not process the request due to some error.
  • ParseError - If the server has responded but client was not able to parse the response. @return Import result

import_data(self, view_id, import_type, file_type, auto_identify, file_path, config={})

source code 

Import the data contained in the mentioned file into the table.

Parameters:
  • view_id (string) - Id of the view where the data to be imported.
  • import_type (string) - The type of import. Can be one of - append, truncateadd, updateadd.
  • file_type (string) - Type of the file to be imported.
  • auto_identify (string) - Used to specify whether to auto identify the CSV format. Allowable values - true/false.
  • file_path (string) - Path of the file to be imported.
  • config (dictionary) - Contains any additional control parameters. Can be None.
Returns: dictionary
Raises:
  • ServerError - If the server has received the request but did not process the request due to some error.
  • ParseError - If the server has responded but client was not able to parse the response. @return Import result

import_raw_data(self, view_id, import_type, file_type, auto_identify, data, config={})

source code 

Import the raw data provided into the table.

Parameters:
  • view_id (string) - Id of the view where the data to be imported.
  • import_type (string) - The type of import. Can be one of - append, truncateadd, updateadd.
  • file_type (string) - Type of the file to be imported.
  • auto_identify (string) - Used to specify whether to auto identify the CSV format. Allowable values - true/false.
  • data (string) - Raw data to be imported.
  • config (dictionary) - Contains any additional control parameters. Can be None.
Returns: dictionary
Raises:
  • ServerError - If the server has received the request but did not process the request due to some error.
  • ParseError - If the server has responded but client was not able to parse the response. @return Import result

import_bulk_data_in_new_table(self, table_name, file_type, auto_identify, file_path, config={})

source code 

Asynchronously create a new table and import the data contained in the mentioned file into the created table.

Parameters:
  • table_name (string) - Name of the new table to be created.
  • file_type (string) - Type of the file to be imported.
  • auto_identify (string) - Used to specify whether to auto identify the CSV format. Allowable values - true/false.
  • file_path (string) - Path of the file to be imported.
  • config (dictionary) - Contains any additional control parameters. Can be None.
Returns: string
Raises:
  • ServerError - If the server has received the request but did not process the request due to some error.
  • ParseError - If the server has responded but client was not able to parse the response. @return Import job id

import_bulk_data(self, view_id, import_type, file_type, auto_identify, file_path, config={})

source code 

Asynchronously import the data contained in the mentioned file into the table.

Parameters:
  • view_id (string) - Id of the view where the data to be imported.
  • import_type (string) - The type of import. Can be one of - append, truncateadd, updateadd.
  • file_type (string) - Type of the file to be imported.
  • auto_identify (string) - Used to specify whether to auto identify the CSV format. Allowable values - true/false.
  • file_path (string) - Path of the file to be imported.
  • config (dictionary) - Contains any additional control parameters. Can be None.
Returns: string
Raises:
  • ServerError - If the server has received the request but did not process the request due to some error.
  • ParseError - If the server has responded but client was not able to parse the response. @return Import job id

import_data_as_batches(self, view_id, import_type, auto_identify, file_path, batch_size, config={}, tool_config={})

source code 

Asynchronously import the data contained in the mentioned file into the table.

Parameters:
  • view_id (string) - Id of the view where the data to be imported.
  • import_type (string) - The type of import. Can be one of - append, truncateadd, updateadd.
  • auto_identify (string) - Used to specify whether to auto identify the CSV format. Allowable values - true/false.
  • file_path (string) - Path of the file to be imported.
  • batch_size (int) - Number of lines per batch.
  • config (dictionary) - Contains any additional control parameters. Can be None.
  • tool_config (dictionary) - Contains any additional control parameters for the library. Can be None.
Returns: string
Raises:
  • ServerError - If the server has received the request but did not process the request due to some error.
  • ParseError - If the server has responded but client was not able to parse the response. @return Import job id

get_import_job_details(self, job_id)

source code 

Returns the details of the import job.

Parameters:
  • job_id (string) - Id of the job.
Returns: dictionary
Raises:
  • ServerError - If the server has received the request but did not process the request due to some error.
  • ParseError - If the server has responded but client was not able to parse the response. @return Import job details

export_data(self, view_id, response_format, file_path, config={})

source code 

Export the mentioned table (or) view data.

Parameters:
  • view_id (string) - Id of the view to be exported.
  • response_format (string) - The format in which the data is to be exported.
  • file_path (string) - Path of the file where the data exported to be stored.
  • config (dictionary) - Contains any additional control parameters. Can be None.
Raises:
  • ServerError - If the server has received the request but did not process the request due to some error.
  • ParseError - If the server has responded but client was not able to parse the response.

initiate_bulk_export(self, view_id, response_format, config={})

source code 

Initiate asynchronous export for the mentioned table (or) view data.

Parameters:
  • view_id (string) - Id of the view to be exported.
  • response_format (string) - The format in which the data is to be exported.
  • config (dictionary) - Contains any additional control parameters. Can be None.
Returns: string
Raises:
  • ServerError - If the server has received the request but did not process the request due to some error.
  • ParseError - If the server has responded but client was not able to parse the response. @return Export job id

initiate_bulk_export_using_sql(self, sql_query, response_format, config={})

source code 

Initiate asynchronous export with the given SQL Query.

Parameters:
  • sql_query (string) - SQL Query.
  • response_format (string) - The format in which the data is to be exported.
  • config (dictionary) - Contains any additional control parameters. Can be None.
Returns: string
Raises:
  • ServerError - If the server has received the request but did not process the request due to some error.
  • ParseError - If the server has responded but client was not able to parse the response. @return Export job id

get_export_job_details(self, job_id)

source code 

Returns the details of the export job.

Parameters:
  • job_id (string) - Id of the export job.
Returns: dictionary
Raises:
  • ServerError - If the server has received the request but did not process the request due to some error.
  • ParseError - If the server has responded but client was not able to parse the response. @return Export job details

export_bulk_data(self, job_id, file_path)

source code 

Download the exported data for the mentioned job id.

Parameters:
  • job_id (string) - Id of the job to be exported.
  • file_path (string) - Path of the file where the data exported to be stored.
Raises:
  • ServerError - If the server has received the request but did not process the request due to some error.
  • ParseError - If the server has responded but client was not able to parse the response.