API Resources¶
Credentials¶
-
class
Credentials
(session, return_type='civis')¶ Methods
get
(id)Get a credential list
(**kwargs)List credentials post
(type, password, username, **kwargs)Create or update a credential post_authenticate
(username, ...)Authenticate against a remote host post_temporary
(id, **kwargs)Generate a temporary credential for accessing S3 put
(id, type, password, username, **kwargs)Update an existing credential -
get
(id)¶ Get a credential
Parameters: id : integer
The ID of the credential.
Returns: remote_host_id : integer
The ID of the remote host associated with this credential.
type : string
The credential’s type.
created_at : string/time
The creation time for this credential.
updated_at : string/time
The last modification time for this credential.
name : string
The name identifying the credential
username : string
The username for the credential.
id : integer
The ID of the credential.
remote_host_name : string
The name of the remote host associated with this credential.
description : string
A long description of the credential.
owner : string
The name of the user who this credential belongs to.
-
list
(**kwargs)¶ List credentials
Parameters: type : string, optional
The type (or types) of credentials to return. One or more of: Amazon Web Services S3, BSD::API, CASS/NCOA PAF, Catalist::API, Catalist::SFTP, Certificate, Civis Platform, Custom, Database, Google, Github, JobTraits::Ftp, Salesforce User, Salesforce Client, Silverpop Application, Silverpop Refresh Token, Silverpop User, TableauUser, VAN::MyVoterFile, VAN::MyCampaign, and VAN::BothModes. Specify multiple values as a comma- separated list (e.g., “A,B”).
Returns: remote_host_id : integer
The ID of the remote host associated with this credential.
type : string
The credential’s type.
created_at : string/time
The creation time for this credential.
updated_at : string/time
The last modification time for this credential.
name : string
The name identifying the credential
username : string
The username for the credential.
id : integer
The ID of the credential.
remote_host_name : string
The name of the remote host associated with this credential.
description : string
A long description of the credential.
owner : string
The name of the user who this credential belongs to.
-
post
(type, password, username, **kwargs)¶ Create or update a credential
Parameters: type : string
password : string
The password for the credential.
username : string
The username for the credential.
remote_host_id : integer, optional
The ID of the remote host associated with the credential.
name : string, optional
The name identifying the credential.
description : string, optional
A long description of the credential.
remote_host : dict, optional:
- type : string The type of remote host. One of: RemoteHostTypes::BSD, RemoteHostTypes::Ftp, RemoteHostTypes::Github, RemoteHostTypes::GoogleDoc, RemoteHostTypes::JDBC, RemoteHostTypes::Redshift, RemoteHostTypes::Salesforce, and RemoteHostTypes::Van - url : string The URL to your host. - name : string The human readable name for the remote host.
Returns: remote_host_id : integer
The ID of the remote host associated with this credential.
type : string
The credential’s type.
created_at : string/time
The creation time for this credential.
updated_at : string/time
The last modification time for this credential.
name : string
The name identifying the credential
username : string
The username for the credential.
id : integer
The ID of the credential.
remote_host_name : string
The name of the remote host associated with this credential.
description : string
A long description of the credential.
owner : string
The name of the user who this credential belongs to.
-
post_authenticate
(username, remote_host_type, url, password)¶ Authenticate against a remote host
Parameters: username : string
The username for the credential.
remote_host_type : string
The type of remote host. One of: RemoteHostTypes::BSD, RemoteHostTypes::Ftp, RemoteHostTypes::Github, RemoteHostTypes::GoogleDoc, RemoteHostTypes::JDBC, RemoteHostTypes::Redshift, RemoteHostTypes::Salesforce, and RemoteHostTypes::Van
url : string
The URL to your host.
password : string
The password for the credential.
Returns: remote_host_id : integer
The ID of the remote host associated with this credential.
type : string
The credential’s type.
created_at : string/time
The creation time for this credential.
updated_at : string/time
The last modification time for this credential.
name : string
The name identifying the credential
username : string
The username for the credential.
id : integer
The ID of the credential.
remote_host_name : string
The name of the remote host associated with this credential.
description : string
A long description of the credential.
owner : string
The name of the user who this credential belongs to.
-
post_temporary
(id, **kwargs)¶ Generate a temporary credential for accessing S3
Parameters: id : integer
The ID of the credential.
duration : integer, optional
The number of seconds the temporary credential should be valid. Defaults to 15 minutes. Must not be less than 15 minutes or greater than 36 hours.
Returns: secret_access_key : string
The secret part of the credential.
session_token : string
The session token identifier.
access_key : string
The identifier of the credential.
-
put
(id, type, password, username, **kwargs)¶ Update an existing credential
Parameters: id : integer
The ID of the credential.
type : string
password : string
The password for the credential.
username : string
The username for the credential.
remote_host_id : integer, optional
The ID of the remote host associated with the credential.
name : string, optional
The name identifying the credential.
description : string, optional
A long description of the credential.
remote_host : dict, optional:
- type : string The type of remote host. One of: RemoteHostTypes::BSD, RemoteHostTypes::Ftp, RemoteHostTypes::Github, RemoteHostTypes::GoogleDoc, RemoteHostTypes::JDBC, RemoteHostTypes::Redshift, RemoteHostTypes::Salesforce, and RemoteHostTypes::Van - url : string The URL to your host. - name : string The human readable name for the remote host.
Returns: remote_host_id : integer
The ID of the remote host associated with this credential.
type : string
The credential’s type.
created_at : string/time
The creation time for this credential.
updated_at : string/time
The last modification time for this credential.
name : string
The name identifying the credential
username : string
The username for the credential.
id : integer
The ID of the credential.
remote_host_name : string
The name of the remote host associated with this credential.
description : string
A long description of the credential.
owner : string
The name of the user who this credential belongs to.
-
Databases¶
-
class
Databases
(session, return_type='civis')¶ Methods
delete_whitelist_ips
(id, whitelisted_ip_id)Remove a whitelisted IP address get_whitelist_ips
(id, whitelisted_ip_id)View details about a whitelisted IP list
()List databases list_schemas
(id)List schemas in this database list_whitelist_ips
(id)List whitelisted IPs for the specified database post_whitelist_ips
(id, subnet_mask)Whitelist an IP address -
delete_whitelist_ips
(id, whitelisted_ip_id)¶ Remove a whitelisted IP address
Parameters: id : integer
The ID of the database this rule is applied to.
whitelisted_ip_id : integer
The ID of this whitelisted IP address.
Returns: None
Response code 204: success
-
get_whitelist_ips
(id, whitelisted_ip_id)¶ View details about a whitelisted IP
Parameters: id : integer
The ID of the database this rule is applied to.
whitelisted_ip_id : integer
The ID of this whitelisted IP address.
Returns: remote_host_id : integer
The ID of the database this rule is applied to.
security_group_id : string
The ID of the security group this rule is applied to.
subnet_mask : string
The subnet mask that is allowed by this rule.
updated_at : string/time
The time this rule was last updated.
authorized_by : string
The user who authorized this rule.
id : integer
The ID of this whitelisted IP address.
created_at : string/time
The time this rule was created.
is_active : boolean
True if the rule is applied, false if it has been revoked.
-
list
()¶ List databases
Returns: id : integer
The ID for the database.
name : string
The name of the database.
-
list_schemas
(id)¶ List schemas in this database
Parameters: id : integer
The ID of the database.
Returns: schema : string
The name of a schema.
-
list_whitelist_ips
(id)¶ List whitelisted IPs for the specified database
Parameters: id : integer
The ID for the database.
Returns: remote_host_id : integer
The ID of the database this rule is applied to.
security_group_id : string
The ID of the security group this rule is applied to.
subnet_mask : string
The subnet mask that is allowed by this rule.
updated_at : string/time
The time this rule was last updated.
id : integer
The ID of this whitelisted IP address.
created_at : string/time
The time this rule was created.
-
post_whitelist_ips
(id, subnet_mask)¶ Whitelist an IP address
Parameters: id : integer
The ID of the database this rule is applied to.
subnet_mask : string
The subnet mask that is allowed by this rule.
Returns: remote_host_id : integer
The ID of the database this rule is applied to.
security_group_id : string
The ID of the security group this rule is applied to.
subnet_mask : string
The subnet mask that is allowed by this rule.
updated_at : string/time
The time this rule was last updated.
authorized_by : string
The user who authorized this rule.
id : integer
The ID of this whitelisted IP address.
created_at : string/time
The time this rule was created.
is_active : boolean
True if the rule is applied, false if it has been revoked.
-
Files¶
-
class
Files
(session, return_type='civis')¶ Methods
delete_projects
(id, project_id)Remove a Data::S3File from a project delete_shares_groups
(id, group_id)Revoke the permissions a group has on this object delete_shares_users
(id, user_id)Revoke the permissions a user has on this object get
(id)Get details about a file list_projects
(id)List the projects a Data::S3File belongs to list_shares
(id)List users and groups permissioned on this object post
(name, **kwargs)Initiate an upload of a file into the platform put_projects
(id, project_id)Add a Data::S3File to a project put_shares_groups
(id, permission_level, ...)Set the permissions groups has on this object put_shares_users
(id, permission_level, user_ids)Set the permissions users have on this object -
delete_projects
(id, project_id)¶ Remove a Data::S3File from a project
Parameters: id : integer
ID of the resource
project_id : integer
The ID of the project
Returns: None
Response code 204: success
Revoke the permissions a group has on this object
Parameters: id : integer
ID of the resource to be revoked
group_id : integer
ID of the group
Returns: None
Response code 204: success
Revoke the permissions a user has on this object
Parameters: id : integer
ID of the resource to be revoked
user_id : integer
ID of the user
Returns: None
Response code 204: success
-
get
(id)¶ Get details about a file
Parameters: id : integer
The ID of the file object.
Returns: expires_at : string/date-time
The date and time the file will expire. If not specified, the file will expire in 30 days. To keep a file indefinitely, specify null.
download_url : string
A JSON string containing information about the URL of the file.
name : string
The file name.
file_url : string
The URL that may be used to download the file.
id : integer
The ID of the file object.
created_at : string/date-time
The date and time the file was created.
file_size : integer
The file size.
-
list_projects
(id)¶ List the projects a Data::S3File belongs to
Parameters: id : integer
The ID of the resource.
Returns: archived : string
The archival status of the requested object(s).
updated_at : string/time
name : string
The name of this project.
author : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
id : integer
The ID for this project.
created_at : string/time
description : string
A description of the project
users : list:
Users who can see the project - username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
auto_share : boolean
List users and groups permissioned on this object
Parameters: id : integer
The ID of the object.
Returns: readers : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
owners : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
writers : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
-
post
(name, **kwargs)¶ Initiate an upload of a file into the platform
Parameters: name : string
The file name.
expires_at : string/date-time, optional
The date and time the file will expire. If not specified, the file will expire in 30 days. To keep a file indefinitely, specify null.
Returns: upload_url : string
The URL that may be used to upload a file. To use the upload URL, initiate a POST request to the given URL with the file you wish to import as the “file” form field.
expires_at : string/date-time
The date and time the file will expire. If not specified, the file will expire in 30 days. To keep a file indefinitely, specify null.
name : string
The file name.
id : integer
The ID of the file object.
created_at : string/date-time
The date and time the file was created.
upload_fields : dict
A hash containing the form fields to be included with the POST request.
file_size : integer
The file size.
-
put_projects
(id, project_id)¶ Add a Data::S3File to a project
Parameters: id : integer
ID of the resource
project_id : integer
The ID of the project
Returns: None
Response code 204: success
Set the permissions groups has on this object
Parameters: id : integer
ID of the resource to be shared
permission_level : string
Options are: “read”, “write”, or “manage”
group_ids : list
An array of one or more group IDs
Returns: readers : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
owners : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
writers : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
Set the permissions users have on this object
Parameters: id : integer
ID of the resource to be shared
permission_level : string
Options are: “read”, “write”, or “manage”
user_ids : list
An array of one or more user IDs
Returns: readers : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
owners : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
writers : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
-
Imports¶
-
class
Imports
(session, return_type='civis')¶ Methods
delete_files_runs
(id, run_id)Cancel a run delete_projects
(id, project_id)Remove a JobTypes::Import from a project delete_shares_groups
(id, group_id)Revoke the permissions a group has on this object delete_shares_users
(id, user_id)Revoke the permissions a user has on this object delete_syncs
(id, sync_id)Delete a sync get
(id)Get details about an import get_files_runs
(id, run_id)Check status of a run list
(**kwargs)List imports list_files_runs
(id, **kwargs)List runs for the given import list_projects
(id)List the projects a JobTypes::Import belongs to list_runs
(id)Get the run history of this import list_shares
(id)List users and groups permissioned on this object post
(sync_type, is_outbound, name, **kwargs)Create a new import configuration post_files
(name, remote_host_id, ...)Initate an import of a tabular file into the platform post_files_runs
(id)Start a run post_runs
(id)Run an import post_syncs
(id, destination, source, **kwargs)Create a sync put
(id, sync_type, is_outbound, name, **kwargs)Update an import put_archive
(id, status)Update the archive status of this object put_projects
(id, project_id)Add a JobTypes::Import to a project put_shares_groups
(id, permission_level, ...)Set the permissions groups has on this object put_shares_users
(id, permission_level, user_ids)Set the permissions users have on this object put_syncs
(id, sync_id, destination, source, ...)Update a sync -
delete_files_runs
(id, run_id)¶ Cancel a run
Parameters: id : integer
The ID of the import.
run_id : integer
The ID of the run.
Returns: None
Response code 202: success
-
delete_projects
(id, project_id)¶ Remove a JobTypes::Import from a project
Parameters: id : integer
ID of the resource
project_id : integer
The ID of the project
Returns: None
Response code 204: success
Revoke the permissions a group has on this object
Parameters: id : integer
ID of the resource to be revoked
group_id : integer
ID of the group
Returns: None
Response code 204: success
Revoke the permissions a user has on this object
Parameters: id : integer
ID of the resource to be revoked
user_id : integer
ID of the user
Returns: None
Response code 204: success
-
delete_syncs
(id, sync_id)¶ Delete a sync
Parameters: id : integer
The ID of the import to fetch.
sync_id : integer
The ID of the sync to fetch.
Returns: None
Response code 204: success
-
get
(id)¶ Get details about an import
Parameters: id : integer
The ID for the import.
Returns: schedule : dict:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
created_at : string/date-time
is_outbound : boolean
archived : string
The archival status of the requested object(s).
name : string
The name of the import.
parent_id : integer
Parent id to trigger this import from
last_run : dict:
- finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued.
time_zone : string
The time zone of this import.
next_run_at : string/time
The time of the next scheduled run.
running_as : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
hidden : boolean
The hidden status of the object.
destination : dict:
- remote_host_id : integer - additional_credentials : list Array that holds additional credentials used for specific imports. For salesforce imports, the first and only element is the client credential id. - credential_id : integer - name : string
sync_type : string
The type of sync to perform; one of Dbsync, AutoImport, SilverpopDataImport, SilverpopContactImport, GdocImport, and Salesforce.
user : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
updated_at : string/date-time
notifications : dict:
- failure_on : boolean If failure email notifications are on - success_email_subject : string Custom subject line for success e-mail. - success_email_body : string Custom body text for success e-mail, written in Markdown. - success_email_addresses : list Addresses to notify by e-mail when the job completes successfully. - stall_warning_minutes : integer Stall warning emails will be sent after this amount of minutes. - failure_email_addresses : list Addresses to notify by e-mail when the job fails. - urls : list URLs to receive a POST request at job completion - success_on : boolean If success email notifications are on
state : string
id : integer
The ID for the import.
source : dict:
- remote_host_id : integer - additional_credentials : list Array that holds additional credentials used for specific imports. For salesforce imports, the first and only element is the client credential id. - credential_id : integer - name : string
syncs : list:
List of syncs. - id : integer - source : dict:: - id : integer The ID of the table or file, if available. - path : string The path of the dataset to sync from; for a database source, schema.tablename. - destination : dict:: - path : string The schema.tablename to sync to. - advanced_options : dict:: - mysql_catalog_matches_schema : boolean - row_chunk_size : integer - invalid_char_replacement : string - truncate_long_lines : boolean - first_row_is_header : boolean - sortkey1 : string - sortkey2 : string - max_errors : integer - partition_table_name : string - partition_table_partition_column_max_name : string - partition_column_name : string - verify_table_row_counts : boolean - contact_lists : string - existing_table_rows : string - column_delimiter : string - partition_schema_name : string - partition_table_partition_column_min_name : string - export_action : string - last_modified_column : string - identity_column : string - wipe_destination_table : boolean - soql_query : string - distkey : string
-
get_files_runs
(id, run_id)¶ Check status of a run
Parameters: id : integer
The ID of the import.
run_id : integer
The ID of the run.
Returns: import_id : integer
The ID of the import.
finished_at : string/time
The time the last run completed.
started_at : string/time
The time the last run started at.
is_cancel_requested : boolean
True if run cancel requested, else false.
error : string
The error, if any, returned by the run.
state : string
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
id : integer
The ID of the run.
-
list
(**kwargs)¶ List imports
Parameters: type : string, optional
If specified, return imports of these types. It accepts a comma-separated list, possible values are ‘AutoImport’, ‘DbSync’, ‘Salesforce’, ‘GdocImport’.
author : string, optional
If specified, return imports from this author. It accepts a comma-separated list of author ids.
destination : string, optional
If specified, returns imports with one of these destinations. It accepts a comma-separated list of remote host ids.
status : string, optional
If specified, returns imports with one of these statuses. It accepts a comma-separated list, possible values are ‘running’, ‘failed’, ‘succeeded’, ‘idle’, ‘scheduled’.
archived : string, optional
The archival status of the requested object(s).
limit : integer, optional
Number of results to return. Defaults to 20. Maximum allowed is 50.
page_num : integer, optional
Page number of the results to return. Defaults to the first page, 1.
order : string, optional
The field on which to order the result set. Defaults to updated_at. Must be one of: updated_at, name, created_at, last_run.updated_at.
order_dir : string, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: schedule : dict:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
source : dict:
- remote_host_id : integer - additional_credentials : list Array that holds additional credentials used for specific imports. For salesforce imports, the first and only element is the client credential id. - credential_id : integer - name : string
is_outbound : boolean
archived : string
The archival status of the requested object(s).
name : string
The name of the import.
last_run : dict:
- finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued.
time_zone : string
The time zone of this import.
destination : dict:
- remote_host_id : integer - additional_credentials : list Array that holds additional credentials used for specific imports. For salesforce imports, the first and only element is the client credential id. - credential_id : integer - name : string
sync_type : string
The type of sync to perform; one of Dbsync, AutoImport, SilverpopDataImport, SilverpopContactImport, GdocImport, and Salesforce.
user : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
updated_at : string/date-time
state : string
id : integer
The ID for the import.
created_at : string/date-time
-
list_files_runs
(id, **kwargs)¶ List runs for the given import
Parameters: id : integer
The ID of the import.
limit : integer, optional
Number of results to return. Defaults to 20. Maximum allowed is 100.
page_num : integer, optional
Page number of the results to return. Defaults to the first page, 1.
order : string, optional
The field on which to order the result set. Defaults to id. Must be one of: id.
order_dir : string, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: import_id : integer
The ID of the import.
finished_at : string/time
The time the last run completed.
started_at : string/time
The time the last run started at.
is_cancel_requested : boolean
True if run cancel requested, else false.
error : string
The error, if any, returned by the run.
state : string
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
id : integer
The ID of the run.
-
list_projects
(id)¶ List the projects a JobTypes::Import belongs to
Parameters: id : integer
The ID of the resource.
Returns: archived : string
The archival status of the requested object(s).
updated_at : string/time
name : string
The name of this project.
author : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
id : integer
The ID for this project.
created_at : string/time
description : string
A description of the project
users : list:
Users who can see the project - username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
auto_share : boolean
-
list_runs
(id)¶ Get the run history of this import
Parameters: id : integer
Returns: finished_at : string/time
The time that the run completed.
started_at : string/time
The time that the run started.
error : string
The error message for this run, if present.
state : string
id : integer
created_at : string/time
The time that the run was queued.
List users and groups permissioned on this object
Parameters: id : integer
The ID of the object.
Returns: readers : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
owners : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
writers : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
-
post
(sync_type, is_outbound, name, **kwargs)¶ Create a new import configuration
Parameters: sync_type : string
The type of sync to perform; one of Dbsync, AutoImport, SilverpopDataImport, SilverpopContactImport, GdocImport, and Salesforce.
is_outbound : boolean
name : string
The name of the import.
parent_id : integer, optional
Parent id to trigger this import from
destination : dict, optional:
- remote_host_id : integer - additional_credentials : list Array that holds additional credentials used for specific imports. For salesforce imports, the first and only element is the client credential id. - credential_id : integer
time_zone : string, optional
The time zone of this import.
notifications : dict, optional:
- failure_on : boolean If failure email notifications are on - success_email_subject : string Custom subject line for success e-mail. - success_email_body : string Custom body text for success e-mail, written in Markdown. - success_email_addresses : list Addresses to notify by e-mail when the job completes successfully. - stall_warning_minutes : integer Stall warning emails will be sent after this amount of minutes. - failure_email_addresses : list Addresses to notify by e-mail when the job fails. - urls : list URLs to receive a POST request at job completion - success_on : boolean If success email notifications are on
hidden : boolean, optional
The hidden status of the object.
schedule : dict, optional:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
source : dict, optional:
- remote_host_id : integer - additional_credentials : list Array that holds additional credentials used for specific imports. For salesforce imports, the first and only element is the client credential id. - credential_id : integer
next_run_at : string/time, optional
The time of the next scheduled run.
Returns: schedule : dict:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
created_at : string/date-time
is_outbound : boolean
archived : string
The archival status of the requested object(s).
name : string
The name of the import.
parent_id : integer
Parent id to trigger this import from
last_run : dict:
- finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued.
time_zone : string
The time zone of this import.
next_run_at : string/time
The time of the next scheduled run.
running_as : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
hidden : boolean
The hidden status of the object.
destination : dict:
- remote_host_id : integer - additional_credentials : list Array that holds additional credentials used for specific imports. For salesforce imports, the first and only element is the client credential id. - credential_id : integer - name : string
sync_type : string
The type of sync to perform; one of Dbsync, AutoImport, SilverpopDataImport, SilverpopContactImport, GdocImport, and Salesforce.
user : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
updated_at : string/date-time
notifications : dict:
- failure_on : boolean If failure email notifications are on - success_email_subject : string Custom subject line for success e-mail. - success_email_body : string Custom body text for success e-mail, written in Markdown. - success_email_addresses : list Addresses to notify by e-mail when the job completes successfully. - stall_warning_minutes : integer Stall warning emails will be sent after this amount of minutes. - failure_email_addresses : list Addresses to notify by e-mail when the job fails. - urls : list URLs to receive a POST request at job completion - success_on : boolean If success email notifications are on
state : string
id : integer
The ID for the import.
source : dict:
- remote_host_id : integer - additional_credentials : list Array that holds additional credentials used for specific imports. For salesforce imports, the first and only element is the client credential id. - credential_id : integer - name : string
syncs : list:
List of syncs. - id : integer - source : dict:: - id : integer The ID of the table or file, if available. - path : string The path of the dataset to sync from; for a database source, schema.tablename. - destination : dict:: - path : string The schema.tablename to sync to. - advanced_options : dict:: - mysql_catalog_matches_schema : boolean - row_chunk_size : integer - invalid_char_replacement : string - truncate_long_lines : boolean - first_row_is_header : boolean - sortkey1 : string - sortkey2 : string - max_errors : integer - partition_table_name : string - partition_table_partition_column_max_name : string - partition_column_name : string - verify_table_row_counts : boolean - contact_lists : string - existing_table_rows : string - column_delimiter : string - partition_schema_name : string - partition_table_partition_column_min_name : string - export_action : string - last_modified_column : string - identity_column : string - wipe_destination_table : boolean - soql_query : string - distkey : string
-
post_files
(name, remote_host_id, credential_id, schema, **kwargs)¶ Initate an import of a tabular file into the platform
Parameters: name : string
The name of the destination table.
remote_host_id : integer
The id of the destination database host.
credential_id : integer
The id of the credentials to be used when performing the database import.
schema : string
The schema of the destination table.
max_errors : integer, optional
The maximum number of rows with errors to remove from the import before failing.
column_delimiter : string, 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”.
existing_table_rows : string, optional
The behaviour if a table with the requested name already exists. One of “fail”, “truncate”, “append”, or “drop”.Defaults to “fail”.
first_row_is_header : boolean, 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.
sortkey2 : string, optional
The second column in a compound sortkey for the table.
multipart : boolean, optional
If true, the upload URI will require a multipart/form-data POST request. Defaults to false.
sortkey1 : string, optional
The column to use as the sort key for the table.
distkey : string, optional
The column to use as the distkey for the table.
Returns: id : integer
The id of the import.
run_uri : string
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 reponse, POST to this URI to initiate the import of your uploaded file into the platform.
upload_fields : dict
If multipart was set to true, these fields should be included in the multipart upload.
upload_uri : string
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 reponse.
-
post_files_runs
(id)¶ Start a run
Parameters: id : integer
The ID of the import.
Returns: import_id : integer
The ID of the import.
finished_at : string/time
The time the last run completed.
started_at : string/time
The time the last run started at.
is_cancel_requested : boolean
True if run cancel requested, else false.
error : string
The error, if any, returned by the run.
state : string
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
id : integer
The ID of the run.
-
post_runs
(id)¶ Run an import
Parameters: id : integer
The ID of the import to run.
Returns: run_id : integer
The ID of the new run triggered.
-
post_syncs
(id, destination, source, **kwargs)¶ Create a sync
Parameters: id : integer
destination : dict:
- path : string The schema.tablename to sync to.
source : dict:
- path : string The path of the dataset to sync from; for a database source, schema.tablename.
advanced_options : dict, optional:
- mysql_catalog_matches_schema : boolean - row_chunk_size : integer - invalid_char_replacement : string - truncate_long_lines : boolean - first_row_is_header : boolean - sortkey1 : string - sortkey2 : string - max_errors : integer - partition_table_name : string - partition_table_partition_column_max_name : string - partition_column_name : string - verify_table_row_counts : boolean - contact_lists : string - existing_table_rows : string - column_delimiter : string - partition_schema_name : string - partition_table_partition_column_min_name : string - export_action : string - last_modified_column : string - identity_column : string - wipe_destination_table : boolean - soql_query : string - distkey : string
Returns: id : integer
source : dict:
- id : integer The ID of the table or file, if available. - path : string The path of the dataset to sync from; for a database source, schema.tablename.
destination : dict:
- path : string The schema.tablename to sync to.
advanced_options : dict:
- mysql_catalog_matches_schema : boolean - row_chunk_size : integer - invalid_char_replacement : string - truncate_long_lines : boolean - first_row_is_header : boolean - sortkey1 : string - sortkey2 : string - max_errors : integer - partition_table_name : string - partition_table_partition_column_max_name : string - partition_column_name : string - verify_table_row_counts : boolean - contact_lists : string - existing_table_rows : string - column_delimiter : string - partition_schema_name : string - partition_table_partition_column_min_name : string - export_action : string - last_modified_column : string - identity_column : string - wipe_destination_table : boolean - soql_query : string - distkey : string
-
put
(id, sync_type, is_outbound, name, **kwargs)¶ Update an import
Parameters: id : integer
The ID for the import.
sync_type : string
The type of sync to perform; one of Dbsync, AutoImport, SilverpopDataImport, SilverpopContactImport, GdocImport, and Salesforce.
is_outbound : boolean
name : string
The name of the import.
parent_id : integer, optional
Parent id to trigger this import from
destination : dict, optional:
- remote_host_id : integer - additional_credentials : list Array that holds additional credentials used for specific imports. For salesforce imports, the first and only element is the client credential id. - credential_id : integer
time_zone : string, optional
The time zone of this import.
notifications : dict, optional:
- failure_on : boolean If failure email notifications are on - success_email_subject : string Custom subject line for success e-mail. - success_email_body : string Custom body text for success e-mail, written in Markdown. - success_email_addresses : list Addresses to notify by e-mail when the job completes successfully. - stall_warning_minutes : integer Stall warning emails will be sent after this amount of minutes. - failure_email_addresses : list Addresses to notify by e-mail when the job fails. - urls : list URLs to receive a POST request at job completion - success_on : boolean If success email notifications are on
schedule : dict, optional:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
source : dict, optional:
- remote_host_id : integer - additional_credentials : list Array that holds additional credentials used for specific imports. For salesforce imports, the first and only element is the client credential id. - credential_id : integer
next_run_at : string/time, optional
The time of the next scheduled run.
Returns: schedule : dict:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
created_at : string/date-time
is_outbound : boolean
archived : string
The archival status of the requested object(s).
name : string
The name of the import.
parent_id : integer
Parent id to trigger this import from
last_run : dict:
- finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued.
time_zone : string
The time zone of this import.
next_run_at : string/time
The time of the next scheduled run.
running_as : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
hidden : boolean
The hidden status of the object.
destination : dict:
- remote_host_id : integer - additional_credentials : list Array that holds additional credentials used for specific imports. For salesforce imports, the first and only element is the client credential id. - credential_id : integer - name : string
sync_type : string
The type of sync to perform; one of Dbsync, AutoImport, SilverpopDataImport, SilverpopContactImport, GdocImport, and Salesforce.
user : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
updated_at : string/date-time
notifications : dict:
- failure_on : boolean If failure email notifications are on - success_email_subject : string Custom subject line for success e-mail. - success_email_body : string Custom body text for success e-mail, written in Markdown. - success_email_addresses : list Addresses to notify by e-mail when the job completes successfully. - stall_warning_minutes : integer Stall warning emails will be sent after this amount of minutes. - failure_email_addresses : list Addresses to notify by e-mail when the job fails. - urls : list URLs to receive a POST request at job completion - success_on : boolean If success email notifications are on
state : string
id : integer
The ID for the import.
source : dict:
- remote_host_id : integer - additional_credentials : list Array that holds additional credentials used for specific imports. For salesforce imports, the first and only element is the client credential id. - credential_id : integer - name : string
syncs : list:
List of syncs. - id : integer - source : dict:: - id : integer The ID of the table or file, if available. - path : string The path of the dataset to sync from; for a database source, schema.tablename. - destination : dict:: - path : string The schema.tablename to sync to. - advanced_options : dict:: - mysql_catalog_matches_schema : boolean - row_chunk_size : integer - invalid_char_replacement : string - truncate_long_lines : boolean - first_row_is_header : boolean - sortkey1 : string - sortkey2 : string - max_errors : integer - partition_table_name : string - partition_table_partition_column_max_name : string - partition_column_name : string - verify_table_row_counts : boolean - contact_lists : string - existing_table_rows : string - column_delimiter : string - partition_schema_name : string - partition_table_partition_column_min_name : string - export_action : string - last_modified_column : string - identity_column : string - wipe_destination_table : boolean - soql_query : string - distkey : string
-
put_archive
(id, status)¶ Update the archive status of this object
Parameters: id : integer
The ID of the object.
status : boolean
The desired archived status of the object.
Returns: schedule : dict:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
created_at : string/date-time
is_outbound : boolean
archived : string
The archival status of the requested object(s).
name : string
The name of the import.
parent_id : integer
Parent id to trigger this import from
last_run : dict:
- finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued.
time_zone : string
The time zone of this import.
next_run_at : string/time
The time of the next scheduled run.
running_as : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
hidden : boolean
The hidden status of the object.
destination : dict:
- remote_host_id : integer - additional_credentials : list Array that holds additional credentials used for specific imports. For salesforce imports, the first and only element is the client credential id. - credential_id : integer - name : string
sync_type : string
The type of sync to perform; one of Dbsync, AutoImport, SilverpopDataImport, SilverpopContactImport, GdocImport, and Salesforce.
user : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
updated_at : string/date-time
notifications : dict:
- failure_on : boolean If failure email notifications are on - success_email_subject : string Custom subject line for success e-mail. - success_email_body : string Custom body text for success e-mail, written in Markdown. - success_email_addresses : list Addresses to notify by e-mail when the job completes successfully. - stall_warning_minutes : integer Stall warning emails will be sent after this amount of minutes. - failure_email_addresses : list Addresses to notify by e-mail when the job fails. - urls : list URLs to receive a POST request at job completion - success_on : boolean If success email notifications are on
state : string
id : integer
The ID for the import.
source : dict:
- remote_host_id : integer - additional_credentials : list Array that holds additional credentials used for specific imports. For salesforce imports, the first and only element is the client credential id. - credential_id : integer - name : string
syncs : list:
List of syncs. - id : integer - source : dict:: - id : integer The ID of the table or file, if available. - path : string The path of the dataset to sync from; for a database source, schema.tablename. - destination : dict:: - path : string The schema.tablename to sync to. - advanced_options : dict:: - mysql_catalog_matches_schema : boolean - row_chunk_size : integer - invalid_char_replacement : string - truncate_long_lines : boolean - first_row_is_header : boolean - sortkey1 : string - sortkey2 : string - max_errors : integer - partition_table_name : string - partition_table_partition_column_max_name : string - partition_column_name : string - verify_table_row_counts : boolean - contact_lists : string - existing_table_rows : string - column_delimiter : string - partition_schema_name : string - partition_table_partition_column_min_name : string - export_action : string - last_modified_column : string - identity_column : string - wipe_destination_table : boolean - soql_query : string - distkey : string
-
put_projects
(id, project_id)¶ Add a JobTypes::Import to a project
Parameters: id : integer
ID of the resource
project_id : integer
The ID of the project
Returns: None
Response code 204: success
Set the permissions groups has on this object
Parameters: id : integer
ID of the resource to be shared
permission_level : string
Options are: “read”, “write”, or “manage”
group_ids : list
An array of one or more group IDs
Returns: readers : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
owners : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
writers : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
Set the permissions users have on this object
Parameters: id : integer
ID of the resource to be shared
permission_level : string
Options are: “read”, “write”, or “manage”
user_ids : list
An array of one or more user IDs
Returns: readers : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
owners : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
writers : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
-
put_syncs
(id, sync_id, destination, source, **kwargs)¶ Update a sync
Parameters: id : integer
The ID of the import to fetch.
sync_id : integer
The ID of the sync to fetch.
destination : dict:
- path : string The schema.tablename to sync to.
source : dict:
- path : string The path of the dataset to sync from; for a database source, schema.tablename.
advanced_options : dict, optional:
- mysql_catalog_matches_schema : boolean - row_chunk_size : integer - invalid_char_replacement : string - truncate_long_lines : boolean - first_row_is_header : boolean - sortkey1 : string - sortkey2 : string - max_errors : integer - partition_table_name : string - partition_table_partition_column_max_name : string - partition_column_name : string - verify_table_row_counts : boolean - contact_lists : string - existing_table_rows : string - column_delimiter : string - partition_schema_name : string - partition_table_partition_column_min_name : string - export_action : string - last_modified_column : string - identity_column : string - wipe_destination_table : boolean - soql_query : string - distkey : string
Returns: id : integer
source : dict:
- id : integer The ID of the table or file, if available. - path : string The path of the dataset to sync from; for a database source, schema.tablename.
destination : dict:
- path : string The schema.tablename to sync to.
advanced_options : dict:
- mysql_catalog_matches_schema : boolean - row_chunk_size : integer - invalid_char_replacement : string - truncate_long_lines : boolean - first_row_is_header : boolean - sortkey1 : string - sortkey2 : string - max_errors : integer - partition_table_name : string - partition_table_partition_column_max_name : string - partition_column_name : string - verify_table_row_counts : boolean - contact_lists : string - existing_table_rows : string - column_delimiter : string - partition_schema_name : string - partition_table_partition_column_min_name : string - export_action : string - last_modified_column : string - identity_column : string - wipe_destination_table : boolean - soql_query : string - distkey : string
-
Jobs¶
-
class
Jobs
(session, return_type='civis')¶ Methods
delete_projects
(id, project_id)Remove a Job from a project delete_shares_groups
(id, group_id)Revoke the permissions a group has on this object delete_shares_users
(id, user_id)Revoke the permissions a user has on this object get
(id)Show basic job info list
(**kwargs)List jobs list_children
(id)Show nested tree of children that this job triggers list_parents
(id)Show chain of parents as a list that this job triggers from list_projects
(id)List the projects a Job belongs to list_shares
(id)List users and groups permissioned on this object post_runs
(id)Run a job post_trigger_email
(id)Generate and retrieve trigger email address put_projects
(id, project_id)Add a Job to a project put_shares_groups
(id, permission_level, ...)Set the permissions groups has on this object put_shares_users
(id, permission_level, user_ids)Set the permissions users have on this object -
delete_projects
(id, project_id)¶ Remove a Job from a project
Parameters: id : integer
ID of the resource
project_id : integer
The ID of the project
Returns: None
Response code 204: success
Revoke the permissions a group has on this object
Parameters: id : integer
ID of the resource to be revoked
group_id : integer
ID of the group
Returns: None
Response code 204: success
Revoke the permissions a user has on this object
Parameters: id : integer
ID of the resource to be revoked
user_id : integer
ID of the user
Returns: None
Response code 204: success
-
get
(id)¶ Show basic job info
Parameters: id : integer
The ID for this job.
Returns: type : string
last_run : dict:
- finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued.
archived : string
The archival status of the requested object(s).
updated_at : string/date-time
name : string
hidden : boolean
The hidden status of the object.
state : string
Whether the job is idle, queued, running, cancelled, or failed.
id : integer
created_at : string/date-time
runs : list:
Information about the most recent runs of the job. - finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued.
-
list
(**kwargs)¶ List jobs
Parameters: limit : integer, optional
The maximum number of jobs to return.
state : string, optional
The job’s state. One or more of queued, running, succeeded, failed, and cancelled. Specify multiple values as a comma-separated list (e.g., “A,B”).
type : string, optional
The job’s type. Specify multiple values as a comma-separated list (e.g., “A,B”).
q : string, optional
Query string to search on the id, name, and job type
permission : string, optional
A permissions string, one of “read”, “write”, or “manage”. Lists only jobs for which the current user has that permission.
archived : string, optional
The archival status of the requested object(s).
Returns: type : string
last_run : dict:
- finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued.
archived : string
The archival status of the requested object(s).
updated_at : string/date-time
name : string
state : string
Whether the job is idle, queued, running, cancelled, or failed.
id : integer
created_at : string/date-time
-
list_children
(id)¶ Show nested tree of children that this job triggers
Parameters: id : integer
The ID for this job.
Returns: children : list
type : string
last_run : dict:
- finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued.
updated_at : string/date-time
name : string
state : string
id : integer
created_at : string/date-time
runs : list:
- finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued.
-
list_parents
(id)¶ Show chain of parents as a list that this job triggers from
Parameters: id : integer
The ID for this job.
Returns: type : string
last_run : dict:
- finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued.
archived : string
The archival status of the requested object(s).
updated_at : string/date-time
name : string
hidden : boolean
The hidden status of the object.
state : string
Whether the job is idle, queued, running, cancelled, or failed.
id : integer
created_at : string/date-time
runs : list:
Information about the most recent runs of the job. - finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued.
-
list_projects
(id)¶ List the projects a Job belongs to
Parameters: id : integer
The ID of the resource.
Returns: archived : string
The archival status of the requested object(s).
updated_at : string/time
name : string
The name of this project.
author : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
id : integer
The ID for this project.
created_at : string/time
description : string
A description of the project
users : list:
Users who can see the project - username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
auto_share : boolean
List users and groups permissioned on this object
Parameters: id : integer
The ID of the object.
Returns: readers : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
owners : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
writers : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
-
post_runs
(id)¶ Run a job
Parameters: id : integer
The ID for this job.
Returns: None
Response code 204: success
-
post_trigger_email
(id)¶ Generate and retrieve trigger email address
Parameters: id : integer
The ID for this job.
Returns: trigger_email : string
Email address which may be used to trigger this job to run.
-
put_projects
(id, project_id)¶ Add a Job to a project
Parameters: id : integer
ID of the resource
project_id : integer
The ID of the project
Returns: None
Response code 204: success
Set the permissions groups has on this object
Parameters: id : integer
ID of the resource to be shared
permission_level : string
Options are: “read”, “write”, or “manage”
group_ids : list
An array of one or more group IDs
Returns: readers : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
owners : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
writers : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
Set the permissions users have on this object
Parameters: id : integer
ID of the resource to be shared
permission_level : string
Options are: “read”, “write”, or “manage”
user_ids : list
An array of one or more user IDs
Returns: readers : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
owners : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
writers : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
-
Models¶
-
class
Models
(session, return_type='civis')¶ Methods
delete_builds
(id, build_id)Cancel a build delete_projects
(id, project_id)Remove a models from a project delete_shares_groups
(id, group_id)Revoke the permissions a group has on this object delete_shares_users
(id, user_id)Revoke the permissions a user has on this object get
(id)Retrieve model configuration get_builds
(id, build_id)Check status of a build list
(**kwargs)List models list_builds
(id, **kwargs)List builds for the given model list_projects
(id)List the projects a models belongs to list_schedules
(id)Show the model build schedule list_shares
(id)List users and groups permissioned on this object list_types
()List all available model types patch
(id, **kwargs)Update model configuration post
(**kwargs)Create new configuration for a model post_builds
(id)Start a build put_archive
(id, status)Update the archive status of this object put_predictions
(id, table_name, primary_key, ...)Add a table on which to apply the predictive model put_projects
(id, project_id)Add a models to a project put_schedules
(id, schedule)Schedule the model build put_shares_groups
(id, permission_level, ...)Set the permissions groups has on this object put_shares_users
(id, permission_level, user_ids)Set the permissions users have on this object -
delete_builds
(id, build_id)¶ Cancel a build
Parameters: id : integer
The ID of the model.
build_id : integer
The ID of the build.
Returns: None
Response code 202: success
-
delete_projects
(id, project_id)¶ Remove a models from a project
Parameters: id : integer
ID of the resource
project_id : integer
The ID of the project
Returns: None
Response code 204: success
Revoke the permissions a group has on this object
Parameters: id : integer
ID of the resource to be revoked
group_id : integer
ID of the group
Returns: None
Response code 204: success
Revoke the permissions a user has on this object
Parameters: id : integer
ID of the resource to be revoked
user_id : integer
ID of the user
Returns: None
Response code 204: success
-
get
(id)¶ Retrieve model configuration
Parameters: id : integer
The ID of the model.
Returns: dependent_variable_order : list
The order of dependent variables, especially useful for Ordinal Modeling.
archived : string
The archival status of the requested object(s).
updated_at : string/date-time
The time the model was updated.
primary_key : string
The unique ID (primary key) of the training dataset.
last_output_location : string
The output JSON for the last build.
last_run : dict:
- finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued.
model_type_id : integer
The ID of the model’s type.
description : string
A description of the model.
active_build_id : integer
The ID of the current active build, the build used to score predictions.
schedule : dict:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
dependent_variable : string
The dependent variable of the training dataset.
number_of_folds : integer
Number of folds for cross validation. Default value is 5.
box_cox_transformation : boolean
Whether to transform data so that it assumes a normal distribution. Valid only with continuous models.
interaction_terms : boolean
Whether to search for interaction terms.
current_build_state : string
The status of the current model build. One of “succeeded”, “failed”, “queued”, or “running,”or “idle”, if no build has been attempted.
current_build_exception : string
Exception message, if applicable, of the current model build.
excluded_columns : list
A list of columns which will be considered ineligible to be independent variables.
database_id : integer
The ID of the database holding the training set table used to build the model.
time_zone : string
The time zone of this model.
parent_id : integer
The ID of the parent job that will trigger this model.
limiting_sql : string
A custom SQL WHERE clause used to filter the rows used to build the model. (e.g., “id > 105”).
cross_validation_parameters : dict
Cross validation parameter grid for tree methods, e.g. {“n_estimators”: [100, 200, 500], “learning_rate”: [0.01, 0.1], “max_depth”: [2, 3]}.
builds : list:
A list of trained models available for making predictions. - name : string The name of the model build. - roc_auc : number/float A key metric for binary, multinomial, and ordinal models. Nil for other model types. - id : integer The ID of the model build. - created_at : string The time the model build was created. - description : string A description of the model build. - r_squared_error : number/float A key metric for continuous models. Nil for other model types. - root_mean_squared_error : number/float A key metric for continuous models. Nil for other model types.
running_as : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
hidden : boolean
The hidden status of the object.
user : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
credential_id : integer
The ID of the credential used to read the target table. Defaults to the user’s default credential.
predictions : list:
The tables upon which the model will be applied. - schedule : dict:: - scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on - primary_key : list The primary key or composite keys of the table being predicted. - state : string The status of the prediction. One of: "succeeded", "failed", "queued", or "running,"or "idle", if no build has been attempted. - id : integer The ID of the model to which to apply the prediction. - output_table : string The qualified name of the table to be created which will contain the model's predictions. - limiting_sql : string A SQL WHERE clause used to scope the rows to be predicted. - table_name : string The qualified name of the table on which to apply the predictive model.
notifications : dict:
- failure_on : boolean If failure email notifications are on - success_email_subject : string Custom subject line for success e-mail. - success_email_body : string Custom body text for success e-mail, written in Markdown. - success_email_addresses : list Addresses to notify by e-mail when the job completes successfully. - stall_warning_minutes : integer Stall warning emails will be sent after this amount of minutes. - failure_email_addresses : list Addresses to notify by e-mail when the job fails. - urls : list URLs to receive a POST request at job completion - success_on : boolean If success email notifications are on
model_name : string
The name of the model.
id : integer
The ID of the model.
created_at : string/date-time
The time the model was created.
table_name : string
The qualified name of the table containing the training set from which to build the model.
-
get_builds
(id, build_id)¶ Check status of a build
Parameters: id : integer
The ID of the model.
build_id : integer
The ID of the build.
Returns: name : string
The name of the model build.
roc_auc : number/float
A key metric for binary, multinomial, and ordinal models. Nil for other model types.
description : string
A description of the model build.
output : string
A string representing the JSON output for the specified build. Only present when smaller than 10KB in size.
r_squared_error : number/float
A key metric for continuous models. Nil for other model types.
transformation_metadata : string
A string representing the full JSON output of the metadata for transformation of column names
output_location : string
A URL representing the location of the full JSON output for the specified build.The URL link will be valid for 5 minutes.
error : string
The error, if any, returned by the build.
state : string
The state of the model build.one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
id : integer
The ID of the model build.
created_at : string
The time the model build was created.
root_mean_squared_error : number/float
A key metric for continuous models. Nil for other model types.
-
list
(**kwargs)¶ List models
Parameters: model_name : string, optional
If specified, will be used to filter the models returned. Substring matching is supported. (e.g., “modelName=model” will return both “model1” and “my model”).
training_table_name : string, optional
If specified, will be used to filter the models returned by the training dataset table name. Substring matching is supported. (e.g., “trainingTableName=table” will return both “table1” and “my_table”).
dependent_variable : string, optional
If specified, will be used to filter the models returned by the dependent variable column name. Substring matching is supported. (e.g., “dependentVariable=predictor” will return both “predictor” and “my predictor”).
author : string, optional
If specified, return models from this author. It accepts a comma-separated list of author ids.
status : string, optional
If specified, returns models with one of these statuses. It accepts a comma-separated list, possible values are ‘running’, ‘failed’, ‘succeeded’, ‘idle’, ‘scheduled’.
archived : string, optional
The archival status of the requested object(s).
limit : integer, optional
Number of results to return. Defaults to its maximum of 50.
page_num : integer, optional
Page number of the results to return. Defaults to the first page, 1.
order : string, optional
The field on which to order the result set. Defaults to updated_at. Must be one of: updated_at, model_name, created_at, name, last_run.updated_at.
order_dir : string, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: dependent_variable_order : list
The order of dependent variables, especially useful for Ordinal Modeling.
archived : string
The archival status of the requested object(s).
updated_at : string/date-time
The time the model was updated.
primary_key : string
The unique ID (primary key) of the training dataset.
last_output_location : string
The output JSON for the last build.
last_run : dict:
- finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued.
model_type_id : integer
The ID of the model’s type.
description : string
A description of the model.
schedule : dict:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
dependent_variable : string
The dependent variable of the training dataset.
number_of_folds : integer
Number of folds for cross validation. Default value is 5.
box_cox_transformation : boolean
Whether to transform data so that it assumes a normal distribution. Valid only with continuous models.
interaction_terms : boolean
Whether to search for interaction terms.
current_build_state : string
The status of the current model build. One of “succeeded”, “failed”, “queued”, or “running,”or “idle”, if no build has been attempted.
current_build_exception : string
Exception message, if applicable, of the current model build.
excluded_columns : list
A list of columns which will be considered ineligible to be independent variables.
database_id : integer
The ID of the database holding the training set table used to build the model.
time_zone : string
The time zone of this model.
parent_id : integer
The ID of the parent job that will trigger this model.
limiting_sql : string
A custom SQL WHERE clause used to filter the rows used to build the model. (e.g., “id > 105”).
cross_validation_parameters : dict
Cross validation parameter grid for tree methods, e.g. {“n_estimators”: [100, 200, 500], “learning_rate”: [0.01, 0.1], “max_depth”: [2, 3]}.
builds : list:
A list of trained models available for making predictions. - name : string The name of the model build. - roc_auc : number/float A key metric for binary, multinomial, and ordinal models. Nil for other model types. - id : integer The ID of the model build. - created_at : string The time the model build was created. - description : string A description of the model build. - r_squared_error : number/float A key metric for continuous models. Nil for other model types. - root_mean_squared_error : number/float A key metric for continuous models. Nil for other model types.
user : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
credential_id : integer
The ID of the credential used to read the target table. Defaults to the user’s default credential.
predictions : list:
The tables upon which the model will be applied. - primary_key : list The primary key or composite keys of the table being predicted. - state : string The status of the prediction. One of: "succeeded", "failed", "queued", or "running,"or "idle", if no build has been attempted. - id : integer The ID of the model to which to apply the prediction. - output_table : string The qualified name of the table to be created which will contain the model's predictions. - limiting_sql : string A SQL WHERE clause used to scope the rows to be predicted. - table_name : string The qualified name of the table on which to apply the predictive model.
model_name : string
The name of the model.
id : integer
The ID of the model.
created_at : string/date-time
The time the model was created.
table_name : string
The qualified name of the table containing the training set from which to build the model.
-
list_builds
(id, **kwargs)¶ List builds for the given model
Parameters: id : integer
The ID of the model.
limit : integer, optional
Number of results to return. Defaults to 20. Maximum allowed is 100.
page_num : integer, optional
Page number of the results to return. Defaults to the first page, 1.
order : string, optional
The field on which to order the result set. Defaults to id. Must be one of: id.
order_dir : string, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: name : string
The name of the model build.
roc_auc : number/float
A key metric for binary, multinomial, and ordinal models. Nil for other model types.
description : string
A description of the model build.
output : string
A string representing the JSON output for the specified build. Only present when smaller than 10KB in size.
r_squared_error : number/float
A key metric for continuous models. Nil for other model types.
transformation_metadata : string
A string representing the full JSON output of the metadata for transformation of column names
output_location : string
A URL representing the location of the full JSON output for the specified build.The URL link will be valid for 5 minutes.
error : string
The error, if any, returned by the build.
state : string
The state of the model build.one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
id : integer
The ID of the model build.
created_at : string
The time the model build was created.
root_mean_squared_error : number/float
A key metric for continuous models. Nil for other model types.
-
list_projects
(id)¶ List the projects a models belongs to
Parameters: id : integer
The ID of the resource.
Returns: archived : string
The archival status of the requested object(s).
updated_at : string/time
name : string
The name of this project.
author : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
id : integer
The ID for this project.
created_at : string/time
description : string
A description of the project
users : list:
Users who can see the project - username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
auto_share : boolean
-
list_schedules
(id)¶ Show the model build schedule
Parameters: id : integer
The ID of the model associated with this schedule.
Returns: id : integer
The ID of the model associated with this schedule.
schedule : dict:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
List users and groups permissioned on this object
Parameters: id : integer
The ID of the object.
Returns: readers : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
owners : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
writers : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
-
list_types
()¶ List all available model types
Returns: dv_type : string
The type of dependent variable predicted by the model.
id : integer
The ID of the model type.
algorithm : string
The name of the algorithm used to train the model.
fint_allowed : boolean
Whether this model type supports searching for interaction terms.
-
patch
(id, **kwargs)¶ Update model configuration
Parameters: id : integer
The ID of the model.
dependent_variable_order : list, optional
The order of dependent variables, especially useful for Ordinal Modeling.
excluded_columns : list, optional
A list of columns which will be considered ineligible to be independent variables.
dependent_variable : string, optional
The dependent variable of the training dataset.
database_id : integer, optional
The ID of the database holding the training set table used to build the model.
time_zone : string, optional
The time zone of this model.
parent_id : integer, optional
The ID of the parent job that will trigger this model.
limiting_sql : string, optional
A custom SQL WHERE clause used to filter the rows used to build the model. (e.g., “id > 105”).
model_type_id : integer, optional
The ID of the model’s type.
description : string, optional
A description of the model.
primary_key : string, optional
The unique ID (primary key) of the training dataset.
notifications : dict, optional:
- failure_on : boolean If failure email notifications are on - success_email_subject : string Custom subject line for success e-mail. - success_email_body : string Custom body text for success e-mail, written in Markdown. - success_email_addresses : list Addresses to notify by e-mail when the job completes successfully. - stall_warning_minutes : integer Stall warning emails will be sent after this amount of minutes. - failure_email_addresses : list Addresses to notify by e-mail when the job fails. - urls : list URLs to receive a POST request at job completion - success_on : boolean If success email notifications are on
active_build_id : integer, optional
The ID of the current active build, the build used to score predictions.
schedule : dict, optional:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
cross_validation_parameters : dict, optional
Cross validation parameter grid for tree methods, e.g. {“n_estimators”: [100, 200, 500], “learning_rate”: [0.01, 0.1], “max_depth”: [2, 3]}.
credential_id : integer, optional
The ID of the credential used to read the target table. Defaults to the user’s default credential.
number_of_folds : integer, optional
Number of folds for cross validation. Default value is 5.
model_name : string, optional
The name of the model.
box_cox_transformation : boolean, optional
Whether to transform data so that it assumes a normal distribution. Valid only with continuous models.
interaction_terms : boolean, optional
Whether to search for interaction terms.
table_name : string, optional
The qualified name of the table containing the training set from which to build the model.
Returns: None
Response code 204: success
-
post
(**kwargs)¶ Create new configuration for a model
Parameters: hidden : boolean, optional
The hidden status of the object.
dependent_variable_order : list, optional
The order of dependent variables, especially useful for Ordinal Modeling.
excluded_columns : list, optional
A list of columns which will be considered ineligible to be independent variables.
dependent_variable : string, optional
The dependent variable of the training dataset.
database_id : integer, optional
The ID of the database holding the training set table used to build the model.
time_zone : string, optional
The time zone of this model.
parent_id : integer, optional
The ID of the parent job that will trigger this model.
limiting_sql : string, optional
A custom SQL WHERE clause used to filter the rows used to build the model. (e.g., “id > 105”).
model_type_id : integer, optional
The ID of the model’s type.
description : string, optional
A description of the model.
primary_key : string, optional
The unique ID (primary key) of the training dataset.
notifications : dict, optional:
- failure_on : boolean If failure email notifications are on - success_email_subject : string Custom subject line for success e-mail. - success_email_body : string Custom body text for success e-mail, written in Markdown. - success_email_addresses : list Addresses to notify by e-mail when the job completes successfully. - stall_warning_minutes : integer Stall warning emails will be sent after this amount of minutes. - failure_email_addresses : list Addresses to notify by e-mail when the job fails. - urls : list URLs to receive a POST request at job completion - success_on : boolean If success email notifications are on
active_build_id : integer, optional
The ID of the current active build, the build used to score predictions.
schedule : dict, optional:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
cross_validation_parameters : dict, optional
Cross validation parameter grid for tree methods, e.g. {“n_estimators”: [100, 200, 500], “learning_rate”: [0.01, 0.1], “max_depth”: [2, 3]}.
credential_id : integer, optional
The ID of the credential used to read the target table. Defaults to the user’s default credential.
number_of_folds : integer, optional
Number of folds for cross validation. Default value is 5.
model_name : string, optional
The name of the model.
box_cox_transformation : boolean, optional
Whether to transform data so that it assumes a normal distribution. Valid only with continuous models.
interaction_terms : boolean, optional
Whether to search for interaction terms.
table_name : string, optional
The qualified name of the table containing the training set from which to build the model.
Returns: dependent_variable_order : list
The order of dependent variables, especially useful for Ordinal Modeling.
archived : string
The archival status of the requested object(s).
updated_at : string/date-time
The time the model was updated.
primary_key : string
The unique ID (primary key) of the training dataset.
last_output_location : string
The output JSON for the last build.
last_run : dict:
- finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued.
model_type_id : integer
The ID of the model’s type.
description : string
A description of the model.
active_build_id : integer
The ID of the current active build, the build used to score predictions.
schedule : dict:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
dependent_variable : string
The dependent variable of the training dataset.
number_of_folds : integer
Number of folds for cross validation. Default value is 5.
box_cox_transformation : boolean
Whether to transform data so that it assumes a normal distribution. Valid only with continuous models.
interaction_terms : boolean
Whether to search for interaction terms.
current_build_state : string
The status of the current model build. One of “succeeded”, “failed”, “queued”, or “running,”or “idle”, if no build has been attempted.
current_build_exception : string
Exception message, if applicable, of the current model build.
excluded_columns : list
A list of columns which will be considered ineligible to be independent variables.
database_id : integer
The ID of the database holding the training set table used to build the model.
time_zone : string
The time zone of this model.
parent_id : integer
The ID of the parent job that will trigger this model.
limiting_sql : string
A custom SQL WHERE clause used to filter the rows used to build the model. (e.g., “id > 105”).
cross_validation_parameters : dict
Cross validation parameter grid for tree methods, e.g. {“n_estimators”: [100, 200, 500], “learning_rate”: [0.01, 0.1], “max_depth”: [2, 3]}.
builds : list:
A list of trained models available for making predictions. - name : string The name of the model build. - roc_auc : number/float A key metric for binary, multinomial, and ordinal models. Nil for other model types. - id : integer The ID of the model build. - created_at : string The time the model build was created. - description : string A description of the model build. - r_squared_error : number/float A key metric for continuous models. Nil for other model types. - root_mean_squared_error : number/float A key metric for continuous models. Nil for other model types.
running_as : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
hidden : boolean
The hidden status of the object.
user : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
credential_id : integer
The ID of the credential used to read the target table. Defaults to the user’s default credential.
predictions : list:
The tables upon which the model will be applied. - schedule : dict:: - scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on - primary_key : list The primary key or composite keys of the table being predicted. - state : string The status of the prediction. One of: "succeeded", "failed", "queued", or "running,"or "idle", if no build has been attempted. - id : integer The ID of the model to which to apply the prediction. - output_table : string The qualified name of the table to be created which will contain the model's predictions. - limiting_sql : string A SQL WHERE clause used to scope the rows to be predicted. - table_name : string The qualified name of the table on which to apply the predictive model.
notifications : dict:
- failure_on : boolean If failure email notifications are on - success_email_subject : string Custom subject line for success e-mail. - success_email_body : string Custom body text for success e-mail, written in Markdown. - success_email_addresses : list Addresses to notify by e-mail when the job completes successfully. - stall_warning_minutes : integer Stall warning emails will be sent after this amount of minutes. - failure_email_addresses : list Addresses to notify by e-mail when the job fails. - urls : list URLs to receive a POST request at job completion - success_on : boolean If success email notifications are on
model_name : string
The name of the model.
id : integer
The ID of the model.
created_at : string/date-time
The time the model was created.
table_name : string
The qualified name of the table containing the training set from which to build the model.
-
post_builds
(id)¶ Start a build
Parameters: id : integer
The ID of the model.
Returns: name : string
The name of the model build.
roc_auc : number/float
A key metric for binary, multinomial, and ordinal models. Nil for other model types.
description : string
A description of the model build.
output : string
A string representing the JSON output for the specified build. Only present when smaller than 10KB in size.
r_squared_error : number/float
A key metric for continuous models. Nil for other model types.
transformation_metadata : string
A string representing the full JSON output of the metadata for transformation of column names
output_location : string
A URL representing the location of the full JSON output for the specified build.The URL link will be valid for 5 minutes.
error : string
The error, if any, returned by the build.
state : string
The state of the model build.one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
id : integer
The ID of the model build.
created_at : string
The time the model build was created.
root_mean_squared_error : number/float
A key metric for continuous models. Nil for other model types.
-
put_archive
(id, status)¶ Update the archive status of this object
Parameters: id : integer
The ID of the object.
status : boolean
The desired archived status of the object.
Returns: dependent_variable_order : list
The order of dependent variables, especially useful for Ordinal Modeling.
archived : string
The archival status of the requested object(s).
updated_at : string/date-time
The time the model was updated.
primary_key : string
The unique ID (primary key) of the training dataset.
last_output_location : string
The output JSON for the last build.
last_run : dict:
- finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued.
model_type_id : integer
The ID of the model’s type.
description : string
A description of the model.
active_build_id : integer
The ID of the current active build, the build used to score predictions.
schedule : dict:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
dependent_variable : string
The dependent variable of the training dataset.
number_of_folds : integer
Number of folds for cross validation. Default value is 5.
box_cox_transformation : boolean
Whether to transform data so that it assumes a normal distribution. Valid only with continuous models.
interaction_terms : boolean
Whether to search for interaction terms.
current_build_state : string
The status of the current model build. One of “succeeded”, “failed”, “queued”, or “running,”or “idle”, if no build has been attempted.
current_build_exception : string
Exception message, if applicable, of the current model build.
excluded_columns : list
A list of columns which will be considered ineligible to be independent variables.
database_id : integer
The ID of the database holding the training set table used to build the model.
time_zone : string
The time zone of this model.
parent_id : integer
The ID of the parent job that will trigger this model.
limiting_sql : string
A custom SQL WHERE clause used to filter the rows used to build the model. (e.g., “id > 105”).
cross_validation_parameters : dict
Cross validation parameter grid for tree methods, e.g. {“n_estimators”: [100, 200, 500], “learning_rate”: [0.01, 0.1], “max_depth”: [2, 3]}.
builds : list:
A list of trained models available for making predictions. - name : string The name of the model build. - roc_auc : number/float A key metric for binary, multinomial, and ordinal models. Nil for other model types. - id : integer The ID of the model build. - created_at : string The time the model build was created. - description : string A description of the model build. - r_squared_error : number/float A key metric for continuous models. Nil for other model types. - root_mean_squared_error : number/float A key metric for continuous models. Nil for other model types.
running_as : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
hidden : boolean
The hidden status of the object.
user : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
credential_id : integer
The ID of the credential used to read the target table. Defaults to the user’s default credential.
predictions : list:
The tables upon which the model will be applied. - schedule : dict:: - scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on - primary_key : list The primary key or composite keys of the table being predicted. - state : string The status of the prediction. One of: "succeeded", "failed", "queued", or "running,"or "idle", if no build has been attempted. - id : integer The ID of the model to which to apply the prediction. - output_table : string The qualified name of the table to be created which will contain the model's predictions. - limiting_sql : string A SQL WHERE clause used to scope the rows to be predicted. - table_name : string The qualified name of the table on which to apply the predictive model.
notifications : dict:
- failure_on : boolean If failure email notifications are on - success_email_subject : string Custom subject line for success e-mail. - success_email_body : string Custom body text for success e-mail, written in Markdown. - success_email_addresses : list Addresses to notify by e-mail when the job completes successfully. - stall_warning_minutes : integer Stall warning emails will be sent after this amount of minutes. - failure_email_addresses : list Addresses to notify by e-mail when the job fails. - urls : list URLs to receive a POST request at job completion - success_on : boolean If success email notifications are on
model_name : string
The name of the model.
id : integer
The ID of the model.
created_at : string/date-time
The time the model was created.
table_name : string
The qualified name of the table containing the training set from which to build the model.
-
put_predictions
(id, table_name, primary_key, **kwargs)¶ Add a table on which to apply the predictive model
Parameters: id : integer
The ID of the model to which to apply the prediction.
table_name : string
The qualified name of the table on which to apply the predictive model.
primary_key : list
The primary key or composite keys of the table being predicted.
schedule : dict, optional:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
output_table : string, optional
The qualified name of the table to be created which will contain the model’s predictions.
limiting_sql : string, optional
A SQL WHERE clause used to scope the rows to be predicted.
Returns: schedule : dict:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
primary_key : list
The primary key or composite keys of the table being predicted.
state : string
The status of the prediction. One of: “succeeded”, “failed”, “queued”, or “running,”or “idle”, if no build has been attempted.
id : integer
The ID of the model to which to apply the prediction.
output_table : string
The qualified name of the table to be created which will contain the model’s predictions.
limiting_sql : string
A SQL WHERE clause used to scope the rows to be predicted.
table_name : string
The qualified name of the table on which to apply the predictive model.
-
put_projects
(id, project_id)¶ Add a models to a project
Parameters: id : integer
ID of the resource
project_id : integer
The ID of the project
Returns: None
Response code 204: success
-
put_schedules
(id, schedule)¶ Schedule the model build
Parameters: id : integer
The ID of the model associated with this schedule.
schedule : dict:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
Returns: id : integer
The ID of the model associated with this schedule.
schedule : dict:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
Set the permissions groups has on this object
Parameters: id : integer
ID of the resource to be shared
permission_level : string
Options are: “read”, “write”, or “manage”
group_ids : list
An array of one or more group IDs
Returns: readers : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
owners : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
writers : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
Set the permissions users have on this object
Parameters: id : integer
ID of the resource to be shared
permission_level : string
Options are: “read”, “write”, or “manage”
user_ids : list
An array of one or more user IDs
Returns: readers : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
owners : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
writers : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
-
Predictions¶
-
class
Predictions
(session, return_type='civis')¶ Methods
delete_runs
(id, run_id)Cancel a run get
(id)Show the specified prediction get_runs
(id, run_id)Check status of a run list
(**kwargs)List predictions list_runs
(id, **kwargs)List runs for the given prediction list_schedules
(id)Show the prediction schedule patch
(id, **kwargs)Update a prediction post_runs
(id)Start a run put_schedules
(id, **kwargs)Schedule the prediction -
delete_runs
(id, run_id)¶ Cancel a run
Parameters: id : integer
The ID of the prediction.
run_id : integer
The ID of the run.
Returns: None
Response code 202: success
-
get
(id)¶ Show the specified prediction
Parameters: id : integer
The ID of the prediction.
Returns: scored_table_name : string
The name of the source table for this prediction.
primary_key : list
The primary key or composite keys of the table being predicted.
model_id : integer
The ID of the model used for this prediction.
last_run : dict:
- finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued.
limiting_sql : string
A SQL WHERE clause used to scope the rows to be predicted.
scored_tables : list:
An array of created prediction tables. - id : integer The ID of the table with created predictions. - created_at : string/date-time The time when the table with created predictions was created. - score_stats : list:: An array of metrics on the created predictions. - min_score : number/float The minimum score. - histogram : list The histogram of the distribution of scores. - max_score : number/float The maximum score. - score_name : string The name of the score. - avg_score : number/float The average score. - schema : string The schema of table with created predictions. - name : string The name of table with created predictions.
finished_at : string/date-time
The end time of the last run of this prediction.
started_at : string/date-time
The start time of the last run of this prediction.
schedule : dict:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
scored_table_id : integer
The ID of the source table for this prediction.
output_table_name : string
The name of the output table for this prediction.
error : string
The error, if any, of the last run of this prediction.
state : string
The state of the last run of this prediction.
id : integer
The ID of the prediction.
-
get_runs
(id, run_id)¶ Check status of a run
Parameters: id : integer
The ID of the prediction.
run_id : integer
The ID of the run.
Returns: prediction_id : integer
The ID of the prediction.
name : string
The name of table created by this predictions run.
state : string
The state of the prediction run.
id : integer
The ID of the prediction run.
created_at : string/date-time
The time when the table with created predictions was created.
score_stats : list:
An array of metrics on the created predictions. - min_score : number/float The minimum score. - histogram : list The histogram of the distribution of scores. - max_score : number/float The maximum score. - score_name : string The name of the score. - avg_score : number/float The average score.
exception : string
The exception, if any, returned by the prediction run.
-
list
(**kwargs)¶ List predictions
Parameters: model_id : integer, optional
If specified, only return predictions associated with this model ID.
Returns: finished_at : string/date-time
The end time of the last run of this prediction.
scored_table_name : string
The name of the source table for this prediction.
started_at : string/date-time
The start time of the last run of this prediction.
scored_table_id : integer
The ID of the source table for this prediction.
output_table_name : string
The name of the output table for this prediction.
error : string
The error, if any, of the last run of this prediction.
last_run : dict:
- finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued.
model_id : integer
The ID of the model used for this prediction.
state : string
The state of the last run of this prediction.
id : integer
The ID of the prediction.
-
list_runs
(id, **kwargs)¶ List runs for the given prediction
Parameters: id : integer
The ID of the prediction.
limit : integer, optional
Number of results to return. Defaults to 20. Maximum allowed is 100.
page_num : integer, optional
Page number of the results to return. Defaults to the first page, 1.
order : string, optional
The field on which to order the result set. Defaults to id. Must be one of: id.
order_dir : string, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: prediction_id : integer
The ID of the prediction.
name : string
The name of table created by this predictions run.
state : string
The state of the prediction run.
id : integer
The ID of the prediction run.
created_at : string/date-time
The time when the table with created predictions was created.
score_stats : list:
An array of metrics on the created predictions. - min_score : number/float The minimum score. - histogram : list The histogram of the distribution of scores. - max_score : number/float The maximum score. - score_name : string The name of the score. - avg_score : number/float The average score.
exception : string
The exception, if any, returned by the prediction run.
-
list_schedules
(id)¶ Show the prediction schedule
Parameters: id : integer
ID of the prediction associated with this schedule.
Returns: score_on_model_build : boolean
Whether the prediction will run after a rebuild of the associated model.
id : integer
ID of the prediction associated with this schedule.
schedule : dict:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
-
patch
(id, **kwargs)¶ Update a prediction
Parameters: id : integer
The ID of the prediction.
limiting_sql : string, optional
A SQL WHERE clause used to scope the rows to be predicted.
output_table_name : string, optional
The name of the output table for this prediction.
primary_key : list, optional
The primary key or composite keys of the table being predicted.
Returns: scored_table_name : string
The name of the source table for this prediction.
primary_key : list
The primary key or composite keys of the table being predicted.
model_id : integer
The ID of the model used for this prediction.
last_run : dict:
- finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued.
limiting_sql : string
A SQL WHERE clause used to scope the rows to be predicted.
scored_tables : list:
An array of created prediction tables. - id : integer The ID of the table with created predictions. - created_at : string/date-time The time when the table with created predictions was created. - score_stats : list:: An array of metrics on the created predictions. - min_score : number/float The minimum score. - histogram : list The histogram of the distribution of scores. - max_score : number/float The maximum score. - score_name : string The name of the score. - avg_score : number/float The average score. - schema : string The schema of table with created predictions. - name : string The name of table with created predictions.
finished_at : string/date-time
The end time of the last run of this prediction.
started_at : string/date-time
The start time of the last run of this prediction.
schedule : dict:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
scored_table_id : integer
The ID of the source table for this prediction.
output_table_name : string
The name of the output table for this prediction.
error : string
The error, if any, of the last run of this prediction.
state : string
The state of the last run of this prediction.
id : integer
The ID of the prediction.
-
post_runs
(id)¶ Start a run
Parameters: id : integer
The ID of the prediction.
Returns: prediction_id : integer
The ID of the prediction.
name : string
The name of table created by this predictions run.
state : string
The state of the prediction run.
id : integer
The ID of the prediction run.
created_at : string/date-time
The time when the table with created predictions was created.
score_stats : list:
An array of metrics on the created predictions. - min_score : number/float The minimum score. - histogram : list The histogram of the distribution of scores. - max_score : number/float The maximum score. - score_name : string The name of the score. - avg_score : number/float The average score.
exception : string
The exception, if any, returned by the prediction run.
-
put_schedules
(id, **kwargs)¶ Schedule the prediction
Parameters: id : integer
ID of the prediction associated with this schedule.
score_on_model_build : boolean, optional
Whether the prediction will run after a rebuild of the associated model.
schedule : dict, optional:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
Returns: score_on_model_build : boolean
Whether the prediction will run after a rebuild of the associated model.
id : integer
ID of the prediction associated with this schedule.
schedule : dict:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
-
Queries¶
-
class
Queries
(session, return_type='civis')¶ Methods
delete_runs
(id, run_id)Cancel a run get
(id)Get details about a query get_runs
(id, run_id)Check status of a run list
(**kwargs)List all queries list_runs
(id, **kwargs)List runs for the given query post
(database, preview_rows, sql, **kwargs)Execute a query post_runs
(id)Start a run put_scripts
(id, script_id)Update the query’s associated script -
delete_runs
(id, run_id)¶ Cancel a run
Parameters: id : integer
The ID of the query.
run_id : integer
The ID of the run.
Returns: None
Response code 202: success
-
get
(id)¶ Get details about a query
Parameters: id : integer
The query ID.
Returns: report_id : integer
The ID of the report associated with this query.
last_run_id : integer
The ID of the last run.
script_id : integer
The ID of the script associated with this query.
database : integer
The database ID.
name : string
The name of the query.
result_rows : list
A preview of rows returned by the query.
author : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
finished_at : string/date-time
The end time of the last run.
hidden : boolean
The hidden status of the object.
started_at : string/date-time
The start time of the last run.
updated_at : string/time
result_columns : list
A preview of columns returned by the query.
state : string
The state of the last run.
id : integer
The query ID.
created_at : string/time
sql : string
The SQL to execute.
exception : string
Exception returned from the query, null if the query was a success.
credential : integer
The credential ID.
-
get_runs
(id, run_id)¶ Check status of a run
Parameters: id : integer
The ID of the query.
run_id : integer
The ID of the run.
Returns: finished_at : string/time
The time the last run completed.
started_at : string/time
The time the last run started at.
is_cancel_requested : boolean
True if run cancel requested, else false.
error : string
The error, if any, returned by the run.
state : string
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
id : integer
The ID of the run.
query_id : integer
The ID of the query.
-
list
(**kwargs)¶ List all queries
Parameters: database_id : integer, optional
The database ID.
author_id : integer, optional
The author of the query.
created_before : string, optional
An upper bound for the creation date of the query.
limit : integer, optional
Number of results to return. Defaults to 20. Maximum allowed is 50.
page_num : integer, optional
Page number of the results to return. Defaults to the first page, 1.
order : string, optional
The field on which to order the result set. Defaults to created_at. Must be one of: created_at.
order_dir : string, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: report_id : integer
The ID of the report associated with this query.
last_run_id : integer
The ID of the last run.
script_id : integer
The ID of the script associated with this query.
database : integer
The database ID.
result_rows : list
A preview of rows returned by the query.
finished_at : string/date-time
The end time of the last run.
started_at : string/date-time
The start time of the last run.
updated_at : string/time
preview_rows : integer
The number of rows to save from the query’s result (maximum: 100).
result_columns : list
A preview of columns returned by the query.
state : string
The state of the last run.
id : integer
The query ID.
created_at : string/time
sql : string
The SQL to execute.
exception : string
Exception returned from the query, null if the query was a success.
credential : integer
The credential ID.
-
list_runs
(id, **kwargs)¶ List runs for the given query
Parameters: id : integer
The ID of the query.
limit : integer, optional
Number of results to return. Defaults to 20. Maximum allowed is 100.
page_num : integer, optional
Page number of the results to return. Defaults to the first page, 1.
order : string, optional
The field on which to order the result set. Defaults to id. Must be one of: id.
order_dir : string, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: finished_at : string/time
The time the last run completed.
started_at : string/time
The time the last run started at.
is_cancel_requested : boolean
True if run cancel requested, else false.
error : string
The error, if any, returned by the run.
state : string
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
id : integer
The ID of the run.
query_id : integer
The ID of the query.
-
post
(database, preview_rows, sql, **kwargs)¶ Execute a query
Parameters: database : integer
The database ID.
preview_rows : integer
The number of rows to save from the query’s result (maximum: 100).
sql : string
The SQL to execute.
filename_prefix : string, optional
The output filename prefix.
interactive : boolean, optional
Deprecated and not used.
column_delimiter : string, optional
The delimiter to use. One of comma or tab, or pipe [default: comma].
hidden : boolean, optional
The hidden status of the object.
unquoted : boolean, optional
If true, will not quote fields.
include_header : boolean, optional
Whether the CSV output should include a header row [default: true].
compression : string, optional
The type of compression. One of gzip or zip, or none [default: gzip].
credential : integer, optional
The credential ID.
Returns: report_id : integer
The ID of the report associated with this query.
updated_at : string/time
database : integer
The database ID.
interactive : boolean
Deprecated and not used.
unquoted : boolean
If true, will not quote fields.
script_id : integer
The ID of the script associated with this query.
result_columns : list
A preview of columns returned by the query.
preview_rows : integer
The number of rows to save from the query’s result (maximum: 100).
last_run_id : integer
The ID of the last run.
sql : string
The SQL to execute.
compression : string
The type of compression. One of gzip or zip, or none [default: gzip].
finished_at : string/date-time
The end time of the last run.
result_rows : list
A preview of rows returned by the query.
include_header : boolean
Whether the CSV output should include a header row [default: true].
column_delimiter : string
The delimiter to use. One of comma or tab, or pipe [default: comma].
filename_prefix : string
The output filename prefix.
hidden : boolean
The hidden status of the object.
started_at : string/date-time
The start time of the last run.
state : string
The state of the last run.
id : integer
The query ID.
created_at : string/time
exception : string
Exception returned from the query, null if the query was a success.
credential : integer
The credential ID.
-
post_runs
(id)¶ Start a run
Parameters: id : integer
The ID of the query.
Returns: finished_at : string/time
The time the last run completed.
started_at : string/time
The time the last run started at.
is_cancel_requested : boolean
True if run cancel requested, else false.
error : string
The error, if any, returned by the run.
state : string
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
id : integer
The ID of the run.
query_id : integer
The ID of the query.
-
put_scripts
(id, script_id)¶ Update the query’s associated script
Parameters: id : integer
The query ID.
script_id : integer
The ID of the script associated with this query.
Returns: report_id : integer
The ID of the report associated with this query.
last_run_id : integer
The ID of the last run.
script_id : integer
The ID of the script associated with this query.
database : integer
The database ID.
name : string
The name of the query.
result_rows : list
A preview of rows returned by the query.
author : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
finished_at : string/date-time
The end time of the last run.
hidden : boolean
The hidden status of the object.
started_at : string/date-time
The start time of the last run.
updated_at : string/time
result_columns : list
A preview of columns returned by the query.
state : string
The state of the last run.
id : integer
The query ID.
created_at : string/time
sql : string
The SQL to execute.
exception : string
Exception returned from the query, null if the query was a success.
credential : integer
The credential ID.
-
Reports¶
-
class
Reports
(session, return_type='civis')¶ Methods
delete_grants
(id)Revoke permisstion for this report to perform Civis platform API operations on delete_projects
(id, project_id)Remove a Report from a project delete_shares_groups
(id, group_id)Revoke the permissions a group has on this object delete_shares_users
(id, user_id)Revoke the permissions a user has on this object get
(id)Show a single report list
(**kwargs)List the reports visible to the current user list_projects
(id)List the projects a Report belongs to list_shares
(id)List users and groups permissioned on this object patch
(id, **kwargs)Update a report post
(**kwargs)Create a report post_grants
(id)Grant this report the ability to perform Civis platform API operations on your put_archive
(id, status)Update the archive status of this object put_projects
(id, project_id)Add a Report to a project put_shares_groups
(id, permission_level, ...)Set the permissions groups has on this object put_shares_users
(id, permission_level, user_ids)Set the permissions users have on this object -
delete_grants
(id)¶ Revoke permisstion for this report to perform Civis platform API operations on your behalf
Parameters: id : integer
The ID of this report.
Returns: None
Response code 204: success
-
delete_projects
(id, project_id)¶ Remove a Report from a project
Parameters: id : integer
ID of the resource
project_id : integer
The ID of the project
Returns: None
Response code 204: success
Revoke the permissions a group has on this object
Parameters: id : integer
ID of the resource to be revoked
group_id : integer
ID of the group
Returns: None
Response code 204: success
Revoke the permissions a user has on this object
Parameters: id : integer
ID of the resource to be revoked
user_id : integer
ID of the user
Returns: None
Response code 204: success
-
get
(id)¶ Show a single report
Parameters: id : integer
The ID of this report.
Returns: viz_updated_at : string/time
The time that the report’s visualization was last updated.
name : string
The name of the report.
last_run : dict:
- finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued.
archived : string
The archival status of the requested object(s).
api_key : string
A Civis API key that can be used by this report.
tableau_id : integer
updated_at : string/time
provide_api_key : boolean
Whether the report requests an API Key from the report viewer.
auth_data_url : string
app_state : dict
Any application state blob for this report.
auth_code_url : string
valid_output_file : boolean
Whether the script that backs the report currently has a valid output file.
hidden : boolean
The hidden status of the object.
template_id : integer
The ID of the template used for this report.
script : dict:
- id : integer The ID for the script. - sql : string The raw SQL query for the script. - name : string The name of the script.
api_key_id : integer
The ID of the API key. Can be used for auditing API use by this report.
finished_at : string/time
The time that the report’s last run finished.
user : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
auth_thumbnail_url : string
URL for a thumbnail of the report.
state : string
The status of the report’s last run.
id : integer
The ID of this report.
created_at : string/time
config : string
Any configuration metadata for this report.
projects : list:
A list of projects containing the report. - id : integer The ID for the project. - name : string The name of the project.
-
list
(**kwargs)¶ List the reports visible to the current user
Parameters: type : string, optional
If specified, return report of these types. It accepts a comma-separated list, possible values are ‘tableau’, ‘other’.
author : string, optional
If specified, return reports from this author. It accepts a comma-separated list of author ids.
template_id : integer, optional
If specified, return reports using the provided Template.
archived : string, optional
The archival status of the requested object(s).
limit : integer, optional
Number of results to return. Defaults to 20. Maximum allowed is 50.
page_num : integer, optional
Page number of the results to return. Defaults to the first page, 1.
order : string, optional
The field on which to order the result set. Defaults to updated_at. Must be one of: updated_at, name, created_at.
order_dir : string, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: tableau_id : integer
viz_updated_at : string/time
The time that the report’s visualization was last updated.
name : string
The name of the report.
last_run : dict:
- finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued.
archived : string
The archival status of the requested object(s).
template_id : integer
The ID of the template used for this report.
script : dict:
- id : integer The ID for the script. - sql : string The raw SQL query for the script. - name : string The name of the script.
finished_at : string/time
The time that the report’s last run finished.
user : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
updated_at : string/time
auth_thumbnail_url : string
URL for a thumbnail of the report.
state : string
The status of the report’s last run.
id : integer
The ID of this report.
created_at : string/time
projects : list:
A list of projects containing the report. - id : integer The ID for the project. - name : string The name of the project.
-
list_projects
(id)¶ List the projects a Report belongs to
Parameters: id : integer
The ID of the resource.
Returns: archived : string
The archival status of the requested object(s).
updated_at : string/time
name : string
The name of this project.
author : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
id : integer
The ID for this project.
created_at : string/time
description : string
A description of the project
users : list:
Users who can see the project - username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
auto_share : boolean
List users and groups permissioned on this object
Parameters: id : integer
The ID of the object.
Returns: readers : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
owners : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
writers : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
-
patch
(id, **kwargs)¶ Update a report
Parameters: id : integer
The ID of the report to modify.
app_state : dict, optional
The application state blob for this report.
code_body : string, optional
The code for the report visualization.
script_id : integer, optional
The ID of the script used to create this report.
name : string, optional
The name of the report.
provide_api_key : boolean, optional
Allow the report to provide an API key to front-end code.
config : string, optional
template_id : integer, optional
The ID of the template used for this report. If null is passed, no template will back this report. Changes to the backing template will reset the report appState.
Returns: viz_updated_at : string/time
The time that the report’s visualization was last updated.
name : string
The name of the report.
last_run : dict:
- finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued.
archived : string
The archival status of the requested object(s).
api_key : string
A Civis API key that can be used by this report.
tableau_id : integer
updated_at : string/time
provide_api_key : boolean
Whether the report requests an API Key from the report viewer.
auth_data_url : string
app_state : dict
Any application state blob for this report.
auth_code_url : string
valid_output_file : boolean
Whether the script that backs the report currently has a valid output file.
hidden : boolean
The hidden status of the object.
template_id : integer
The ID of the template used for this report.
script : dict:
- id : integer The ID for the script. - sql : string The raw SQL query for the script. - name : string The name of the script.
api_key_id : integer
The ID of the API key. Can be used for auditing API use by this report.
finished_at : string/time
The time that the report’s last run finished.
user : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
auth_thumbnail_url : string
URL for a thumbnail of the report.
state : string
The status of the report’s last run.
id : integer
The ID of this report.
created_at : string/time
config : string
Any configuration metadata for this report.
projects : list:
A list of projects containing the report. - id : integer The ID for the project. - name : string The name of the project.
-
post
(**kwargs)¶ Create a report
Parameters: app_state : dict, optional
Any application state blob for this report.
code_body : string, optional
The code for the report visualization.
script_id : integer, optional
The ID of the script used to create this report.
name : string, optional
The name of the report.
hidden : boolean, optional
The hidden status of the object.
provide_api_key : boolean, optional
Allow the report to provide an API key to front-end code.
template_id : integer, optional
The ID of the template used for this report.
Returns: viz_updated_at : string/time
The time that the report’s visualization was last updated.
name : string
The name of the report.
last_run : dict:
- finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued.
archived : string
The archival status of the requested object(s).
api_key : string
A Civis API key that can be used by this report.
tableau_id : integer
updated_at : string/time
provide_api_key : boolean
Whether the report requests an API Key from the report viewer.
auth_data_url : string
app_state : dict
Any application state blob for this report.
auth_code_url : string
valid_output_file : boolean
Whether the script that backs the report currently has a valid output file.
hidden : boolean
The hidden status of the object.
template_id : integer
The ID of the template used for this report.
script : dict:
- id : integer The ID for the script. - sql : string The raw SQL query for the script. - name : string The name of the script.
api_key_id : integer
The ID of the API key. Can be used for auditing API use by this report.
finished_at : string/time
The time that the report’s last run finished.
user : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
auth_thumbnail_url : string
URL for a thumbnail of the report.
state : string
The status of the report’s last run.
id : integer
The ID of this report.
created_at : string/time
config : string
Any configuration metadata for this report.
projects : list:
A list of projects containing the report. - id : integer The ID for the project. - name : string The name of the project.
-
post_grants
(id)¶ Grant this report the ability to perform Civis platform API operations on your behalf
Parameters: id : integer
The ID of this report.
Returns: viz_updated_at : string/time
The time that the report’s visualization was last updated.
name : string
The name of the report.
last_run : dict:
- finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued.
archived : string
The archival status of the requested object(s).
api_key : string
A Civis API key that can be used by this report.
tableau_id : integer
updated_at : string/time
provide_api_key : boolean
Whether the report requests an API Key from the report viewer.
auth_data_url : string
app_state : dict
Any application state blob for this report.
auth_code_url : string
valid_output_file : boolean
Whether the script that backs the report currently has a valid output file.
hidden : boolean
The hidden status of the object.
template_id : integer
The ID of the template used for this report.
script : dict:
- id : integer The ID for the script. - sql : string The raw SQL query for the script. - name : string The name of the script.
api_key_id : integer
The ID of the API key. Can be used for auditing API use by this report.
finished_at : string/time
The time that the report’s last run finished.
user : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
auth_thumbnail_url : string
URL for a thumbnail of the report.
state : string
The status of the report’s last run.
id : integer
The ID of this report.
created_at : string/time
config : string
Any configuration metadata for this report.
projects : list:
A list of projects containing the report. - id : integer The ID for the project. - name : string The name of the project.
-
put_archive
(id, status)¶ Update the archive status of this object
Parameters: id : integer
The ID of the object.
status : boolean
The desired archived status of the object.
Returns: viz_updated_at : string/time
The time that the report’s visualization was last updated.
name : string
The name of the report.
last_run : dict:
- finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued.
archived : string
The archival status of the requested object(s).
api_key : string
A Civis API key that can be used by this report.
tableau_id : integer
updated_at : string/time
provide_api_key : boolean
Whether the report requests an API Key from the report viewer.
auth_data_url : string
app_state : dict
Any application state blob for this report.
auth_code_url : string
valid_output_file : boolean
Whether the script that backs the report currently has a valid output file.
hidden : boolean
The hidden status of the object.
template_id : integer
The ID of the template used for this report.
script : dict:
- id : integer The ID for the script. - sql : string The raw SQL query for the script. - name : string The name of the script.
api_key_id : integer
The ID of the API key. Can be used for auditing API use by this report.
finished_at : string/time
The time that the report’s last run finished.
user : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
auth_thumbnail_url : string
URL for a thumbnail of the report.
state : string
The status of the report’s last run.
id : integer
The ID of this report.
created_at : string/time
config : string
Any configuration metadata for this report.
projects : list:
A list of projects containing the report. - id : integer The ID for the project. - name : string The name of the project.
-
put_projects
(id, project_id)¶ Add a Report to a project
Parameters: id : integer
ID of the resource
project_id : integer
The ID of the project
Returns: None
Response code 204: success
Set the permissions groups has on this object
Parameters: id : integer
ID of the resource to be shared
permission_level : string
Options are: “read”, “write”, or “manage”
group_ids : list
An array of one or more group IDs
Returns: readers : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
owners : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
writers : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
Set the permissions users have on this object
Parameters: id : integer
ID of the resource to be shared
permission_level : string
Options are: “read”, “write”, or “manage”
user_ids : list
An array of one or more user IDs
Returns: readers : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
owners : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
writers : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
-
Scripts¶
-
class
Scripts
(session, return_type='civis')¶ Methods
delete
(id)Delete a script delete_containers
(id)Delete a container delete_containers_projects
(id, project_id)Remove a container docker from a project delete_containers_runs
(id, run_id)Cancel a run delete_containers_shares_groups
(id, group_id)Revoke the permissions a group has on this object delete_containers_shares_users
(id, user_id)Revoke the permissions a user has on this object delete_custom
(id)Delete a CustomScript delete_custom_projects
(id, project_id)Remove a Job from a project delete_custom_runs
(id, run_id)Cancel a run delete_custom_shares_groups
(id, group_id)Revoke the permissions a group has on this object delete_custom_shares_users
(id, user_id)Revoke the permissions a user has on this object delete_javascript
(id)Delete a JavaScript Script delete_javascript_projects
(id, project_id)Remove a scripted sql from a project delete_javascript_runs
(id, run_id)Cancel a run delete_javascript_shares_groups
(id, group_id)Revoke the permissions a group has on this object delete_javascript_shares_users
(id, user_id)Revoke the permissions a user has on this object delete_python3
(id)Delete a Python Script delete_python3_projects
(id, project_id)Remove a python docker from a project delete_python3_runs
(id, run_id)Cancel a run delete_python3_shares_groups
(id, group_id)Revoke the permissions a group has on this object delete_python3_shares_users
(id, user_id)Revoke the permissions a user has on this object delete_r
(id)Delete an R Script delete_r_projects
(id, project_id)Remove a r docker from a project delete_r_runs
(id, run_id)Cancel a run delete_r_shares_groups
(id, group_id)Revoke the permissions a group has on this object delete_r_shares_users
(id, user_id)Revoke the permissions a user has on this object delete_sql
(id)Delete a SQL script delete_sql_projects
(id, project_id)Remove a scripts from a project delete_sql_runs
(id, run_id)Cancel a run delete_sql_shares_groups
(id, group_id)Revoke the permissions a group has on this object delete_sql_shares_users
(id, user_id)Revoke the permissions a user has on this object get
(id)Get details about a script get_containers
(id)View a container get_containers_runs
(id, run_id)Check status of a run get_custom
(id)Get a CustomScript get_custom_runs
(id, run_id)Check status of a run get_javascript
(id)Get a JavaScript Script get_javascript_runs
(id, run_id)Check status of a run get_python3
(id)Get a Python Script get_python3_runs
(id, run_id)Check status of a run get_r
(id)Get an R Script get_r_runs
(id, run_id)Check status of a run get_sql
(id)Get a SQL script get_sql_runs
(id, run_id)Check status of a run list
(**kwargs)List scripts list_containers_projects
(id)List the projects a container docker belongs to list_containers_runs
(id, **kwargs)List runs for the given container list_containers_runs_logs
(id, run_id, **kwargs)Get the logs for a run list_containers_shares
(id)List users and groups permissioned on this object list_custom
(**kwargs)List Custom Scripts list_custom_projects
(id)List the projects a Job belongs to list_custom_runs
(id, **kwargs)List runs for the given custom list_custom_runs_logs
(id, run_id, **kwargs)Get the logs for a run list_custom_shares
(id)List users and groups permissioned on this object list_history
(id)Get the run history and outputs of this script list_javascript_projects
(id)List the projects a scripted sql belongs to list_javascript_runs
(id, **kwargs)List runs for the given javascript list_javascript_runs_logs
(id, run_id, **kwargs)Get the logs for a run list_javascript_shares
(id)List users and groups permissioned on this object list_python3_projects
(id)List the projects a python docker belongs to list_python3_runs
(id, **kwargs)List runs for the given python list_python3_runs_logs
(id, run_id, **kwargs)Get the logs for a run list_python3_shares
(id)List users and groups permissioned on this object list_r_projects
(id)List the projects a r docker belongs to list_r_runs
(id, **kwargs)List runs for the given r list_r_runs_logs
(id, run_id, **kwargs)Get the logs for a run list_r_shares
(id)List users and groups permissioned on this object list_sql_projects
(id)List the projects a scripts belongs to list_sql_runs
(id, **kwargs)List runs for the given sql list_sql_runs_logs
(id, run_id, **kwargs)Get the logs for a run list_sql_shares
(id)List users and groups permissioned on this object list_types
()List available script types patch
(id, **kwargs)Update a script patch_containers
(id, **kwargs)Update a container patch_custom
(id, **kwargs)Update some attributes of this CustomScript patch_javascript
(id, **kwargs)Update some attributes of this JavaScript Script patch_python3
(id, **kwargs)Update some attributes of this Python Script patch_r
(id, **kwargs)Update some attributes of this R Script patch_sql
(id, **kwargs)Update some attributes of this SQL script post
(remote_host_id, credential_id, name, ...)Create a script post_cancel
(id)Cancel a run post_containers
(docker_image_name, ...)Create a container post_containers_runs
(id)Start a run post_custom
(from_template_id, **kwargs)Create a CustomScript post_custom_runs
(id)Start a run post_javascript
(credential_id, name, ...)Create a JavaScript Script post_javascript_runs
(id)Start a run post_python3
(name, source, **kwargs)Create a Python Script post_python3_runs
(id)Start a run post_r
(name, source, **kwargs)Create an R Script post_r_runs
(id)Start a run post_run
(id)Run a script post_sql
(credential_id, name, ...)Create a SQL script post_sql_runs
(id)Start a run put_containers
(id, docker_image_name, ...)Edit a container put_containers_archive
(id, status)Update the archive status of this object put_containers_projects
(id, project_id)Add a container docker to a project put_containers_shares_groups
(id, ...)Set the permissions groups has on this object put_containers_shares_users
(id, ...)Set the permissions users have on this object put_custom
(id, **kwargs)Replace all attributes of this CustomScript put_custom_archive
(id, status)Update the archive status of this object put_custom_projects
(id, project_id)Add a Job to a project put_custom_shares_groups
(id, ...)Set the permissions groups has on this object put_custom_shares_users
(id, ...)Set the permissions users have on this object put_javascript
(id, credential_id, name, ...)Replace all attributes of this JavaScript Script put_javascript_archive
(id, status)Update the archive status of this object put_javascript_projects
(id, project_id)Add a scripted sql to a project put_javascript_shares_groups
(id, ...)Set the permissions groups has on this object put_javascript_shares_users
(id, ...)Set the permissions users have on this object put_python3
(id, name, source, **kwargs)Replace all attributes of this Python Script put_python3_archive
(id, status)Update the archive status of this object put_python3_projects
(id, project_id)Add a python docker to a project put_python3_shares_groups
(id, ...)Set the permissions groups has on this object put_python3_shares_users
(id, ...)Set the permissions users have on this object put_r
(id, name, source, **kwargs)Replace all attributes of this R Script put_r_archive
(id, status)Update the archive status of this object put_r_projects
(id, project_id)Add a r docker to a project put_r_shares_groups
(id, permission_level, ...)Set the permissions groups has on this object put_r_shares_users
(id, permission_level, ...)Set the permissions users have on this object put_sql
(id, credential_id, name, ...)Replace all attributes of this SQL script put_sql_archive
(id, status)Update the archive status of this object put_sql_projects
(id, project_id)Add a scripts to a project put_sql_shares_groups
(id, permission_level, ...)Set the permissions groups has on this object put_sql_shares_users
(id, permission_level, ...)Set the permissions users have on this object -
delete
(id)¶ Delete a script
Parameters: id : integer
The ID for the script.
Returns: None
Response code 204: success
-
delete_containers
(id)¶ Delete a container
Parameters: id : integer
The ID for the script.
Returns: None
Response code 204: success
-
delete_containers_projects
(id, project_id)¶ Remove a container docker from a project
Parameters: id : integer
ID of the resource
project_id : integer
The ID of the project
Returns: None
Response code 204: success
-
delete_containers_runs
(id, run_id)¶ Cancel a run
Parameters: id : integer
The ID of the container.
run_id : integer
The ID of the run.
Returns: None
Response code 202: success
Revoke the permissions a group has on this object
Parameters: id : integer
ID of the resource to be revoked
group_id : integer
ID of the group
Returns: None
Response code 204: success
Revoke the permissions a user has on this object
Parameters: id : integer
ID of the resource to be revoked
user_id : integer
ID of the user
Returns: None
Response code 204: success
-
delete_custom
(id)¶ Delete a CustomScript
Parameters: id : integer
Returns: None
Response code 204: success
-
delete_custom_projects
(id, project_id)¶ Remove a Job from a project
Parameters: id : integer
ID of the resource
project_id : integer
The ID of the project
Returns: None
Response code 204: success
-
delete_custom_runs
(id, run_id)¶ Cancel a run
Parameters: id : integer
The ID of the custom.
run_id : integer
The ID of the run.
Returns: None
Response code 202: success
Revoke the permissions a group has on this object
Parameters: id : integer
ID of the resource to be revoked
group_id : integer
ID of the group
Returns: None
Response code 204: success
Revoke the permissions a user has on this object
Parameters: id : integer
ID of the resource to be revoked
user_id : integer
ID of the user
Returns: None
Response code 204: success
-
delete_javascript
(id)¶ Delete a JavaScript Script
Parameters: id : integer
Returns: None
Response code 204: success
-
delete_javascript_projects
(id, project_id)¶ Remove a scripted sql from a project
Parameters: id : integer
ID of the resource
project_id : integer
The ID of the project
Returns: None
Response code 204: success
-
delete_javascript_runs
(id, run_id)¶ Cancel a run
Parameters: id : integer
The ID of the javascript.
run_id : integer
The ID of the run.
Returns: None
Response code 202: success
Revoke the permissions a group has on this object
Parameters: id : integer
ID of the resource to be revoked
group_id : integer
ID of the group
Returns: None
Response code 204: success
Revoke the permissions a user has on this object
Parameters: id : integer
ID of the resource to be revoked
user_id : integer
ID of the user
Returns: None
Response code 204: success
-
delete_python3
(id)¶ Delete a Python Script
Parameters: id : integer
Returns: None
Response code 204: success
-
delete_python3_projects
(id, project_id)¶ Remove a python docker from a project
Parameters: id : integer
ID of the resource
project_id : integer
The ID of the project
Returns: None
Response code 204: success
-
delete_python3_runs
(id, run_id)¶ Cancel a run
Parameters: id : integer
The ID of the python.
run_id : integer
The ID of the run.
Returns: None
Response code 202: success
Revoke the permissions a group has on this object
Parameters: id : integer
ID of the resource to be revoked
group_id : integer
ID of the group
Returns: None
Response code 204: success
Revoke the permissions a user has on this object
Parameters: id : integer
ID of the resource to be revoked
user_id : integer
ID of the user
Returns: None
Response code 204: success
-
delete_r
(id)¶ Delete an R Script
Parameters: id : integer
Returns: None
Response code 204: success
-
delete_r_projects
(id, project_id)¶ Remove a r docker from a project
Parameters: id : integer
ID of the resource
project_id : integer
The ID of the project
Returns: None
Response code 204: success
-
delete_r_runs
(id, run_id)¶ Cancel a run
Parameters: id : integer
The ID of the r.
run_id : integer
The ID of the run.
Returns: None
Response code 202: success
Revoke the permissions a group has on this object
Parameters: id : integer
ID of the resource to be revoked
group_id : integer
ID of the group
Returns: None
Response code 204: success
Revoke the permissions a user has on this object
Parameters: id : integer
ID of the resource to be revoked
user_id : integer
ID of the user
Returns: None
Response code 204: success
-
delete_sql
(id)¶ Delete a SQL script
Parameters: id : integer
Returns: None
Response code 204: success
-
delete_sql_projects
(id, project_id)¶ Remove a scripts from a project
Parameters: id : integer
ID of the resource
project_id : integer
The ID of the project
Returns: None
Response code 204: success
-
delete_sql_runs
(id, run_id)¶ Cancel a run
Parameters: id : integer
The ID of the sql.
run_id : integer
The ID of the run.
Returns: None
Response code 202: success
Revoke the permissions a group has on this object
Parameters: id : integer
ID of the resource to be revoked
group_id : integer
ID of the group
Returns: None
Response code 204: success
Revoke the permissions a user has on this object
Parameters: id : integer
ID of the resource to be revoked
user_id : integer
ID of the user
Returns: None
Response code 204: success
-
get
(id)¶ Get details about a script
Parameters: id : integer
The ID for the script.
Returns: links : dict:
- runs : string The runs link to get the run information list for this script. - details : string The details link to get more information about the script.
archived : string
The archival status of the requested object(s).
is_template : boolean
Whether others scripts use this one as a template.
name : string
The name of the script.
last_run : dict:
- finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued.
published_as_template_id : integer
The ID of the template that this script is backing.
type : string
The type of script.
schedule : dict:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
updated_at : string/time
The time this script was last updated.
from_template_id : integer
The ID of the template this script uses, if any.
sql : string
The raw SQL query for the script.
state : string
The status of the script’s last run.
running_as : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
time_zone : string
The time zone of this script.
parent_id : integer
The ID of the parent job that will trigger this script
template_dependents_count : integer
How many other scripts use this one as a template.
template_script_id : integer
The ID of the template script, if any.
template_script_name : string
The name of the template script.
next_run_at : string/time
The time of the next scheduled run.
expanded_arguments : dict
Expanded arguments for use in injecting into different environments.
finished_at : string/time
The time that the script’s last run finished.
hidden : boolean
The hidden status of the object.
user_context : string
“runner” or “author”, who to execute the script as when run as a template.
params : list:
A definition of the parameters this script accepts in the arguments field. - type : string The type of parameter. Valid options: string, integer, float, bool, database, credential_aws, credential_redshift, or credential_custom - name : string The variable's name as used within your code. - required : boolean Whether this param is required. - description : string A short sentence or fragment describing this parameter to the end user. - label : string The label to present to users when asking them for the value. - default : string If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool's or false, False, f, n, no, or 0 for false bool's. Cannot be used for parameters that are required or a credential type.
notifications : dict:
- failure_on : boolean If failure email notifications are on - success_email_subject : string Custom subject line for success e-mail. - success_email_body : string Custom body text for success e-mail, written in Markdown. - success_email_addresses : list Addresses to notify by e-mail when the job completes successfully. - stall_warning_minutes : integer Stall warning emails will be sent after this amount of minutes. - failure_email_addresses : list Addresses to notify by e-mail when the job fails. - urls : list URLs to receive a POST request at job completion - success_on : boolean If success email notifications are on
arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
id : integer
The ID for the script.
created_at : string/time
The time this script was created.
author : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
target_project_id : integer
Target project to which script outputs will be added.
projects : list:
A list of projects containing the script. - id : integer The ID for the project. - name : string The name of the project.
-
get_containers
(id)¶ View a container
Parameters: id : integer
The ID for the script.
Returns: links : dict:
- runs : string The runs link to get the run information list for this script. - details : string The details link to get more information about the script.
repo_ref : string
The tag or branch of the github repo to clone into the container.
is_template : boolean
Whether others scripts use this one as a template.
required_resources : dict:
- cpu : integer The number of CPU shares to allocate for the container. Each core has 1024 shares. - disk_space : number/float The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported. - memory : integer The amount of RAM to allocate for the container (in MiB).
name : string
The name of the container.
last_run : dict:
- finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued.
published_as_template_id : integer
The ID of the template that this script is backing.
remote_host_credential_id : integer
The id of the database credentials to pass into the environment of the container.
docker_command : string
The command to run on the container. Will be run via sh as: [“sh”, “-c”, dockerCommand]
type : string
The type of the script (e.g Container)
schedule : dict:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
git_credential_id : integer
The id of the git credential to be used when checking out the specified git repo. If not supplied, the first git credential you’ve submitted will be used. Unnecessary if no git repo is specified or the git repo is public.
docker_image_tag : string
The tag of the docker image to pull from DockerHub (default: latest).
updated_at : string/time
The time the script was last updated.
from_template_id : integer
The ID of the template script.
state : string
The status of the script’s last run.
docker_image_name : string
The name of the docker image to pull from DockerHub.
running_as : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
parent_id : integer
The ID of the parent job that will trigger this script
template_dependents_count : integer
How many other scripts use this one as a template.
template_script_name : string
The name of the template script.
finished_at : string/time
The time that the script’s last run finished.
hidden : boolean
The hidden status of the object.
user_context : string
“runner” or “author”, who to execute the script as when run as a template.
repo_http_uri : string
The location of a github repo to clone into the container, e.g. github.com/my-user/my-repo.git.
archived : string
The archival status of the requested object(s).
params : list:
A definition of the parameters this script accepts in the arguments field. - type : string The type of parameter. Valid options: string, integer, float, bool, database, credential_aws, credential_redshift, or credential_custom - name : string The variable's name as used within your code. - required : boolean Whether this param is required. - description : string A short sentence or fragment describing this parameter to the end user. - label : string The label to present to users when asking them for the value. - default : string If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool's or false, False, f, n, no, or 0 for false bool's. Cannot be used for parameters that are required or a credential type.
notifications : dict:
- failure_on : boolean If failure email notifications are on - success_email_subject : string Custom subject line for success e-mail. - success_email_body : string Custom body text for success e-mail, written in Markdown. - success_email_addresses : list Addresses to notify by e-mail when the job completes successfully. - stall_warning_minutes : integer Stall warning emails will be sent after this amount of minutes. - failure_email_addresses : list Addresses to notify by e-mail when the job fails. - urls : list URLs to receive a POST request at job completion - success_on : boolean If success email notifications are on
arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
id : integer
The ID for the script.
created_at : string/time
The time this script was created.
author : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
target_project_id : integer
Target project to which script outputs will be added.
projects : list:
A list of projects containing the script. - id : integer The ID for the project. - name : string The name of the project.
-
get_containers_runs
(id, run_id)¶ Check status of a run
Parameters: id : integer
The ID of the container.
run_id : integer
The ID of the run.
Returns: finished_at : string/time
The time the last run completed.
container_id : integer
The ID of the container.
started_at : string/time
The time the last run started at.
is_cancel_requested : boolean
True if run cancel requested, else false.
error : string
The error, if any, returned by the run.
state : string
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
id : integer
The ID of the run.
-
get_custom
(id)¶ Get a CustomScript
Parameters: id : integer
Returns: params : list:
A definition of the parameters this script accepts in the arguments field. - type : string The type of parameter. Valid options: string, integer, float, bool, database, credential_aws, credential_redshift, or credential_custom - name : string The variable's name as used within your code. - required : boolean Whether this param is required. - description : string A short sentence or fragment describing this parameter to the end user. - label : string The label to present to users when asking them for the value. - default : string If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool's or false, False, f, n, no, or 0 for false bool's. Cannot be used for parameters that are required or a credential type.
name : string
The name of the script.
last_run : dict:
- finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued.
archived : string
The archival status of the requested object(s).
template_script_name : string
The name of the template script.
type : string
The type of the script (e.g Custom)
schedule : dict:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
updated_at : string/time
The time the script was last updated.
from_template_id : integer
The ID of the template script.
state : string
The status of the script’s last run.
finished_at : string/time
The time that the script’s last run finished.
hidden : boolean
The hidden status of the object.
parent_id : integer
The ID of the parent job that will trigger this script
code_preview : string
The code that this script will run with arguments inserted.
running_as : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
remote_host_id : integer
The remote host ID that this script will connect to.
credential_id : integer
The credential that this script will use.
notifications : dict:
- failure_on : boolean If failure email notifications are on - success_email_subject : string Custom subject line for success e-mail. - success_email_body : string Custom body text for success e-mail, written in Markdown. - success_email_addresses : list Addresses to notify by e-mail when the job completes successfully. - stall_warning_minutes : integer Stall warning emails will be sent after this amount of minutes. - failure_email_addresses : list Addresses to notify by e-mail when the job fails. - urls : list URLs to receive a POST request at job completion - success_on : boolean If success email notifications are on
arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
id : integer
The ID for the script.
created_at : string/time
The time this script was created.
author : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
target_project_id : integer
Target project to which script outputs will be added.
projects : list:
A list of projects containing the script. - id : integer The ID for the project. - name : string The name of the project.
-
get_custom_runs
(id, run_id)¶ Check status of a run
Parameters: id : integer
The ID of the custom.
run_id : integer
The ID of the run.
Returns: finished_at : string/time
The time the last run completed.
started_at : string/time
The time the last run started at.
is_cancel_requested : boolean
True if run cancel requested, else false.
error : string
The error, if any, returned by the run.
custom_id : integer
The ID of the custom.
state : string
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
id : integer
The ID of the run.
-
get_javascript
(id)¶ Get a JavaScript Script
Parameters: id : integer
Returns: links : dict:
- runs : string The runs link to get the run information list for this script. - details : string The details link to get more information about the script.
archived : string
The archival status of the requested object(s).
is_template : boolean
Whether others scripts use this one as a template.
name : string
The name of the script.
last_run : dict:
- finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued.
published_as_template_id : integer
The ID of the template that this script is backing.
credential_id : integer
The credential that this script will use.
type : string
The type of the script (e.g SQL, Container, Python, R, JavaScript)
schedule : dict:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
updated_at : string/time
The time the script was last updated.
from_template_id : integer
The ID of the template this script uses, if any.
source : string
The body/text of the script.
state : string
The status of the script’s last run.
running_as : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
time_zone : string
The time zone of this script.
parent_id : integer
The ID of the parent job that will trigger this script
template_dependents_count : integer
How many other scripts use this one as a template.
template_script_name : string
The name of the template script.
next_run_at : string/time
The time of the next scheduled run.
finished_at : string/time
The time that the script’s last run finished.
hidden : boolean
The hidden status of the object.
user_context : string
“runner” or “author”, who to execute the script as when run as a template.
remote_host_id : integer
The remote host ID that this script will connect to.
params : list:
A definition of the parameters this script accepts in the arguments field. - type : string The type of parameter. Valid options: string, integer, float, bool, database, credential_aws, credential_redshift, or credential_custom - name : string The variable's name as used within your code. - required : boolean Whether this param is required. - description : string A short sentence or fragment describing this parameter to the end user. - label : string The label to present to users when asking them for the value. - default : string If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool's or false, False, f, n, no, or 0 for false bool's. Cannot be used for parameters that are required or a credential type.
notifications : dict:
- failure_on : boolean If failure email notifications are on - success_email_subject : string Custom subject line for success e-mail. - success_email_body : string Custom body text for success e-mail, written in Markdown. - success_email_addresses : list Addresses to notify by e-mail when the job completes successfully. - stall_warning_minutes : integer Stall warning emails will be sent after this amount of minutes. - failure_email_addresses : list Addresses to notify by e-mail when the job fails. - urls : list URLs to receive a POST request at job completion - success_on : boolean If success email notifications are on
arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
id : integer
The ID for the script.
created_at : string/time
The time this script was created.
author : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
target_project_id : integer
Target project to which script outputs will be added.
projects : list:
A list of projects containing the script. - id : integer The ID for the project. - name : string The name of the project.
-
get_javascript_runs
(id, run_id)¶ Check status of a run
Parameters: id : integer
The ID of the javascript.
run_id : integer
The ID of the run.
Returns: finished_at : string/time
The time the last run completed.
started_at : string/time
The time the last run started at.
javascript_id : integer
The ID of the javascript.
is_cancel_requested : boolean
True if run cancel requested, else false.
error : string
The error, if any, returned by the run.
state : string
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
id : integer
The ID of the run.
-
get_python3
(id)¶ Get a Python Script
Parameters: id : integer
Returns: links : dict:
- runs : string The runs link to get the run information list for this script. - details : string The details link to get more information about the script.
archived : string
The archival status of the requested object(s).
is_template : boolean
Whether others scripts use this one as a template.
required_resources : dict:
- cpu : integer The number of CPU shares to allocate for the container. Each core has 1024 shares. Must be at least 2 shares. - disk_space : number/float The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported. - memory : integer The amount of RAM to allocate for the container (in MiB). Must be at least 4 MiB.
name : string
The name of the script.
last_run : dict:
- finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued.
published_as_template_id : integer
The ID of the template that this script is backing.
type : string
The type of the script (e.g SQL, Container, Python, R, JavaScript)
schedule : dict:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
updated_at : string/time
The time the script was last updated.
from_template_id : integer
The ID of the template this script uses, if any.
source : string
The body/text of the script.
state : string
The status of the script’s last run.
running_as : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
time_zone : string
The time zone of this script.
parent_id : integer
The ID of the parent job that will trigger this script
template_dependents_count : integer
How many other scripts use this one as a template.
template_script_name : string
The name of the template script.
next_run_at : string/time
The time of the next scheduled run.
finished_at : string/time
The time that the script’s last run finished.
hidden : boolean
The hidden status of the object.
user_context : string
“runner” or “author”, who to execute the script as when run as a template.
params : list:
A definition of the parameters this script accepts in the arguments field. - type : string The type of parameter. Valid options: string, integer, float, bool, database, credential_aws, credential_redshift, or credential_custom - name : string The variable's name as used within your code. - required : boolean Whether this param is required. - description : string A short sentence or fragment describing this parameter to the end user. - label : string The label to present to users when asking them for the value. - default : string If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool's or false, False, f, n, no, or 0 for false bool's. Cannot be used for parameters that are required or a credential type.
notifications : dict:
- failure_on : boolean If failure email notifications are on - success_email_subject : string Custom subject line for success e-mail. - success_email_body : string Custom body text for success e-mail, written in Markdown. - success_email_addresses : list Addresses to notify by e-mail when the job completes successfully. - stall_warning_minutes : integer Stall warning emails will be sent after this amount of minutes. - failure_email_addresses : list Addresses to notify by e-mail when the job fails. - urls : list URLs to receive a POST request at job completion - success_on : boolean If success email notifications are on
arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
id : integer
The ID for the script.
created_at : string/time
The time this script was created.
author : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
target_project_id : integer
Target project to which script outputs will be added.
projects : list:
A list of projects containing the script. - id : integer The ID for the project. - name : string The name of the project.
-
get_python3_runs
(id, run_id)¶ Check status of a run
Parameters: id : integer
The ID of the python.
run_id : integer
The ID of the run.
Returns: finished_at : string/time
The time the last run completed.
python_id : integer
The ID of the python.
started_at : string/time
The time the last run started at.
is_cancel_requested : boolean
True if run cancel requested, else false.
error : string
The error, if any, returned by the run.
state : string
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
id : integer
The ID of the run.
-
get_r
(id)¶ Get an R Script
Parameters: id : integer
Returns: links : dict:
- runs : string The runs link to get the run information list for this script. - details : string The details link to get more information about the script.
archived : string
The archival status of the requested object(s).
is_template : boolean
Whether others scripts use this one as a template.
required_resources : dict:
- cpu : integer The number of CPU shares to allocate for the container. Each core has 1024 shares. Must be at least 2 shares. - disk_space : number/float The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported. - memory : integer The amount of RAM to allocate for the container (in MiB). Must be at least 4 MiB.
name : string
The name of the script.
last_run : dict:
- finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued.
published_as_template_id : integer
The ID of the template that this script is backing.
type : string
The type of the script (e.g SQL, Container, Python, R, JavaScript)
schedule : dict:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
updated_at : string/time
The time the script was last updated.
from_template_id : integer
The ID of the template this script uses, if any.
source : string
The body/text of the script.
state : string
The status of the script’s last run.
running_as : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
time_zone : string
The time zone of this script.
parent_id : integer
The ID of the parent job that will trigger this script
template_dependents_count : integer
How many other scripts use this one as a template.
template_script_name : string
The name of the template script.
next_run_at : string/time
The time of the next scheduled run.
finished_at : string/time
The time that the script’s last run finished.
hidden : boolean
The hidden status of the object.
user_context : string
“runner” or “author”, who to execute the script as when run as a template.
params : list:
A definition of the parameters this script accepts in the arguments field. - type : string The type of parameter. Valid options: string, integer, float, bool, database, credential_aws, credential_redshift, or credential_custom - name : string The variable's name as used within your code. - required : boolean Whether this param is required. - description : string A short sentence or fragment describing this parameter to the end user. - label : string The label to present to users when asking them for the value. - default : string If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool's or false, False, f, n, no, or 0 for false bool's. Cannot be used for parameters that are required or a credential type.
notifications : dict:
- failure_on : boolean If failure email notifications are on - success_email_subject : string Custom subject line for success e-mail. - success_email_body : string Custom body text for success e-mail, written in Markdown. - success_email_addresses : list Addresses to notify by e-mail when the job completes successfully. - stall_warning_minutes : integer Stall warning emails will be sent after this amount of minutes. - failure_email_addresses : list Addresses to notify by e-mail when the job fails. - urls : list URLs to receive a POST request at job completion - success_on : boolean If success email notifications are on
arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
id : integer
The ID for the script.
created_at : string/time
The time this script was created.
author : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
target_project_id : integer
Target project to which script outputs will be added.
projects : list:
A list of projects containing the script. - id : integer The ID for the project. - name : string The name of the project.
-
get_r_runs
(id, run_id)¶ Check status of a run
Parameters: id : integer
The ID of the r.
run_id : integer
The ID of the run.
Returns: finished_at : string/time
The time the last run completed.
r_id : integer
The ID of the r.
is_cancel_requested : boolean
True if run cancel requested, else false.
error : string
The error, if any, returned by the run.
state : string
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
id : integer
The ID of the run.
started_at : string/time
The time the last run started at.
-
get_sql
(id)¶ Get a SQL script
Parameters: id : integer
Returns: links : dict:
- runs : string The runs link to get the run information list for this script. - details : string The details link to get more information about the script.
archived : string
The archival status of the requested object(s).
is_template : boolean
Whether others scripts use this one as a template.
name : string
The name of the script.
last_run : dict:
- finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued.
published_as_template_id : integer
The ID of the template that this script is backing.
code_preview : string
The code that this script will run with arguments inserted.
credential_id : integer
The credential that this script will use.
type : string
The type of the script (e.g SQL, Container, Python, R, JavaScript)
schedule : dict:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
updated_at : string/time
The time the script was last updated.
from_template_id : integer
The ID of the template this script uses, if any.
sql : string
The raw SQL query for the script.
state : string
The status of the script’s last run.
running_as : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
time_zone : string
The time zone of this script.
parent_id : integer
The ID of the parent job that will trigger this script
template_dependents_count : integer
How many other scripts use this one as a template.
template_script_name : string
The name of the template script.
next_run_at : string/time
The time of the next scheduled run.
expanded_arguments : dict
Expanded arguments for use in injecting into different environments.
finished_at : string/time
The time that the script’s last run finished.
hidden : boolean
The hidden status of the object.
user_context : string
“runner” or “author”, who to execute the script as when run as a template.
remote_host_id : integer
The remote host ID that this script will connect to.
params : list:
A definition of the parameters this script accepts in the arguments field. - type : string The type of parameter. Valid options: string, integer, float, bool, database, credential_aws, credential_redshift, or credential_custom - name : string The variable's name as used within your code. - required : boolean Whether this param is required. - description : string A short sentence or fragment describing this parameter to the end user. - label : string The label to present to users when asking them for the value. - default : string If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool's or false, False, f, n, no, or 0 for false bool's. Cannot be used for parameters that are required or a credential type.
notifications : dict:
- failure_on : boolean If failure email notifications are on - success_email_subject : string Custom subject line for success e-mail. - success_email_body : string Custom body text for success e-mail, written in Markdown. - success_email_addresses : list Addresses to notify by e-mail when the job completes successfully. - stall_warning_minutes : integer Stall warning emails will be sent after this amount of minutes. - failure_email_addresses : list Addresses to notify by e-mail when the job fails. - urls : list URLs to receive a POST request at job completion - success_on : boolean If success email notifications are on
arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
id : integer
The ID for the script.
created_at : string/time
The time this script was created.
author : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
target_project_id : integer
Target project to which script outputs will be added.
projects : list:
A list of projects containing the script. - id : integer The ID for the project. - name : string The name of the project.
-
get_sql_runs
(id, run_id)¶ Check status of a run
Parameters: id : integer
The ID of the sql.
run_id : integer
The ID of the run.
Returns: finished_at : string/time
The time that this run finished.
started_at : string/time
The time the last run started.
is_cancel_requested : boolean
True if run cancel requested, else false.
error : string
The error message for this run, if present.
state : string
The state of this run.
id : integer
The ID of this run.
output : list:
A list of the outputs of this script. - output_name : string The name of the output file. - path : string The temporary link to download this output file, valid for 36 hours.
sql_id : integer
The ID of this sql.
-
list
(**kwargs)¶ List scripts
Parameters: type : string, optional
If specified, return objects of these types. The valid types are ‘sql’, ‘python3’, ‘r’, and ‘javascript’.
author : string, optional
If specified, return objects from this author.
status : string, optional
If specified, returns objects with one of these statuses. It accepts a comma-separated list, possible values are ‘running’, ‘failed’, ‘succeeded’, ‘idle’, ‘scheduled’.
archived : string, optional
The archival status of the requested object(s).
limit : integer, optional
Number of results to return. Defaults to 20. Maximum allowed is 50.
page_num : integer, optional
Page number of the results to return. Defaults to the first page, 1.
order : string, optional
The field on which to order the result set. Defaults to updated_at. Must be one of: updated_at, name, created_at, last_run.updated_at.
order_dir : string, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: links : dict:
- runs : string The runs link to get the run information list for this script. - details : string The details link to get more information about the script.
archived : string
The archival status of the requested object(s).
updated_at : string/time
The time the script was last updated.
name : string
The name of the script.
parent_id : integer
The ID of the parent job that will trigger this script
last_run : dict:
- finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued.
time_zone : string
The time zone of this script.
template_script_id : integer
The ID of the template script, if any.
finished_at : string/time
The time that the script’s last run finished.
type : string
The type of the script (e.g SQL, Container, Python, R, JavaScript)
is_template : boolean
Whether others scripts use this one as a template.
from_template_id : integer
The ID of the template this script uses, if any.
state : string
The status of the script’s last run.
id : integer
The ID for the script.
created_at : string/time
The time this script was created.
author : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
projects : list:
A list of projects containing the script. - id : integer The ID for the project. - name : string The name of the project.
-
list_containers_projects
(id)¶ List the projects a container docker belongs to
Parameters: id : integer
The ID of the resource.
Returns: archived : string
The archival status of the requested object(s).
updated_at : string/time
name : string
The name of this project.
author : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
id : integer
The ID for this project.
created_at : string/time
description : string
A description of the project
users : list:
Users who can see the project - username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
auto_share : boolean
-
list_containers_runs
(id, **kwargs)¶ List runs for the given container
Parameters: id : integer
The ID of the container.
limit : integer, optional
Number of results to return. Defaults to 20. Maximum allowed is 100.
page_num : integer, optional
Page number of the results to return. Defaults to the first page, 1.
order : string, optional
The field on which to order the result set. Defaults to id. Must be one of: id.
order_dir : string, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: finished_at : string/time
The time the last run completed.
container_id : integer
The ID of the container.
started_at : string/time
The time the last run started at.
is_cancel_requested : boolean
True if run cancel requested, else false.
error : string
The error, if any, returned by the run.
state : string
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
id : integer
The ID of the run.
-
list_containers_runs_logs
(id, run_id, **kwargs)¶ Get the logs for a run
Parameters: id : integer
The ID of the container.
run_id : integer
The ID of the run.
last_id : integer, optional
The ID of the last log message received. Log entries with this ID value or lower will be omitted.Logs are sorted by ID if this value is provided, and are otherwise sorted by createdAt.
limit : integer, optional
The maximum number of log messages to return. Default of 10000.
Returns: id : integer
The ID of the log.
created_at : string/date-time
The time the log was created.
message : string
The log message.
level : string
The level of the log. One of unknown,fatal,error,warn,info,debug.
List users and groups permissioned on this object
Parameters: id : integer
The ID of the object.
Returns: readers : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
owners : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
writers : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
-
list_custom
(**kwargs)¶ List Custom Scripts
Parameters: from_template_id : integer, optional
The template script that this app uses.
archived : string, optional
The archival status of the requested object(s).
limit : integer, optional
Number of results to return. Defaults to its maximum of 50.
page_num : integer, optional
Page number of the results to return. Defaults to the first page, 1.
order : string, optional
The field on which to order the result set. Defaults to updated_at. Must be one of: updated_at, name, created_at.
order_dir : string, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to asc.
iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: name : string
The name of the script.
parent_id : integer
The ID of the parent job that will trigger this script
last_run : dict:
- finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued.
archived : string
The archival status of the requested object(s).
finished_at : string/time
The time that the script’s last run finished.
type : string
The type of the script (e.g Custom)
updated_at : string/time
The time the script was last updated.
from_template_id : integer
The ID of the template script.
state : string
The status of the script’s last run.
id : integer
The ID for the script.
created_at : string/time
The time this script was created.
author : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
projects : list:
A list of projects containing the script. - id : integer The ID for the project. - name : string The name of the project.
-
list_custom_projects
(id)¶ List the projects a Job belongs to
Parameters: id : integer
The ID of the resource.
Returns: archived : string
The archival status of the requested object(s).
updated_at : string/time
name : string
The name of this project.
author : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
id : integer
The ID for this project.
created_at : string/time
description : string
A description of the project
users : list:
Users who can see the project - username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
auto_share : boolean
-
list_custom_runs
(id, **kwargs)¶ List runs for the given custom
Parameters: id : integer
The ID of the custom.
limit : integer, optional
Number of results to return. Defaults to 20. Maximum allowed is 100.
page_num : integer, optional
Page number of the results to return. Defaults to the first page, 1.
order : string, optional
The field on which to order the result set. Defaults to id. Must be one of: id.
order_dir : string, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: finished_at : string/time
The time the last run completed.
started_at : string/time
The time the last run started at.
is_cancel_requested : boolean
True if run cancel requested, else false.
error : string
The error, if any, returned by the run.
custom_id : integer
The ID of the custom.
state : string
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
id : integer
The ID of the run.
-
list_custom_runs_logs
(id, run_id, **kwargs)¶ Get the logs for a run
Parameters: id : integer
The ID of the custom.
run_id : integer
The ID of the run.
last_id : integer, optional
The ID of the last log message received. Log entries with this ID value or lower will be omitted.Logs are sorted by ID if this value is provided, and are otherwise sorted by createdAt.
limit : integer, optional
The maximum number of log messages to return. Default of 10000.
Returns: id : integer
The ID of the log.
created_at : string/date-time
The time the log was created.
message : string
The log message.
level : string
The level of the log. One of unknown,fatal,error,warn,info,debug.
List users and groups permissioned on this object
Parameters: id : integer
The ID of the object.
Returns: readers : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
owners : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
writers : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
-
list_history
(id)¶ Get the run history and outputs of this script
Parameters: id : integer
The ID for the script.
Returns: finished_at : string/time
The time that this run finished.
is_cancel_requested : boolean
True if run cancel requested, else false.
error : string
The error message for this run, if present.
state : string
The state of this run.
id : integer
The ID of this run.
output : list:
A list of the outputs of this script. - output_name : string The name of the output file. - path : string The temporary link to download this output file, valid for 36 hours.
sql_id : integer
The ID of this sql.
-
list_javascript_projects
(id)¶ List the projects a scripted sql belongs to
Parameters: id : integer
The ID of the resource.
Returns: archived : string
The archival status of the requested object(s).
updated_at : string/time
name : string
The name of this project.
author : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
id : integer
The ID for this project.
created_at : string/time
description : string
A description of the project
users : list:
Users who can see the project - username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
auto_share : boolean
-
list_javascript_runs
(id, **kwargs)¶ List runs for the given javascript
Parameters: id : integer
The ID of the javascript.
limit : integer, optional
Number of results to return. Defaults to 20. Maximum allowed is 100.
page_num : integer, optional
Page number of the results to return. Defaults to the first page, 1.
order : string, optional
The field on which to order the result set. Defaults to id. Must be one of: id.
order_dir : string, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: finished_at : string/time
The time the last run completed.
started_at : string/time
The time the last run started at.
javascript_id : integer
The ID of the javascript.
is_cancel_requested : boolean
True if run cancel requested, else false.
error : string
The error, if any, returned by the run.
state : string
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
id : integer
The ID of the run.
-
list_javascript_runs_logs
(id, run_id, **kwargs)¶ Get the logs for a run
Parameters: id : integer
The ID of the javascript.
run_id : integer
The ID of the run.
last_id : integer, optional
The ID of the last log message received. Log entries with this ID value or lower will be omitted.Logs are sorted by ID if this value is provided, and are otherwise sorted by createdAt.
limit : integer, optional
The maximum number of log messages to return. Default of 10000.
Returns: id : integer
The ID of the log.
created_at : string/date-time
The time the log was created.
message : string
The log message.
level : string
The level of the log. One of unknown,fatal,error,warn,info,debug.
List users and groups permissioned on this object
Parameters: id : integer
The ID of the object.
Returns: readers : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
owners : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
writers : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
-
list_python3_projects
(id)¶ List the projects a python docker belongs to
Parameters: id : integer
The ID of the resource.
Returns: archived : string
The archival status of the requested object(s).
updated_at : string/time
name : string
The name of this project.
author : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
id : integer
The ID for this project.
created_at : string/time
description : string
A description of the project
users : list:
Users who can see the project - username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
auto_share : boolean
-
list_python3_runs
(id, **kwargs)¶ List runs for the given python
Parameters: id : integer
The ID of the python.
limit : integer, optional
Number of results to return. Defaults to 20. Maximum allowed is 100.
page_num : integer, optional
Page number of the results to return. Defaults to the first page, 1.
order : string, optional
The field on which to order the result set. Defaults to id. Must be one of: id.
order_dir : string, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: finished_at : string/time
The time the last run completed.
python_id : integer
The ID of the python.
started_at : string/time
The time the last run started at.
is_cancel_requested : boolean
True if run cancel requested, else false.
error : string
The error, if any, returned by the run.
state : string
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
id : integer
The ID of the run.
-
list_python3_runs_logs
(id, run_id, **kwargs)¶ Get the logs for a run
Parameters: id : integer
The ID of the python.
run_id : integer
The ID of the run.
last_id : integer, optional
The ID of the last log message received. Log entries with this ID value or lower will be omitted.Logs are sorted by ID if this value is provided, and are otherwise sorted by createdAt.
limit : integer, optional
The maximum number of log messages to return. Default of 10000.
Returns: id : integer
The ID of the log.
created_at : string/date-time
The time the log was created.
message : string
The log message.
level : string
The level of the log. One of unknown,fatal,error,warn,info,debug.
List users and groups permissioned on this object
Parameters: id : integer
The ID of the object.
Returns: readers : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
owners : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
writers : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
-
list_r_projects
(id)¶ List the projects a r docker belongs to
Parameters: id : integer
The ID of the resource.
Returns: archived : string
The archival status of the requested object(s).
updated_at : string/time
name : string
The name of this project.
author : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
id : integer
The ID for this project.
created_at : string/time
description : string
A description of the project
users : list:
Users who can see the project - username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
auto_share : boolean
-
list_r_runs
(id, **kwargs)¶ List runs for the given r
Parameters: id : integer
The ID of the r.
limit : integer, optional
Number of results to return. Defaults to 20. Maximum allowed is 100.
page_num : integer, optional
Page number of the results to return. Defaults to the first page, 1.
order : string, optional
The field on which to order the result set. Defaults to id. Must be one of: id.
order_dir : string, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: finished_at : string/time
The time the last run completed.
r_id : integer
The ID of the r.
is_cancel_requested : boolean
True if run cancel requested, else false.
error : string
The error, if any, returned by the run.
state : string
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
id : integer
The ID of the run.
started_at : string/time
The time the last run started at.
-
list_r_runs_logs
(id, run_id, **kwargs)¶ Get the logs for a run
Parameters: id : integer
The ID of the r.
run_id : integer
The ID of the run.
last_id : integer, optional
The ID of the last log message received. Log entries with this ID value or lower will be omitted.Logs are sorted by ID if this value is provided, and are otherwise sorted by createdAt.
limit : integer, optional
The maximum number of log messages to return. Default of 10000.
Returns: id : integer
The ID of the log.
created_at : string/date-time
The time the log was created.
message : string
The log message.
level : string
The level of the log. One of unknown,fatal,error,warn,info,debug.
List users and groups permissioned on this object
Parameters: id : integer
The ID of the object.
Returns: readers : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
owners : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
writers : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
-
list_sql_projects
(id)¶ List the projects a scripts belongs to
Parameters: id : integer
The ID of the resource.
Returns: archived : string
The archival status of the requested object(s).
updated_at : string/time
name : string
The name of this project.
author : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
id : integer
The ID for this project.
created_at : string/time
description : string
A description of the project
users : list:
Users who can see the project - username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
auto_share : boolean
-
list_sql_runs
(id, **kwargs)¶ List runs for the given sql
Parameters: id : integer
The ID of the sql.
limit : integer, optional
Number of results to return. Defaults to 20. Maximum allowed is 100.
page_num : integer, optional
Page number of the results to return. Defaults to the first page, 1.
order : string, optional
The field on which to order the result set. Defaults to id. Must be one of: id.
order_dir : string, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: finished_at : string/time
The time that this run finished.
started_at : string/time
The time the last run started.
is_cancel_requested : boolean
True if run cancel requested, else false.
error : string
The error message for this run, if present.
state : string
The state of this run.
id : integer
The ID of this run.
output : list:
A list of the outputs of this script. - output_name : string The name of the output file. - path : string The temporary link to download this output file, valid for 36 hours.
sql_id : integer
The ID of this sql.
-
list_sql_runs_logs
(id, run_id, **kwargs)¶ Get the logs for a run
Parameters: id : integer
The ID of the sql.
run_id : integer
The ID of the run.
last_id : integer, optional
The ID of the last log message received. Log entries with this ID value or lower will be omitted.Logs are sorted by ID if this value is provided, and are otherwise sorted by createdAt.
limit : integer, optional
The maximum number of log messages to return. Default of 10000.
Returns: id : integer
The ID of the log.
created_at : string/date-time
The time the log was created.
message : string
The log message.
level : string
The level of the log. One of unknown,fatal,error,warn,info,debug.
List users and groups permissioned on this object
Parameters: id : integer
The ID of the object.
Returns: readers : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
owners : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
writers : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
-
list_types
()¶ List available script types
Returns: name : string
The name of the type.
-
patch
(id, **kwargs)¶ Update a script
Parameters: id : integer
The ID for the script.
parent_id : integer, optional
The ID of the parent job that will trigger this script
schedule : dict, optional:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
params : list, optional:
A definition of the parameters this script accepts in the arguments field. Cannot be set if this script uses a template script. - type : string The type of parameter. Valid options: string, integer, float, bool, database, credential_aws, credential_redshift, or credential_custom - name : string The variable's name as used within your code. - required : boolean Whether this param is required. - description : string A short sentence or fragment describing this parameter to the end user. - label : string The label to present to users when asking them for the value. - default : string If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool's or false, False, f, n, no, or 0 for false bool's. Cannot be used for parameters that are required or a credential type.
template_script_id : integer, optional
The ID of the template script, if any. A script cannot both have a template script and be a template for other scripts.
notifications : dict, optional:
- failure_on : boolean If failure email notifications are on - success_email_subject : string Custom subject line for success e-mail. - success_email_body : string Custom body text for success e-mail, written in Markdown. - success_email_addresses : list Addresses to notify by e-mail when the job completes successfully. - stall_warning_minutes : integer Stall warning emails will be sent after this amount of minutes. - failure_email_addresses : list Addresses to notify by e-mail when the job fails. - urls : list URLs to receive a POST request at job completion - success_on : boolean If success email notifications are on
arguments : dict, optional
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
name : string, optional
The name of the script.
sql : string, optional
The raw SQL query for the script.
Returns: links : dict:
- runs : string The runs link to get the run information list for this script. - details : string The details link to get more information about the script.
archived : string
The archival status of the requested object(s).
is_template : boolean
Whether others scripts use this one as a template.
name : string
The name of the script.
last_run : dict:
- finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued.
published_as_template_id : integer
The ID of the template that this script is backing.
type : string
The type of script.
schedule : dict:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
updated_at : string/time
The time this script was last updated.
from_template_id : integer
The ID of the template this script uses, if any.
sql : string
The raw SQL query for the script.
state : string
The status of the script’s last run.
running_as : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
time_zone : string
The time zone of this script.
parent_id : integer
The ID of the parent job that will trigger this script
template_dependents_count : integer
How many other scripts use this one as a template.
template_script_id : integer
The ID of the template script, if any.
template_script_name : string
The name of the template script.
next_run_at : string/time
The time of the next scheduled run.
expanded_arguments : dict
Expanded arguments for use in injecting into different environments.
finished_at : string/time
The time that the script’s last run finished.
hidden : boolean
The hidden status of the object.
user_context : string
“runner” or “author”, who to execute the script as when run as a template.
params : list:
A definition of the parameters this script accepts in the arguments field. - type : string The type of parameter. Valid options: string, integer, float, bool, database, credential_aws, credential_redshift, or credential_custom - name : string The variable's name as used within your code. - required : boolean Whether this param is required. - description : string A short sentence or fragment describing this parameter to the end user. - label : string The label to present to users when asking them for the value. - default : string If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool's or false, False, f, n, no, or 0 for false bool's. Cannot be used for parameters that are required or a credential type.
notifications : dict:
- failure_on : boolean If failure email notifications are on - success_email_subject : string Custom subject line for success e-mail. - success_email_body : string Custom body text for success e-mail, written in Markdown. - success_email_addresses : list Addresses to notify by e-mail when the job completes successfully. - stall_warning_minutes : integer Stall warning emails will be sent after this amount of minutes. - failure_email_addresses : list Addresses to notify by e-mail when the job fails. - urls : list URLs to receive a POST request at job completion - success_on : boolean If success email notifications are on
arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
id : integer
The ID for the script.
created_at : string/time
The time this script was created.
author : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
target_project_id : integer
Target project to which script outputs will be added.
projects : list:
A list of projects containing the script. - id : integer The ID for the project. - name : string The name of the project.
-
patch_containers
(id, **kwargs)¶ Update a container
Parameters: id : integer
The ID for the script.
docker_image_name : string, optional
The name of the docker image to pull from DockerHub.
required_resources : dict, optional:
- cpu : integer The number of CPU shares to allocate for the container. Each core has 1024 shares. - disk_space : number/float The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported. - memory : integer The amount of RAM to allocate for the container (in MiB).
name : string, optional
The name of the container.
parent_id : integer, optional
The ID of the parent job that will trigger this script
repo_ref : string, optional
The tag or branch of the github repo to clone into the container.
remote_host_credential_id : integer, optional
The id of the database credentials to pass into the environment of the container.
repo_http_uri : string, optional
The location of a github repo to clone into the container, e.g. github.com/my-user/my-repo.git.
docker_command : string, optional
The command to run on the container. Will be run via sh as: [“sh”, “-c”, dockerCommand]
user_context : string, optional
“runner” or “author”, who to execute the script as when run as a template.
schedule : dict, optional:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
git_credential_id : integer, optional
The id of the git credential to be used when checking out the specified git repo. If not supplied, the first git credential you’ve submitted will be used. Unnecessary if no git repo is specified or the git repo is public.
docker_image_tag : string, optional
The tag of the docker image to pull from DockerHub (default: latest).
params : list, optional:
A definition of the parameters this script accepts in the arguments field. - type : string The type of parameter. Valid options: string, integer, float, bool, database, credential_aws, credential_redshift, or credential_custom - name : string The variable's name as used within your code. - required : boolean Whether this param is required. - description : string A short sentence or fragment describing this parameter to the end user. - label : string The label to present to users when asking them for the value. - default : string If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool's or false, False, f, n, no, or 0 for false bool's. Cannot be used for parameters that are required or a credential type.
notifications : dict, optional:
- failure_on : boolean If failure email notifications are on - success_email_subject : string Custom subject line for success e-mail. - success_email_body : string Custom body text for success e-mail, written in Markdown. - success_email_addresses : list Addresses to notify by e-mail when the job completes successfully. - stall_warning_minutes : integer Stall warning emails will be sent after this amount of minutes. - failure_email_addresses : list Addresses to notify by e-mail when the job fails. - urls : list URLs to receive a POST request at job completion - success_on : boolean If success email notifications are on
arguments : dict, optional
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
target_project_id : integer, optional
Target project to which script outputs will be added.
Returns: links : dict:
- runs : string The runs link to get the run information list for this script. - details : string The details link to get more information about the script.
repo_ref : string
The tag or branch of the github repo to clone into the container.
is_template : boolean
Whether others scripts use this one as a template.
required_resources : dict:
- cpu : integer The number of CPU shares to allocate for the container. Each core has 1024 shares. - disk_space : number/float The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported. - memory : integer The amount of RAM to allocate for the container (in MiB).
name : string
The name of the container.
last_run : dict:
- finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued.
published_as_template_id : integer
The ID of the template that this script is backing.
remote_host_credential_id : integer
The id of the database credentials to pass into the environment of the container.
docker_command : string
The command to run on the container. Will be run via sh as: [“sh”, “-c”, dockerCommand]
type : string
The type of the script (e.g Container)
schedule : dict:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
git_credential_id : integer
The id of the git credential to be used when checking out the specified git repo. If not supplied, the first git credential you’ve submitted will be used. Unnecessary if no git repo is specified or the git repo is public.
docker_image_tag : string
The tag of the docker image to pull from DockerHub (default: latest).
updated_at : string/time
The time the script was last updated.
from_template_id : integer
The ID of the template script.
state : string
The status of the script’s last run.
docker_image_name : string
The name of the docker image to pull from DockerHub.
running_as : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
parent_id : integer
The ID of the parent job that will trigger this script
template_dependents_count : integer
How many other scripts use this one as a template.
template_script_name : string
The name of the template script.
finished_at : string/time
The time that the script’s last run finished.
hidden : boolean
The hidden status of the object.
user_context : string
“runner” or “author”, who to execute the script as when run as a template.
repo_http_uri : string
The location of a github repo to clone into the container, e.g. github.com/my-user/my-repo.git.
archived : string
The archival status of the requested object(s).
params : list:
A definition of the parameters this script accepts in the arguments field. - type : string The type of parameter. Valid options: string, integer, float, bool, database, credential_aws, credential_redshift, or credential_custom - name : string The variable's name as used within your code. - required : boolean Whether this param is required. - description : string A short sentence or fragment describing this parameter to the end user. - label : string The label to present to users when asking them for the value. - default : string If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool's or false, False, f, n, no, or 0 for false bool's. Cannot be used for parameters that are required or a credential type.
notifications : dict:
- failure_on : boolean If failure email notifications are on - success_email_subject : string Custom subject line for success e-mail. - success_email_body : string Custom body text for success e-mail, written in Markdown. - success_email_addresses : list Addresses to notify by e-mail when the job completes successfully. - stall_warning_minutes : integer Stall warning emails will be sent after this amount of minutes. - failure_email_addresses : list Addresses to notify by e-mail when the job fails. - urls : list URLs to receive a POST request at job completion - success_on : boolean If success email notifications are on
arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
id : integer
The ID for the script.
created_at : string/time
The time this script was created.
author : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
target_project_id : integer
Target project to which script outputs will be added.
projects : list:
A list of projects containing the script. - id : integer The ID for the project. - name : string The name of the project.
-
patch_custom
(id, **kwargs)¶ Update some attributes of this CustomScript
Parameters: id : integer
The ID for the script.
remote_host_id : integer, optional
The remote host ID that this script will connect to.
schedule : dict, optional:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
credential_id : integer, optional
The credential that this script will use.
name : string, optional
The name of the script.
parent_id : integer, optional
The ID of the parent job that will trigger this script
arguments : dict, optional
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
target_project_id : integer, optional
Target project to which script outputs will be added.
notifications : dict, optional:
- failure_on : boolean If failure email notifications are on - success_email_subject : string Custom subject line for success e-mail. - success_email_body : string Custom body text for success e-mail, written in Markdown. - success_email_addresses : list Addresses to notify by e-mail when the job completes successfully. - stall_warning_minutes : integer Stall warning emails will be sent after this amount of minutes. - failure_email_addresses : list Addresses to notify by e-mail when the job fails. - urls : list URLs to receive a POST request at job completion - success_on : boolean If success email notifications are on
Returns: params : list:
A definition of the parameters this script accepts in the arguments field. - type : string The type of parameter. Valid options: string, integer, float, bool, database, credential_aws, credential_redshift, or credential_custom - name : string The variable's name as used within your code. - required : boolean Whether this param is required. - description : string A short sentence or fragment describing this parameter to the end user. - label : string The label to present to users when asking them for the value. - default : string If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool's or false, False, f, n, no, or 0 for false bool's. Cannot be used for parameters that are required or a credential type.
name : string
The name of the script.
last_run : dict:
- finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued.
archived : string
The archival status of the requested object(s).
template_script_name : string
The name of the template script.
type : string
The type of the script (e.g Custom)
schedule : dict:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
updated_at : string/time
The time the script was last updated.
from_template_id : integer
The ID of the template script.
state : string
The status of the script’s last run.
finished_at : string/time
The time that the script’s last run finished.
hidden : boolean
The hidden status of the object.
parent_id : integer
The ID of the parent job that will trigger this script
code_preview : string
The code that this script will run with arguments inserted.
running_as : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
remote_host_id : integer
The remote host ID that this script will connect to.
credential_id : integer
The credential that this script will use.
notifications : dict:
- failure_on : boolean If failure email notifications are on - success_email_subject : string Custom subject line for success e-mail. - success_email_body : string Custom body text for success e-mail, written in Markdown. - success_email_addresses : list Addresses to notify by e-mail when the job completes successfully. - stall_warning_minutes : integer Stall warning emails will be sent after this amount of minutes. - failure_email_addresses : list Addresses to notify by e-mail when the job fails. - urls : list URLs to receive a POST request at job completion - success_on : boolean If success email notifications are on
arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
id : integer
The ID for the script.
created_at : string/time
The time this script was created.
author : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
target_project_id : integer
Target project to which script outputs will be added.
projects : list:
A list of projects containing the script. - id : integer The ID for the project. - name : string The name of the project.
-
patch_javascript
(id, **kwargs)¶ Update some attributes of this JavaScript Script
Parameters: id : integer
The ID for the script.
credential_id : integer, optional
The credential that this script will use.
name : string, optional
The name of the script.
parent_id : integer, optional
The ID of the parent job that will trigger this script
time_zone : string, optional
The time zone of this script.
next_run_at : string/time, optional
The time of the next scheduled run.
remote_host_id : integer, optional
The remote host ID that this script will connect to.
user_context : string, optional
“runner” or “author”, who to execute the script as when run as a template.
schedule : dict, optional:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
params : list, optional:
A definition of the parameters this script accepts in the arguments field. - type : string The type of parameter. Valid options: string, integer, float, bool, database, credential_aws, credential_redshift, or credential_custom - name : string The variable's name as used within your code. - required : boolean Whether this param is required. - description : string A short sentence or fragment describing this parameter to the end user. - label : string The label to present to users when asking them for the value. - default : string If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool's or false, False, f, n, no, or 0 for false bool's. Cannot be used for parameters that are required or a credential type.
notifications : dict, optional:
- failure_on : boolean If failure email notifications are on - success_email_subject : string Custom subject line for success e-mail. - success_email_body : string Custom body text for success e-mail, written in Markdown. - success_email_addresses : list Addresses to notify by e-mail when the job completes successfully. - stall_warning_minutes : integer Stall warning emails will be sent after this amount of minutes. - failure_email_addresses : list Addresses to notify by e-mail when the job fails. - urls : list URLs to receive a POST request at job completion - success_on : boolean If success email notifications are on
arguments : dict, optional
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
source : string, optional
The body/text of the script.
target_project_id : integer, optional
Target project to which script outputs will be added.
Returns: links : dict:
- runs : string The runs link to get the run information list for this script. - details : string The details link to get more information about the script.
archived : string
The archival status of the requested object(s).
is_template : boolean
Whether others scripts use this one as a template.
name : string
The name of the script.
last_run : dict:
- finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued.
published_as_template_id : integer
The ID of the template that this script is backing.
credential_id : integer
The credential that this script will use.
type : string
The type of the script (e.g SQL, Container, Python, R, JavaScript)
schedule : dict:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
updated_at : string/time
The time the script was last updated.
from_template_id : integer
The ID of the template this script uses, if any.
source : string
The body/text of the script.
state : string
The status of the script’s last run.
running_as : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
time_zone : string
The time zone of this script.
parent_id : integer
The ID of the parent job that will trigger this script
template_dependents_count : integer
How many other scripts use this one as a template.
template_script_name : string
The name of the template script.
next_run_at : string/time
The time of the next scheduled run.
finished_at : string/time
The time that the script’s last run finished.
hidden : boolean
The hidden status of the object.
user_context : string
“runner” or “author”, who to execute the script as when run as a template.
remote_host_id : integer
The remote host ID that this script will connect to.
params : list:
A definition of the parameters this script accepts in the arguments field. - type : string The type of parameter. Valid options: string, integer, float, bool, database, credential_aws, credential_redshift, or credential_custom - name : string The variable's name as used within your code. - required : boolean Whether this param is required. - description : string A short sentence or fragment describing this parameter to the end user. - label : string The label to present to users when asking them for the value. - default : string If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool's or false, False, f, n, no, or 0 for false bool's. Cannot be used for parameters that are required or a credential type.
notifications : dict:
- failure_on : boolean If failure email notifications are on - success_email_subject : string Custom subject line for success e-mail. - success_email_body : string Custom body text for success e-mail, written in Markdown. - success_email_addresses : list Addresses to notify by e-mail when the job completes successfully. - stall_warning_minutes : integer Stall warning emails will be sent after this amount of minutes. - failure_email_addresses : list Addresses to notify by e-mail when the job fails. - urls : list URLs to receive a POST request at job completion - success_on : boolean If success email notifications are on
arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
id : integer
The ID for the script.
created_at : string/time
The time this script was created.
author : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
target_project_id : integer
Target project to which script outputs will be added.
projects : list:
A list of projects containing the script. - id : integer The ID for the project. - name : string The name of the project.
-
patch_python3
(id, **kwargs)¶ Update some attributes of this Python Script
Parameters: id : integer
The ID for the script.
required_resources : dict, optional:
- cpu : integer The number of CPU shares to allocate for the container. Each core has 1024 shares. Must be at least 2 shares. - disk_space : number/float The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported. - memory : integer The amount of RAM to allocate for the container (in MiB). Must be at least 4 MiB.
name : string, optional
The name of the script.
parent_id : integer, optional
The ID of the parent job that will trigger this script
time_zone : string, optional
The time zone of this script.
next_run_at : string/time, optional
The time of the next scheduled run.
user_context : string, optional
“runner” or “author”, who to execute the script as when run as a template.
schedule : dict, optional:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
params : list, optional:
A definition of the parameters this script accepts in the arguments field. - type : string The type of parameter. Valid options: string, integer, float, bool, database, credential_aws, credential_redshift, or credential_custom - name : string The variable's name as used within your code. - required : boolean Whether this param is required. - description : string A short sentence or fragment describing this parameter to the end user. - label : string The label to present to users when asking them for the value. - default : string If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool's or false, False, f, n, no, or 0 for false bool's. Cannot be used for parameters that are required or a credential type.
notifications : dict, optional:
- failure_on : boolean If failure email notifications are on - success_email_subject : string Custom subject line for success e-mail. - success_email_body : string Custom body text for success e-mail, written in Markdown. - success_email_addresses : list Addresses to notify by e-mail when the job completes successfully. - stall_warning_minutes : integer Stall warning emails will be sent after this amount of minutes. - failure_email_addresses : list Addresses to notify by e-mail when the job fails. - urls : list URLs to receive a POST request at job completion - success_on : boolean If success email notifications are on
arguments : dict, optional
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
source : string, optional
The body/text of the script.
target_project_id : integer, optional
Target project to which script outputs will be added.
Returns: links : dict:
- runs : string The runs link to get the run information list for this script. - details : string The details link to get more information about the script.
archived : string
The archival status of the requested object(s).
is_template : boolean
Whether others scripts use this one as a template.
required_resources : dict:
- cpu : integer The number of CPU shares to allocate for the container. Each core has 1024 shares. Must be at least 2 shares. - disk_space : number/float The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported. - memory : integer The amount of RAM to allocate for the container (in MiB). Must be at least 4 MiB.
name : string
The name of the script.
last_run : dict:
- finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued.
published_as_template_id : integer
The ID of the template that this script is backing.
type : string
The type of the script (e.g SQL, Container, Python, R, JavaScript)
schedule : dict:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
updated_at : string/time
The time the script was last updated.
from_template_id : integer
The ID of the template this script uses, if any.
source : string
The body/text of the script.
state : string
The status of the script’s last run.
running_as : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
time_zone : string
The time zone of this script.
parent_id : integer
The ID of the parent job that will trigger this script
template_dependents_count : integer
How many other scripts use this one as a template.
template_script_name : string
The name of the template script.
next_run_at : string/time
The time of the next scheduled run.
finished_at : string/time
The time that the script’s last run finished.
hidden : boolean
The hidden status of the object.
user_context : string
“runner” or “author”, who to execute the script as when run as a template.
params : list:
A definition of the parameters this script accepts in the arguments field. - type : string The type of parameter. Valid options: string, integer, float, bool, database, credential_aws, credential_redshift, or credential_custom - name : string The variable's name as used within your code. - required : boolean Whether this param is required. - description : string A short sentence or fragment describing this parameter to the end user. - label : string The label to present to users when asking them for the value. - default : string If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool's or false, False, f, n, no, or 0 for false bool's. Cannot be used for parameters that are required or a credential type.
notifications : dict:
- failure_on : boolean If failure email notifications are on - success_email_subject : string Custom subject line for success e-mail. - success_email_body : string Custom body text for success e-mail, written in Markdown. - success_email_addresses : list Addresses to notify by e-mail when the job completes successfully. - stall_warning_minutes : integer Stall warning emails will be sent after this amount of minutes. - failure_email_addresses : list Addresses to notify by e-mail when the job fails. - urls : list URLs to receive a POST request at job completion - success_on : boolean If success email notifications are on
arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
id : integer
The ID for the script.
created_at : string/time
The time this script was created.
author : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
target_project_id : integer
Target project to which script outputs will be added.
projects : list:
A list of projects containing the script. - id : integer The ID for the project. - name : string The name of the project.
-
patch_r
(id, **kwargs)¶ Update some attributes of this R Script
Parameters: id : integer
The ID for the script.
required_resources : dict, optional:
- cpu : integer The number of CPU shares to allocate for the container. Each core has 1024 shares. Must be at least 2 shares. - disk_space : number/float The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported. - memory : integer The amount of RAM to allocate for the container (in MiB). Must be at least 4 MiB.
name : string, optional
The name of the script.
parent_id : integer, optional
The ID of the parent job that will trigger this script
time_zone : string, optional
The time zone of this script.
next_run_at : string/time, optional
The time of the next scheduled run.
user_context : string, optional
“runner” or “author”, who to execute the script as when run as a template.
schedule : dict, optional:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
params : list, optional:
A definition of the parameters this script accepts in the arguments field. - type : string The type of parameter. Valid options: string, integer, float, bool, database, credential_aws, credential_redshift, or credential_custom - name : string The variable's name as used within your code. - required : boolean Whether this param is required. - description : string A short sentence or fragment describing this parameter to the end user. - label : string The label to present to users when asking them for the value. - default : string If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool's or false, False, f, n, no, or 0 for false bool's. Cannot be used for parameters that are required or a credential type.
notifications : dict, optional:
- failure_on : boolean If failure email notifications are on - success_email_subject : string Custom subject line for success e-mail. - success_email_body : string Custom body text for success e-mail, written in Markdown. - success_email_addresses : list Addresses to notify by e-mail when the job completes successfully. - stall_warning_minutes : integer Stall warning emails will be sent after this amount of minutes. - failure_email_addresses : list Addresses to notify by e-mail when the job fails. - urls : list URLs to receive a POST request at job completion - success_on : boolean If success email notifications are on
arguments : dict, optional
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
source : string, optional
The body/text of the script.
target_project_id : integer, optional
Target project to which script outputs will be added.
Returns: links : dict:
- runs : string The runs link to get the run information list for this script. - details : string The details link to get more information about the script.
archived : string
The archival status of the requested object(s).
is_template : boolean
Whether others scripts use this one as a template.
required_resources : dict:
- cpu : integer The number of CPU shares to allocate for the container. Each core has 1024 shares. Must be at least 2 shares. - disk_space : number/float The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported. - memory : integer The amount of RAM to allocate for the container (in MiB). Must be at least 4 MiB.
name : string
The name of the script.
last_run : dict:
- finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued.
published_as_template_id : integer
The ID of the template that this script is backing.
type : string
The type of the script (e.g SQL, Container, Python, R, JavaScript)
schedule : dict:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
updated_at : string/time
The time the script was last updated.
from_template_id : integer
The ID of the template this script uses, if any.
source : string
The body/text of the script.
state : string
The status of the script’s last run.
running_as : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
time_zone : string
The time zone of this script.
parent_id : integer
The ID of the parent job that will trigger this script
template_dependents_count : integer
How many other scripts use this one as a template.
template_script_name : string
The name of the template script.
next_run_at : string/time
The time of the next scheduled run.
finished_at : string/time
The time that the script’s last run finished.
hidden : boolean
The hidden status of the object.
user_context : string
“runner” or “author”, who to execute the script as when run as a template.
params : list:
A definition of the parameters this script accepts in the arguments field. - type : string The type of parameter. Valid options: string, integer, float, bool, database, credential_aws, credential_redshift, or credential_custom - name : string The variable's name as used within your code. - required : boolean Whether this param is required. - description : string A short sentence or fragment describing this parameter to the end user. - label : string The label to present to users when asking them for the value. - default : string If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool's or false, False, f, n, no, or 0 for false bool's. Cannot be used for parameters that are required or a credential type.
notifications : dict:
- failure_on : boolean If failure email notifications are on - success_email_subject : string Custom subject line for success e-mail. - success_email_body : string Custom body text for success e-mail, written in Markdown. - success_email_addresses : list Addresses to notify by e-mail when the job completes successfully. - stall_warning_minutes : integer Stall warning emails will be sent after this amount of minutes. - failure_email_addresses : list Addresses to notify by e-mail when the job fails. - urls : list URLs to receive a POST request at job completion - success_on : boolean If success email notifications are on
arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
id : integer
The ID for the script.
created_at : string/time
The time this script was created.
author : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
target_project_id : integer
Target project to which script outputs will be added.
projects : list:
A list of projects containing the script. - id : integer The ID for the project. - name : string The name of the project.
-
patch_sql
(id, **kwargs)¶ Update some attributes of this SQL script
Parameters: id : integer
The ID for the script.
credential_id : integer, optional
The credential that this script will use.
name : string, optional
The name of the script.
parent_id : integer, optional
The ID of the parent job that will trigger this script
time_zone : string, optional
The time zone of this script.
next_run_at : string/time, optional
The time of the next scheduled run.
remote_host_id : integer, optional
The remote host ID that this script will connect to.
user_context : string, optional
“runner” or “author”, who to execute the script as when run as a template.
schedule : dict, optional:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
params : list, optional:
A definition of the parameters this script accepts in the arguments field. - type : string The type of parameter. Valid options: string, integer, float, bool, database, credential_aws, credential_redshift, or credential_custom - name : string The variable's name as used within your code. - required : boolean Whether this param is required. - description : string A short sentence or fragment describing this parameter to the end user. - label : string The label to present to users when asking them for the value. - default : string If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool's or false, False, f, n, no, or 0 for false bool's. Cannot be used for parameters that are required or a credential type.
notifications : dict, optional:
- failure_on : boolean If failure email notifications are on - success_email_subject : string Custom subject line for success e-mail. - success_email_body : string Custom body text for success e-mail, written in Markdown. - success_email_addresses : list Addresses to notify by e-mail when the job completes successfully. - stall_warning_minutes : integer Stall warning emails will be sent after this amount of minutes. - failure_email_addresses : list Addresses to notify by e-mail when the job fails. - urls : list URLs to receive a POST request at job completion - success_on : boolean If success email notifications are on
arguments : dict, optional
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
sql : string, optional
The raw SQL query for the script.
target_project_id : integer, optional
Target project to which script outputs will be added.
Returns: links : dict:
- runs : string The runs link to get the run information list for this script. - details : string The details link to get more information about the script.
archived : string
The archival status of the requested object(s).
is_template : boolean
Whether others scripts use this one as a template.
name : string
The name of the script.
last_run : dict:
- finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued.
published_as_template_id : integer
The ID of the template that this script is backing.
code_preview : string
The code that this script will run with arguments inserted.
credential_id : integer
The credential that this script will use.
type : string
The type of the script (e.g SQL, Container, Python, R, JavaScript)
schedule : dict:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
updated_at : string/time
The time the script was last updated.
from_template_id : integer
The ID of the template this script uses, if any.
sql : string
The raw SQL query for the script.
state : string
The status of the script’s last run.
running_as : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
time_zone : string
The time zone of this script.
parent_id : integer
The ID of the parent job that will trigger this script
template_dependents_count : integer
How many other scripts use this one as a template.
template_script_name : string
The name of the template script.
next_run_at : string/time
The time of the next scheduled run.
expanded_arguments : dict
Expanded arguments for use in injecting into different environments.
finished_at : string/time
The time that the script’s last run finished.
hidden : boolean
The hidden status of the object.
user_context : string
“runner” or “author”, who to execute the script as when run as a template.
remote_host_id : integer
The remote host ID that this script will connect to.
params : list:
A definition of the parameters this script accepts in the arguments field. - type : string The type of parameter. Valid options: string, integer, float, bool, database, credential_aws, credential_redshift, or credential_custom - name : string The variable's name as used within your code. - required : boolean Whether this param is required. - description : string A short sentence or fragment describing this parameter to the end user. - label : string The label to present to users when asking them for the value. - default : string If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool's or false, False, f, n, no, or 0 for false bool's. Cannot be used for parameters that are required or a credential type.
notifications : dict:
- failure_on : boolean If failure email notifications are on - success_email_subject : string Custom subject line for success e-mail. - success_email_body : string Custom body text for success e-mail, written in Markdown. - success_email_addresses : list Addresses to notify by e-mail when the job completes successfully. - stall_warning_minutes : integer Stall warning emails will be sent after this amount of minutes. - failure_email_addresses : list Addresses to notify by e-mail when the job fails. - urls : list URLs to receive a POST request at job completion - success_on : boolean If success email notifications are on
arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
id : integer
The ID for the script.
created_at : string/time
The time this script was created.
author : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
target_project_id : integer
Target project to which script outputs will be added.
projects : list:
A list of projects containing the script. - id : integer The ID for the project. - name : string The name of the project.
-
post
(remote_host_id, credential_id, name, sql, **kwargs)¶ Create a script
Parameters: remote_host_id : integer
The database ID.
credential_id : integer
The credential ID.
name : string
The name of the script.
sql : string
The raw SQL query for the script.
hidden : boolean, optional
The hidden status of the object.
template_script_id : integer, optional
The ID of the template script, if any. A script cannot both have a template script and be a template for other scripts.
params : list, optional:
A definition of the parameters this script accepts in the arguments field. Cannot be set if this script uses a template script. - type : string The type of parameter. Valid options: string, integer, float, bool, database, credential_aws, credential_redshift, or credential_custom - name : string The variable's name as used within your code. - required : boolean Whether this param is required. - description : string A short sentence or fragment describing this parameter to the end user. - label : string The label to present to users when asking them for the value. - default : string If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool's or false, False, f, n, no, or 0 for false bool's. Cannot be used for parameters that are required or a credential type.
notifications : dict, optional:
- failure_on : boolean If failure email notifications are on - success_email_subject : string Custom subject line for success e-mail. - success_email_body : string Custom body text for success e-mail, written in Markdown. - success_email_addresses : list Addresses to notify by e-mail when the job completes successfully. - stall_warning_minutes : integer Stall warning emails will be sent after this amount of minutes. - failure_email_addresses : list Addresses to notify by e-mail when the job fails. - urls : list URLs to receive a POST request at job completion - success_on : boolean If success email notifications are on
arguments : dict, optional
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
Returns: links : dict:
- runs : string The runs link to get the run information list for this script. - details : string The details link to get more information about the script.
archived : string
The archival status of the requested object(s).
is_template : boolean
Whether others scripts use this one as a template.
name : string
The name of the script.
last_run : dict:
- finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued.
published_as_template_id : integer
The ID of the template that this script is backing.
type : string
The type of the script (e.g SQL, Container, Python, R, JavaScript)
schedule : dict:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
updated_at : string/time
The time the script was last updated.
from_template_id : integer
The ID of the template this script uses, if any.
state : string
The status of the script’s last run.
running_as : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
time_zone : string
The time zone of this script.
parent_id : integer
The ID of the parent job that will trigger this script
template_dependents_count : integer
How many other scripts use this one as a template.
template_script_id : integer
The ID of the template script, if any.
template_script_name : string
The name of the template script.
next_run_at : string/time
The time of the next scheduled run.
finished_at : string/time
The time that the script’s last run finished.
hidden : boolean
The hidden status of the object.
user_context : string
“runner” or “author”, who to execute the script as when run as a template.
params : list:
A definition of the parameters this script accepts in the arguments field. - type : string The type of parameter. Valid options: string, integer, float, bool, database, credential_aws, credential_redshift, or credential_custom - name : string The variable's name as used within your code. - required : boolean Whether this param is required. - description : string A short sentence or fragment describing this parameter to the end user. - label : string The label to present to users when asking them for the value. - default : string If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool's or false, False, f, n, no, or 0 for false bool's. Cannot be used for parameters that are required or a credential type.
notifications : dict:
- failure_on : boolean If failure email notifications are on - success_email_subject : string Custom subject line for success e-mail. - success_email_body : string Custom body text for success e-mail, written in Markdown. - success_email_addresses : list Addresses to notify by e-mail when the job completes successfully. - stall_warning_minutes : integer Stall warning emails will be sent after this amount of minutes. - failure_email_addresses : list Addresses to notify by e-mail when the job fails. - urls : list URLs to receive a POST request at job completion - success_on : boolean If success email notifications are on
arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
id : integer
The ID for the script.
created_at : string/time
The time this script was created.
author : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
target_project_id : integer
Target project to which script outputs will be added.
projects : list:
A list of projects containing the script. - id : integer The ID for the project. - name : string The name of the project.
-
post_cancel
(id)¶ Cancel a run
Parameters: id : integer
The ID of the job.
Returns: state : string
The state of the run, one of ‘queued’, ‘running’ or ‘cancelled’.
id : integer
The ID of the run.
is_cancel_requested : boolean
True if run cancel requested, else false.
-
post_containers
(docker_image_name, required_resources, docker_command, **kwargs)¶ Create a container
Parameters: docker_image_name : string
The name of the docker image to pull from DockerHub.
required_resources : dict:
- cpu : integer The number of CPU shares to allocate for the container. Each core has 1024 shares. - disk_space : number/float The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported. - memory : integer The amount of RAM to allocate for the container (in MiB).
docker_command : string
The command to run on the container. Will be run via sh as: [“sh”, “-c”, dockerCommand]
hidden : boolean, optional
The hidden status of the object.
name : string, optional
The name of the container.
parent_id : integer, optional
The ID of the parent job that will trigger this script
repo_ref : string, optional
The tag or branch of the github repo to clone into the container.
remote_host_credential_id : integer, optional
The id of the database credentials to pass into the environment of the container.
repo_http_uri : string, optional
The location of a github repo to clone into the container, e.g. github.com/my-user/my-repo.git.
user_context : string, optional
“runner” or “author”, who to execute the script as when run as a template.
schedule : dict, optional:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
git_credential_id : integer, optional
The id of the git credential to be used when checking out the specified git repo. If not supplied, the first git credential you’ve submitted will be used. Unnecessary if no git repo is specified or the git repo is public.
docker_image_tag : string, optional
The tag of the docker image to pull from DockerHub (default: latest).
params : list, optional:
A definition of the parameters this script accepts in the arguments field. - type : string The type of parameter. Valid options: string, integer, float, bool, database, credential_aws, credential_redshift, or credential_custom - name : string The variable's name as used within your code. - required : boolean Whether this param is required. - description : string A short sentence or fragment describing this parameter to the end user. - label : string The label to present to users when asking them for the value. - default : string If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool's or false, False, f, n, no, or 0 for false bool's. Cannot be used for parameters that are required or a credential type.
notifications : dict, optional:
- failure_on : boolean If failure email notifications are on - success_email_subject : string Custom subject line for success e-mail. - success_email_body : string Custom body text for success e-mail, written in Markdown. - success_email_addresses : list Addresses to notify by e-mail when the job completes successfully. - stall_warning_minutes : integer Stall warning emails will be sent after this amount of minutes. - failure_email_addresses : list Addresses to notify by e-mail when the job fails. - urls : list URLs to receive a POST request at job completion - success_on : boolean If success email notifications are on
arguments : dict, optional
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
target_project_id : integer, optional
Target project to which script outputs will be added.
Returns: links : dict:
- runs : string The runs link to get the run information list for this script. - details : string The details link to get more information about the script.
repo_ref : string
The tag or branch of the github repo to clone into the container.
is_template : boolean
Whether others scripts use this one as a template.
required_resources : dict:
- cpu : integer The number of CPU shares to allocate for the container. Each core has 1024 shares. - disk_space : number/float The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported. - memory : integer The amount of RAM to allocate for the container (in MiB).
name : string
The name of the container.
last_run : dict:
- finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued.
published_as_template_id : integer
The ID of the template that this script is backing.
remote_host_credential_id : integer
The id of the database credentials to pass into the environment of the container.
docker_command : string
The command to run on the container. Will be run via sh as: [“sh”, “-c”, dockerCommand]
type : string
The type of the script (e.g Container)
schedule : dict:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
git_credential_id : integer
The id of the git credential to be used when checking out the specified git repo. If not supplied, the first git credential you’ve submitted will be used. Unnecessary if no git repo is specified or the git repo is public.
docker_image_tag : string
The tag of the docker image to pull from DockerHub (default: latest).
updated_at : string/time
The time the script was last updated.
from_template_id : integer
The ID of the template script.
state : string
The status of the script’s last run.
docker_image_name : string
The name of the docker image to pull from DockerHub.
running_as : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
parent_id : integer
The ID of the parent job that will trigger this script
template_dependents_count : integer
How many other scripts use this one as a template.
template_script_name : string
The name of the template script.
finished_at : string/time
The time that the script’s last run finished.
hidden : boolean
The hidden status of the object.
user_context : string
“runner” or “author”, who to execute the script as when run as a template.
repo_http_uri : string
The location of a github repo to clone into the container, e.g. github.com/my-user/my-repo.git.
archived : string
The archival status of the requested object(s).
params : list:
A definition of the parameters this script accepts in the arguments field. - type : string The type of parameter. Valid options: string, integer, float, bool, database, credential_aws, credential_redshift, or credential_custom - name : string The variable's name as used within your code. - required : boolean Whether this param is required. - description : string A short sentence or fragment describing this parameter to the end user. - label : string The label to present to users when asking them for the value. - default : string If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool's or false, False, f, n, no, or 0 for false bool's. Cannot be used for parameters that are required or a credential type.
notifications : dict:
- failure_on : boolean If failure email notifications are on - success_email_subject : string Custom subject line for success e-mail. - success_email_body : string Custom body text for success e-mail, written in Markdown. - success_email_addresses : list Addresses to notify by e-mail when the job completes successfully. - stall_warning_minutes : integer Stall warning emails will be sent after this amount of minutes. - failure_email_addresses : list Addresses to notify by e-mail when the job fails. - urls : list URLs to receive a POST request at job completion - success_on : boolean If success email notifications are on
arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
id : integer
The ID for the script.
created_at : string/time
The time this script was created.
author : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
target_project_id : integer
Target project to which script outputs will be added.
projects : list:
A list of projects containing the script. - id : integer The ID for the project. - name : string The name of the project.
-
post_containers_runs
(id)¶ Start a run
Parameters: id : integer
The ID of the container.
Returns: finished_at : string/time
The time the last run completed.
container_id : integer
The ID of the container.
started_at : string/time
The time the last run started at.
is_cancel_requested : boolean
True if run cancel requested, else false.
error : string
The error, if any, returned by the run.
state : string
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
id : integer
The ID of the run.
-
post_custom
(from_template_id, **kwargs)¶ Create a CustomScript
Parameters: from_template_id : integer
The ID of the template script.
hidden : boolean, optional
The hidden status of the object.
remote_host_id : integer, optional
The remote host ID that this script will connect to.
schedule : dict, optional:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
credential_id : integer, optional
The credential that this script will use.
parent_id : integer, optional
The ID of the parent job that will trigger this script
arguments : dict, optional
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
name : string, optional
The name of the script.
target_project_id : integer, optional
Target project to which script outputs will be added.
notifications : dict, optional:
- failure_on : boolean If failure email notifications are on - success_email_subject : string Custom subject line for success e-mail. - success_email_body : string Custom body text for success e-mail, written in Markdown. - success_email_addresses : list Addresses to notify by e-mail when the job completes successfully. - stall_warning_minutes : integer Stall warning emails will be sent after this amount of minutes. - failure_email_addresses : list Addresses to notify by e-mail when the job fails. - urls : list URLs to receive a POST request at job completion - success_on : boolean If success email notifications are on
Returns: params : list:
A definition of the parameters this script accepts in the arguments field. - type : string The type of parameter. Valid options: string, integer, float, bool, database, credential_aws, credential_redshift, or credential_custom - name : string The variable's name as used within your code. - required : boolean Whether this param is required. - description : string A short sentence or fragment describing this parameter to the end user. - label : string The label to present to users when asking them for the value. - default : string If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool's or false, False, f, n, no, or 0 for false bool's. Cannot be used for parameters that are required or a credential type.
name : string
The name of the script.
last_run : dict:
- finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued.
archived : string
The archival status of the requested object(s).
template_script_name : string
The name of the template script.
type : string
The type of the script (e.g Custom)
schedule : dict:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
updated_at : string/time
The time the script was last updated.
from_template_id : integer
The ID of the template script.
state : string
The status of the script’s last run.
finished_at : string/time
The time that the script’s last run finished.
hidden : boolean
The hidden status of the object.
parent_id : integer
The ID of the parent job that will trigger this script
code_preview : string
The code that this script will run with arguments inserted.
running_as : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
remote_host_id : integer
The remote host ID that this script will connect to.
credential_id : integer
The credential that this script will use.
notifications : dict:
- failure_on : boolean If failure email notifications are on - success_email_subject : string Custom subject line for success e-mail. - success_email_body : string Custom body text for success e-mail, written in Markdown. - success_email_addresses : list Addresses to notify by e-mail when the job completes successfully. - stall_warning_minutes : integer Stall warning emails will be sent after this amount of minutes. - failure_email_addresses : list Addresses to notify by e-mail when the job fails. - urls : list URLs to receive a POST request at job completion - success_on : boolean If success email notifications are on
arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
id : integer
The ID for the script.
created_at : string/time
The time this script was created.
author : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
target_project_id : integer
Target project to which script outputs will be added.
projects : list:
A list of projects containing the script. - id : integer The ID for the project. - name : string The name of the project.
-
post_custom_runs
(id)¶ Start a run
Parameters: id : integer
The ID of the custom.
Returns: finished_at : string/time
The time the last run completed.
started_at : string/time
The time the last run started at.
is_cancel_requested : boolean
True if run cancel requested, else false.
error : string
The error, if any, returned by the run.
custom_id : integer
The ID of the custom.
state : string
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
id : integer
The ID of the run.
-
post_javascript
(credential_id, name, remote_host_id, source, **kwargs)¶ Create a JavaScript Script
Parameters: credential_id : integer
The credential that this script will use.
name : string
The name of the script.
remote_host_id : integer
The remote host ID that this script will connect to.
source : string
The body/text of the script.
hidden : boolean, optional
The hidden status of the object.
time_zone : string, optional
The time zone of this script.
next_run_at : string/time, optional
The time of the next scheduled run.
parent_id : integer, optional
The ID of the parent job that will trigger this script
user_context : string, optional
“runner” or “author”, who to execute the script as when run as a template.
schedule : dict, optional:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
params : list, optional:
A definition of the parameters this script accepts in the arguments field. - type : string The type of parameter. Valid options: string, integer, float, bool, database, credential_aws, credential_redshift, or credential_custom - name : string The variable's name as used within your code. - required : boolean Whether this param is required. - description : string A short sentence or fragment describing this parameter to the end user. - label : string The label to present to users when asking them for the value. - default : string If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool's or false, False, f, n, no, or 0 for false bool's. Cannot be used for parameters that are required or a credential type.
notifications : dict, optional:
- failure_on : boolean If failure email notifications are on - success_email_subject : string Custom subject line for success e-mail. - success_email_body : string Custom body text for success e-mail, written in Markdown. - success_email_addresses : list Addresses to notify by e-mail when the job completes successfully. - stall_warning_minutes : integer Stall warning emails will be sent after this amount of minutes. - failure_email_addresses : list Addresses to notify by e-mail when the job fails. - urls : list URLs to receive a POST request at job completion - success_on : boolean If success email notifications are on
arguments : dict, optional
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
target_project_id : integer, optional
Target project to which script outputs will be added.
Returns: links : dict:
- runs : string The runs link to get the run information list for this script. - details : string The details link to get more information about the script.
archived : string
The archival status of the requested object(s).
is_template : boolean
Whether others scripts use this one as a template.
name : string
The name of the script.
last_run : dict:
- finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued.
published_as_template_id : integer
The ID of the template that this script is backing.
credential_id : integer
The credential that this script will use.
type : string
The type of the script (e.g SQL, Container, Python, R, JavaScript)
schedule : dict:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
updated_at : string/time
The time the script was last updated.
from_template_id : integer
The ID of the template this script uses, if any.
source : string
The body/text of the script.
state : string
The status of the script’s last run.
running_as : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
time_zone : string
The time zone of this script.
parent_id : integer
The ID of the parent job that will trigger this script
template_dependents_count : integer
How many other scripts use this one as a template.
template_script_name : string
The name of the template script.
next_run_at : string/time
The time of the next scheduled run.
finished_at : string/time
The time that the script’s last run finished.
hidden : boolean
The hidden status of the object.
user_context : string
“runner” or “author”, who to execute the script as when run as a template.
remote_host_id : integer
The remote host ID that this script will connect to.
params : list:
A definition of the parameters this script accepts in the arguments field. - type : string The type of parameter. Valid options: string, integer, float, bool, database, credential_aws, credential_redshift, or credential_custom - name : string The variable's name as used within your code. - required : boolean Whether this param is required. - description : string A short sentence or fragment describing this parameter to the end user. - label : string The label to present to users when asking them for the value. - default : string If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool's or false, False, f, n, no, or 0 for false bool's. Cannot be used for parameters that are required or a credential type.
notifications : dict:
- failure_on : boolean If failure email notifications are on - success_email_subject : string Custom subject line for success e-mail. - success_email_body : string Custom body text for success e-mail, written in Markdown. - success_email_addresses : list Addresses to notify by e-mail when the job completes successfully. - stall_warning_minutes : integer Stall warning emails will be sent after this amount of minutes. - failure_email_addresses : list Addresses to notify by e-mail when the job fails. - urls : list URLs to receive a POST request at job completion - success_on : boolean If success email notifications are on
arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
id : integer
The ID for the script.
created_at : string/time
The time this script was created.
author : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
target_project_id : integer
Target project to which script outputs will be added.
projects : list:
A list of projects containing the script. - id : integer The ID for the project. - name : string The name of the project.
-
post_javascript_runs
(id)¶ Start a run
Parameters: id : integer
The ID of the javascript.
Returns: finished_at : string/time
The time the last run completed.
started_at : string/time
The time the last run started at.
javascript_id : integer
The ID of the javascript.
is_cancel_requested : boolean
True if run cancel requested, else false.
error : string
The error, if any, returned by the run.
state : string
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
id : integer
The ID of the run.
-
post_python3
(name, source, **kwargs)¶ Create a Python Script
Parameters: name : string
The name of the script.
source : string
The body/text of the script.
required_resources : dict, optional:
- cpu : integer The number of CPU shares to allocate for the container. Each core has 1024 shares. Must be at least 2 shares. - disk_space : number/float The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported. - memory : integer The amount of RAM to allocate for the container (in MiB). Must be at least 4 MiB.
hidden : boolean, optional
The hidden status of the object.
time_zone : string, optional
The time zone of this script.
next_run_at : string/time, optional
The time of the next scheduled run.
parent_id : integer, optional
The ID of the parent job that will trigger this script
user_context : string, optional
“runner” or “author”, who to execute the script as when run as a template.
schedule : dict, optional:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
params : list, optional:
A definition of the parameters this script accepts in the arguments field. - type : string The type of parameter. Valid options: string, integer, float, bool, database, credential_aws, credential_redshift, or credential_custom - name : string The variable's name as used within your code. - required : boolean Whether this param is required. - description : string A short sentence or fragment describing this parameter to the end user. - label : string The label to present to users when asking them for the value. - default : string If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool's or false, False, f, n, no, or 0 for false bool's. Cannot be used for parameters that are required or a credential type.
notifications : dict, optional:
- failure_on : boolean If failure email notifications are on - success_email_subject : string Custom subject line for success e-mail. - success_email_body : string Custom body text for success e-mail, written in Markdown. - success_email_addresses : list Addresses to notify by e-mail when the job completes successfully. - stall_warning_minutes : integer Stall warning emails will be sent after this amount of minutes. - failure_email_addresses : list Addresses to notify by e-mail when the job fails. - urls : list URLs to receive a POST request at job completion - success_on : boolean If success email notifications are on
arguments : dict, optional
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
target_project_id : integer, optional
Target project to which script outputs will be added.
Returns: links : dict:
- runs : string The runs link to get the run information list for this script. - details : string The details link to get more information about the script.
archived : string
The archival status of the requested object(s).
is_template : boolean
Whether others scripts use this one as a template.
required_resources : dict:
- cpu : integer The number of CPU shares to allocate for the container. Each core has 1024 shares. Must be at least 2 shares. - disk_space : number/float The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported. - memory : integer The amount of RAM to allocate for the container (in MiB). Must be at least 4 MiB.
name : string
The name of the script.
last_run : dict:
- finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued.
published_as_template_id : integer
The ID of the template that this script is backing.
type : string
The type of the script (e.g SQL, Container, Python, R, JavaScript)
schedule : dict:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
updated_at : string/time
The time the script was last updated.
from_template_id : integer
The ID of the template this script uses, if any.
source : string
The body/text of the script.
state : string
The status of the script’s last run.
running_as : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
time_zone : string
The time zone of this script.
parent_id : integer
The ID of the parent job that will trigger this script
template_dependents_count : integer
How many other scripts use this one as a template.
template_script_name : string
The name of the template script.
next_run_at : string/time
The time of the next scheduled run.
finished_at : string/time
The time that the script’s last run finished.
hidden : boolean
The hidden status of the object.
user_context : string
“runner” or “author”, who to execute the script as when run as a template.
params : list:
A definition of the parameters this script accepts in the arguments field. - type : string The type of parameter. Valid options: string, integer, float, bool, database, credential_aws, credential_redshift, or credential_custom - name : string The variable's name as used within your code. - required : boolean Whether this param is required. - description : string A short sentence or fragment describing this parameter to the end user. - label : string The label to present to users when asking them for the value. - default : string If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool's or false, False, f, n, no, or 0 for false bool's. Cannot be used for parameters that are required or a credential type.
notifications : dict:
- failure_on : boolean If failure email notifications are on - success_email_subject : string Custom subject line for success e-mail. - success_email_body : string Custom body text for success e-mail, written in Markdown. - success_email_addresses : list Addresses to notify by e-mail when the job completes successfully. - stall_warning_minutes : integer Stall warning emails will be sent after this amount of minutes. - failure_email_addresses : list Addresses to notify by e-mail when the job fails. - urls : list URLs to receive a POST request at job completion - success_on : boolean If success email notifications are on
arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
id : integer
The ID for the script.
created_at : string/time
The time this script was created.
author : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
target_project_id : integer
Target project to which script outputs will be added.
projects : list:
A list of projects containing the script. - id : integer The ID for the project. - name : string The name of the project.
-
post_python3_runs
(id)¶ Start a run
Parameters: id : integer
The ID of the python.
Returns: finished_at : string/time
The time the last run completed.
python_id : integer
The ID of the python.
started_at : string/time
The time the last run started at.
is_cancel_requested : boolean
True if run cancel requested, else false.
error : string
The error, if any, returned by the run.
state : string
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
id : integer
The ID of the run.
-
post_r
(name, source, **kwargs)¶ Create an R Script
Parameters: name : string
The name of the script.
source : string
The body/text of the script.
required_resources : dict, optional:
- cpu : integer The number of CPU shares to allocate for the container. Each core has 1024 shares. Must be at least 2 shares. - disk_space : number/float The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported. - memory : integer The amount of RAM to allocate for the container (in MiB). Must be at least 4 MiB.
hidden : boolean, optional
The hidden status of the object.
time_zone : string, optional
The time zone of this script.
next_run_at : string/time, optional
The time of the next scheduled run.
parent_id : integer, optional
The ID of the parent job that will trigger this script
user_context : string, optional
“runner” or “author”, who to execute the script as when run as a template.
schedule : dict, optional:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
params : list, optional:
A definition of the parameters this script accepts in the arguments field. - type : string The type of parameter. Valid options: string, integer, float, bool, database, credential_aws, credential_redshift, or credential_custom - name : string The variable's name as used within your code. - required : boolean Whether this param is required. - description : string A short sentence or fragment describing this parameter to the end user. - label : string The label to present to users when asking them for the value. - default : string If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool's or false, False, f, n, no, or 0 for false bool's. Cannot be used for parameters that are required or a credential type.
notifications : dict, optional:
- failure_on : boolean If failure email notifications are on - success_email_subject : string Custom subject line for success e-mail. - success_email_body : string Custom body text for success e-mail, written in Markdown. - success_email_addresses : list Addresses to notify by e-mail when the job completes successfully. - stall_warning_minutes : integer Stall warning emails will be sent after this amount of minutes. - failure_email_addresses : list Addresses to notify by e-mail when the job fails. - urls : list URLs to receive a POST request at job completion - success_on : boolean If success email notifications are on
arguments : dict, optional
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
target_project_id : integer, optional
Target project to which script outputs will be added.
Returns: links : dict:
- runs : string The runs link to get the run information list for this script. - details : string The details link to get more information about the script.
archived : string
The archival status of the requested object(s).
is_template : boolean
Whether others scripts use this one as a template.
required_resources : dict:
- cpu : integer The number of CPU shares to allocate for the container. Each core has 1024 shares. Must be at least 2 shares. - disk_space : number/float The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported. - memory : integer The amount of RAM to allocate for the container (in MiB). Must be at least 4 MiB.
name : string
The name of the script.
last_run : dict:
- finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued.
published_as_template_id : integer
The ID of the template that this script is backing.
type : string
The type of the script (e.g SQL, Container, Python, R, JavaScript)
schedule : dict:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
updated_at : string/time
The time the script was last updated.
from_template_id : integer
The ID of the template this script uses, if any.
source : string
The body/text of the script.
state : string
The status of the script’s last run.
running_as : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
time_zone : string
The time zone of this script.
parent_id : integer
The ID of the parent job that will trigger this script
template_dependents_count : integer
How many other scripts use this one as a template.
template_script_name : string
The name of the template script.
next_run_at : string/time
The time of the next scheduled run.
finished_at : string/time
The time that the script’s last run finished.
hidden : boolean
The hidden status of the object.
user_context : string
“runner” or “author”, who to execute the script as when run as a template.
params : list:
A definition of the parameters this script accepts in the arguments field. - type : string The type of parameter. Valid options: string, integer, float, bool, database, credential_aws, credential_redshift, or credential_custom - name : string The variable's name as used within your code. - required : boolean Whether this param is required. - description : string A short sentence or fragment describing this parameter to the end user. - label : string The label to present to users when asking them for the value. - default : string If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool's or false, False, f, n, no, or 0 for false bool's. Cannot be used for parameters that are required or a credential type.
notifications : dict:
- failure_on : boolean If failure email notifications are on - success_email_subject : string Custom subject line for success e-mail. - success_email_body : string Custom body text for success e-mail, written in Markdown. - success_email_addresses : list Addresses to notify by e-mail when the job completes successfully. - stall_warning_minutes : integer Stall warning emails will be sent after this amount of minutes. - failure_email_addresses : list Addresses to notify by e-mail when the job fails. - urls : list URLs to receive a POST request at job completion - success_on : boolean If success email notifications are on
arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
id : integer
The ID for the script.
created_at : string/time
The time this script was created.
author : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
target_project_id : integer
Target project to which script outputs will be added.
projects : list:
A list of projects containing the script. - id : integer The ID for the project. - name : string The name of the project.
-
post_r_runs
(id)¶ Start a run
Parameters: id : integer
The ID of the r.
Returns: finished_at : string/time
The time the last run completed.
r_id : integer
The ID of the r.
is_cancel_requested : boolean
True if run cancel requested, else false.
error : string
The error, if any, returned by the run.
state : string
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
id : integer
The ID of the run.
started_at : string/time
The time the last run started at.
-
post_run
(id)¶ Run a script
Parameters: id : integer
The ID for the script.
Returns: None
Response code 204: success
-
post_sql
(credential_id, name, remote_host_id, sql, **kwargs)¶ Create a SQL script
Parameters: credential_id : integer
The credential that this script will use.
name : string
The name of the script.
remote_host_id : integer
The remote host ID that this script will connect to.
sql : string
The raw SQL query for the script.
hidden : boolean, optional
The hidden status of the object.
time_zone : string, optional
The time zone of this script.
next_run_at : string/time, optional
The time of the next scheduled run.
parent_id : integer, optional
The ID of the parent job that will trigger this script
user_context : string, optional
“runner” or “author”, who to execute the script as when run as a template.
schedule : dict, optional:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
params : list, optional:
A definition of the parameters this script accepts in the arguments field. - type : string The type of parameter. Valid options: string, integer, float, bool, database, credential_aws, credential_redshift, or credential_custom - name : string The variable's name as used within your code. - required : boolean Whether this param is required. - description : string A short sentence or fragment describing this parameter to the end user. - label : string The label to present to users when asking them for the value. - default : string If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool's or false, False, f, n, no, or 0 for false bool's. Cannot be used for parameters that are required or a credential type.
notifications : dict, optional:
- failure_on : boolean If failure email notifications are on - success_email_subject : string Custom subject line for success e-mail. - success_email_body : string Custom body text for success e-mail, written in Markdown. - success_email_addresses : list Addresses to notify by e-mail when the job completes successfully. - stall_warning_minutes : integer Stall warning emails will be sent after this amount of minutes. - failure_email_addresses : list Addresses to notify by e-mail when the job fails. - urls : list URLs to receive a POST request at job completion - success_on : boolean If success email notifications are on
arguments : dict, optional
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
target_project_id : integer, optional
Target project to which script outputs will be added.
Returns: links : dict:
- runs : string The runs link to get the run information list for this script. - details : string The details link to get more information about the script.
archived : string
The archival status of the requested object(s).
is_template : boolean
Whether others scripts use this one as a template.
name : string
The name of the script.
last_run : dict:
- finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued.
published_as_template_id : integer
The ID of the template that this script is backing.
code_preview : string
The code that this script will run with arguments inserted.
credential_id : integer
The credential that this script will use.
type : string
The type of the script (e.g SQL, Container, Python, R, JavaScript)
schedule : dict:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
updated_at : string/time
The time the script was last updated.
from_template_id : integer
The ID of the template this script uses, if any.
sql : string
The raw SQL query for the script.
state : string
The status of the script’s last run.
running_as : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
time_zone : string
The time zone of this script.
parent_id : integer
The ID of the parent job that will trigger this script
template_dependents_count : integer
How many other scripts use this one as a template.
template_script_name : string
The name of the template script.
next_run_at : string/time
The time of the next scheduled run.
expanded_arguments : dict
Expanded arguments for use in injecting into different environments.
finished_at : string/time
The time that the script’s last run finished.
hidden : boolean
The hidden status of the object.
user_context : string
“runner” or “author”, who to execute the script as when run as a template.
remote_host_id : integer
The remote host ID that this script will connect to.
params : list:
A definition of the parameters this script accepts in the arguments field. - type : string The type of parameter. Valid options: string, integer, float, bool, database, credential_aws, credential_redshift, or credential_custom - name : string The variable's name as used within your code. - required : boolean Whether this param is required. - description : string A short sentence or fragment describing this parameter to the end user. - label : string The label to present to users when asking them for the value. - default : string If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool's or false, False, f, n, no, or 0 for false bool's. Cannot be used for parameters that are required or a credential type.
notifications : dict:
- failure_on : boolean If failure email notifications are on - success_email_subject : string Custom subject line for success e-mail. - success_email_body : string Custom body text for success e-mail, written in Markdown. - success_email_addresses : list Addresses to notify by e-mail when the job completes successfully. - stall_warning_minutes : integer Stall warning emails will be sent after this amount of minutes. - failure_email_addresses : list Addresses to notify by e-mail when the job fails. - urls : list URLs to receive a POST request at job completion - success_on : boolean If success email notifications are on
arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
id : integer
The ID for the script.
created_at : string/time
The time this script was created.
author : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
target_project_id : integer
Target project to which script outputs will be added.
projects : list:
A list of projects containing the script. - id : integer The ID for the project. - name : string The name of the project.
-
post_sql_runs
(id)¶ Start a run
Parameters: id : integer
The ID of the sql.
Returns: finished_at : string/time
The time that this run finished.
started_at : string/time
The time the last run started.
is_cancel_requested : boolean
True if run cancel requested, else false.
error : string
The error message for this run, if present.
state : string
The state of this run.
id : integer
The ID of this run.
output : list:
A list of the outputs of this script. - output_name : string The name of the output file. - path : string The temporary link to download this output file, valid for 36 hours.
sql_id : integer
The ID of this sql.
-
put_containers
(id, docker_image_name, required_resources, docker_command, **kwargs)¶ Edit a container
Parameters: id : integer
The ID for the script.
docker_image_name : string
The name of the docker image to pull from DockerHub.
required_resources : dict:
- cpu : integer The number of CPU shares to allocate for the container. Each core has 1024 shares. - disk_space : number/float The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported. - memory : integer The amount of RAM to allocate for the container (in MiB).
docker_command : string
The command to run on the container. Will be run via sh as: [“sh”, “-c”, dockerCommand]
name : string, optional
The name of the container.
parent_id : integer, optional
The ID of the parent job that will trigger this script
repo_ref : string, optional
The tag or branch of the github repo to clone into the container.
remote_host_credential_id : integer, optional
The id of the database credentials to pass into the environment of the container.
repo_http_uri : string, optional
The location of a github repo to clone into the container, e.g. github.com/my-user/my-repo.git.
user_context : string, optional
“runner” or “author”, who to execute the script as when run as a template.
schedule : dict, optional:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
git_credential_id : integer, optional
The id of the git credential to be used when checking out the specified git repo. If not supplied, the first git credential you’ve submitted will be used. Unnecessary if no git repo is specified or the git repo is public.
docker_image_tag : string, optional
The tag of the docker image to pull from DockerHub (default: latest).
params : list, optional:
A definition of the parameters this script accepts in the arguments field. - type : string The type of parameter. Valid options: string, integer, float, bool, database, credential_aws, credential_redshift, or credential_custom - name : string The variable's name as used within your code. - required : boolean Whether this param is required. - description : string A short sentence or fragment describing this parameter to the end user. - label : string The label to present to users when asking them for the value. - default : string If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool's or false, False, f, n, no, or 0 for false bool's. Cannot be used for parameters that are required or a credential type.
notifications : dict, optional:
- failure_on : boolean If failure email notifications are on - success_email_subject : string Custom subject line for success e-mail. - success_email_body : string Custom body text for success e-mail, written in Markdown. - success_email_addresses : list Addresses to notify by e-mail when the job completes successfully. - stall_warning_minutes : integer Stall warning emails will be sent after this amount of minutes. - failure_email_addresses : list Addresses to notify by e-mail when the job fails. - urls : list URLs to receive a POST request at job completion - success_on : boolean If success email notifications are on
arguments : dict, optional
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
target_project_id : integer, optional
Target project to which script outputs will be added.
Returns: links : dict:
- runs : string The runs link to get the run information list for this script. - details : string The details link to get more information about the script.
repo_ref : string
The tag or branch of the github repo to clone into the container.
is_template : boolean
Whether others scripts use this one as a template.
required_resources : dict:
- cpu : integer The number of CPU shares to allocate for the container. Each core has 1024 shares. - disk_space : number/float The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported. - memory : integer The amount of RAM to allocate for the container (in MiB).
name : string
The name of the container.
last_run : dict:
- finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued.
published_as_template_id : integer
The ID of the template that this script is backing.
remote_host_credential_id : integer
The id of the database credentials to pass into the environment of the container.
docker_command : string
The command to run on the container. Will be run via sh as: [“sh”, “-c”, dockerCommand]
type : string
The type of the script (e.g Container)
schedule : dict:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
git_credential_id : integer
The id of the git credential to be used when checking out the specified git repo. If not supplied, the first git credential you’ve submitted will be used. Unnecessary if no git repo is specified or the git repo is public.
docker_image_tag : string
The tag of the docker image to pull from DockerHub (default: latest).
updated_at : string/time
The time the script was last updated.
from_template_id : integer
The ID of the template script.
state : string
The status of the script’s last run.
docker_image_name : string
The name of the docker image to pull from DockerHub.
running_as : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
parent_id : integer
The ID of the parent job that will trigger this script
template_dependents_count : integer
How many other scripts use this one as a template.
template_script_name : string
The name of the template script.
finished_at : string/time
The time that the script’s last run finished.
hidden : boolean
The hidden status of the object.
user_context : string
“runner” or “author”, who to execute the script as when run as a template.
repo_http_uri : string
The location of a github repo to clone into the container, e.g. github.com/my-user/my-repo.git.
archived : string
The archival status of the requested object(s).
params : list:
A definition of the parameters this script accepts in the arguments field. - type : string The type of parameter. Valid options: string, integer, float, bool, database, credential_aws, credential_redshift, or credential_custom - name : string The variable's name as used within your code. - required : boolean Whether this param is required. - description : string A short sentence or fragment describing this parameter to the end user. - label : string The label to present to users when asking them for the value. - default : string If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool's or false, False, f, n, no, or 0 for false bool's. Cannot be used for parameters that are required or a credential type.
notifications : dict:
- failure_on : boolean If failure email notifications are on - success_email_subject : string Custom subject line for success e-mail. - success_email_body : string Custom body text for success e-mail, written in Markdown. - success_email_addresses : list Addresses to notify by e-mail when the job completes successfully. - stall_warning_minutes : integer Stall warning emails will be sent after this amount of minutes. - failure_email_addresses : list Addresses to notify by e-mail when the job fails. - urls : list URLs to receive a POST request at job completion - success_on : boolean If success email notifications are on
arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
id : integer
The ID for the script.
created_at : string/time
The time this script was created.
author : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
target_project_id : integer
Target project to which script outputs will be added.
projects : list:
A list of projects containing the script. - id : integer The ID for the project. - name : string The name of the project.
-
put_containers_archive
(id, status)¶ Update the archive status of this object
Parameters: id : integer
The ID of the object.
status : boolean
The desired archived status of the object.
Returns: links : dict:
- runs : string The runs link to get the run information list for this script. - details : string The details link to get more information about the script.
repo_ref : string
The tag or branch of the github repo to clone into the container.
is_template : boolean
Whether others scripts use this one as a template.
required_resources : dict:
- cpu : integer The number of CPU shares to allocate for the container. Each core has 1024 shares. - disk_space : number/float The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported. - memory : integer The amount of RAM to allocate for the container (in MiB).
name : string
The name of the container.
last_run : dict:
- finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued.
published_as_template_id : integer
The ID of the template that this script is backing.
remote_host_credential_id : integer
The id of the database credentials to pass into the environment of the container.
docker_command : string
The command to run on the container. Will be run via sh as: [“sh”, “-c”, dockerCommand]
type : string
The type of the script (e.g Container)
schedule : dict:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
git_credential_id : integer
The id of the git credential to be used when checking out the specified git repo. If not supplied, the first git credential you’ve submitted will be used. Unnecessary if no git repo is specified or the git repo is public.
docker_image_tag : string
The tag of the docker image to pull from DockerHub (default: latest).
updated_at : string/time
The time the script was last updated.
from_template_id : integer
The ID of the template script.
state : string
The status of the script’s last run.
docker_image_name : string
The name of the docker image to pull from DockerHub.
running_as : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
parent_id : integer
The ID of the parent job that will trigger this script
template_dependents_count : integer
How many other scripts use this one as a template.
template_script_name : string
The name of the template script.
finished_at : string/time
The time that the script’s last run finished.
hidden : boolean
The hidden status of the object.
user_context : string
“runner” or “author”, who to execute the script as when run as a template.
repo_http_uri : string
The location of a github repo to clone into the container, e.g. github.com/my-user/my-repo.git.
archived : string
The archival status of the requested object(s).
params : list:
A definition of the parameters this script accepts in the arguments field. - type : string The type of parameter. Valid options: string, integer, float, bool, database, credential_aws, credential_redshift, or credential_custom - name : string The variable's name as used within your code. - required : boolean Whether this param is required. - description : string A short sentence or fragment describing this parameter to the end user. - label : string The label to present to users when asking them for the value. - default : string If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool's or false, False, f, n, no, or 0 for false bool's. Cannot be used for parameters that are required or a credential type.
notifications : dict:
- failure_on : boolean If failure email notifications are on - success_email_subject : string Custom subject line for success e-mail. - success_email_body : string Custom body text for success e-mail, written in Markdown. - success_email_addresses : list Addresses to notify by e-mail when the job completes successfully. - stall_warning_minutes : integer Stall warning emails will be sent after this amount of minutes. - failure_email_addresses : list Addresses to notify by e-mail when the job fails. - urls : list URLs to receive a POST request at job completion - success_on : boolean If success email notifications are on
arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
id : integer
The ID for the script.
created_at : string/time
The time this script was created.
author : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
target_project_id : integer
Target project to which script outputs will be added.
projects : list:
A list of projects containing the script. - id : integer The ID for the project. - name : string The name of the project.
-
put_containers_projects
(id, project_id)¶ Add a container docker to a project
Parameters: id : integer
ID of the resource
project_id : integer
The ID of the project
Returns: None
Response code 204: success
Set the permissions groups has on this object
Parameters: id : integer
ID of the resource to be shared
permission_level : string
Options are: “read”, “write”, or “manage”
group_ids : list
An array of one or more group IDs
Returns: readers : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
owners : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
writers : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
Set the permissions users have on this object
Parameters: id : integer
ID of the resource to be shared
permission_level : string
Options are: “read”, “write”, or “manage”
user_ids : list
An array of one or more user IDs
Returns: readers : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
owners : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
writers : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
-
put_custom
(id, **kwargs)¶ Replace all attributes of this CustomScript
Parameters: id : integer
The ID for the script.
remote_host_id : integer, optional
The remote host ID that this script will connect to.
schedule : dict, optional:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
credential_id : integer, optional
The credential that this script will use.
name : string, optional
The name of the script.
parent_id : integer, optional
The ID of the parent job that will trigger this script
arguments : dict, optional
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
target_project_id : integer, optional
Target project to which script outputs will be added.
notifications : dict, optional:
- failure_on : boolean If failure email notifications are on - success_email_subject : string Custom subject line for success e-mail. - success_email_body : string Custom body text for success e-mail, written in Markdown. - success_email_addresses : list Addresses to notify by e-mail when the job completes successfully. - stall_warning_minutes : integer Stall warning emails will be sent after this amount of minutes. - failure_email_addresses : list Addresses to notify by e-mail when the job fails. - urls : list URLs to receive a POST request at job completion - success_on : boolean If success email notifications are on
Returns: params : list:
A definition of the parameters this script accepts in the arguments field. - type : string The type of parameter. Valid options: string, integer, float, bool, database, credential_aws, credential_redshift, or credential_custom - name : string The variable's name as used within your code. - required : boolean Whether this param is required. - description : string A short sentence or fragment describing this parameter to the end user. - label : string The label to present to users when asking them for the value. - default : string If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool's or false, False, f, n, no, or 0 for false bool's. Cannot be used for parameters that are required or a credential type.
name : string
The name of the script.
last_run : dict:
- finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued.
archived : string
The archival status of the requested object(s).
template_script_name : string
The name of the template script.
type : string
The type of the script (e.g Custom)
schedule : dict:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
updated_at : string/time
The time the script was last updated.
from_template_id : integer
The ID of the template script.
state : string
The status of the script’s last run.
finished_at : string/time
The time that the script’s last run finished.
hidden : boolean
The hidden status of the object.
parent_id : integer
The ID of the parent job that will trigger this script
code_preview : string
The code that this script will run with arguments inserted.
running_as : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
remote_host_id : integer
The remote host ID that this script will connect to.
credential_id : integer
The credential that this script will use.
notifications : dict:
- failure_on : boolean If failure email notifications are on - success_email_subject : string Custom subject line for success e-mail. - success_email_body : string Custom body text for success e-mail, written in Markdown. - success_email_addresses : list Addresses to notify by e-mail when the job completes successfully. - stall_warning_minutes : integer Stall warning emails will be sent after this amount of minutes. - failure_email_addresses : list Addresses to notify by e-mail when the job fails. - urls : list URLs to receive a POST request at job completion - success_on : boolean If success email notifications are on
arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
id : integer
The ID for the script.
created_at : string/time
The time this script was created.
author : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
target_project_id : integer
Target project to which script outputs will be added.
projects : list:
A list of projects containing the script. - id : integer The ID for the project. - name : string The name of the project.
-
put_custom_archive
(id, status)¶ Update the archive status of this object
Parameters: id : integer
The ID of the object.
status : boolean
The desired archived status of the object.
Returns: params : list:
A definition of the parameters this script accepts in the arguments field. - type : string The type of parameter. Valid options: string, integer, float, bool, database, credential_aws, credential_redshift, or credential_custom - name : string The variable's name as used within your code. - required : boolean Whether this param is required. - description : string A short sentence or fragment describing this parameter to the end user. - label : string The label to present to users when asking them for the value. - default : string If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool's or false, False, f, n, no, or 0 for false bool's. Cannot be used for parameters that are required or a credential type.
name : string
The name of the script.
last_run : dict:
- finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued.
archived : string
The archival status of the requested object(s).
template_script_name : string
The name of the template script.
type : string
The type of the script (e.g Custom)
schedule : dict:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
updated_at : string/time
The time the script was last updated.
from_template_id : integer
The ID of the template script.
state : string
The status of the script’s last run.
finished_at : string/time
The time that the script’s last run finished.
hidden : boolean
The hidden status of the object.
parent_id : integer
The ID of the parent job that will trigger this script
code_preview : string
The code that this script will run with arguments inserted.
running_as : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
remote_host_id : integer
The remote host ID that this script will connect to.
credential_id : integer
The credential that this script will use.
notifications : dict:
- failure_on : boolean If failure email notifications are on - success_email_subject : string Custom subject line for success e-mail. - success_email_body : string Custom body text for success e-mail, written in Markdown. - success_email_addresses : list Addresses to notify by e-mail when the job completes successfully. - stall_warning_minutes : integer Stall warning emails will be sent after this amount of minutes. - failure_email_addresses : list Addresses to notify by e-mail when the job fails. - urls : list URLs to receive a POST request at job completion - success_on : boolean If success email notifications are on
arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
id : integer
The ID for the script.
created_at : string/time
The time this script was created.
author : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
target_project_id : integer
Target project to which script outputs will be added.
projects : list:
A list of projects containing the script. - id : integer The ID for the project. - name : string The name of the project.
-
put_custom_projects
(id, project_id)¶ Add a Job to a project
Parameters: id : integer
ID of the resource
project_id : integer
The ID of the project
Returns: None
Response code 204: success
Set the permissions groups has on this object
Parameters: id : integer
ID of the resource to be shared
permission_level : string
Options are: “read”, “write”, or “manage”
group_ids : list
An array of one or more group IDs
Returns: readers : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
owners : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
writers : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
Set the permissions users have on this object
Parameters: id : integer
ID of the resource to be shared
permission_level : string
Options are: “read”, “write”, or “manage”
user_ids : list
An array of one or more user IDs
Returns: readers : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
owners : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
writers : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
-
put_javascript
(id, credential_id, name, remote_host_id, source, **kwargs)¶ Replace all attributes of this JavaScript Script
Parameters: id : integer
The ID for the script.
credential_id : integer
The credential that this script will use.
name : string
The name of the script.
remote_host_id : integer
The remote host ID that this script will connect to.
source : string
The body/text of the script.
parent_id : integer, optional
The ID of the parent job that will trigger this script
time_zone : string, optional
The time zone of this script.
next_run_at : string/time, optional
The time of the next scheduled run.
user_context : string, optional
“runner” or “author”, who to execute the script as when run as a template.
schedule : dict, optional:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
params : list, optional:
A definition of the parameters this script accepts in the arguments field. - type : string The type of parameter. Valid options: string, integer, float, bool, database, credential_aws, credential_redshift, or credential_custom - name : string The variable's name as used within your code. - required : boolean Whether this param is required. - description : string A short sentence or fragment describing this parameter to the end user. - label : string The label to present to users when asking them for the value. - default : string If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool's or false, False, f, n, no, or 0 for false bool's. Cannot be used for parameters that are required or a credential type.
notifications : dict, optional:
- failure_on : boolean If failure email notifications are on - success_email_subject : string Custom subject line for success e-mail. - success_email_body : string Custom body text for success e-mail, written in Markdown. - success_email_addresses : list Addresses to notify by e-mail when the job completes successfully. - stall_warning_minutes : integer Stall warning emails will be sent after this amount of minutes. - failure_email_addresses : list Addresses to notify by e-mail when the job fails. - urls : list URLs to receive a POST request at job completion - success_on : boolean If success email notifications are on
arguments : dict, optional
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
target_project_id : integer, optional
Target project to which script outputs will be added.
Returns: links : dict:
- runs : string The runs link to get the run information list for this script. - details : string The details link to get more information about the script.
archived : string
The archival status of the requested object(s).
is_template : boolean
Whether others scripts use this one as a template.
name : string
The name of the script.
last_run : dict:
- finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued.
published_as_template_id : integer
The ID of the template that this script is backing.
credential_id : integer
The credential that this script will use.
type : string
The type of the script (e.g SQL, Container, Python, R, JavaScript)
schedule : dict:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
updated_at : string/time
The time the script was last updated.
from_template_id : integer
The ID of the template this script uses, if any.
source : string
The body/text of the script.
state : string
The status of the script’s last run.
running_as : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
time_zone : string
The time zone of this script.
parent_id : integer
The ID of the parent job that will trigger this script
template_dependents_count : integer
How many other scripts use this one as a template.
template_script_name : string
The name of the template script.
next_run_at : string/time
The time of the next scheduled run.
finished_at : string/time
The time that the script’s last run finished.
hidden : boolean
The hidden status of the object.
user_context : string
“runner” or “author”, who to execute the script as when run as a template.
remote_host_id : integer
The remote host ID that this script will connect to.
params : list:
A definition of the parameters this script accepts in the arguments field. - type : string The type of parameter. Valid options: string, integer, float, bool, database, credential_aws, credential_redshift, or credential_custom - name : string The variable's name as used within your code. - required : boolean Whether this param is required. - description : string A short sentence or fragment describing this parameter to the end user. - label : string The label to present to users when asking them for the value. - default : string If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool's or false, False, f, n, no, or 0 for false bool's. Cannot be used for parameters that are required or a credential type.
notifications : dict:
- failure_on : boolean If failure email notifications are on - success_email_subject : string Custom subject line for success e-mail. - success_email_body : string Custom body text for success e-mail, written in Markdown. - success_email_addresses : list Addresses to notify by e-mail when the job completes successfully. - stall_warning_minutes : integer Stall warning emails will be sent after this amount of minutes. - failure_email_addresses : list Addresses to notify by e-mail when the job fails. - urls : list URLs to receive a POST request at job completion - success_on : boolean If success email notifications are on
arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
id : integer
The ID for the script.
created_at : string/time
The time this script was created.
author : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
target_project_id : integer
Target project to which script outputs will be added.
projects : list:
A list of projects containing the script. - id : integer The ID for the project. - name : string The name of the project.
-
put_javascript_archive
(id, status)¶ Update the archive status of this object
Parameters: id : integer
The ID of the object.
status : boolean
The desired archived status of the object.
Returns: links : dict:
- runs : string The runs link to get the run information list for this script. - details : string The details link to get more information about the script.
archived : string
The archival status of the requested object(s).
is_template : boolean
Whether others scripts use this one as a template.
name : string
The name of the script.
last_run : dict:
- finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued.
published_as_template_id : integer
The ID of the template that this script is backing.
credential_id : integer
The credential that this script will use.
type : string
The type of the script (e.g SQL, Container, Python, R, JavaScript)
schedule : dict:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
updated_at : string/time
The time the script was last updated.
from_template_id : integer
The ID of the template this script uses, if any.
source : string
The body/text of the script.
state : string
The status of the script’s last run.
running_as : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
time_zone : string
The time zone of this script.
parent_id : integer
The ID of the parent job that will trigger this script
template_dependents_count : integer
How many other scripts use this one as a template.
template_script_name : string
The name of the template script.
next_run_at : string/time
The time of the next scheduled run.
finished_at : string/time
The time that the script’s last run finished.
hidden : boolean
The hidden status of the object.
user_context : string
“runner” or “author”, who to execute the script as when run as a template.
remote_host_id : integer
The remote host ID that this script will connect to.
params : list:
A definition of the parameters this script accepts in the arguments field. - type : string The type of parameter. Valid options: string, integer, float, bool, database, credential_aws, credential_redshift, or credential_custom - name : string The variable's name as used within your code. - required : boolean Whether this param is required. - description : string A short sentence or fragment describing this parameter to the end user. - label : string The label to present to users when asking them for the value. - default : string If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool's or false, False, f, n, no, or 0 for false bool's. Cannot be used for parameters that are required or a credential type.
notifications : dict:
- failure_on : boolean If failure email notifications are on - success_email_subject : string Custom subject line for success e-mail. - success_email_body : string Custom body text for success e-mail, written in Markdown. - success_email_addresses : list Addresses to notify by e-mail when the job completes successfully. - stall_warning_minutes : integer Stall warning emails will be sent after this amount of minutes. - failure_email_addresses : list Addresses to notify by e-mail when the job fails. - urls : list URLs to receive a POST request at job completion - success_on : boolean If success email notifications are on
arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
id : integer
The ID for the script.
created_at : string/time
The time this script was created.
author : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
target_project_id : integer
Target project to which script outputs will be added.
projects : list:
A list of projects containing the script. - id : integer The ID for the project. - name : string The name of the project.
-
put_javascript_projects
(id, project_id)¶ Add a scripted sql to a project
Parameters: id : integer
ID of the resource
project_id : integer
The ID of the project
Returns: None
Response code 204: success
Set the permissions groups has on this object
Parameters: id : integer
ID of the resource to be shared
permission_level : string
Options are: “read”, “write”, or “manage”
group_ids : list
An array of one or more group IDs
Returns: readers : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
owners : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
writers : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
Set the permissions users have on this object
Parameters: id : integer
ID of the resource to be shared
permission_level : string
Options are: “read”, “write”, or “manage”
user_ids : list
An array of one or more user IDs
Returns: readers : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
owners : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
writers : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
-
put_python3
(id, name, source, **kwargs)¶ Replace all attributes of this Python Script
Parameters: id : integer
The ID for the script.
name : string
The name of the script.
source : string
The body/text of the script.
required_resources : dict, optional:
- cpu : integer The number of CPU shares to allocate for the container. Each core has 1024 shares. Must be at least 2 shares. - disk_space : number/float The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported. - memory : integer The amount of RAM to allocate for the container (in MiB). Must be at least 4 MiB.
parent_id : integer, optional
The ID of the parent job that will trigger this script
time_zone : string, optional
The time zone of this script.
next_run_at : string/time, optional
The time of the next scheduled run.
user_context : string, optional
“runner” or “author”, who to execute the script as when run as a template.
schedule : dict, optional:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
params : list, optional:
A definition of the parameters this script accepts in the arguments field. - type : string The type of parameter. Valid options: string, integer, float, bool, database, credential_aws, credential_redshift, or credential_custom - name : string The variable's name as used within your code. - required : boolean Whether this param is required. - description : string A short sentence or fragment describing this parameter to the end user. - label : string The label to present to users when asking them for the value. - default : string If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool's or false, False, f, n, no, or 0 for false bool's. Cannot be used for parameters that are required or a credential type.
notifications : dict, optional:
- failure_on : boolean If failure email notifications are on - success_email_subject : string Custom subject line for success e-mail. - success_email_body : string Custom body text for success e-mail, written in Markdown. - success_email_addresses : list Addresses to notify by e-mail when the job completes successfully. - stall_warning_minutes : integer Stall warning emails will be sent after this amount of minutes. - failure_email_addresses : list Addresses to notify by e-mail when the job fails. - urls : list URLs to receive a POST request at job completion - success_on : boolean If success email notifications are on
arguments : dict, optional
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
target_project_id : integer, optional
Target project to which script outputs will be added.
Returns: links : dict:
- runs : string The runs link to get the run information list for this script. - details : string The details link to get more information about the script.
archived : string
The archival status of the requested object(s).
is_template : boolean
Whether others scripts use this one as a template.
required_resources : dict:
- cpu : integer The number of CPU shares to allocate for the container. Each core has 1024 shares. Must be at least 2 shares. - disk_space : number/float The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported. - memory : integer The amount of RAM to allocate for the container (in MiB). Must be at least 4 MiB.
name : string
The name of the script.
last_run : dict:
- finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued.
published_as_template_id : integer
The ID of the template that this script is backing.
type : string
The type of the script (e.g SQL, Container, Python, R, JavaScript)
schedule : dict:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
updated_at : string/time
The time the script was last updated.
from_template_id : integer
The ID of the template this script uses, if any.
source : string
The body/text of the script.
state : string
The status of the script’s last run.
running_as : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
time_zone : string
The time zone of this script.
parent_id : integer
The ID of the parent job that will trigger this script
template_dependents_count : integer
How many other scripts use this one as a template.
template_script_name : string
The name of the template script.
next_run_at : string/time
The time of the next scheduled run.
finished_at : string/time
The time that the script’s last run finished.
hidden : boolean
The hidden status of the object.
user_context : string
“runner” or “author”, who to execute the script as when run as a template.
params : list:
A definition of the parameters this script accepts in the arguments field. - type : string The type of parameter. Valid options: string, integer, float, bool, database, credential_aws, credential_redshift, or credential_custom - name : string The variable's name as used within your code. - required : boolean Whether this param is required. - description : string A short sentence or fragment describing this parameter to the end user. - label : string The label to present to users when asking them for the value. - default : string If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool's or false, False, f, n, no, or 0 for false bool's. Cannot be used for parameters that are required or a credential type.
notifications : dict:
- failure_on : boolean If failure email notifications are on - success_email_subject : string Custom subject line for success e-mail. - success_email_body : string Custom body text for success e-mail, written in Markdown. - success_email_addresses : list Addresses to notify by e-mail when the job completes successfully. - stall_warning_minutes : integer Stall warning emails will be sent after this amount of minutes. - failure_email_addresses : list Addresses to notify by e-mail when the job fails. - urls : list URLs to receive a POST request at job completion - success_on : boolean If success email notifications are on
arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
id : integer
The ID for the script.
created_at : string/time
The time this script was created.
author : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
target_project_id : integer
Target project to which script outputs will be added.
projects : list:
A list of projects containing the script. - id : integer The ID for the project. - name : string The name of the project.
-
put_python3_archive
(id, status)¶ Update the archive status of this object
Parameters: id : integer
The ID of the object.
status : boolean
The desired archived status of the object.
Returns: links : dict:
- runs : string The runs link to get the run information list for this script. - details : string The details link to get more information about the script.
archived : string
The archival status of the requested object(s).
is_template : boolean
Whether others scripts use this one as a template.
required_resources : dict:
- cpu : integer The number of CPU shares to allocate for the container. Each core has 1024 shares. Must be at least 2 shares. - disk_space : number/float The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported. - memory : integer The amount of RAM to allocate for the container (in MiB). Must be at least 4 MiB.
name : string
The name of the script.
last_run : dict:
- finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued.
published_as_template_id : integer
The ID of the template that this script is backing.
type : string
The type of the script (e.g SQL, Container, Python, R, JavaScript)
schedule : dict:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
updated_at : string/time
The time the script was last updated.
from_template_id : integer
The ID of the template this script uses, if any.
source : string
The body/text of the script.
state : string
The status of the script’s last run.
running_as : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
time_zone : string
The time zone of this script.
parent_id : integer
The ID of the parent job that will trigger this script
template_dependents_count : integer
How many other scripts use this one as a template.
template_script_name : string
The name of the template script.
next_run_at : string/time
The time of the next scheduled run.
finished_at : string/time
The time that the script’s last run finished.
hidden : boolean
The hidden status of the object.
user_context : string
“runner” or “author”, who to execute the script as when run as a template.
params : list:
A definition of the parameters this script accepts in the arguments field. - type : string The type of parameter. Valid options: string, integer, float, bool, database, credential_aws, credential_redshift, or credential_custom - name : string The variable's name as used within your code. - required : boolean Whether this param is required. - description : string A short sentence or fragment describing this parameter to the end user. - label : string The label to present to users when asking them for the value. - default : string If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool's or false, False, f, n, no, or 0 for false bool's. Cannot be used for parameters that are required or a credential type.
notifications : dict:
- failure_on : boolean If failure email notifications are on - success_email_subject : string Custom subject line for success e-mail. - success_email_body : string Custom body text for success e-mail, written in Markdown. - success_email_addresses : list Addresses to notify by e-mail when the job completes successfully. - stall_warning_minutes : integer Stall warning emails will be sent after this amount of minutes. - failure_email_addresses : list Addresses to notify by e-mail when the job fails. - urls : list URLs to receive a POST request at job completion - success_on : boolean If success email notifications are on
arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
id : integer
The ID for the script.
created_at : string/time
The time this script was created.
author : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
target_project_id : integer
Target project to which script outputs will be added.
projects : list:
A list of projects containing the script. - id : integer The ID for the project. - name : string The name of the project.
-
put_python3_projects
(id, project_id)¶ Add a python docker to a project
Parameters: id : integer
ID of the resource
project_id : integer
The ID of the project
Returns: None
Response code 204: success
Set the permissions groups has on this object
Parameters: id : integer
ID of the resource to be shared
permission_level : string
Options are: “read”, “write”, or “manage”
group_ids : list
An array of one or more group IDs
Returns: readers : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
owners : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
writers : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
Set the permissions users have on this object
Parameters: id : integer
ID of the resource to be shared
permission_level : string
Options are: “read”, “write”, or “manage”
user_ids : list
An array of one or more user IDs
Returns: readers : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
owners : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
writers : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
-
put_r
(id, name, source, **kwargs)¶ Replace all attributes of this R Script
Parameters: id : integer
The ID for the script.
name : string
The name of the script.
source : string
The body/text of the script.
required_resources : dict, optional:
- cpu : integer The number of CPU shares to allocate for the container. Each core has 1024 shares. Must be at least 2 shares. - disk_space : number/float The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported. - memory : integer The amount of RAM to allocate for the container (in MiB). Must be at least 4 MiB.
parent_id : integer, optional
The ID of the parent job that will trigger this script
time_zone : string, optional
The time zone of this script.
next_run_at : string/time, optional
The time of the next scheduled run.
user_context : string, optional
“runner” or “author”, who to execute the script as when run as a template.
schedule : dict, optional:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
params : list, optional:
A definition of the parameters this script accepts in the arguments field. - type : string The type of parameter. Valid options: string, integer, float, bool, database, credential_aws, credential_redshift, or credential_custom - name : string The variable's name as used within your code. - required : boolean Whether this param is required. - description : string A short sentence or fragment describing this parameter to the end user. - label : string The label to present to users when asking them for the value. - default : string If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool's or false, False, f, n, no, or 0 for false bool's. Cannot be used for parameters that are required or a credential type.
notifications : dict, optional:
- failure_on : boolean If failure email notifications are on - success_email_subject : string Custom subject line for success e-mail. - success_email_body : string Custom body text for success e-mail, written in Markdown. - success_email_addresses : list Addresses to notify by e-mail when the job completes successfully. - stall_warning_minutes : integer Stall warning emails will be sent after this amount of minutes. - failure_email_addresses : list Addresses to notify by e-mail when the job fails. - urls : list URLs to receive a POST request at job completion - success_on : boolean If success email notifications are on
arguments : dict, optional
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
target_project_id : integer, optional
Target project to which script outputs will be added.
Returns: links : dict:
- runs : string The runs link to get the run information list for this script. - details : string The details link to get more information about the script.
archived : string
The archival status of the requested object(s).
is_template : boolean
Whether others scripts use this one as a template.
required_resources : dict:
- cpu : integer The number of CPU shares to allocate for the container. Each core has 1024 shares. Must be at least 2 shares. - disk_space : number/float The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported. - memory : integer The amount of RAM to allocate for the container (in MiB). Must be at least 4 MiB.
name : string
The name of the script.
last_run : dict:
- finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued.
published_as_template_id : integer
The ID of the template that this script is backing.
type : string
The type of the script (e.g SQL, Container, Python, R, JavaScript)
schedule : dict:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
updated_at : string/time
The time the script was last updated.
from_template_id : integer
The ID of the template this script uses, if any.
source : string
The body/text of the script.
state : string
The status of the script’s last run.
running_as : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
time_zone : string
The time zone of this script.
parent_id : integer
The ID of the parent job that will trigger this script
template_dependents_count : integer
How many other scripts use this one as a template.
template_script_name : string
The name of the template script.
next_run_at : string/time
The time of the next scheduled run.
finished_at : string/time
The time that the script’s last run finished.
hidden : boolean
The hidden status of the object.
user_context : string
“runner” or “author”, who to execute the script as when run as a template.
params : list:
A definition of the parameters this script accepts in the arguments field. - type : string The type of parameter. Valid options: string, integer, float, bool, database, credential_aws, credential_redshift, or credential_custom - name : string The variable's name as used within your code. - required : boolean Whether this param is required. - description : string A short sentence or fragment describing this parameter to the end user. - label : string The label to present to users when asking them for the value. - default : string If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool's or false, False, f, n, no, or 0 for false bool's. Cannot be used for parameters that are required or a credential type.
notifications : dict:
- failure_on : boolean If failure email notifications are on - success_email_subject : string Custom subject line for success e-mail. - success_email_body : string Custom body text for success e-mail, written in Markdown. - success_email_addresses : list Addresses to notify by e-mail when the job completes successfully. - stall_warning_minutes : integer Stall warning emails will be sent after this amount of minutes. - failure_email_addresses : list Addresses to notify by e-mail when the job fails. - urls : list URLs to receive a POST request at job completion - success_on : boolean If success email notifications are on
arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
id : integer
The ID for the script.
created_at : string/time
The time this script was created.
author : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
target_project_id : integer
Target project to which script outputs will be added.
projects : list:
A list of projects containing the script. - id : integer The ID for the project. - name : string The name of the project.
-
put_r_archive
(id, status)¶ Update the archive status of this object
Parameters: id : integer
The ID of the object.
status : boolean
The desired archived status of the object.
Returns: links : dict:
- runs : string The runs link to get the run information list for this script. - details : string The details link to get more information about the script.
archived : string
The archival status of the requested object(s).
is_template : boolean
Whether others scripts use this one as a template.
required_resources : dict:
- cpu : integer The number of CPU shares to allocate for the container. Each core has 1024 shares. Must be at least 2 shares. - disk_space : number/float The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported. - memory : integer The amount of RAM to allocate for the container (in MiB). Must be at least 4 MiB.
name : string
The name of the script.
last_run : dict:
- finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued.
published_as_template_id : integer
The ID of the template that this script is backing.
type : string
The type of the script (e.g SQL, Container, Python, R, JavaScript)
schedule : dict:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
updated_at : string/time
The time the script was last updated.
from_template_id : integer
The ID of the template this script uses, if any.
source : string
The body/text of the script.
state : string
The status of the script’s last run.
running_as : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
time_zone : string
The time zone of this script.
parent_id : integer
The ID of the parent job that will trigger this script
template_dependents_count : integer
How many other scripts use this one as a template.
template_script_name : string
The name of the template script.
next_run_at : string/time
The time of the next scheduled run.
finished_at : string/time
The time that the script’s last run finished.
hidden : boolean
The hidden status of the object.
user_context : string
“runner” or “author”, who to execute the script as when run as a template.
params : list:
A definition of the parameters this script accepts in the arguments field. - type : string The type of parameter. Valid options: string, integer, float, bool, database, credential_aws, credential_redshift, or credential_custom - name : string The variable's name as used within your code. - required : boolean Whether this param is required. - description : string A short sentence or fragment describing this parameter to the end user. - label : string The label to present to users when asking them for the value. - default : string If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool's or false, False, f, n, no, or 0 for false bool's. Cannot be used for parameters that are required or a credential type.
notifications : dict:
- failure_on : boolean If failure email notifications are on - success_email_subject : string Custom subject line for success e-mail. - success_email_body : string Custom body text for success e-mail, written in Markdown. - success_email_addresses : list Addresses to notify by e-mail when the job completes successfully. - stall_warning_minutes : integer Stall warning emails will be sent after this amount of minutes. - failure_email_addresses : list Addresses to notify by e-mail when the job fails. - urls : list URLs to receive a POST request at job completion - success_on : boolean If success email notifications are on
arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
id : integer
The ID for the script.
created_at : string/time
The time this script was created.
author : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
target_project_id : integer
Target project to which script outputs will be added.
projects : list:
A list of projects containing the script. - id : integer The ID for the project. - name : string The name of the project.
-
put_r_projects
(id, project_id)¶ Add a r docker to a project
Parameters: id : integer
ID of the resource
project_id : integer
The ID of the project
Returns: None
Response code 204: success
Set the permissions groups has on this object
Parameters: id : integer
ID of the resource to be shared
permission_level : string
Options are: “read”, “write”, or “manage”
group_ids : list
An array of one or more group IDs
Returns: readers : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
owners : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
writers : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
Set the permissions users have on this object
Parameters: id : integer
ID of the resource to be shared
permission_level : string
Options are: “read”, “write”, or “manage”
user_ids : list
An array of one or more user IDs
Returns: readers : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
owners : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
writers : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
-
put_sql
(id, credential_id, name, remote_host_id, sql, **kwargs)¶ Replace all attributes of this SQL script
Parameters: id : integer
The ID for the script.
credential_id : integer
The credential that this script will use.
name : string
The name of the script.
remote_host_id : integer
The remote host ID that this script will connect to.
sql : string
The raw SQL query for the script.
parent_id : integer, optional
The ID of the parent job that will trigger this script
time_zone : string, optional
The time zone of this script.
next_run_at : string/time, optional
The time of the next scheduled run.
user_context : string, optional
“runner” or “author”, who to execute the script as when run as a template.
schedule : dict, optional:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
params : list, optional:
A definition of the parameters this script accepts in the arguments field. - type : string The type of parameter. Valid options: string, integer, float, bool, database, credential_aws, credential_redshift, or credential_custom - name : string The variable's name as used within your code. - required : boolean Whether this param is required. - description : string A short sentence or fragment describing this parameter to the end user. - label : string The label to present to users when asking them for the value. - default : string If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool's or false, False, f, n, no, or 0 for false bool's. Cannot be used for parameters that are required or a credential type.
notifications : dict, optional:
- failure_on : boolean If failure email notifications are on - success_email_subject : string Custom subject line for success e-mail. - success_email_body : string Custom body text for success e-mail, written in Markdown. - success_email_addresses : list Addresses to notify by e-mail when the job completes successfully. - stall_warning_minutes : integer Stall warning emails will be sent after this amount of minutes. - failure_email_addresses : list Addresses to notify by e-mail when the job fails. - urls : list URLs to receive a POST request at job completion - success_on : boolean If success email notifications are on
arguments : dict, optional
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
target_project_id : integer, optional
Target project to which script outputs will be added.
Returns: links : dict:
- runs : string The runs link to get the run information list for this script. - details : string The details link to get more information about the script.
archived : string
The archival status of the requested object(s).
is_template : boolean
Whether others scripts use this one as a template.
name : string
The name of the script.
last_run : dict:
- finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued.
published_as_template_id : integer
The ID of the template that this script is backing.
code_preview : string
The code that this script will run with arguments inserted.
credential_id : integer
The credential that this script will use.
type : string
The type of the script (e.g SQL, Container, Python, R, JavaScript)
schedule : dict:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
updated_at : string/time
The time the script was last updated.
from_template_id : integer
The ID of the template this script uses, if any.
sql : string
The raw SQL query for the script.
state : string
The status of the script’s last run.
running_as : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
time_zone : string
The time zone of this script.
parent_id : integer
The ID of the parent job that will trigger this script
template_dependents_count : integer
How many other scripts use this one as a template.
template_script_name : string
The name of the template script.
next_run_at : string/time
The time of the next scheduled run.
expanded_arguments : dict
Expanded arguments for use in injecting into different environments.
finished_at : string/time
The time that the script’s last run finished.
hidden : boolean
The hidden status of the object.
user_context : string
“runner” or “author”, who to execute the script as when run as a template.
remote_host_id : integer
The remote host ID that this script will connect to.
params : list:
A definition of the parameters this script accepts in the arguments field. - type : string The type of parameter. Valid options: string, integer, float, bool, database, credential_aws, credential_redshift, or credential_custom - name : string The variable's name as used within your code. - required : boolean Whether this param is required. - description : string A short sentence or fragment describing this parameter to the end user. - label : string The label to present to users when asking them for the value. - default : string If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool's or false, False, f, n, no, or 0 for false bool's. Cannot be used for parameters that are required or a credential type.
notifications : dict:
- failure_on : boolean If failure email notifications are on - success_email_subject : string Custom subject line for success e-mail. - success_email_body : string Custom body text for success e-mail, written in Markdown. - success_email_addresses : list Addresses to notify by e-mail when the job completes successfully. - stall_warning_minutes : integer Stall warning emails will be sent after this amount of minutes. - failure_email_addresses : list Addresses to notify by e-mail when the job fails. - urls : list URLs to receive a POST request at job completion - success_on : boolean If success email notifications are on
arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
id : integer
The ID for the script.
created_at : string/time
The time this script was created.
author : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
target_project_id : integer
Target project to which script outputs will be added.
projects : list:
A list of projects containing the script. - id : integer The ID for the project. - name : string The name of the project.
-
put_sql_archive
(id, status)¶ Update the archive status of this object
Parameters: id : integer
The ID of the object.
status : boolean
The desired archived status of the object.
Returns: links : dict:
- runs : string The runs link to get the run information list for this script. - details : string The details link to get more information about the script.
archived : string
The archival status of the requested object(s).
is_template : boolean
Whether others scripts use this one as a template.
name : string
The name of the script.
last_run : dict:
- finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued.
published_as_template_id : integer
The ID of the template that this script is backing.
code_preview : string
The code that this script will run with arguments inserted.
credential_id : integer
The credential that this script will use.
type : string
The type of the script (e.g SQL, Container, Python, R, JavaScript)
schedule : dict:
- scheduled_minutes : list Minutes of the day it is scheduled on - scheduled : boolean If the object is scheduled - scheduled_days : list Day based on numeric value starting at 0 for Sunday - scheduled_runs_per_hour : integer Alternative to scheduled minutes, number of times to run per hour - scheduled_hours : list Hours of the day it is scheduled on
updated_at : string/time
The time the script was last updated.
from_template_id : integer
The ID of the template this script uses, if any.
sql : string
The raw SQL query for the script.
state : string
The status of the script’s last run.
running_as : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
time_zone : string
The time zone of this script.
parent_id : integer
The ID of the parent job that will trigger this script
template_dependents_count : integer
How many other scripts use this one as a template.
template_script_name : string
The name of the template script.
next_run_at : string/time
The time of the next scheduled run.
expanded_arguments : dict
Expanded arguments for use in injecting into different environments.
finished_at : string/time
The time that the script’s last run finished.
hidden : boolean
The hidden status of the object.
user_context : string
“runner” or “author”, who to execute the script as when run as a template.
remote_host_id : integer
The remote host ID that this script will connect to.
params : list:
A definition of the parameters this script accepts in the arguments field. - type : string The type of parameter. Valid options: string, integer, float, bool, database, credential_aws, credential_redshift, or credential_custom - name : string The variable's name as used within your code. - required : boolean Whether this param is required. - description : string A short sentence or fragment describing this parameter to the end user. - label : string The label to present to users when asking them for the value. - default : string If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool's or false, False, f, n, no, or 0 for false bool's. Cannot be used for parameters that are required or a credential type.
notifications : dict:
- failure_on : boolean If failure email notifications are on - success_email_subject : string Custom subject line for success e-mail. - success_email_body : string Custom body text for success e-mail, written in Markdown. - success_email_addresses : list Addresses to notify by e-mail when the job completes successfully. - stall_warning_minutes : integer Stall warning emails will be sent after this amount of minutes. - failure_email_addresses : list Addresses to notify by e-mail when the job fails. - urls : list URLs to receive a POST request at job completion - success_on : boolean If success email notifications are on
arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
id : integer
The ID for the script.
created_at : string/time
The time this script was created.
author : dict:
- username : string This user's username. - online : boolean Whether this user is online. - id : integer The ID of this user. - initials : string This user's initials. - name : string This user's name.
target_project_id : integer
Target project to which script outputs will be added.
projects : list:
A list of projects containing the script. - id : integer The ID for the project. - name : string The name of the project.
-
put_sql_projects
(id, project_id)¶ Add a scripts to a project
Parameters: id : integer
ID of the resource
project_id : integer
The ID of the project
Returns: None
Response code 204: success
Set the permissions groups has on this object
Parameters: id : integer
ID of the resource to be shared
permission_level : string
Options are: “read”, “write”, or “manage”
group_ids : list
An array of one or more group IDs
Returns: readers : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
owners : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
writers : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
Set the permissions users have on this object
Parameters: id : integer
ID of the resource to be shared
permission_level : string
Options are: “read”, “write”, or “manage”
user_ids : list
An array of one or more user IDs
Returns: readers : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
owners : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
writers : dict:
- groups : list:: - id : integer - name : string - users : list:: - id : integer - name : string
total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
-
Tables¶
-
class
Tables
(session, return_type='civis')¶ Methods
get
(id)Show basic table info get_enhancements_cass_ncoa
(id, source_table_id)View the status of a CASS / NCOA table enhancement get_enhancements_geocodings
(id, source_table_id)View the status of a geocoding table enhancement get_enhancements_prepared_matchings
(id, ...)View a prepared matching enhancement get_enhancements_table_matchings
(id, ...)View a table matching enhancement list
(**kwargs)List tables list_columns
(id, **kwargs)List columns in the specified table patch
(id, **kwargs)Update a table post
(schema, data, database_id, name)Import a file into a table post_enhancements_cass_ncoa
(source_table_id, ...)Standardize addresses in a table post_enhancements_geocodings
(source_table_id)Geocode a table post_enhancements_prepared_matchings
(...)Match person records against a dynamo table prepared by Civis post_enhancements_table_matchings
(...)Match person records against an arbitrary Redshift table post_refresh
(id)Request a refresh for column and table statistics -
get
(id)¶ Show basic table info
Parameters: id : integer
Returns: refresh_id : string
The ID of the most recent statistics refresh.
joins : list:
- right_identifier : string - left_identifier : string - left_table_id : integer - updated_at : string/time - on : string - right_table_id : integer - id : integer - created_at : string/time - left_join : boolean
sortkeys : string
The column used as the Amazon Redshift sortkey.
name : string
Name of the table.
last_run : dict:
- finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued.
description : string
The description of the table, as specified by the table owner
column_count : integer
The number of columns in the table.
multipart_key : list
is_view : boolean
True if this table represents a view. False if it represents a regular table.
ontology_mapping : dict
The ontology-key to column-name mapping. See /ontology for the list of valid ontology keys.
refresh_status : string
How up-to-date the table’s statistics on row counts, null counts, distinct counts, and values distributions are. One of: refreshing, stale, or current.
size_mb : number/float
The size of the table in megabytes.
database_id : integer
The ID of the database.
outgoing_table_matches : list:
- target_id : integer Target ID - job : dict:: - type : string - last_run : dict:: - finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued. - updated_at : string/date-time - name : string - hidden : boolean The hidden status of the object. - state : string Whether the job is idle, queued, running, cancelled, or failed. - id : integer - created_at : string/date-time - runs : list:: Information about the most recent runs of the job. - finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued. - match_options : dict:: - max_matches : integer - threshold : string - target : dict:: - name : string - source_table_id : integer Source table - target_type : string Target type
owner : string
The database username of the table’s owner.
enhancements : list:
- type : string - created_at : string/time - join_id : integer - updated_at : string/time
last_refresh : string/date-time
The time of the last statistics refresh.
columns : list:
- sql_type : string SQL type of the column. - coverage_count : integer Number of non-null values in the column. - encoding : string The compression encoding for this columnSee: http://docs.aws.amazon.com /redshift/latest/dg/c_Compression_encodings.html - sample_values : list A sample of values from the column. - useable_as_independent_variable : boolean Whether the column may be used as an independent variable to train a model. - name : string Name of the column. - description : string The description of the column, as specified by the table owner - null_count : integer Number of null values in the column. - min_value : string Smallest value in the column. - possible_dependent_variable_types : list Possible dependent variable types the column may be used to model. Null if it may not be used as a dependent variable. - avg_value : number/float Average value of the column, where applicable. - stddev : number/float Stddev of the column, where applicable. - max_value : string Largest value in the column. - order : integer Relative position of the column in the table. - value_distribution_percent : dict A mapping between each value in the column and the percentage of rows with that value.Only present for tables with fewer than approximately 25,000,000 rows and for columns with fewer than twenty distinct values. - value_distribution : dict An object mapping distinct values in the column to the number of times they appear in the column - useable_as_primary_key : boolean Whether the column may be used as an primary key to identify table rows. - distinct_count : integer Number of distinct values in the column.
view_def : string
id : integer
The ID of the table.
row_count : integer
The number of rows in the table.
distkey : string
The column used as the Amazon Redshift distkey.
schema : string
The name of the schema containing the table.
-
get_enhancements_cass_ncoa
(id, source_table_id)¶ View the status of a CASS / NCOA table enhancement
Parameters: id : integer
The ID of the enhancement.
source_table_id : integer
The ID of the table that was enhanced.
Returns: ncoa_credential_id : integer
Credential to use when performing NCOA updates. Required if ‘performNcoa’ is true.
source_table_id : integer
The ID of the table that was enhanced.
enhanced_table_name : string
The name of the table created by the enhancement.
perform_ncoa : boolean
Whether to update addresses for records matching the National Change of Address (NCOA) database.
state : string
The state of the enhancement, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
id : integer
The ID of the enhancement.
output_level : string
The set of fields persisted by a CASS or NCOA enhancement.For CASS enhancements, one of ‘cass’ or ‘all.’For NCOA enhancements, one of ‘cass’, ‘ncoa’ , ‘coalesced’ or ‘all’.By default, all fields will be returned.
enhanced_table_schema : string
The schema name of the table created by the enhancement.
-
get_enhancements_geocodings
(id, source_table_id)¶ View the status of a geocoding table enhancement
Parameters: id : integer
The ID of the enhancement.
source_table_id : integer
The ID of the table that was enhanced.
Returns: state : string
The state of the enhancement, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
id : integer
The ID of the enhancement.
enhanced_table_name : string
The name of the table created by the enhancement.
source_table_id : integer
The ID of the table that was enhanced.
enhanced_table_schema : string
The schema name of the table created by the enhancement.
-
get_enhancements_prepared_matchings
(id, source_table_id)¶ View a prepared matching enhancement
Parameters: id : integer
The ID of the enhancement.
source_table_id : integer
The ID of the table that was enhanced.
Returns: match_table_id : integer
The ID of the Dynamo table to match against.
max_matches : integer
The maximum number of individuals a person may be matched with.A value of 0 indicates that all matches should be returned.
source_table_id : integer
The ID of the table that was enhanced.
threshold : number/float
The confidence threshold which must be met for two individuals to be declared a match. Must be less than or equal to 1 and greater than or equal to 0.
enhanced_table_name : string
The name of the table created by the enhancement.
state : string
The state of the enhancement, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
id : integer
The ID of the enhancement.
enhanced_table_schema : string
The schema name of the table created by the enhancement.
-
get_enhancements_table_matchings
(id, source_table_id)¶ View a table matching enhancement
Parameters: id : integer
The ID of the enhancement.
source_table_id : integer
The ID of the table that was enhanced.
Returns: match_table_id : integer
The ID of the Redshift table to match against.
max_matches : integer
The maximum number of individuals a person may be matched with.A value of 0 indicates that all matches should be returned.
source_table_id : integer
The ID of the table that was enhanced.
threshold : number/float
The confidence threshold which must be met for two individuals to be declared a match. Must be less than or equal to 1 and greater than or equal to 0.
enhanced_table_name : string
The name of the table created by the enhancement.
state : string
The state of the enhancement, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
id : integer
The ID of the enhancement.
enhanced_table_schema : string
The schema name of the table created by the enhancement.
-
list
(**kwargs)¶ List tables
Parameters: database_id : integer, optional
The ID of the database.
schema : string, optional
If specified, will be used to filter the tables returned. Substring matching is supported with “%” and “*” wildcards (e.g., “schema=%census%” will return both “client_census.table” and “census_2010.table”).
name : string, optional
If specified, will be used to filter the tables returned. Substring matching is supported with “%” and “*” wildcards (e.g., “name=%table%” will return both “table1” and “my table”).
search : string, optional
If specified, will be used to filter the tables returned. Will search across schema and name (in the full form schema.name) and will return any full name containing the search string.
limit : integer, optional
Number of results to return. Defaults to its maximum of 50.
page_num : integer, optional
Page number of the results to return. Defaults to the first page, 1.
order : string, optional
The field on which to order the result set. Defaults to schema. Must be one of: schema, name, search.
order_dir : string, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to asc.
iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: refresh_id : string
The ID of the most recent statistics refresh.
size_mb : number/float
The size of the table in megabytes.
database_id : integer
The ID of the database.
name : string
Name of the table.
last_run : dict:
- finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued.
description : string
The description of the table, as specified by the table owner
owner : string
The database username of the table’s owner.
sortkeys : string
The column used as the Amazon Redshift sortkey.
column_count : integer
The number of columns in the table.
refresh_status : string
How up-to-date the table’s statistics on row counts, null counts, distinct counts, and values distributions are. One of: refreshing, stale, or current.
last_refresh : string/date-time
The time of the last statistics refresh.
is_view : boolean
True if this table represents a view. False if it represents a regular table.
id : integer
The ID of the table.
row_count : integer
The number of rows in the table.
schema : string
The name of the schema containing the table.
distkey : string
The column used as the Amazon Redshift distkey.
-
list_columns
(id, **kwargs)¶ List columns in the specified table
Parameters: id : integer
name : string, optional
Search for columns with the given name, within the specified table.
limit : integer, optional
Number of results to return. Defaults to its maximum of 50.
page_num : integer, optional
Page number of the results to return. Defaults to the first page, 1.
order : string, optional
The field on which to order the result set. Defaults to name. Must be one of: name, order.
order_dir : string, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to asc.
iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: sql_type : string
SQL type of the column.
coverage_count : integer
Number of non-null values in the column.
encoding : string
The compression encoding for this columnSee: http://docs.aws.amazon.com/redshift/latest/dg/c_Compression_encodings.html
sample_values : list
A sample of values from the column.
useable_as_independent_variable : boolean
Whether the column may be used as an independent variable to train a model.
name : string
Name of the column.
description : string
The description of the column, as specified by the table owner
null_count : integer
Number of null values in the column.
min_value : string
Smallest value in the column.
possible_dependent_variable_types : list
Possible dependent variable types the column may be used to model. Null if it may not be used as a dependent variable.
avg_value : number/float
Average value of the column, where applicable.
stddev : number/float
Stddev of the column, where applicable.
max_value : string
Largest value in the column.
order : integer
Relative position of the column in the table.
value_distribution_percent : dict
A mapping between each value in the column and the percentage of rows with that value.Only present for tables with fewer than approximately 25,000,000 rows and for columns with fewer than twenty distinct values.
value_distribution : dict
An object mapping distinct values in the column to the number of times they appear in the column
useable_as_primary_key : boolean
Whether the column may be used as an primary key to identify table rows.
distinct_count : integer
Number of distinct values in the column.
-
patch
(id, **kwargs)¶ Update a table
Parameters: id : integer
The ID of the table.
description : string, optional
The user-defined description of the table.
ontology_mapping : dict, optional
The ontology-key to column-name mapping. See /ontology for the list of valid ontology keys.
Returns: refresh_id : string
The ID of the most recent statistics refresh.
size_mb : number/float
The size of the table in megabytes.
database_id : integer
The ID of the database.
name : string
Name of the table.
last_run : dict:
- finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued.
description : string
The description of the table, as specified by the table owner
owner : string
The database username of the table’s owner.
sortkeys : string
The column used as the Amazon Redshift sortkey.
column_count : integer
The number of columns in the table.
ontology_mapping : dict
The ontology-key to column-name mapping. See /ontology for the list of valid ontology keys.
refresh_status : string
How up-to-date the table’s statistics on row counts, null counts, distinct counts, and values distributions are. One of: refreshing, stale, or current.
last_refresh : string/date-time
The time of the last statistics refresh.
is_view : boolean
True if this table represents a view. False if it represents a regular table.
id : integer
The ID of the table.
row_count : integer
The number of rows in the table.
schema : string
The name of the schema containing the table.
distkey : string
The column used as the Amazon Redshift distkey.
-
post
(schema, data, database_id, name)¶ Import a file into a table
Parameters: schema : string
The destination schema name.
data : string
The file to import, uploaded using HTTP multipart.
database_id : integer
The ID of the destination database.
name : string
The destination table name, without the schema prefix.
Returns: finished_at : string/date-time
The end time of the last run.
started_at : string/date-time
The start time of the last run.
database_id : integer
The ID of the destination database.
name : string
The destination table name, without the schema prefix.
state : string
The state of the last run.
schema : string
The destination schema name.
-
post_enhancements_cass_ncoa
(source_table_id, **kwargs)¶ Standardize addresses in a table
Parameters: source_table_id : integer
The ID of the table to be enhanced.
perform_ncoa : boolean, optional
Whether to update addresses for records matching the National Change of Address (NCOA) database.
ncoa_credential_id : integer, optional
Credential to use when performing NCOA updates. Required if ‘performNcoa’ is true.
output_level : string, optional
The set of fields persisted by a CASS or NCOA enhancement.For CASS enhancements, one of ‘cass’ or ‘all.’For NCOA enhancements, one of ‘cass’, ‘ncoa’ , ‘coalesced’ or ‘all’.By default, all fields will be returned.
Returns: ncoa_credential_id : integer
Credential to use when performing NCOA updates. Required if ‘performNcoa’ is true.
source_table_id : integer
The ID of the table that was enhanced.
enhanced_table_name : string
The name of the table created by the enhancement.
perform_ncoa : boolean
Whether to update addresses for records matching the National Change of Address (NCOA) database.
state : string
The state of the enhancement, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
id : integer
The ID of the enhancement.
output_level : string
The set of fields persisted by a CASS or NCOA enhancement.For CASS enhancements, one of ‘cass’ or ‘all.’For NCOA enhancements, one of ‘cass’, ‘ncoa’ , ‘coalesced’ or ‘all’.By default, all fields will be returned.
enhanced_table_schema : string
The schema name of the table created by the enhancement.
-
post_enhancements_geocodings
(source_table_id)¶ Geocode a table
Parameters: source_table_id : integer
The ID of the table to be enhanced.
Returns: state : string
The state of the enhancement, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
id : integer
The ID of the enhancement.
enhanced_table_name : string
The name of the table created by the enhancement.
source_table_id : integer
The ID of the table that was enhanced.
enhanced_table_schema : string
The schema name of the table created by the enhancement.
-
post_enhancements_prepared_matchings
(source_table_id, match_table_id, threshold, **kwargs)¶ Match person records against a dynamo table prepared by Civis
Parameters: source_table_id : integer
The ID of the table to be enhanced.
match_table_id : integer
The ID of the Dynamo table to match against.
threshold : number/float
The confidence threshold which must be met for two individuals to be declared a match. Must be less than or equal to 1 and greater than or equal to 0.
max_matches : integer, optional
The maximum number of individuals a person may be matched with.A value of 0 indicates that all matches should be returned.
Returns: match_table_id : integer
The ID of the Dynamo table to match against.
max_matches : integer
The maximum number of individuals a person may be matched with.A value of 0 indicates that all matches should be returned.
source_table_id : integer
The ID of the table that was enhanced.
threshold : number/float
The confidence threshold which must be met for two individuals to be declared a match. Must be less than or equal to 1 and greater than or equal to 0.
enhanced_table_name : string
The name of the table created by the enhancement.
state : string
The state of the enhancement, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
id : integer
The ID of the enhancement.
enhanced_table_schema : string
The schema name of the table created by the enhancement.
-
post_enhancements_table_matchings
(source_table_id, match_table_id, threshold, **kwargs)¶ Match person records against an arbitrary Redshift table
Parameters: source_table_id : integer
The ID of the table to be enhanced.
match_table_id : integer
The ID of the Redshift table to match against.
threshold : number/float
The confidence threshold which must be met for two individuals to be declared a match. Must be less than or equal to 1 and greater than or equal to 0.
max_matches : integer, optional
The maximum number of individuals a person may be matched with.A value of 0 indicates that all matches should be returned.
Returns: match_table_id : integer
The ID of the Redshift table to match against.
max_matches : integer
The maximum number of individuals a person may be matched with.A value of 0 indicates that all matches should be returned.
source_table_id : integer
The ID of the table that was enhanced.
threshold : number/float
The confidence threshold which must be met for two individuals to be declared a match. Must be less than or equal to 1 and greater than or equal to 0.
enhanced_table_name : string
The name of the table created by the enhancement.
state : string
The state of the enhancement, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
id : integer
The ID of the enhancement.
enhanced_table_schema : string
The schema name of the table created by the enhancement.
-
post_refresh
(id)¶ Request a refresh for column and table statistics
Parameters: id : integer
Returns: refresh_id : string
The ID of the most recent statistics refresh.
joins : list:
- right_identifier : string - left_identifier : string - left_table_id : integer - updated_at : string/time - on : string - right_table_id : integer - id : integer - created_at : string/time - left_join : boolean
sortkeys : string
The column used as the Amazon Redshift sortkey.
name : string
Name of the table.
last_run : dict:
- finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued.
description : string
The description of the table, as specified by the table owner
column_count : integer
The number of columns in the table.
multipart_key : list
is_view : boolean
True if this table represents a view. False if it represents a regular table.
ontology_mapping : dict
The ontology-key to column-name mapping. See /ontology for the list of valid ontology keys.
refresh_status : string
How up-to-date the table’s statistics on row counts, null counts, distinct counts, and values distributions are. One of: refreshing, stale, or current.
size_mb : number/float
The size of the table in megabytes.
database_id : integer
The ID of the database.
outgoing_table_matches : list:
- target_id : integer Target ID - job : dict:: - type : string - last_run : dict:: - finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued. - updated_at : string/date-time - name : string - hidden : boolean The hidden status of the object. - state : string Whether the job is idle, queued, running, cancelled, or failed. - id : integer - created_at : string/date-time - runs : list:: Information about the most recent runs of the job. - finished_at : string/time The time that the run completed. - started_at : string/time The time that the run started. - error : string The error message for this run, if present. - state : string - id : integer - created_at : string/time The time that the run was queued. - match_options : dict:: - max_matches : integer - threshold : string - target : dict:: - name : string - source_table_id : integer Source table - target_type : string Target type
owner : string
The database username of the table’s owner.
enhancements : list:
- type : string - created_at : string/time - join_id : integer - updated_at : string/time
last_refresh : string/date-time
The time of the last statistics refresh.
columns : list:
- sql_type : string SQL type of the column. - coverage_count : integer Number of non-null values in the column. - encoding : string The compression encoding for this columnSee: http://docs.aws.amazon.com /redshift/latest/dg/c_Compression_encodings.html - sample_values : list A sample of values from the column. - useable_as_independent_variable : boolean Whether the column may be used as an independent variable to train a model. - name : string Name of the column. - description : string The description of the column, as specified by the table owner - null_count : integer Number of null values in the column. - min_value : string Smallest value in the column. - possible_dependent_variable_types : list Possible dependent variable types the column may be used to model. Null if it may not be used as a dependent variable. - avg_value : number/float Average value of the column, where applicable. - stddev : number/float Stddev of the column, where applicable. - max_value : string Largest value in the column. - order : integer Relative position of the column in the table. - value_distribution_percent : dict A mapping between each value in the column and the percentage of rows with that value.Only present for tables with fewer than approximately 25,000,000 rows and for columns with fewer than twenty distinct values. - value_distribution : dict An object mapping distinct values in the column to the number of times they appear in the column - useable_as_primary_key : boolean Whether the column may be used as an primary key to identify table rows. - distinct_count : integer Number of distinct values in the column.
view_def : string
id : integer
The ID of the table.
row_count : integer
The number of rows in the table.
distkey : string
The column used as the Amazon Redshift distkey.
schema : string
The name of the schema containing the table.
-
Users¶
-
class
Users
(session, return_type='civis')¶ Methods
delete_api_keys
(id, key_id)Revoke the specified API key get
(id)Show info about a user get_api_keys
(id, key_id)Show the specified API key list
(**kwargs)List users list_api_keys
(id, **kwargs)Show API keys belonging to the specified user list_me
()Show info about the logged-in user list_me_api_accesses
(**kwargs)Show API accesses made by or on behalf of the logged-in user patch_me
(**kwargs)Update info about the logged-in user post_api_keys
(id, expires_in, name, **kwargs)Create a new API key belonging to the logged-in user -
delete_api_keys
(id, key_id)¶ Revoke the specified API key
Parameters: id : string
The ID of the user or ‘me’.
key_id : integer
The ID of the API key.
Returns: use_count : integer
The number of times the key has been used.
active : boolean
True if the key has neither expired nor been revoked.
expired : boolean
True if the key has expired.
last_used_at : string/date-time
The date and time when the key was last used.
expires_at : string/date-time
The date and time when the key expired.
revoked_at : string/date-time
The date and time when the key was revoked.
scopes : list
The scopes which the key is permissioned on.
name : string
The name of the API key.
constraints : list:
Constraints on the abilities of the created key - get_allowed : boolean Whether the constraint allows GET requests. - constraint : string The path matcher of the constraint. - head_allowed : boolean Whether the constraint allows HEAD requests. - delete_allowed : boolean Whether the constraint allows DELETE requests. - constraint_type : string The type of constraint (exact/prefix/regex/verb). - patch_allowed : boolean Whether the constraint allows PATCH requests. - post_allowed : boolean Whether the constraint allows POST requests. - put_allowed : boolean Whether the constraint allows PUT requests.
id : integer
The ID of the API key.
created_at : string/date-time
The date and time when the key was created.
-
get
(id)¶ Show info about a user
Parameters: id : integer
The ID of this user.
Returns: active : string
The account status of this user.
github_username : string
The GitHub username of this user.
city : string
The city of this user.
initials : string
The initials of this user.
department : string
The deartment of this user.
name : string
The name of this user.
time_zone : string
The time zone of this user.
email : string
The email of this user.
phone : string
The phone number of this user.
primary_group_id : integer
The ID of the primary group of this user.
user : string
The username of this user.
groups : list:
An array of all the groups this user is in. - id : integer The ID of this group. - organization_id : integer The organization associated with this group. - name : string The name of this group.
title : string
The title of this user.
state : string
The state of this user.
id : integer
The ID of this user.
prefers_sms_otp : string
The preference for phone authorization of this user
-
get_api_keys
(id, key_id)¶ Show the specified API key
Parameters: id : string
The ID of the user or ‘me’.
key_id : integer
The ID of the API key.
Returns: use_count : integer
The number of times the key has been used.
active : boolean
True if the key has neither expired nor been revoked.
expired : boolean
True if the key has expired.
last_used_at : string/date-time
The date and time when the key was last used.
expires_at : string/date-time
The date and time when the key expired.
revoked_at : string/date-time
The date and time when the key was revoked.
scopes : list
The scopes which the key is permissioned on.
name : string
The name of the API key.
constraints : list:
Constraints on the abilities of the created key - get_allowed : boolean Whether the constraint allows GET requests. - constraint : string The path matcher of the constraint. - head_allowed : boolean Whether the constraint allows HEAD requests. - delete_allowed : boolean Whether the constraint allows DELETE requests. - constraint_type : string The type of constraint (exact/prefix/regex/verb). - patch_allowed : boolean Whether the constraint allows PATCH requests. - post_allowed : boolean Whether the constraint allows POST requests. - put_allowed : boolean Whether the constraint allows PUT requests.
id : integer
The ID of the API key.
created_at : string/date-time
The date and time when the key was created.
-
list
(**kwargs)¶ List users
Parameters: feature_flag : string, optional
Return users that have a feature flag enabled.
account_status : string, optional
The account status by which to filter users. May be one of “active”, “inactive”, or “all”.
query : string, optional
Return users who match the given query, based on name, user, and email.
limit : integer, optional
Number of results to return. Defaults to 20. Maximum allowed is 10000.
page_num : integer, optional
Page number of the results to return. Defaults to the first page, 1.
order : string, optional
The field on which to order the result set. Defaults to name. Must be one of: name, user.
order_dir : string, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to asc.
iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: primary_group_id : integer
The ID of the primary group of this user.
created_at : string/date-time
The date and time when the user was created.
user : string
The username of this user.
name : string
The name of this user.
id : integer
The ID of this user.
groups : list:
An array of all the groups this user is in. - id : integer The ID of this group. - organization_id : integer The organization associated with this group. - name : string The name of this group.
current_sign_in_at : string/date-time
The date and time when the user’s current session began.
email : string
The email of this user.
-
list_api_keys
(id, **kwargs)¶ Show API keys belonging to the specified user
Parameters: id : string
The ID of the user or ‘me’.
limit : integer, optional
Number of results to return. Defaults to its maximum of 50.
page_num : integer, optional
Page number of the results to return. Defaults to the first page, 1.
order : string, optional
The field on which to order the result set. Defaults to id. Must be one of: id.
order_dir : string, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: use_count : integer
The number of times the key has been used.
active : boolean
True if the key has neither expired nor been revoked.
expired : boolean
True if the key has expired.
last_used_at : string/date-time
The date and time when the key was last used.
expires_at : string/date-time
The date and time when the key expired.
revoked_at : string/date-time
The date and time when the key was revoked.
scopes : list
The scopes which the key is permissioned on.
name : string
The name of the API key.
constraint_count : integer
The number of constraints on the created key
id : integer
The ID of the API key.
created_at : string/date-time
The date and time when the key was created.
-
list_me
()¶ Show info about the logged-in user
Returns: custom_branding : string
The branding of Platform for this user.
initials : string
This user’s initials.
name : string
This user’s name.
username : string
This user’s username.
feature_flags : dict
The feature flag settings for this user.
id : integer
The ID of this user.
last_checked_announcements : string/date-time
The date and time at which the user last checked their announcements.
preferences : dict
This user’s preferences.
email : string
This user’s email address.
groups : list:
An array of all the groups this user is in. - id : integer The ID of this group. - organization_id : integer The organization associated with this group. - name : string The name of this group.
-
list_me_api_accesses
(**kwargs)¶ Show API accesses made by or on behalf of the logged-in user
Parameters: limit : integer, optional
Number of results to return. Defaults to its maximum of 50.
page_num : integer, optional
Page number of the results to return. Defaults to the first page, 1.
order : string, optional
The field on which to order the result set. Defaults to id. Must be one of: id.
order_dir : string, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: method : string
requested_version : integer
ip : string
id : integer
created_at : string/time
status_code : string
path : string
processing_seconds : number/float
api_key_id : integer
-
patch_me
(**kwargs)¶ Update info about the logged-in user
Parameters: preferences : dict, optional:
- model_index_order_dir : string Order direction for the models index page. - script_index_order_dir : string Order direction for the scripts index page. - model_index_thumbnail_view : string Thumbnail view for the models index page. - script_index_order_field : string Order field for the scripts index page. - project_index_author_filter : string Author filter for the projects index page. - project_index_order_dir : string Order direction for the projects index page. - model_index_archived_filter : string Archived filter for the models index page. - project_detail_order_field : string Order field for projects detail pages. - export_index_order_field : string Order field for the exports index page. - import_index_author_filter : string Author filter for the imports index page. - script_index_type_filter : string Type filter for the scripts index page. - export_index_order_dir : string Order direction for the exports index page. - report_index_thumbnail_view : string Thumbnail view for the reports index page. - script_index_archived_filter : string Archived filter for the scripts index page. - result_index_type_filter : string Type filter for the results index page. - project_detail_type_filter : string Type filter for projects detail pages. - project_detail_author_filter : string Author filter for projects detail pages. - app_index_order_field : string Order field for the apps index pages. - model_index_author_filter : string Author filter for the models index page. - result_index_author_filter : string Author filter for the results index page. - export_index_author_filter : string Author filter for the exports index page. - import_index_archived_filter : string Archived filter for the imports index page. - result_index_archived_filter : string Archived filter for the results index page. - model_index_order_field : string Order field for the models index page. - import_index_order_field : string Order field for the imports index page. - app_index_order_dir : string Oder direction for the apps index pages. - project_index_archived_filter : string Archived filter for the projects index page. - import_index_status_filter : string Status filter for the imports index page. - import_index_type_filter : string Type filter for the imports index page. - export_index_status_filter : string Status filter for the exports index page. - preferred_server_id : integer ID of preferred server. - import_index_order_dir : string Order direction for the imports index page. - import_index_dest_filter : string Destination filter for the imports index page. - result_index_order_dir : string Order direction for the results index page. - result_index_order_field : string Order field for the results index page. - script_index_author_filter : string Author filter for the scripts index page. - project_detail_archived_filter : string Arhived filter for the projects detail pages. - project_detail_order_dir : string Order direction for projects detail pages. - script_index_status_filter : string Status filter for the scripts index page. - project_index_order_field : string Order field for the projects index page. - export_index_type_filter : string Type filter for the exports index page. - model_index_status_filter : string Status filter for the models index page.
last_checked_announcements : string/date-time, optional
The date and time at which the user last checked their announcements.
Returns: custom_branding : string
The branding of Platform for this user.
initials : string
This user’s initials.
name : string
This user’s name.
username : string
This user’s username.
feature_flags : dict
The feature flag settings for this user.
id : integer
The ID of this user.
last_checked_announcements : string/date-time
The date and time at which the user last checked their announcements.
preferences : dict
This user’s preferences.
email : string
This user’s email address.
groups : list:
An array of all the groups this user is in. - id : integer The ID of this group. - organization_id : integer The organization associated with this group. - name : string The name of this group.
-
post_api_keys
(id, expires_in, name, **kwargs)¶ Create a new API key belonging to the logged-in user
Parameters: id : string
The ID of the user or ‘me’.
expires_in : integer
The number of seconds the key should last for.
name : string
The name of the API key.
constraints : list, optional:
Constraints on the abilities of the created key. - get_allowed : boolean Whether the constraint allows GET requests. - constraint : string The path matcher of the constraint. - head_allowed : boolean Whether the constraint allows HEAD requests. - delete_allowed : boolean Whether the constraint allows DELETE requests. - constraint_type : string The type of constraint (exact/prefix/regex/verb). - patch_allowed : boolean Whether the constraint allows PATCH requests. - post_allowed : boolean Whether the constraint allows POST requests. - put_allowed : boolean Whether the constraint allows PUT requests.
Returns: use_count : integer
The number of times the key has been used.
active : boolean
True if the key has neither expired nor been revoked.
expired : boolean
True if the key has expired.
revoked_at : string/date-time
The date and time when the key was revoked.
scopes : list
The scopes which the key is permissioned on.
name : string
The name of the API key.
constraints : list:
Constraints on the abilities of the created key - get_allowed : boolean Whether the constraint allows GET requests. - constraint : string The path matcher of the constraint. - head_allowed : boolean Whether the constraint allows HEAD requests. - delete_allowed : boolean Whether the constraint allows DELETE requests. - constraint_type : string The type of constraint (exact/prefix/regex/verb). - patch_allowed : boolean Whether the constraint allows PATCH requests. - post_allowed : boolean Whether the constraint allows POST requests. - put_allowed : boolean Whether the constraint allows PUT requests.
last_used_at : string/date-time
The date and time when the key was last used.
expires_at : string/date-time
The date and time when the key expired.
token : string
The API key.
id : integer
The ID of the API key.
created_at : string/date-time
The date and time when the key was created.
-