Scripts

class Scripts(session_kwargs, client, return_type='raw')

Examples

>>> import civis
>>> client = civis.APIClient()
>>> client.scripts.list_types(...)

Methods

delete_containers_projects(id, project_id)

Remove a Container Script 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_projects(id, project_id)

Remove a Custom Script 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_projects(id, project_id)

Remove a JavaScript Script 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_projects(id, project_id)

Remove a Python Script 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_projects(id, project_id)

Remove an R Script 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_projects(id, project_id)

Remove a SQL Script 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 Custom Script

get_custom_runs(id, run_id)

Check status of a run

get_javascript(id)

Get a JavaScript Script

get_javascript_git_commits(id, commit_hash)

Get file contents at git ref

get_javascript_runs(id, run_id)

Check status of a run

get_python3(id)

Get a Python Script

get_python3_git_commits(id, commit_hash)

Get file contents at git ref

get_python3_runs(id, run_id)

Check status of a run

get_r(id)

Get an R Script

get_r_git_commits(id, commit_hash)

Get file contents at git ref

get_r_runs(id, run_id)

Check status of a run

get_sql(id)

Get a SQL Script

get_sql_git_commits(id, commit_hash)

Get file contents at git ref

get_sql_runs(id, run_id)

Check status of a run

list(*[, type, category, author, status, ...])

List Scripts

list_containers_dependencies(id, *[, user_id])

List dependent objects for this object

list_containers_projects(id, *[, hidden])

List the projects a Container Script belongs to

list_containers_runs(id, *[, limit, ...])

List runs for the given Container job

list_containers_runs_logs(id, run_id, *[, ...])

Get the logs for a run

list_containers_runs_outputs(id, run_id, *)

List the outputs for a run

list_containers_shares(id)

List users and groups permissioned on this object

list_custom(*[, from_template_id, author, ...])

List Custom Scripts

list_custom_dependencies(id, *[, user_id])

List dependent objects for this object

list_custom_projects(id, *[, hidden])

List the projects a Custom Script belongs to

list_custom_runs(id, *[, limit, page_num, ...])

List runs for the given Custom job

list_custom_runs_logs(id, run_id, *[, ...])

Get the logs for a run

list_custom_runs_outputs(id, run_id, *[, ...])

List the outputs for a run

list_custom_shares(id)

List users and groups permissioned on this object

list_dbt_runs_logs(id, run_id, *[, last_id, ...])

Get the logs for a run

list_history(id)

Get the run history and outputs of this script

list_javascript_dependencies(id, *[, user_id])

List dependent objects for this object

list_javascript_git(id)

Get the git metadata attached to an item

list_javascript_git_commits(id)

Get the git commits for an item on the current branch

list_javascript_projects(id, *[, hidden])

List the projects a JavaScript Script belongs to

list_javascript_runs(id, *[, limit, ...])

List runs for the given Javascript job

list_javascript_runs_logs(id, run_id, *[, ...])

Get the logs for a run

list_javascript_runs_outputs(id, run_id, *)

List the outputs for a run

list_javascript_shares(id)

List users and groups permissioned on this object

list_python3_dependencies(id, *[, user_id])

List dependent objects for this object

list_python3_git(id)

Get the git metadata attached to an item

list_python3_git_commits(id)

Get the git commits for an item on the current branch

list_python3_projects(id, *[, hidden])

List the projects a Python Script belongs to

list_python3_runs(id, *[, limit, page_num, ...])

List runs for the given Python job

list_python3_runs_logs(id, run_id, *[, ...])

Get the logs for a run

list_python3_runs_outputs(id, run_id, *[, ...])

List the outputs for a run

list_python3_shares(id)

List users and groups permissioned on this object

list_r_dependencies(id, *[, user_id])

List dependent objects for this object

list_r_git(id)

Get the git metadata attached to an item

list_r_git_commits(id)

Get the git commits for an item on the current branch

list_r_projects(id, *[, hidden])

List the projects an R Script belongs to

list_r_runs(id, *[, limit, page_num, order, ...])

List runs for the given R job

list_r_runs_logs(id, run_id, *[, last_id, limit])

Get the logs for a run

list_r_runs_outputs(id, run_id, *[, limit, ...])

List the outputs for a run

list_r_shares(id)

List users and groups permissioned on this object

list_sql_dependencies(id, *[, user_id])

List dependent objects for this object

list_sql_git(id)

Get the git metadata attached to an item

list_sql_git_commits(id)

Get the git commits for an item on the current branch

list_sql_projects(id, *[, hidden])

List the projects a SQL Script belongs to

list_sql_runs(id, *[, limit, page_num, ...])

List runs for the given SQL job

list_sql_runs_logs(id, run_id, *[, last_id, ...])

Get the logs for a run

list_sql_runs_outputs(id, run_id, *[, ...])

List the outputs for a run

list_sql_shares(id)

List users and groups permissioned on this object

list_types()

List available script types

patch(id, *[, name, sql, params, arguments, ...])

Update a script

patch_container_runs(id, run_id, *[, error])

Update the given run

patch_containers(id, *[, name, parent_id, ...])

Update a container

patch_custom(id, *[, name, parent_id, ...])

Update some attributes of this Custom Script

patch_javascript(id, *[, name, parent_id, ...])

Update some attributes of this JavaScript Script

patch_javascript_git(id, *[, git_ref, ...])

Update an attached git file

patch_javascript_runs(id, run_id, *[, error])

Update the given run

patch_python3(id, *[, name, parent_id, ...])

Update some attributes of this Python Script

patch_python3_git(id, *[, git_ref, ...])

Update an attached git file

patch_python3_runs(id, run_id, *[, error])

Update the given run

patch_r(id, *[, name, parent_id, ...])

Update some attributes of this R Script

patch_r_git(id, *[, git_ref, git_branch, ...])

Update an attached git file

patch_r_runs(id, run_id, *[, error])

Update the given run

patch_sql(id, *[, name, parent_id, ...])

Update some attributes of this SQL Script

patch_sql_git(id, *[, git_ref, git_branch, ...])

Update an attached git file

patch_sql_runs(id, run_id, *[, error])

Update the given run

post(name, remote_host_id, credential_id, sql, *)

Create a script

post_cancel(id)

Cancel a run

post_containers(required_resources, ...[, ...])

Create a container

post_containers_clone(id, *[, ...])

Clone this Container Script

post_containers_runs(id)

Start a run

post_containers_runs_logs(id, run_id, *[, ...])

Add log messages

post_containers_runs_outputs(id, run_id, ...)

Add an output for a run

post_custom(from_template_id, *[, name, ...])

Create a Custom Script

post_custom_clone(id, *[, clone_schedule, ...])

Clone this Custom Script

post_custom_runs(id)

Start a run

post_custom_runs_outputs(id, run_id, ...)

Add an output for a run

post_javascript(name, source, ...[, ...])

Create a JavaScript Script

post_javascript_clone(id, *[, ...])

Clone this JavaScript Script

post_javascript_git_checkout(id)

Checkout content that the existing git_ref points to and save to the object

post_javascript_git_checkout_latest(id)

Checkout latest commit on the current branch of a script or workflow

post_javascript_git_commits(id, content, ...)

Commit and push a new version of the file

post_javascript_runs(id)

Start a run

post_javascript_runs_outputs(id, run_id, ...)

Add an output for a run

post_python3(name, source, *[, parent_id, ...])

Create a Python Script

post_python3_clone(id, *[, clone_schedule, ...])

Clone this Python Script

post_python3_git_checkout(id)

Checkout content that the existing git_ref points to and save to the object

post_python3_git_checkout_latest(id)

Checkout latest commit on the current branch of a script or workflow

post_python3_git_commits(id, content, ...)

Commit and push a new version of the file

post_python3_runs(id)

Start a run

post_python3_runs_outputs(id, run_id, ...)

Add an output for a run

post_r(name, source, *[, parent_id, ...])

Create an R Script

post_r_clone(id, *[, clone_schedule, ...])

Clone this R Script

post_r_git_checkout(id)

Checkout content that the existing git_ref points to and save to the object

post_r_git_checkout_latest(id)

Checkout latest commit on the current branch of a script or workflow

post_r_git_commits(id, content, message, ...)

Commit and push a new version of the file

post_r_runs(id)

Start a run

post_r_runs_outputs(id, run_id, object_type, ...)

Add an output for a run

post_run(id)

Run a script

post_sql(name, sql, remote_host_id, ...[, ...])

Create a SQL Script

post_sql_clone(id, *[, clone_schedule, ...])

Clone this SQL Script

post_sql_git_checkout(id)

Checkout content that the existing git_ref points to and save to the object

post_sql_git_checkout_latest(id)

Checkout latest commit on the current branch of a script or workflow

post_sql_git_commits(id, content, message, ...)

Commit and push a new version of the file

post_sql_runs(id)

Start a run

put_containers(id, required_resources, ...)

Edit a container

put_containers_archive(id, status)

Update the archive status of this object

put_containers_projects(id, project_id)

Add a Container Script to a project

put_containers_shares_groups(id, group_ids, ...)

Set the permissions groups has on this object

put_containers_shares_users(id, user_ids, ...)

Set the permissions users have on this object

put_containers_transfer(id, user_id, ...[, ...])

Transfer ownership of this object to another user

put_custom(id, *[, name, parent_id, ...])

Replace all attributes of this Custom Script

put_custom_archive(id, status)

Update the archive status of this object

put_custom_projects(id, project_id)

Add a Custom Script to a project

put_custom_shares_groups(id, group_ids, ...)

Set the permissions groups has on this object

put_custom_shares_users(id, user_ids, ...[, ...])

Set the permissions users have on this object

put_custom_transfer(id, user_id, ...[, ...])

Transfer ownership of this object to another user

put_javascript(id, name, source, ...[, ...])

Replace all attributes of this JavaScript Script

put_javascript_archive(id, status)

Update the archive status of this object

put_javascript_git(id, *[, git_ref, ...])

Attach an item to a file in a git repo

put_javascript_projects(id, project_id)

Add a JavaScript Script to a project

put_javascript_shares_groups(id, group_ids, ...)

Set the permissions groups has on this object

put_javascript_shares_users(id, user_ids, ...)

Set the permissions users have on this object

put_javascript_transfer(id, user_id, ...[, ...])

Transfer ownership of this object to another user

put_python3(id, name, source, *[, ...])

Replace all attributes of this Python Script

put_python3_archive(id, status)

Update the archive status of this object

put_python3_git(id, *[, git_ref, ...])

Attach an item to a file in a git repo

put_python3_projects(id, project_id)

Add a Python Script to a project

put_python3_shares_groups(id, group_ids, ...)

Set the permissions groups has on this object

put_python3_shares_users(id, user_ids, ...)

Set the permissions users have on this object

put_python3_transfer(id, user_id, ...[, ...])

Transfer ownership of this object to another user

put_r(id, name, source, *[, parent_id, ...])

Replace all attributes of this R Script

put_r_archive(id, status)

Update the archive status of this object

put_r_git(id, *[, git_ref, git_branch, ...])

Attach an item to a file in a git repo

put_r_projects(id, project_id)

Add an R Script to a project

put_r_shares_groups(id, group_ids, ...[, ...])

Set the permissions groups has on this object

put_r_shares_users(id, user_ids, ...[, ...])

Set the permissions users have on this object

put_r_transfer(id, user_id, ...[, ...])

Transfer ownership of this object to another user

put_sql(id, name, sql, remote_host_id, ...)

Replace all attributes of this SQL Script

put_sql_archive(id, status)

Update the archive status of this object

put_sql_git(id, *[, git_ref, git_branch, ...])

Attach an item to a file in a git repo

put_sql_projects(id, project_id)

Add a SQL Script to a project

put_sql_shares_groups(id, group_ids, ...[, ...])

Set the permissions groups has on this object

put_sql_shares_users(id, user_ids, ...[, ...])

Set the permissions users have on this object

put_sql_transfer(id, user_id, ...[, ...])

Transfer ownership of this object to another user

delete_containers_projects(id: int, project_id: int)

Remove a Container Script from a project

Parameters:
idint

The ID of the Container Script.

project_idint

The ID of the project.

Returns:
None

Response code 204: success

delete_containers_runs(id: int, run_id: int)

Cancel a run

Parameters:
idint

The ID of the Container job.

run_idint

The ID of the run.

Returns:
None

Response code 202: success

delete_containers_shares_groups(id: int, group_id: int)

Revoke the permissions a group has on this object

Parameters:
idint

The ID of the resource that is shared.

group_idint

The ID of the group.

Returns:
None

Response code 204: success

delete_containers_shares_users(id: int, user_id: int)

Revoke the permissions a user has on this object

Parameters:
idint

The ID of the resource that is shared.

user_idint

The ID of the user.

Returns:
None

Response code 204: success

delete_custom_projects(id: int, project_id: int)

Remove a Custom Script from a project

Parameters:
idint

The ID of the Custom Script.

project_idint

The ID of the project.

Returns:
None

Response code 204: success

delete_custom_runs(id: int, run_id: int)

Cancel a run

Parameters:
idint

The ID of the Custom job.

run_idint

The ID of the run.

Returns:
None

Response code 202: success

delete_custom_shares_groups(id: int, group_id: int)

Revoke the permissions a group has on this object

Parameters:
idint

The ID of the resource that is shared.

group_idint

The ID of the group.

Returns:
None

Response code 204: success

delete_custom_shares_users(id: int, user_id: int)

Revoke the permissions a user has on this object

Parameters:
idint

The ID of the resource that is shared.

user_idint

The ID of the user.

Returns:
None

Response code 204: success

delete_javascript_projects(id: int, project_id: int)

Remove a JavaScript Script from a project

Parameters:
idint

The ID of the JavaScript Script.

project_idint

The ID of the project.

Returns:
None

Response code 204: success

delete_javascript_runs(id: int, run_id: int)

Cancel a run

Parameters:
idint

The ID of the Javascript job.

run_idint

The ID of the run.

Returns:
None

Response code 202: success

delete_javascript_shares_groups(id: int, group_id: int)

Revoke the permissions a group has on this object

Parameters:
idint

The ID of the resource that is shared.

group_idint

The ID of the group.

Returns:
None

Response code 204: success

delete_javascript_shares_users(id: int, user_id: int)

Revoke the permissions a user has on this object

Parameters:
idint

The ID of the resource that is shared.

user_idint

The ID of the user.

Returns:
None

Response code 204: success

delete_python3_projects(id: int, project_id: int)

Remove a Python Script from a project

Parameters:
idint

The ID of the Python Script.

project_idint

The ID of the project.

Returns:
None

Response code 204: success

delete_python3_runs(id: int, run_id: int)

Cancel a run

Parameters:
idint

The ID of the Python job.

run_idint

The ID of the run.

Returns:
None

Response code 202: success

delete_python3_shares_groups(id: int, group_id: int)

Revoke the permissions a group has on this object

Parameters:
idint

The ID of the resource that is shared.

group_idint

The ID of the group.

Returns:
None

Response code 204: success

delete_python3_shares_users(id: int, user_id: int)

Revoke the permissions a user has on this object

Parameters:
idint

The ID of the resource that is shared.

user_idint

The ID of the user.

Returns:
None

Response code 204: success

delete_r_projects(id: int, project_id: int)

Remove an R Script from a project

Parameters:
idint

The ID of the R Script.

project_idint

The ID of the project.

Returns:
None

Response code 204: success

delete_r_runs(id: int, run_id: int)

Cancel a run

Parameters:
idint

The ID of the R job.

run_idint

The ID of the run.

Returns:
None

Response code 202: success

delete_r_shares_groups(id: int, group_id: int)

Revoke the permissions a group has on this object

Parameters:
idint

The ID of the resource that is shared.

group_idint

The ID of the group.

Returns:
None

Response code 204: success

delete_r_shares_users(id: int, user_id: int)

Revoke the permissions a user has on this object

Parameters:
idint

The ID of the resource that is shared.

user_idint

The ID of the user.

Returns:
None

Response code 204: success

delete_sql_projects(id: int, project_id: int)

Remove a SQL Script from a project

Parameters:
idint

The ID of the SQL Script.

project_idint

The ID of the project.

Returns:
None

Response code 204: success

delete_sql_runs(id: int, run_id: int)

Cancel a run

Parameters:
idint

The ID of the SQL job.

run_idint

The ID of the run.

Returns:
None

Response code 202: success

delete_sql_shares_groups(id: int, group_id: int)

Revoke the permissions a group has on this object

Parameters:
idint

The ID of the resource that is shared.

group_idint

The ID of the group.

Returns:
None

Response code 204: success

delete_sql_shares_users(id: int, user_id: int)

Revoke the permissions a user has on this object

Parameters:
idint

The ID of the resource that is shared.

user_idint

The ID of the user.

Returns:
None

Response code 204: success

get(id: int)

Get details about a script

Parameters:
idint

The ID for the script.

Returns:
civis.response.Response
  • idint

    The ID for the script.

  • namestr

    The name of the script.

  • typestr

    The type of script.

  • created_atstr (time)

    The time this script was created.

  • updated_atstr (time)

    The time this script was last updated.

  • authordict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • statestr

    The status of the script’s last run.

  • finished_atstr (time)

    The time that the script’s last run finished.

  • categorystr

    The category of the script.

  • projectsList[dict]

    A list of projects containing the script.

    • idint

      The ID for the project.

    • namestr

      The name of the project.

  • parent_idint

    The ID of the parent job that will trigger this script

  • user_contextstr

    “runner” or “author”, who to execute the script as when run as a template.

  • paramsList[dict]

    A definition of the parameters this script accepts in the arguments field.

    • namestr

      The variable’s name as used within your code.

    • labelstr

      The label to present to users when asking them for the value.

    • descriptionstr

      A short sentence or fragment describing this parameter to the end user.

    • typestr

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredbool

      Whether this param is required.

    • valuestr

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstr

      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.

    • allowed_valuesList[dict]

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templatebool

    Whether others scripts use this one as a template.

  • published_as_template_idint

    The ID of the template that this script is backing.

  • from_template_idint

    The ID of the template this script uses, if any.

  • template_dependents_countint

    How many other scripts use this one as a template.

  • template_script_namestr

    The name of the template script.

  • linksdict
    • detailsstr

      The details link to get more information about the script.

    • runsstr

      The runs link to get the run information list for this script.

  • scheduledict
    • scheduledbool

      If the item is scheduled.

    • scheduled_daysList[int]

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hoursList[int]

      Hours of the day it is scheduled on.

    • scheduled_minutesList[int]

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourint

      Deprecated in favor of scheduled minutes.

    • scheduled_days_of_monthList[int]

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict
    • urlsList[str]

      URLs to receive a POST request at job completion

    • success_email_subjectstr

      Custom subject line for success e-mail.

    • success_email_bodystr

      Custom body text for success e-mail, written in Markdown.

    • success_email_addressesList[str]

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestr

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostr

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addressesList[str]

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesint

      Stall warning emails will be sent after this amount of minutes.

    • success_onbool

      If success email notifications are on. Defaults to user’s preferences.

    • failure_onbool

      If failure email notifications are on. Defaults to user’s preferences.

  • running_asdict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • next_run_atstr (time)

    The time of the next scheduled run.

  • time_zonestr

    The time zone of this script.

  • last_rundict
    • id : int

    • state : str

    • created_atstr (time)

      The time that the run was queued.

    • started_atstr (time)

      The time that the run started.

    • finished_atstr (time)

      The time that the run completed.

    • errorstr

      The error message for this run, if present.

  • my_permission_levelstr

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenbool

    The hidden status of the item.

  • target_project_idint

    Target project to which script outputs will be added.

  • archivedstr

    The archival status of the requested item(s).

  • sqlstr

    The raw SQL query for the script.

  • expanded_argumentsdict

    Expanded arguments for use in injecting into different environments.

  • template_script_idint

    The ID of the template script, if any.

get_containers(id: int)

View a container

Parameters:
idint

The ID for the script.

Returns:
civis.response.Response
  • idint

    The ID for the script.

  • from_template_aliasesList[dict]

    An array of the aliases of the template script.

    • idint

      The id of the Alias object.

    • object_idint

      The id of the object

    • aliasstr

      The alias of the object

  • namestr

    The name of the container.

  • typestr

    The type of the script (e.g Container)

  • created_atstr (time)

    The time this script was created.

  • updated_atstr (time)

    The time the script was last updated.

  • authordict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • statestr

    The status of the script’s last run.

  • finished_atstr (time)

    The time that the script’s last run finished.

  • categorystr

    The category of the script.

  • projectsList[dict]

    A list of projects containing the script.

    • idint

      The ID for the project.

    • namestr

      The name of the project.

  • parent_idint

    The ID of the parent job that will trigger this script

  • user_contextstr

    “runner” or “author”, who to execute the script as when run as a template.

  • paramsList[dict]

    A definition of the parameters this script accepts in the arguments field.

    • namestr

      The variable’s name as used within your code.

    • labelstr

      The label to present to users when asking them for the value.

    • descriptionstr

      A short sentence or fragment describing this parameter to the end user.

    • typestr

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredbool

      Whether this param is required.

    • valuestr

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstr

      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.

    • allowed_valuesList[dict]

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templatebool

    Whether others scripts use this one as a template.

  • template_dependents_countint

    How many other scripts use this one as a template.

  • published_as_template_idint

    The ID of the template that this script is backing.

  • from_template_idint

    The ID of the template script.

  • template_script_namestr

    The name of the template script.

  • linksdict
    • detailsstr

      The details link to get more information about the script.

    • runsstr

      The runs link to get the run information list for this script.

  • scheduledict
    • scheduledbool

      If the item is scheduled.

    • scheduled_daysList[int]

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hoursList[int]

      Hours of the day it is scheduled on.

    • scheduled_minutesList[int]

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourint

      Deprecated in favor of scheduled minutes.

    • scheduled_days_of_monthList[int]

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict
    • urlsList[str]

      URLs to receive a POST request at job completion

    • success_email_subjectstr

      Custom subject line for success e-mail.

    • success_email_bodystr

      Custom body text for success e-mail, written in Markdown.

    • success_email_addressesList[str]

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestr

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostr

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addressesList[str]

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesint

      Stall warning emails will be sent after this amount of minutes.

    • success_onbool

      If success email notifications are on. Defaults to user’s preferences.

    • failure_onbool

      If failure email notifications are on. Defaults to user’s preferences.

  • running_asdict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • required_resourcesdict
    • cpuint

      The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.

    • memoryint

      The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.

    • disk_spacefloat (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.

  • repo_http_uristr

    The location of a github repo to clone into the container, e.g. github.com/my-user/my-repo.git.

  • repo_refstr

    The tag or branch of the github repo to clone into the container.

  • remote_host_credential_idint

    The id of the database credentials to pass into the environment of the container.

  • git_credential_idint

    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_commandstr

    The command to run on the container. Will be run via sh as: [“sh”, “-c”, dockerCommand]. Defaults to the Docker image’s ENTRYPOINT/CMD.

  • docker_image_namestr

    The name of the docker image to pull from DockerHub.

  • docker_image_tagstr

    The tag of the docker image to pull from DockerHub.

  • instance_typestr

    The EC2 instance type to deploy to. Only available for jobs running on kubernetes.

  • cancel_timeoutint

    The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.

  • last_rundict
    • id : int

    • state : str

    • created_atstr (time)

      The time that the run was queued.

    • started_atstr (time)

      The time that the run started.

    • finished_atstr (time)

      The time that the run completed.

    • errorstr

      The error message for this run, if present.

  • time_zonestr

    The time zone of this script.

  • partition_labelstr

    The partition label used to run this object.

  • my_permission_levelstr

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenbool

    The hidden status of the item.

  • archivedstr

    The archival status of the requested item(s).

  • target_project_idint

    Target project to which script outputs will be added.

  • running_as_idint

    The ID of the runner of this script.

get_containers_runs(id: int, run_id: int)

Check status of a run

Parameters:
idint

The ID of the Container job.

run_idint

The ID of the run.

Returns:
civis.response.Response
  • idint

    The ID of the run.

  • container_idint

    The ID of the Container job.

  • statestr

    The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.

  • is_cancel_requestedbool

    True if run cancel requested, else false.

  • created_atstr (time)

    The time the run was created.

  • started_atstr (time)

    The time the run started at.

  • finished_atstr (time)

    The time the run completed.

  • errorstr

    The error, if any, returned by the run.

  • max_memory_usagefloat (float)

    If the run has finished, the maximum amount of memory used during the run, in MB.

  • max_cpu_usagefloat (float)

    If the run has finished, the maximum amount of cpu used during the run, in millicores.

get_custom(id: int)

Get a Custom Script

Parameters:
idint
Returns:
civis.response.Response
  • idint

    The ID for the script.

  • from_template_aliasesList[dict]

    An array of the aliases of the template script.

    • idint

      The id of the Alias object.

    • object_idint

      The id of the object

    • aliasstr

      The alias of the object

  • namestr

    The name of the script.

  • typestr

    The type of the script (e.g Custom)

  • backing_script_typestr

    The type of the script backing this template (e.g Python)

  • created_atstr (time)

    The time this script was created.

  • updated_atstr (time)

    The time the script was last updated.

  • authordict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • statestr

    The status of the script’s last run.

  • finished_atstr (time)

    The time that the script’s last run finished.

  • category : str

  • projectsList[dict]

    A list of projects containing the script.

    • idint

      The ID for the project.

    • namestr

      The name of the project.

  • parent_idint

    The ID of the parent job that will trigger this script

  • paramsList[dict]

    A definition of the parameters this script accepts in the arguments field.

    • namestr

      The variable’s name as used within your code.

    • labelstr

      The label to present to users when asking them for the value.

    • descriptionstr

      A short sentence or fragment describing this parameter to the end user.

    • typestr

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredbool

      Whether this param is required.

    • valuestr

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstr

      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.

    • allowed_valuesList[dict]

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templatebool

    Whether others scripts use this one as a template.

  • published_as_template_idint

    The ID of the template that this script is backing.

  • from_template_idint

    The ID of the template script.

  • ui_report_urlint

    The url of the custom HTML.

  • ui_report_idint

    The id of the report with the custom HTML.

  • ui_report_provide_api_keybool

    Whether the ui report requests an API Key from the report viewer.

  • template_script_namestr

    The name of the template script.

  • template_notestr

    The template’s note.

  • remote_host_idint

    The remote host ID that this script will connect to.

  • credential_idint

    The credential that this script will use.

  • code_previewstr

    The code that this script will run with arguments inserted.

  • scheduledict
    • scheduledbool

      If the item is scheduled.

    • scheduled_daysList[int]

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hoursList[int]

      Hours of the day it is scheduled on.

    • scheduled_minutesList[int]

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourint

      Deprecated in favor of scheduled minutes.

    • scheduled_days_of_monthList[int]

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict
    • urlsList[str]

      URLs to receive a POST request at job completion

    • success_email_subjectstr

      Custom subject line for success e-mail.

    • success_email_bodystr

      Custom body text for success e-mail, written in Markdown.

    • success_email_addressesList[str]

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestr

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostr

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addressesList[str]

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesint

      Stall warning emails will be sent after this amount of minutes.

    • success_onbool

      If success email notifications are on. Defaults to user’s preferences.

    • failure_onbool

      If failure email notifications are on. Defaults to user’s preferences.

  • running_asdict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • time_zonestr

    The time zone of this script.

  • last_rundict
    • id : int

    • state : str

    • created_atstr (time)

      The time that the run was queued.

    • started_atstr (time)

      The time that the run started.

    • finished_atstr (time)

      The time that the run completed.

    • errorstr

      The error message for this run, if present.

  • my_permission_levelstr

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenbool

    The hidden status of the item.

  • archivedstr

    The archival status of the requested item(s).

  • target_project_idint

    Target project to which script outputs will be added.

  • last_successful_rundict
    • id : int

    • state : str

    • created_atstr (time)

      The time that the run was queued.

    • started_atstr (time)

      The time that the run started.

    • finished_atstr (time)

      The time that the run completed.

    • errorstr

      The error message for this run, if present.

  • required_resourcesdict
    • cpuint

      The number of CPU shares to allocate for the container. Each core has 1000 shares.

    • memoryint

      The amount of RAM to allocate for the container (in MB).

    • disk_spacefloat (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.

  • partition_labelstr

    The partition label used to run this object. Only applicable for jobs using Docker.

  • running_as_idint

    The ID of the runner of this script.

get_custom_runs(id: int, run_id: int)

Check status of a run

Parameters:
idint

The ID of the Custom job.

run_idint

The ID of the run.

Returns:
civis.response.Response
  • idint

    The ID of the run.

  • custom_idint

    The ID of the Custom job.

  • statestr

    The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.

  • is_cancel_requestedbool

    True if run cancel requested, else false.

  • created_atstr (time)

    The time the run was created.

  • started_atstr (time)

    The time the run started at.

  • finished_atstr (time)

    The time the run completed.

  • errorstr

    The error, if any, returned by the run.

  • max_memory_usagefloat (float)

    If the run has finished, the maximum amount of memory used during the run, in MB. Only available if the backing script is a Python, R, or container script.

  • max_cpu_usagefloat (float)

    If the run has finished, the maximum amount of cpu used during the run, in millicores. Only available if the backing script is a Python, R, or container script.

get_javascript(id: int)

Get a JavaScript Script

Parameters:
idint
Returns:
civis.response.Response
  • idint

    The ID for the script.

  • namestr

    The name of the script.

  • typestr

    The type of the script (e.g SQL, Container, Python, R, JavaScript, dbt)

  • created_atstr (time)

    The time this script was created.

  • updated_atstr (time)

    The time the script was last updated.

  • authordict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • statestr

    The status of the script’s last run.

  • finished_atstr (time)

    The time that the script’s last run finished.

  • categorystr

    The category of the script.

  • projectsList[dict]

    A list of projects containing the script.

    • idint

      The ID for the project.

    • namestr

      The name of the project.

  • parent_idint

    The ID of the parent job that will trigger this script

  • user_contextstr

    “runner” or “author”, who to execute the script as when run as a template.

  • paramsList[dict]

    A definition of the parameters this script accepts in the arguments field.

    • namestr

      The variable’s name as used within your code.

    • labelstr

      The label to present to users when asking them for the value.

    • descriptionstr

      A short sentence or fragment describing this parameter to the end user.

    • typestr

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredbool

      Whether this param is required.

    • valuestr

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstr

      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.

    • allowed_valuesList[dict]

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templatebool

    Whether others scripts use this one as a template.

  • published_as_template_idint

    The ID of the template that this script is backing.

  • from_template_idint

    The ID of the template this script uses, if any.

  • template_dependents_countint

    How many other scripts use this one as a template.

  • template_script_namestr

    The name of the template script.

  • linksdict
    • detailsstr

      The details link to get more information about the script.

    • runsstr

      The runs link to get the run information list for this script.

  • scheduledict
    • scheduledbool

      If the item is scheduled.

    • scheduled_daysList[int]

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hoursList[int]

      Hours of the day it is scheduled on.

    • scheduled_minutesList[int]

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourint

      Deprecated in favor of scheduled minutes.

    • scheduled_days_of_monthList[int]

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict
    • urlsList[str]

      URLs to receive a POST request at job completion

    • success_email_subjectstr

      Custom subject line for success e-mail.

    • success_email_bodystr

      Custom body text for success e-mail, written in Markdown.

    • success_email_addressesList[str]

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestr

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostr

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addressesList[str]

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesint

      Stall warning emails will be sent after this amount of minutes.

    • success_onbool

      If success email notifications are on. Defaults to user’s preferences.

    • failure_onbool

      If failure email notifications are on. Defaults to user’s preferences.

  • running_asdict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • next_run_atstr (time)

    The time of the next scheduled run.

  • time_zonestr

    The time zone of this script.

  • last_rundict
    • id : int

    • state : str

    • created_atstr (time)

      The time that the run was queued.

    • started_atstr (time)

      The time that the run started.

    • finished_atstr (time)

      The time that the run completed.

    • errorstr

      The error message for this run, if present.

  • my_permission_levelstr

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenbool

    The hidden status of the item.

  • target_project_idint

    Target project to which script outputs will be added.

  • archivedstr

    The archival status of the requested item(s).

  • sourcestr

    The body/text of the script.

  • remote_host_idint

    The remote host ID that this script will connect to.

  • credential_idint

    The credential that this script will use.

  • running_as_idint

    The ID of the runner of this script.

get_javascript_git_commits(id: int, commit_hash: str)

Get file contents at git ref

Parameters:
idint

The ID of the file.

commit_hashstr

The SHA (full or shortened) of the desired git commit.

Returns:
civis.response.Response
  • contentstr

    The file’s contents.

  • typestr

    The file’s type.

  • sizeint

    The file’s size.

  • file_hashstr

    The SHA of the file.

get_javascript_runs(id: int, run_id: int)

Check status of a run

Parameters:
idint

The ID of the Javascript job.

run_idint

The ID of the run.

Returns:
civis.response.Response
  • idint

    The ID of the run.

  • javascript_idint

    The ID of the Javascript job.

  • statestr

    The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.

  • is_cancel_requestedbool

    True if run cancel requested, else false.

  • created_atstr (time)

    The time the run was created.

  • started_atstr (time)

    The time the run started at.

  • finished_atstr (time)

    The time the run completed.

  • errorstr

    The error, if any, returned by the run.

get_python3(id: int)

Get a Python Script

Parameters:
idint
Returns:
civis.response.Response
  • idint

    The ID for the script.

  • namestr

    The name of the script.

  • typestr

    The type of the script (e.g SQL, Container, Python, R, JavaScript, dbt)

  • created_atstr (time)

    The time this script was created.

  • updated_atstr (time)

    The time the script was last updated.

  • authordict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • statestr

    The status of the script’s last run.

  • finished_atstr (time)

    The time that the script’s last run finished.

  • categorystr

    The category of the script.

  • projectsList[dict]

    A list of projects containing the script.

    • idint

      The ID for the project.

    • namestr

      The name of the project.

  • parent_idint

    The ID of the parent job that will trigger this script

  • user_contextstr

    “runner” or “author”, who to execute the script as when run as a template.

  • paramsList[dict]

    A definition of the parameters this script accepts in the arguments field.

    • namestr

      The variable’s name as used within your code.

    • labelstr

      The label to present to users when asking them for the value.

    • descriptionstr

      A short sentence or fragment describing this parameter to the end user.

    • typestr

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredbool

      Whether this param is required.

    • valuestr

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstr

      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.

    • allowed_valuesList[dict]

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templatebool

    Whether others scripts use this one as a template.

  • published_as_template_idint

    The ID of the template that this script is backing.

  • from_template_idint

    The ID of the template this script uses, if any.

  • template_dependents_countint

    How many other scripts use this one as a template.

  • template_script_namestr

    The name of the template script.

  • linksdict
    • detailsstr

      The details link to get more information about the script.

    • runsstr

      The runs link to get the run information list for this script.

  • scheduledict
    • scheduledbool

      If the item is scheduled.

    • scheduled_daysList[int]

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hoursList[int]

      Hours of the day it is scheduled on.

    • scheduled_minutesList[int]

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourint

      Deprecated in favor of scheduled minutes.

    • scheduled_days_of_monthList[int]

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict
    • urlsList[str]

      URLs to receive a POST request at job completion

    • success_email_subjectstr

      Custom subject line for success e-mail.

    • success_email_bodystr

      Custom body text for success e-mail, written in Markdown.

    • success_email_addressesList[str]

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestr

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostr

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addressesList[str]

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesint

      Stall warning emails will be sent after this amount of minutes.

    • success_onbool

      If success email notifications are on. Defaults to user’s preferences.

    • failure_onbool

      If failure email notifications are on. Defaults to user’s preferences.

  • running_asdict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • next_run_atstr (time)

    The time of the next scheduled run.

  • time_zonestr

    The time zone of this script.

  • last_rundict
    • id : int

    • state : str

    • created_atstr (time)

      The time that the run was queued.

    • started_atstr (time)

      The time that the run started.

    • finished_atstr (time)

      The time that the run completed.

    • errorstr

      The error message for this run, if present.

  • my_permission_levelstr

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenbool

    The hidden status of the item.

  • target_project_idint

    Target project to which script outputs will be added.

  • archivedstr

    The archival status of the requested item(s).

  • required_resourcesdict
    • cpuint

      The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.

    • memoryint

      The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.

    • disk_spacefloat (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.

  • instance_typestr

    The EC2 instance type to deploy to. Only available for jobs running on kubernetes.

  • sourcestr

    The body/text of the script.

  • cancel_timeoutint

    The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.

  • docker_image_tagstr

    The tag of the docker image to pull from DockerHub.

  • partition_labelstr

    The partition label used to run this object.

  • running_as_idint

    The ID of the runner of this script.

get_python3_git_commits(id: int, commit_hash: str)

Get file contents at git ref

Parameters:
idint

The ID of the file.

commit_hashstr

The SHA (full or shortened) of the desired git commit.

Returns:
civis.response.Response
  • contentstr

    The file’s contents.

  • typestr

    The file’s type.

  • sizeint

    The file’s size.

  • file_hashstr

    The SHA of the file.

get_python3_runs(id: int, run_id: int)

Check status of a run

Parameters:
idint

The ID of the Python job.

run_idint

The ID of the run.

Returns:
civis.response.Response
  • idint

    The ID of the run.

  • python_idint

    The ID of the Python job.

  • statestr

    The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.

  • is_cancel_requestedbool

    True if run cancel requested, else false.

  • created_atstr (time)

    The time the run was created.

  • started_atstr (time)

    The time the run started at.

  • finished_atstr (time)

    The time the run completed.

  • errorstr

    The error, if any, returned by the run.

  • max_memory_usagefloat (float)

    If the run has finished, the maximum amount of memory used during the run, in MB.

  • max_cpu_usagefloat (float)

    If the run has finished, the maximum amount of cpu used during the run, in millicores.

get_r(id: int)

Get an R Script

Parameters:
idint
Returns:
civis.response.Response
  • idint

    The ID for the script.

  • namestr

    The name of the script.

  • typestr

    The type of the script (e.g SQL, Container, Python, R, JavaScript, dbt)

  • created_atstr (time)

    The time this script was created.

  • updated_atstr (time)

    The time the script was last updated.

  • authordict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • statestr

    The status of the script’s last run.

  • finished_atstr (time)

    The time that the script’s last run finished.

  • categorystr

    The category of the script.

  • projectsList[dict]

    A list of projects containing the script.

    • idint

      The ID for the project.

    • namestr

      The name of the project.

  • parent_idint

    The ID of the parent job that will trigger this script

  • user_contextstr

    “runner” or “author”, who to execute the script as when run as a template.

  • paramsList[dict]

    A definition of the parameters this script accepts in the arguments field.

    • namestr

      The variable’s name as used within your code.

    • labelstr

      The label to present to users when asking them for the value.

    • descriptionstr

      A short sentence or fragment describing this parameter to the end user.

    • typestr

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredbool

      Whether this param is required.

    • valuestr

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstr

      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.

    • allowed_valuesList[dict]

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templatebool

    Whether others scripts use this one as a template.

  • published_as_template_idint

    The ID of the template that this script is backing.

  • from_template_idint

    The ID of the template this script uses, if any.

  • template_dependents_countint

    How many other scripts use this one as a template.

  • template_script_namestr

    The name of the template script.

  • linksdict
    • detailsstr

      The details link to get more information about the script.

    • runsstr

      The runs link to get the run information list for this script.

  • scheduledict
    • scheduledbool

      If the item is scheduled.

    • scheduled_daysList[int]

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hoursList[int]

      Hours of the day it is scheduled on.

    • scheduled_minutesList[int]

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourint

      Deprecated in favor of scheduled minutes.

    • scheduled_days_of_monthList[int]

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict
    • urlsList[str]

      URLs to receive a POST request at job completion

    • success_email_subjectstr

      Custom subject line for success e-mail.

    • success_email_bodystr

      Custom body text for success e-mail, written in Markdown.

    • success_email_addressesList[str]

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestr

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostr

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addressesList[str]

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesint

      Stall warning emails will be sent after this amount of minutes.

    • success_onbool

      If success email notifications are on. Defaults to user’s preferences.

    • failure_onbool

      If failure email notifications are on. Defaults to user’s preferences.

  • running_asdict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • next_run_atstr (time)

    The time of the next scheduled run.

  • time_zonestr

    The time zone of this script.

  • last_rundict
    • id : int

    • state : str

    • created_atstr (time)

      The time that the run was queued.

    • started_atstr (time)

      The time that the run started.

    • finished_atstr (time)

      The time that the run completed.

    • errorstr

      The error message for this run, if present.

  • my_permission_levelstr

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenbool

    The hidden status of the item.

  • target_project_idint

    Target project to which script outputs will be added.

  • archivedstr

    The archival status of the requested item(s).

  • required_resourcesdict
    • cpuint

      The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.

    • memoryint

      The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.

    • disk_spacefloat (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.

  • instance_typestr

    The EC2 instance type to deploy to. Only available for jobs running on kubernetes.

  • sourcestr

    The body/text of the script.

  • cancel_timeoutint

    The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.

  • docker_image_tagstr

    The tag of the docker image to pull from DockerHub.

  • partition_labelstr

    The partition label used to run this object.

  • running_as_idint

    The ID of the runner of this script.

get_r_git_commits(id: int, commit_hash: str)

Get file contents at git ref

Parameters:
idint

The ID of the file.

commit_hashstr

The SHA (full or shortened) of the desired git commit.

Returns:
civis.response.Response
  • contentstr

    The file’s contents.

  • typestr

    The file’s type.

  • sizeint

    The file’s size.

  • file_hashstr

    The SHA of the file.

get_r_runs(id: int, run_id: int)

Check status of a run

Parameters:
idint

The ID of the R job.

run_idint

The ID of the run.

Returns:
civis.response.Response
  • idint

    The ID of the run.

  • r_idint

    The ID of the R job.

  • statestr

    The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.

  • is_cancel_requestedbool

    True if run cancel requested, else false.

  • created_atstr (time)

    The time the run was created.

  • started_atstr (time)

    The time the run started at.

  • finished_atstr (time)

    The time the run completed.

  • errorstr

    The error, if any, returned by the run.

  • max_memory_usagefloat (float)

    If the run has finished, the maximum amount of memory used during the run, in MB.

  • max_cpu_usagefloat (float)

    If the run has finished, the maximum amount of cpu used during the run, in millicores.

get_sql(id: int)

Get a SQL Script

Parameters:
idint
Returns:
civis.response.Response
  • idint

    The ID for the script.

  • namestr

    The name of the script.

  • typestr

    The type of the script (e.g SQL, Container, Python, R, JavaScript, dbt)

  • created_atstr (time)

    The time this script was created.

  • updated_atstr (time)

    The time the script was last updated.

  • authordict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • statestr

    The status of the script’s last run.

  • finished_atstr (time)

    The time that the script’s last run finished.

  • categorystr

    The category of the script.

  • projectsList[dict]

    A list of projects containing the script.

    • idint

      The ID for the project.

    • namestr

      The name of the project.

  • parent_idint

    The ID of the parent job that will trigger this script

  • user_contextstr

    “runner” or “author”, who to execute the script as when run as a template.

  • paramsList[dict]

    A definition of the parameters this script accepts in the arguments field.

    • namestr

      The variable’s name as used within your code.

    • labelstr

      The label to present to users when asking them for the value.

    • descriptionstr

      A short sentence or fragment describing this parameter to the end user.

    • typestr

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredbool

      Whether this param is required.

    • valuestr

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstr

      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.

    • allowed_valuesList[dict]

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templatebool

    Whether others scripts use this one as a template.

  • published_as_template_idint

    The ID of the template that this script is backing.

  • from_template_idint

    The ID of the template this script uses, if any.

  • template_dependents_countint

    How many other scripts use this one as a template.

  • template_script_namestr

    The name of the template script.

  • linksdict
    • detailsstr

      The details link to get more information about the script.

    • runsstr

      The runs link to get the run information list for this script.

  • scheduledict
    • scheduledbool

      If the item is scheduled.

    • scheduled_daysList[int]

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hoursList[int]

      Hours of the day it is scheduled on.

    • scheduled_minutesList[int]

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourint

      Deprecated in favor of scheduled minutes.

    • scheduled_days_of_monthList[int]

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict
    • urlsList[str]

      URLs to receive a POST request at job completion

    • success_email_subjectstr

      Custom subject line for success e-mail.

    • success_email_bodystr

      Custom body text for success e-mail, written in Markdown.

    • success_email_addressesList[str]

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestr

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostr

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addressesList[str]

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesint

      Stall warning emails will be sent after this amount of minutes.

    • success_onbool

      If success email notifications are on. Defaults to user’s preferences.

    • failure_onbool

      If failure email notifications are on. Defaults to user’s preferences.

  • running_asdict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • next_run_atstr (time)

    The time of the next scheduled run.

  • time_zonestr

    The time zone of this script.

  • last_rundict
    • id : int

    • state : str

    • created_atstr (time)

      The time that the run was queued.

    • started_atstr (time)

      The time that the run started.

    • finished_atstr (time)

      The time that the run completed.

    • errorstr

      The error message for this run, if present.

  • my_permission_levelstr

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenbool

    The hidden status of the item.

  • target_project_idint

    Target project to which script outputs will be added.

  • archivedstr

    The archival status of the requested item(s).

  • sqlstr

    The raw SQL query for the script.

  • expanded_argumentsdict

    Expanded arguments for use in injecting into different environments.

  • remote_host_idint

    The remote host ID that this script will connect to.

  • credential_idint

    The credential that this script will use.

  • code_previewstr

    The code that this script will run with arguments inserted.

  • csv_settingsdict
    • include_headerbool

      Whether or not to include headers in the output data. Default: true

    • compressionstr

      The type of compression to use, if any, one of “none”, “zip”, or “gzip”. Default: gzip

    • column_delimiterstr

      Which delimiter to use, one of “comma”, “tab”, or “pipe”. Default: comma

    • unquotedbool

      Whether or not to quote fields. Default: false

    • force_multifilebool

      Whether or not the csv should be split into multiple files. Default: false

    • filename_prefixstr

      A user specified filename prefix for the output file to have. Default: null

    • max_file_sizeint

      The max file size, in MB, created files will be. Only available when force_multifile is true.

  • running_as_idint

    The ID of the runner of this script.

get_sql_git_commits(id: int, commit_hash: str)

Get file contents at git ref

Parameters:
idint

The ID of the file.

commit_hashstr

The SHA (full or shortened) of the desired git commit.

Returns:
civis.response.Response
  • contentstr

    The file’s contents.

  • typestr

    The file’s type.

  • sizeint

    The file’s size.

  • file_hashstr

    The SHA of the file.

get_sql_runs(id: int, run_id: int)

Check status of a run

Parameters:
idint

The ID of the SQL job.

run_idint

The ID of the run.

Returns:
civis.response.Response
  • idint

    The ID of the run.

  • sql_idint

    The ID of the SQL job.

  • statestr

    The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.

  • is_cancel_requestedbool

    True if run cancel requested, else false.

  • created_atstr (time)

    The time the run was created.

  • started_atstr (time)

    The time the run started at.

  • finished_atstr (time)

    The time the run completed.

  • errorstr

    The error, if any, returned by the run.

  • outputList[dict]

    A list of the outputs of this script.

    • output_namestr

      The name of the output file.

    • file_idint

      The unique ID of the output file.

    • pathstr

      The temporary link to download this output file, valid for 36 hours.

  • output_cached_onstr (time)

    The time that the output was originally exported, if a cache entry was used by the run.

list(*, type: str = None, category: str = None, author: str = None, status: str = None, hidden: bool = None, archived: str = None, limit: int = None, page_num: int = None, order: str = None, order_dir: str = None, iterator: bool = None)

List Scripts

Parameters:
typestr, optional

If specified, return items of these types. The valid types are sql, python3, javascript, r, containers, and dbt.

categorystr, optional

A job category for filtering scripts. Must be one of script, import, export, and enhancement.

authorstr, optional

If specified, return items from any of these authors. It accepts a comma- separated list of user IDs.

statusstr, optional

If specified, returns items with one of these statuses. It accepts a comma- separated list, possible values are ‘running’, ‘failed’, ‘succeeded’, ‘idle’, ‘scheduled’.

hiddenbool, optional

If specified to be true, returns hidden items. Defaults to false, returning non-hidden items.

archivedstr, optional

The archival status of the requested item(s).

limitint, optional

Number of results to return. Defaults to 20. Maximum allowed is 50.

page_numint, optional

Page number of the results to return. Defaults to the first page, 1.

orderstr, 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_dirstr, optional

Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.

iteratorbool, 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:
civis.response.PaginatedResponse
  • idint

    The ID for the script.

  • namestr

    The name of the script.

  • typestr

    The type of the script (e.g SQL, Container, Python, R, JavaScript, dbt)

  • created_atstr (time)

    The time this script was created.

  • updated_atstr (time)

    The time the script was last updated.

  • authordict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • statestr

    The status of the script’s last run.

  • finished_atstr (time)

    The time that the script’s last run finished.

  • projectsList[dict]

    A list of projects containing the script.

    • idint

      The ID for the project.

    • namestr

      The name of the project.

  • parent_idint

    The ID of the parent job that will trigger this script

  • is_templatebool

    Whether others scripts use this one as a template.

  • from_template_idint

    The ID of the template this script uses, if any.

  • linksdict
    • detailsstr

      The details link to get more information about the script.

    • runsstr

      The runs link to get the run information list for this script.

  • time_zonestr

    The time zone of this script.

  • last_rundict
    • id : int

    • state : str

    • created_atstr (time)

      The time that the run was queued.

    • started_atstr (time)

      The time that the run started.

    • finished_atstr (time)

      The time that the run completed.

    • errorstr

      The error message for this run, if present.

  • archivedstr

    The archival status of the requested item(s).

  • template_script_idint

    The ID of the template script, if any.

list_containers_dependencies(id: int, *, user_id: int = None)

List dependent objects for this object

Parameters:
idint

The ID of the resource that is shared.

user_idint, optional

ID of target user

Returns:
civis.response.Response
  • object_typestr

    Dependent object type

  • fco_typestr

    Human readable dependent object type

  • idint

    Dependent object ID

  • namestr

    Dependent object name, or nil if the requesting user cannot read this object

  • permission_levelstr

    Permission level of target user (not user’s groups) for dependent object. Null if no target user or not shareable (e.g. a database table).

  • descriptionstr

    Additional information about the dependency, if relevant

  • shareablebool

    Whether or not the requesting user can share this object.

list_containers_projects(id: int, *, hidden: bool = None)

List the projects a Container Script belongs to

Parameters:
idint

The ID of the Container Script.

hiddenbool, optional

If specified to be true, returns hidden items. Defaults to false, returning non-hidden items.

Returns:
civis.response.Response
  • idint

    The ID for this project.

  • authordict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • namestr

    The name of this project.

  • descriptionstr

    A description of the project.

  • usersList[dict]

    Users who can see the project.

    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • auto_share : bool

  • created_at : str (time)

  • updated_at : str (time)

  • archivedstr

    The archival status of the requested item(s).

list_containers_runs(id: int, *, limit: int = None, page_num: int = None, order: str = None, order_dir: str = None, iterator: bool = None)

List runs for the given Container job

Parameters:
idint

The ID of the Container job.

limitint, optional

Number of results to return. Defaults to 20. Maximum allowed is 100.

page_numint, optional

Page number of the results to return. Defaults to the first page, 1.

orderstr, optional

The field on which to order the result set. Defaults to id. Must be one of: id.

order_dirstr, optional

Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.

iteratorbool, 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:
civis.response.PaginatedResponse
  • idint

    The ID of the run.

  • container_idint

    The ID of the Container job.

  • statestr

    The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.

  • is_cancel_requestedbool

    True if run cancel requested, else false.

  • created_atstr (time)

    The time the run was created.

  • started_atstr (time)

    The time the run started at.

  • finished_atstr (time)

    The time the run completed.

  • errorstr

    The error, if any, returned by the run.

  • max_memory_usagefloat (float)

    If the run has finished, the maximum amount of memory used during the run, in MB.

  • max_cpu_usagefloat (float)

    If the run has finished, the maximum amount of cpu used during the run, in millicores.

list_containers_runs_logs(id: int, run_id: int, *, last_id: int = None, limit: int = None)

Get the logs for a run

Parameters:
idint

The ID of the Container job.

run_idint

The ID of the run.

last_idint, 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.

limitint, optional

The maximum number of log messages to return. Default of 10000.

Returns:
civis.response.Response
  • idint

    The ID of the log.

  • created_atstr (date-time)

    The time the log was created.

  • messagestr

    The log message.

  • levelstr

    The level of the log. One of unknown,fatal,error,warn,info,debug.

list_containers_runs_outputs(id: int, run_id: int, *, limit: int = None, page_num: int = None, order: str = None, order_dir: str = None, iterator: bool = None)

List the outputs for a run

Parameters:
idint

The ID of the container script.

run_idint

The ID of the run.

limitint, optional

Number of results to return. Defaults to its maximum of 50.

page_numint, optional

Page number of the results to return. Defaults to the first page, 1.

orderstr, optional

The field on which to order the result set. Defaults to created_at. Must be one of: created_at, id.

order_dirstr, optional

Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.

iteratorbool, 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:
civis.response.PaginatedResponse
  • object_typestr

    The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue

  • object_idint

    The ID of the output.

  • namestr

    The name of the output.

  • linkstr

    The hypermedia link to the output.

  • value : str

list_containers_shares(id: int)

List users and groups permissioned on this object

Parameters:
idint

The ID of the resource that is shared.

Returns:
civis.response.Response
  • readersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • writersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • ownersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • total_user_sharesint

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesint

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

list_custom(*, from_template_id: str = None, author: str = None, status: str = None, hidden: bool = None, archived: str = None, limit: int = None, page_num: int = None, order: str = None, order_dir: str = None, iterator: bool = None)

List Custom Scripts

Parameters:
from_template_idstr, optional

If specified, return scripts based on the template with this ID. Specify multiple IDs as a comma-separated list.

authorstr, optional

If specified, return items from any of these authors. It accepts a comma- separated list of user IDs.

statusstr, optional

If specified, returns items with one of these statuses. It accepts a comma- separated list, possible values are ‘running’, ‘failed’, ‘succeeded’, ‘idle’, ‘scheduled’.

hiddenbool, optional

If specified to be true, returns hidden items. Defaults to false, returning non-hidden items.

archivedstr, optional

The archival status of the requested item(s).

limitint, optional

Number of results to return. Defaults to its maximum of 50.

page_numint, optional

Page number of the results to return. Defaults to the first page, 1.

orderstr, optional

The field on which to order the result set. Defaults to updated_at. Must be one of: updated_at, name, created_at.

order_dirstr, optional

Direction in which to sort, either asc (ascending) or desc (descending) defaulting to asc.

iteratorbool, 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:
civis.response.PaginatedResponse
  • idint

    The ID for the script.

  • namestr

    The name of the script.

  • typestr

    The type of the script (e.g Custom)

  • backing_script_typestr

    The type of the script backing this template (e.g Python)

  • created_atstr (time)

    The time this script was created.

  • updated_atstr (time)

    The time the script was last updated.

  • authordict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • statestr

    The status of the script’s last run.

  • finished_atstr (time)

    The time that the script’s last run finished.

  • projectsList[dict]

    A list of projects containing the script.

    • idint

      The ID for the project.

    • namestr

      The name of the project.

  • parent_idint

    The ID of the parent job that will trigger this script

  • from_template_idint

    The ID of the template script.

  • time_zonestr

    The time zone of this script.

  • last_rundict
    • id : int

    • state : str

    • created_atstr (time)

      The time that the run was queued.

    • started_atstr (time)

      The time that the run started.

    • finished_atstr (time)

      The time that the run completed.

    • errorstr

      The error message for this run, if present.

  • archivedstr

    The archival status of the requested item(s).

  • last_successful_rundict
    • id : int

    • state : str

    • created_atstr (time)

      The time that the run was queued.

    • started_atstr (time)

      The time that the run started.

    • finished_atstr (time)

      The time that the run completed.

    • errorstr

      The error message for this run, if present.

list_custom_dependencies(id: int, *, user_id: int = None)

List dependent objects for this object

Parameters:
idint

The ID of the resource that is shared.

user_idint, optional

ID of target user

Returns:
civis.response.Response
  • object_typestr

    Dependent object type

  • fco_typestr

    Human readable dependent object type

  • idint

    Dependent object ID

  • namestr

    Dependent object name, or nil if the requesting user cannot read this object

  • permission_levelstr

    Permission level of target user (not user’s groups) for dependent object. Null if no target user or not shareable (e.g. a database table).

  • descriptionstr

    Additional information about the dependency, if relevant

  • shareablebool

    Whether or not the requesting user can share this object.

list_custom_projects(id: int, *, hidden: bool = None)

List the projects a Custom Script belongs to

Parameters:
idint

The ID of the Custom Script.

hiddenbool, optional

If specified to be true, returns hidden items. Defaults to false, returning non-hidden items.

Returns:
civis.response.Response
  • idint

    The ID for this project.

  • authordict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • namestr

    The name of this project.

  • descriptionstr

    A description of the project.

  • usersList[dict]

    Users who can see the project.

    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • auto_share : bool

  • created_at : str (time)

  • updated_at : str (time)

  • archivedstr

    The archival status of the requested item(s).

list_custom_runs(id: int, *, limit: int = None, page_num: int = None, order: str = None, order_dir: str = None, iterator: bool = None)

List runs for the given Custom job

Parameters:
idint

The ID of the Custom job.

limitint, optional

Number of results to return. Defaults to 20. Maximum allowed is 100.

page_numint, optional

Page number of the results to return. Defaults to the first page, 1.

orderstr, optional

The field on which to order the result set. Defaults to id. Must be one of: id.

order_dirstr, optional

Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.

iteratorbool, 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:
civis.response.PaginatedResponse
  • idint

    The ID of the run.

  • custom_idint

    The ID of the Custom job.

  • statestr

    The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.

  • is_cancel_requestedbool

    True if run cancel requested, else false.

  • created_atstr (time)

    The time the run was created.

  • started_atstr (time)

    The time the run started at.

  • finished_atstr (time)

    The time the run completed.

  • errorstr

    The error, if any, returned by the run.

  • max_memory_usagefloat (float)

    If the run has finished, the maximum amount of memory used during the run, in MB. Only available if the backing script is a Python, R, or container script.

  • max_cpu_usagefloat (float)

    If the run has finished, the maximum amount of cpu used during the run, in millicores. Only available if the backing script is a Python, R, or container script.

list_custom_runs_logs(id: int, run_id: int, *, last_id: int = None, limit: int = None)

Get the logs for a run

Parameters:
idint

The ID of the Custom job.

run_idint

The ID of the run.

last_idint, 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.

limitint, optional

The maximum number of log messages to return. Default of 10000.

Returns:
civis.response.Response
  • idint

    The ID of the log.

  • created_atstr (date-time)

    The time the log was created.

  • messagestr

    The log message.

  • levelstr

    The level of the log. One of unknown,fatal,error,warn,info,debug.

list_custom_runs_outputs(id: int, run_id: int, *, limit: int = None, page_num: int = None, order: str = None, order_dir: str = None, iterator: bool = None)

List the outputs for a run

Parameters:
idint

The ID of the custom script.

run_idint

The ID of the run.

limitint, optional

Number of results to return. Defaults to its maximum of 50.

page_numint, optional

Page number of the results to return. Defaults to the first page, 1.

orderstr, optional

The field on which to order the result set. Defaults to created_at. Must be one of: created_at, id.

order_dirstr, optional

Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.

iteratorbool, 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:
civis.response.PaginatedResponse
  • object_typestr

    The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue

  • object_idint

    The ID of the output.

  • namestr

    The name of the output.

  • linkstr

    The hypermedia link to the output.

  • value : str

list_custom_shares(id: int)

List users and groups permissioned on this object

Parameters:
idint

The ID of the resource that is shared.

Returns:
civis.response.Response
  • readersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • writersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • ownersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • total_user_sharesint

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesint

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

list_dbt_runs_logs(id: int, run_id: int, *, last_id: int = None, limit: int = None)

Get the logs for a run

Parameters:
idint

The ID of the dbt job.

run_idint

The ID of the run.

last_idint, 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.

limitint, optional

The maximum number of log messages to return. Default of 10000.

Returns:
civis.response.Response
  • idint

    The ID of the log.

  • created_atstr (date-time)

    The time the log was created.

  • messagestr

    The log message.

  • levelstr

    The level of the log. One of unknown,fatal,error,warn,info,debug.

list_history(id: int)

Get the run history and outputs of this script

Parameters:
idint

The ID for the script.

Returns:
civis.response.Response
  • idint

    The ID of this run.

  • sql_idint

    The ID of this sql.

  • statestr

    The state of this run.

  • is_cancel_requestedbool

    True if run cancel requested, else false.

  • finished_atstr (time)

    The time that this run finished.

  • errorstr

    The error message for this run, if present.

  • outputList[dict]

    A list of the outputs of this script.

    • output_namestr

      The name of the output file.

    • file_idint

      The unique ID of the output file.

    • pathstr

      The temporary link to download this output file, valid for 36 hours.

list_javascript_dependencies(id: int, *, user_id: int = None)

List dependent objects for this object

Parameters:
idint

The ID of the resource that is shared.

user_idint, optional

ID of target user

Returns:
civis.response.Response
  • object_typestr

    Dependent object type

  • fco_typestr

    Human readable dependent object type

  • idint

    Dependent object ID

  • namestr

    Dependent object name, or nil if the requesting user cannot read this object

  • permission_levelstr

    Permission level of target user (not user’s groups) for dependent object. Null if no target user or not shareable (e.g. a database table).

  • descriptionstr

    Additional information about the dependency, if relevant

  • shareablebool

    Whether or not the requesting user can share this object.

list_javascript_git(id: int)

Get the git metadata attached to an item

Parameters:
idint

The ID of the file.

Returns:
civis.response.Response
  • git_refstr

    A git reference specifying an unambiguous version of the file. Can be a branch name, tag or the full or shortened SHA of a commit.

  • git_branchstr

    The git branch that the file is on.

  • git_pathstr

    The path of the file in the repository.

  • git_repodict
    • idint

      The ID for this git repository.

    • repo_urlstr

      The URL for this git repository.

    • created_at : str (time)

    • updated_at : str (time)

  • git_ref_typestr

    Specifies if the file is versioned by branch or tag.

  • pull_from_gitbool

    Automatically pull latest commit from git. Only works for scripts and workflows (assuming you have the feature enabled)

list_javascript_git_commits(id: int)

Get the git commits for an item on the current branch

Parameters:
idint

The ID of the file.

Returns:
civis.response.Response
  • commit_hashstr

    The SHA of the commit.

  • author_namestr

    The name of the commit’s author.

  • datestr (time)

    The commit’s timestamp.

  • messagestr

    The commit message.

list_javascript_projects(id: int, *, hidden: bool = None)

List the projects a JavaScript Script belongs to

Parameters:
idint

The ID of the JavaScript Script.

hiddenbool, optional

If specified to be true, returns hidden items. Defaults to false, returning non-hidden items.

Returns:
civis.response.Response
  • idint

    The ID for this project.

  • authordict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • namestr

    The name of this project.

  • descriptionstr

    A description of the project.

  • usersList[dict]

    Users who can see the project.

    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • auto_share : bool

  • created_at : str (time)

  • updated_at : str (time)

  • archivedstr

    The archival status of the requested item(s).

list_javascript_runs(id: int, *, limit: int = None, page_num: int = None, order: str = None, order_dir: str = None, iterator: bool = None)

List runs for the given Javascript job

Parameters:
idint

The ID of the Javascript job.

limitint, optional

Number of results to return. Defaults to 20. Maximum allowed is 100.

page_numint, optional

Page number of the results to return. Defaults to the first page, 1.

orderstr, optional

The field on which to order the result set. Defaults to id. Must be one of: id.

order_dirstr, optional

Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.

iteratorbool, 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:
civis.response.PaginatedResponse
  • idint

    The ID of the run.

  • javascript_idint

    The ID of the Javascript job.

  • statestr

    The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.

  • is_cancel_requestedbool

    True if run cancel requested, else false.

  • created_atstr (time)

    The time the run was created.

  • started_atstr (time)

    The time the run started at.

  • finished_atstr (time)

    The time the run completed.

  • errorstr

    The error, if any, returned by the run.

list_javascript_runs_logs(id: int, run_id: int, *, last_id: int = None, limit: int = None)

Get the logs for a run

Parameters:
idint

The ID of the Javascript job.

run_idint

The ID of the run.

last_idint, 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.

limitint, optional

The maximum number of log messages to return. Default of 10000.

Returns:
civis.response.Response
  • idint

    The ID of the log.

  • created_atstr (date-time)

    The time the log was created.

  • messagestr

    The log message.

  • levelstr

    The level of the log. One of unknown,fatal,error,warn,info,debug.

list_javascript_runs_outputs(id: int, run_id: int, *, limit: int = None, page_num: int = None, order: str = None, order_dir: str = None, iterator: bool = None)

List the outputs for a run

Parameters:
idint

The ID of the javascript script.

run_idint

The ID of the run.

limitint, optional

Number of results to return. Defaults to its maximum of 50.

page_numint, optional

Page number of the results to return. Defaults to the first page, 1.

orderstr, optional

The field on which to order the result set. Defaults to created_at. Must be one of: created_at, id.

order_dirstr, optional

Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.

iteratorbool, 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:
civis.response.PaginatedResponse
  • object_typestr

    The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue

  • object_idint

    The ID of the output.

  • namestr

    The name of the output.

  • linkstr

    The hypermedia link to the output.

  • value : str

list_javascript_shares(id: int)

List users and groups permissioned on this object

Parameters:
idint

The ID of the resource that is shared.

Returns:
civis.response.Response
  • readersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • writersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • ownersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • total_user_sharesint

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesint

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

list_python3_dependencies(id: int, *, user_id: int = None)

List dependent objects for this object

Parameters:
idint

The ID of the resource that is shared.

user_idint, optional

ID of target user

Returns:
civis.response.Response
  • object_typestr

    Dependent object type

  • fco_typestr

    Human readable dependent object type

  • idint

    Dependent object ID

  • namestr

    Dependent object name, or nil if the requesting user cannot read this object

  • permission_levelstr

    Permission level of target user (not user’s groups) for dependent object. Null if no target user or not shareable (e.g. a database table).

  • descriptionstr

    Additional information about the dependency, if relevant

  • shareablebool

    Whether or not the requesting user can share this object.

list_python3_git(id: int)

Get the git metadata attached to an item

Parameters:
idint

The ID of the file.

Returns:
civis.response.Response
  • git_refstr

    A git reference specifying an unambiguous version of the file. Can be a branch name, tag or the full or shortened SHA of a commit.

  • git_branchstr

    The git branch that the file is on.

  • git_pathstr

    The path of the file in the repository.

  • git_repodict
    • idint

      The ID for this git repository.

    • repo_urlstr

      The URL for this git repository.

    • created_at : str (time)

    • updated_at : str (time)

  • git_ref_typestr

    Specifies if the file is versioned by branch or tag.

  • pull_from_gitbool

    Automatically pull latest commit from git. Only works for scripts and workflows (assuming you have the feature enabled)

list_python3_git_commits(id: int)

Get the git commits for an item on the current branch

Parameters:
idint

The ID of the file.

Returns:
civis.response.Response
  • commit_hashstr

    The SHA of the commit.

  • author_namestr

    The name of the commit’s author.

  • datestr (time)

    The commit’s timestamp.

  • messagestr

    The commit message.

list_python3_projects(id: int, *, hidden: bool = None)

List the projects a Python Script belongs to

Parameters:
idint

The ID of the Python Script.

hiddenbool, optional

If specified to be true, returns hidden items. Defaults to false, returning non-hidden items.

Returns:
civis.response.Response
  • idint

    The ID for this project.

  • authordict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • namestr

    The name of this project.

  • descriptionstr

    A description of the project.

  • usersList[dict]

    Users who can see the project.

    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • auto_share : bool

  • created_at : str (time)

  • updated_at : str (time)

  • archivedstr

    The archival status of the requested item(s).

list_python3_runs(id: int, *, limit: int = None, page_num: int = None, order: str = None, order_dir: str = None, iterator: bool = None)

List runs for the given Python job

Parameters:
idint

The ID of the Python job.

limitint, optional

Number of results to return. Defaults to 20. Maximum allowed is 100.

page_numint, optional

Page number of the results to return. Defaults to the first page, 1.

orderstr, optional

The field on which to order the result set. Defaults to id. Must be one of: id.

order_dirstr, optional

Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.

iteratorbool, 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:
civis.response.PaginatedResponse
  • idint

    The ID of the run.

  • python_idint

    The ID of the Python job.

  • statestr

    The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.

  • is_cancel_requestedbool

    True if run cancel requested, else false.

  • created_atstr (time)

    The time the run was created.

  • started_atstr (time)

    The time the run started at.

  • finished_atstr (time)

    The time the run completed.

  • errorstr

    The error, if any, returned by the run.

  • max_memory_usagefloat (float)

    If the run has finished, the maximum amount of memory used during the run, in MB.

  • max_cpu_usagefloat (float)

    If the run has finished, the maximum amount of cpu used during the run, in millicores.

list_python3_runs_logs(id: int, run_id: int, *, last_id: int = None, limit: int = None)

Get the logs for a run

Parameters:
idint

The ID of the Python job.

run_idint

The ID of the run.

last_idint, 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.

limitint, optional

The maximum number of log messages to return. Default of 10000.

Returns:
civis.response.Response
  • idint

    The ID of the log.

  • created_atstr (date-time)

    The time the log was created.

  • messagestr

    The log message.

  • levelstr

    The level of the log. One of unknown,fatal,error,warn,info,debug.

list_python3_runs_outputs(id: int, run_id: int, *, limit: int = None, page_num: int = None, order: str = None, order_dir: str = None, iterator: bool = None)

List the outputs for a run

Parameters:
idint

The ID of the python script.

run_idint

The ID of the run.

limitint, optional

Number of results to return. Defaults to its maximum of 50.

page_numint, optional

Page number of the results to return. Defaults to the first page, 1.

orderstr, optional

The field on which to order the result set. Defaults to created_at. Must be one of: created_at, id.

order_dirstr, optional

Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.

iteratorbool, 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:
civis.response.PaginatedResponse
  • object_typestr

    The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue

  • object_idint

    The ID of the output.

  • namestr

    The name of the output.

  • linkstr

    The hypermedia link to the output.

  • value : str

list_python3_shares(id: int)

List users and groups permissioned on this object

Parameters:
idint

The ID of the resource that is shared.

Returns:
civis.response.Response
  • readersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • writersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • ownersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • total_user_sharesint

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesint

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

list_r_dependencies(id: int, *, user_id: int = None)

List dependent objects for this object

Parameters:
idint

The ID of the resource that is shared.

user_idint, optional

ID of target user

Returns:
civis.response.Response
  • object_typestr

    Dependent object type

  • fco_typestr

    Human readable dependent object type

  • idint

    Dependent object ID

  • namestr

    Dependent object name, or nil if the requesting user cannot read this object

  • permission_levelstr

    Permission level of target user (not user’s groups) for dependent object. Null if no target user or not shareable (e.g. a database table).

  • descriptionstr

    Additional information about the dependency, if relevant

  • shareablebool

    Whether or not the requesting user can share this object.

list_r_git(id: int)

Get the git metadata attached to an item

Parameters:
idint

The ID of the file.

Returns:
civis.response.Response
  • git_refstr

    A git reference specifying an unambiguous version of the file. Can be a branch name, tag or the full or shortened SHA of a commit.

  • git_branchstr

    The git branch that the file is on.

  • git_pathstr

    The path of the file in the repository.

  • git_repodict
    • idint

      The ID for this git repository.

    • repo_urlstr

      The URL for this git repository.

    • created_at : str (time)

    • updated_at : str (time)

  • git_ref_typestr

    Specifies if the file is versioned by branch or tag.

  • pull_from_gitbool

    Automatically pull latest commit from git. Only works for scripts and workflows (assuming you have the feature enabled)

list_r_git_commits(id: int)

Get the git commits for an item on the current branch

Parameters:
idint

The ID of the file.

Returns:
civis.response.Response
  • commit_hashstr

    The SHA of the commit.

  • author_namestr

    The name of the commit’s author.

  • datestr (time)

    The commit’s timestamp.

  • messagestr

    The commit message.

list_r_projects(id: int, *, hidden: bool = None)

List the projects an R Script belongs to

Parameters:
idint

The ID of the R Script.

hiddenbool, optional

If specified to be true, returns hidden items. Defaults to false, returning non-hidden items.

Returns:
civis.response.Response
  • idint

    The ID for this project.

  • authordict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • namestr

    The name of this project.

  • descriptionstr

    A description of the project.

  • usersList[dict]

    Users who can see the project.

    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • auto_share : bool

  • created_at : str (time)

  • updated_at : str (time)

  • archivedstr

    The archival status of the requested item(s).

list_r_runs(id: int, *, limit: int = None, page_num: int = None, order: str = None, order_dir: str = None, iterator: bool = None)

List runs for the given R job

Parameters:
idint

The ID of the R job.

limitint, optional

Number of results to return. Defaults to 20. Maximum allowed is 100.

page_numint, optional

Page number of the results to return. Defaults to the first page, 1.

orderstr, optional

The field on which to order the result set. Defaults to id. Must be one of: id.

order_dirstr, optional

Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.

iteratorbool, 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:
civis.response.PaginatedResponse
  • idint

    The ID of the run.

  • r_idint

    The ID of the R job.

  • statestr

    The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.

  • is_cancel_requestedbool

    True if run cancel requested, else false.

  • created_atstr (time)

    The time the run was created.

  • started_atstr (time)

    The time the run started at.

  • finished_atstr (time)

    The time the run completed.

  • errorstr

    The error, if any, returned by the run.

  • max_memory_usagefloat (float)

    If the run has finished, the maximum amount of memory used during the run, in MB.

  • max_cpu_usagefloat (float)

    If the run has finished, the maximum amount of cpu used during the run, in millicores.

list_r_runs_logs(id: int, run_id: int, *, last_id: int = None, limit: int = None)

Get the logs for a run

Parameters:
idint

The ID of the R job.

run_idint

The ID of the run.

last_idint, 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.

limitint, optional

The maximum number of log messages to return. Default of 10000.

Returns:
civis.response.Response
  • idint

    The ID of the log.

  • created_atstr (date-time)

    The time the log was created.

  • messagestr

    The log message.

  • levelstr

    The level of the log. One of unknown,fatal,error,warn,info,debug.

list_r_runs_outputs(id: int, run_id: int, *, limit: int = None, page_num: int = None, order: str = None, order_dir: str = None, iterator: bool = None)

List the outputs for a run

Parameters:
idint

The ID of the r script.

run_idint

The ID of the run.

limitint, optional

Number of results to return. Defaults to its maximum of 50.

page_numint, optional

Page number of the results to return. Defaults to the first page, 1.

orderstr, optional

The field on which to order the result set. Defaults to created_at. Must be one of: created_at, id.

order_dirstr, optional

Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.

iteratorbool, 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:
civis.response.PaginatedResponse
  • object_typestr

    The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue

  • object_idint

    The ID of the output.

  • namestr

    The name of the output.

  • linkstr

    The hypermedia link to the output.

  • value : str

list_r_shares(id: int)

List users and groups permissioned on this object

Parameters:
idint

The ID of the resource that is shared.

Returns:
civis.response.Response
  • readersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • writersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • ownersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • total_user_sharesint

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesint

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

list_sql_dependencies(id: int, *, user_id: int = None)

List dependent objects for this object

Parameters:
idint

The ID of the resource that is shared.

user_idint, optional

ID of target user

Returns:
civis.response.Response
  • object_typestr

    Dependent object type

  • fco_typestr

    Human readable dependent object type

  • idint

    Dependent object ID

  • namestr

    Dependent object name, or nil if the requesting user cannot read this object

  • permission_levelstr

    Permission level of target user (not user’s groups) for dependent object. Null if no target user or not shareable (e.g. a database table).

  • descriptionstr

    Additional information about the dependency, if relevant

  • shareablebool

    Whether or not the requesting user can share this object.

list_sql_git(id: int)

Get the git metadata attached to an item

Parameters:
idint

The ID of the file.

Returns:
civis.response.Response
  • git_refstr

    A git reference specifying an unambiguous version of the file. Can be a branch name, tag or the full or shortened SHA of a commit.

  • git_branchstr

    The git branch that the file is on.

  • git_pathstr

    The path of the file in the repository.

  • git_repodict
    • idint

      The ID for this git repository.

    • repo_urlstr

      The URL for this git repository.

    • created_at : str (time)

    • updated_at : str (time)

  • git_ref_typestr

    Specifies if the file is versioned by branch or tag.

  • pull_from_gitbool

    Automatically pull latest commit from git. Only works for scripts and workflows (assuming you have the feature enabled)

list_sql_git_commits(id: int)

Get the git commits for an item on the current branch

Parameters:
idint

The ID of the file.

Returns:
civis.response.Response
  • commit_hashstr

    The SHA of the commit.

  • author_namestr

    The name of the commit’s author.

  • datestr (time)

    The commit’s timestamp.

  • messagestr

    The commit message.

list_sql_projects(id: int, *, hidden: bool = None)

List the projects a SQL Script belongs to

Parameters:
idint

The ID of the SQL Script.

hiddenbool, optional

If specified to be true, returns hidden items. Defaults to false, returning non-hidden items.

Returns:
civis.response.Response
  • idint

    The ID for this project.

  • authordict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • namestr

    The name of this project.

  • descriptionstr

    A description of the project.

  • usersList[dict]

    Users who can see the project.

    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • auto_share : bool

  • created_at : str (time)

  • updated_at : str (time)

  • archivedstr

    The archival status of the requested item(s).

list_sql_runs(id: int, *, limit: int = None, page_num: int = None, order: str = None, order_dir: str = None, iterator: bool = None)

List runs for the given SQL job

Parameters:
idint

The ID of the SQL job.

limitint, optional

Number of results to return. Defaults to 20. Maximum allowed is 100.

page_numint, optional

Page number of the results to return. Defaults to the first page, 1.

orderstr, optional

The field on which to order the result set. Defaults to id. Must be one of: id.

order_dirstr, optional

Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.

iteratorbool, 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:
civis.response.PaginatedResponse
  • idint

    The ID of the run.

  • sql_idint

    The ID of the SQL job.

  • statestr

    The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.

  • is_cancel_requestedbool

    True if run cancel requested, else false.

  • created_atstr (time)

    The time the run was created.

  • started_atstr (time)

    The time the run started at.

  • finished_atstr (time)

    The time the run completed.

  • errorstr

    The error, if any, returned by the run.

  • outputList[dict]

    A list of the outputs of this script.

    • output_namestr

      The name of the output file.

    • file_idint

      The unique ID of the output file.

    • pathstr

      The temporary link to download this output file, valid for 36 hours.

  • output_cached_onstr (time)

    The time that the output was originally exported, if a cache entry was used by the run.

list_sql_runs_logs(id: int, run_id: int, *, last_id: int = None, limit: int = None)

Get the logs for a run

Parameters:
idint

The ID of the SQL job.

run_idint

The ID of the run.

last_idint, 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.

limitint, optional

The maximum number of log messages to return. Default of 10000.

Returns:
civis.response.Response
  • idint

    The ID of the log.

  • created_atstr (date-time)

    The time the log was created.

  • messagestr

    The log message.

  • levelstr

    The level of the log. One of unknown,fatal,error,warn,info,debug.

list_sql_runs_outputs(id: int, run_id: int, *, limit: int = None, page_num: int = None, order: str = None, order_dir: str = None, iterator: bool = None)

List the outputs for a run

Parameters:
idint

The ID of the sql script.

run_idint

The ID of the run.

limitint, optional

Number of results to return. Defaults to its maximum of 50.

page_numint, optional

Page number of the results to return. Defaults to the first page, 1.

orderstr, optional

The field on which to order the result set. Defaults to created_at. Must be one of: created_at, id.

order_dirstr, optional

Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.

iteratorbool, 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:
civis.response.PaginatedResponse
  • object_typestr

    The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue

  • object_idint

    The ID of the output.

  • namestr

    The name of the output.

  • linkstr

    The hypermedia link to the output.

  • value : str

list_sql_shares(id: int)

List users and groups permissioned on this object

Parameters:
idint

The ID of the resource that is shared.

Returns:
civis.response.Response
  • readersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • writersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • ownersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • total_user_sharesint

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesint

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

list_types()

List available script types

Returns:
civis.response.Response
  • namestr

    The name of the type.

patch(id: int, *, name: str = None, sql: str = None, params: List[dict] = None, arguments: dict = None, template_script_id: int = None, schedule: dict = None, notifications: dict = None, parent_id: int = None, running_as_id: int = None)

Update a script

Parameters:
idint

The ID for the script.

namestr, optional

The name of the script.

sqlstr, optional

The raw SQL query for the script.

paramsList[dict], optional

A definition of the parameters this script accepts in the arguments field. Cannot be set if this script uses a template script.

  • namestr

    The variable’s name as used within your code.

  • labelstr

    The label to present to users when asking them for the value.

  • descriptionstr

    A short sentence or fragment describing this parameter to the end user.

  • typestr

    The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

  • requiredbool

    Whether this param is required.

  • valuestr

    The value you would like to set this param to. Setting this value makes this parameter a fixed param.

  • defaultstr

    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.

  • allowed_valuesList[dict]

    The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

argumentsdict, optional

Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

template_script_idint, optional

The ID of the template script, if any. A script cannot both have a template script and be a template for other scripts.

scheduledict, optional
  • scheduledbool

    If the item is scheduled.

  • scheduled_daysList[int]

    Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

  • scheduled_hoursList[int]

    Hours of the day it is scheduled on.

  • scheduled_minutesList[int]

    Minutes of the day it is scheduled on.

  • scheduled_runs_per_hourint

    Deprecated in favor of scheduled minutes.

  • scheduled_days_of_monthList[int]

    Days of the month it is scheduled on, mutually exclusive with scheduledDays.

notificationsdict, optional
  • urlsList[str]

    URLs to receive a POST request at job completion

  • success_email_subjectstr

    Custom subject line for success e-mail.

  • success_email_bodystr

    Custom body text for success e-mail, written in Markdown.

  • success_email_addressesList[str]

    Addresses to notify by e-mail when the job completes successfully.

  • success_email_from_namestr

    Name from which success emails are sent; defaults to “Civis.”

  • success_email_reply_tostr

    Address for replies to success emails; defaults to the author of the job.

  • failure_email_addressesList[str]

    Addresses to notify by e-mail when the job fails.

  • stall_warning_minutesint

    Stall warning emails will be sent after this amount of minutes.

  • success_onbool

    If success email notifications are on. Defaults to user’s preferences.

  • failure_onbool

    If failure email notifications are on. Defaults to user’s preferences.

parent_idint, optional

The ID of the parent job that will trigger this script

running_as_idint, optional

The ID of the runner of this script.

Returns:
civis.response.Response
  • idint

    The ID for the script.

  • namestr

    The name of the script.

  • typestr

    The type of script.

  • created_atstr (time)

    The time this script was created.

  • updated_atstr (time)

    The time this script was last updated.

  • authordict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • statestr

    The status of the script’s last run.

  • finished_atstr (time)

    The time that the script’s last run finished.

  • categorystr

    The category of the script.

  • projectsList[dict]

    A list of projects containing the script.

    • idint

      The ID for the project.

    • namestr

      The name of the project.

  • parent_idint

    The ID of the parent job that will trigger this script

  • user_contextstr

    “runner” or “author”, who to execute the script as when run as a template.

  • paramsList[dict]

    A definition of the parameters this script accepts in the arguments field.

    • namestr

      The variable’s name as used within your code.

    • labelstr

      The label to present to users when asking them for the value.

    • descriptionstr

      A short sentence or fragment describing this parameter to the end user.

    • typestr

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredbool

      Whether this param is required.

    • valuestr

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstr

      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.

    • allowed_valuesList[dict]

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templatebool

    Whether others scripts use this one as a template.

  • published_as_template_idint

    The ID of the template that this script is backing.

  • from_template_idint

    The ID of the template this script uses, if any.

  • template_dependents_countint

    How many other scripts use this one as a template.

  • template_script_namestr

    The name of the template script.

  • linksdict
    • detailsstr

      The details link to get more information about the script.

    • runsstr

      The runs link to get the run information list for this script.

  • scheduledict
    • scheduledbool

      If the item is scheduled.

    • scheduled_daysList[int]

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hoursList[int]

      Hours of the day it is scheduled on.

    • scheduled_minutesList[int]

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourint

      Deprecated in favor of scheduled minutes.

    • scheduled_days_of_monthList[int]

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict
    • urlsList[str]

      URLs to receive a POST request at job completion

    • success_email_subjectstr

      Custom subject line for success e-mail.

    • success_email_bodystr

      Custom body text for success e-mail, written in Markdown.

    • success_email_addressesList[str]

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestr

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostr

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addressesList[str]

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesint

      Stall warning emails will be sent after this amount of minutes.

    • success_onbool

      If success email notifications are on. Defaults to user’s preferences.

    • failure_onbool

      If failure email notifications are on. Defaults to user’s preferences.

  • running_asdict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • next_run_atstr (time)

    The time of the next scheduled run.

  • time_zonestr

    The time zone of this script.

  • last_rundict
    • id : int

    • state : str

    • created_atstr (time)

      The time that the run was queued.

    • started_atstr (time)

      The time that the run started.

    • finished_atstr (time)

      The time that the run completed.

    • errorstr

      The error message for this run, if present.

  • my_permission_levelstr

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenbool

    The hidden status of the item.

  • target_project_idint

    Target project to which script outputs will be added.

  • archivedstr

    The archival status of the requested item(s).

  • sqlstr

    The raw SQL query for the script.

  • expanded_argumentsdict

    Expanded arguments for use in injecting into different environments.

  • template_script_idint

    The ID of the template script, if any.

patch_container_runs(id: int, run_id: int, *, error: str = None)

Update the given run

Parameters:
idint

ID of the Job

run_idint

ID of the Run

errorstr, optional

The error message to update

Returns:
None

Response code 204: success

patch_containers(id: int, *, name: str = None, parent_id: int = None, user_context: str = None, params: List[dict] = None, arguments: dict = None, schedule: dict = None, notifications: dict = None, required_resources: dict = None, repo_http_uri: str = None, repo_ref: str = None, remote_host_credential_id: int = None, git_credential_id: int = None, docker_command: str = None, docker_image_name: str = None, docker_image_tag: str = None, instance_type: str = None, cancel_timeout: int = None, time_zone: str = None, partition_label: str = None, target_project_id: int = None, running_as_id: int = None)

Update a container

Parameters:
idint

The ID for the script.

namestr, optional

The name of the container.

parent_idint, optional

The ID of the parent job that will trigger this script

user_contextstr, optional

“runner” or “author”, who to execute the script as when run as a template.

paramsList[dict], optional

A definition of the parameters this script accepts in the arguments field.

  • namestr

    The variable’s name as used within your code.

  • labelstr

    The label to present to users when asking them for the value.

  • descriptionstr

    A short sentence or fragment describing this parameter to the end user.

  • typestr

    The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

  • requiredbool

    Whether this param is required.

  • valuestr

    The value you would like to set this param to. Setting this value makes this parameter a fixed param.

  • defaultstr

    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.

  • allowed_valuesList[dict]

    The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

argumentsdict, optional

Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

scheduledict, optional
  • scheduledbool

    If the item is scheduled.

  • scheduled_daysList[int]

    Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

  • scheduled_hoursList[int]

    Hours of the day it is scheduled on.

  • scheduled_minutesList[int]

    Minutes of the day it is scheduled on.

  • scheduled_runs_per_hourint

    Deprecated in favor of scheduled minutes.

  • scheduled_days_of_monthList[int]

    Days of the month it is scheduled on, mutually exclusive with scheduledDays.

notificationsdict, optional
  • urlsList[str]

    URLs to receive a POST request at job completion

  • success_email_subjectstr

    Custom subject line for success e-mail.

  • success_email_bodystr

    Custom body text for success e-mail, written in Markdown.

  • success_email_addressesList[str]

    Addresses to notify by e-mail when the job completes successfully.

  • success_email_from_namestr

    Name from which success emails are sent; defaults to “Civis.”

  • success_email_reply_tostr

    Address for replies to success emails; defaults to the author of the job.

  • failure_email_addressesList[str]

    Addresses to notify by e-mail when the job fails.

  • stall_warning_minutesint

    Stall warning emails will be sent after this amount of minutes.

  • success_onbool

    If success email notifications are on. Defaults to user’s preferences.

  • failure_onbool

    If failure email notifications are on. Defaults to user’s preferences.

required_resourcesdict, optional
  • cpuint

    The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.

  • memoryint

    The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.

  • disk_spacefloat (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.

repo_http_uristr, optional

The location of a github repo to clone into the container, e.g. github.com/my-user/my-repo.git.

repo_refstr, optional

The tag or branch of the github repo to clone into the container.

remote_host_credential_idint, optional

The id of the database credentials to pass into the environment of the container.

git_credential_idint, 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_commandstr, optional

The command to run on the container. Will be run via sh as: [“sh”, “-c”, dockerCommand]. Defaults to the Docker image’s ENTRYPOINT/CMD.

docker_image_namestr, optional

The name of the docker image to pull from DockerHub.

docker_image_tagstr, optional

The tag of the docker image to pull from DockerHub.

instance_typestr, optional

The EC2 instance type to deploy to. Only available for jobs running on kubernetes.

cancel_timeoutint, optional

The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.

time_zonestr, optional

The time zone of this script.

partition_labelstr, optional

The partition label used to run this object.

target_project_idint, optional

Target project to which script outputs will be added.

running_as_idint, optional

The ID of the runner of this script.

Returns:
civis.response.Response
  • idint

    The ID for the script.

  • from_template_aliasesList[dict]

    An array of the aliases of the template script.

    • idint

      The id of the Alias object.

    • object_idint

      The id of the object

    • aliasstr

      The alias of the object

  • namestr

    The name of the container.

  • typestr

    The type of the script (e.g Container)

  • created_atstr (time)

    The time this script was created.

  • updated_atstr (time)

    The time the script was last updated.

  • authordict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • statestr

    The status of the script’s last run.

  • finished_atstr (time)

    The time that the script’s last run finished.

  • categorystr

    The category of the script.

  • projectsList[dict]

    A list of projects containing the script.

    • idint

      The ID for the project.

    • namestr

      The name of the project.

  • parent_idint

    The ID of the parent job that will trigger this script

  • user_contextstr

    “runner” or “author”, who to execute the script as when run as a template.

  • paramsList[dict]

    A definition of the parameters this script accepts in the arguments field.

    • namestr

      The variable’s name as used within your code.

    • labelstr

      The label to present to users when asking them for the value.

    • descriptionstr

      A short sentence or fragment describing this parameter to the end user.

    • typestr

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredbool

      Whether this param is required.

    • valuestr

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstr

      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.

    • allowed_valuesList[dict]

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templatebool

    Whether others scripts use this one as a template.

  • template_dependents_countint

    How many other scripts use this one as a template.

  • published_as_template_idint

    The ID of the template that this script is backing.

  • from_template_idint

    The ID of the template script.

  • template_script_namestr

    The name of the template script.

  • linksdict
    • detailsstr

      The details link to get more information about the script.

    • runsstr

      The runs link to get the run information list for this script.

  • scheduledict
    • scheduledbool

      If the item is scheduled.

    • scheduled_daysList[int]

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hoursList[int]

      Hours of the day it is scheduled on.

    • scheduled_minutesList[int]

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourint

      Deprecated in favor of scheduled minutes.

    • scheduled_days_of_monthList[int]

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict
    • urlsList[str]

      URLs to receive a POST request at job completion

    • success_email_subjectstr

      Custom subject line for success e-mail.

    • success_email_bodystr

      Custom body text for success e-mail, written in Markdown.

    • success_email_addressesList[str]

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestr

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostr

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addressesList[str]

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesint

      Stall warning emails will be sent after this amount of minutes.

    • success_onbool

      If success email notifications are on. Defaults to user’s preferences.

    • failure_onbool

      If failure email notifications are on. Defaults to user’s preferences.

  • running_asdict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • required_resourcesdict
    • cpuint

      The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.

    • memoryint

      The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.

    • disk_spacefloat (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.

  • repo_http_uristr

    The location of a github repo to clone into the container, e.g. github.com/my-user/my-repo.git.

  • repo_refstr

    The tag or branch of the github repo to clone into the container.

  • remote_host_credential_idint

    The id of the database credentials to pass into the environment of the container.

  • git_credential_idint

    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_commandstr

    The command to run on the container. Will be run via sh as: [“sh”, “-c”, dockerCommand]. Defaults to the Docker image’s ENTRYPOINT/CMD.

  • docker_image_namestr

    The name of the docker image to pull from DockerHub.

  • docker_image_tagstr

    The tag of the docker image to pull from DockerHub.

  • instance_typestr

    The EC2 instance type to deploy to. Only available for jobs running on kubernetes.

  • cancel_timeoutint

    The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.

  • last_rundict
    • id : int

    • state : str

    • created_atstr (time)

      The time that the run was queued.

    • started_atstr (time)

      The time that the run started.

    • finished_atstr (time)

      The time that the run completed.

    • errorstr

      The error message for this run, if present.

  • time_zonestr

    The time zone of this script.

  • partition_labelstr

    The partition label used to run this object.

  • my_permission_levelstr

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenbool

    The hidden status of the item.

  • archivedstr

    The archival status of the requested item(s).

  • target_project_idint

    Target project to which script outputs will be added.

  • running_as_idint

    The ID of the runner of this script.

patch_custom(id: int, *, name: str = None, parent_id: int = None, arguments: dict = None, remote_host_id: int = None, credential_id: int = None, schedule: dict = None, notifications: dict = None, time_zone: str = None, target_project_id: int = None, required_resources: dict = None, partition_label: str = None, running_as_id: int = None)

Update some attributes of this Custom Script

Parameters:
idint

The ID for the script.

namestr, optional

The name of the script.

parent_idint, optional

The ID of the parent job that will trigger this script

argumentsdict, optional

Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

remote_host_idint, optional

The remote host ID that this script will connect to.

credential_idint, optional

The credential that this script will use.

scheduledict, optional
  • scheduledbool

    If the item is scheduled.

  • scheduled_daysList[int]

    Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

  • scheduled_hoursList[int]

    Hours of the day it is scheduled on.

  • scheduled_minutesList[int]

    Minutes of the day it is scheduled on.

  • scheduled_runs_per_hourint

    Deprecated in favor of scheduled minutes.

  • scheduled_days_of_monthList[int]

    Days of the month it is scheduled on, mutually exclusive with scheduledDays.

notificationsdict, optional
  • urlsList[str]

    URLs to receive a POST request at job completion

  • success_email_subjectstr

    Custom subject line for success e-mail.

  • success_email_bodystr

    Custom body text for success e-mail, written in Markdown.

  • success_email_addressesList[str]

    Addresses to notify by e-mail when the job completes successfully.

  • success_email_from_namestr

    Name from which success emails are sent; defaults to “Civis.”

  • success_email_reply_tostr

    Address for replies to success emails; defaults to the author of the job.

  • failure_email_addressesList[str]

    Addresses to notify by e-mail when the job fails.

  • stall_warning_minutesint

    Stall warning emails will be sent after this amount of minutes.

  • success_onbool

    If success email notifications are on. Defaults to user’s preferences.

  • failure_onbool

    If failure email notifications are on. Defaults to user’s preferences.

time_zonestr, optional

The time zone of this script.

target_project_idint, optional

Target project to which script outputs will be added.

required_resourcesdict, optional
  • cpuint

    The number of CPU shares to allocate for the container. Each core has 1000 shares.

  • memoryint

    The amount of RAM to allocate for the container (in MB).

  • disk_spacefloat (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.

partition_labelstr, optional

The partition label used to run this object. Only applicable for jobs using Docker.

running_as_idint, optional

The ID of the runner of this script.

Returns:
civis.response.Response
  • idint

    The ID for the script.

  • from_template_aliasesList[dict]

    An array of the aliases of the template script.

    • idint

      The id of the Alias object.

    • object_idint

      The id of the object

    • aliasstr

      The alias of the object

  • namestr

    The name of the script.

  • typestr

    The type of the script (e.g Custom)

  • backing_script_typestr

    The type of the script backing this template (e.g Python)

  • created_atstr (time)

    The time this script was created.

  • updated_atstr (time)

    The time the script was last updated.

  • authordict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • statestr

    The status of the script’s last run.

  • finished_atstr (time)

    The time that the script’s last run finished.

  • category : str

  • projectsList[dict]

    A list of projects containing the script.

    • idint

      The ID for the project.

    • namestr

      The name of the project.

  • parent_idint

    The ID of the parent job that will trigger this script

  • paramsList[dict]

    A definition of the parameters this script accepts in the arguments field.

    • namestr

      The variable’s name as used within your code.

    • labelstr

      The label to present to users when asking them for the value.

    • descriptionstr

      A short sentence or fragment describing this parameter to the end user.

    • typestr

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredbool

      Whether this param is required.

    • valuestr

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstr

      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.

    • allowed_valuesList[dict]

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templatebool

    Whether others scripts use this one as a template.

  • published_as_template_idint

    The ID of the template that this script is backing.

  • from_template_idint

    The ID of the template script.

  • ui_report_urlint

    The url of the custom HTML.

  • ui_report_idint

    The id of the report with the custom HTML.

  • ui_report_provide_api_keybool

    Whether the ui report requests an API Key from the report viewer.

  • template_script_namestr

    The name of the template script.

  • template_notestr

    The template’s note.

  • remote_host_idint

    The remote host ID that this script will connect to.

  • credential_idint

    The credential that this script will use.

  • code_previewstr

    The code that this script will run with arguments inserted.

  • scheduledict
    • scheduledbool

      If the item is scheduled.

    • scheduled_daysList[int]

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hoursList[int]

      Hours of the day it is scheduled on.

    • scheduled_minutesList[int]

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourint

      Deprecated in favor of scheduled minutes.

    • scheduled_days_of_monthList[int]

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict
    • urlsList[str]

      URLs to receive a POST request at job completion

    • success_email_subjectstr

      Custom subject line for success e-mail.

    • success_email_bodystr

      Custom body text for success e-mail, written in Markdown.

    • success_email_addressesList[str]

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestr

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostr

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addressesList[str]

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesint

      Stall warning emails will be sent after this amount of minutes.

    • success_onbool

      If success email notifications are on. Defaults to user’s preferences.

    • failure_onbool

      If failure email notifications are on. Defaults to user’s preferences.

  • running_asdict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • time_zonestr

    The time zone of this script.

  • last_rundict
    • id : int

    • state : str

    • created_atstr (time)

      The time that the run was queued.

    • started_atstr (time)

      The time that the run started.

    • finished_atstr (time)

      The time that the run completed.

    • errorstr

      The error message for this run, if present.

  • my_permission_levelstr

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenbool

    The hidden status of the item.

  • archivedstr

    The archival status of the requested item(s).

  • target_project_idint

    Target project to which script outputs will be added.

  • last_successful_rundict
    • id : int

    • state : str

    • created_atstr (time)

      The time that the run was queued.

    • started_atstr (time)

      The time that the run started.

    • finished_atstr (time)

      The time that the run completed.

    • errorstr

      The error message for this run, if present.

  • required_resourcesdict
    • cpuint

      The number of CPU shares to allocate for the container. Each core has 1000 shares.

    • memoryint

      The amount of RAM to allocate for the container (in MB).

    • disk_spacefloat (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.

  • partition_labelstr

    The partition label used to run this object. Only applicable for jobs using Docker.

  • running_as_idint

    The ID of the runner of this script.

patch_javascript(id: int, *, name: str = None, parent_id: int = None, user_context: str = None, params: List[dict] = None, arguments: dict = None, schedule: dict = None, notifications: dict = None, next_run_at: str = None, time_zone: str = None, target_project_id: int = None, source: str = None, remote_host_id: int = None, credential_id: int = None, running_as_id: int = None)

Update some attributes of this JavaScript Script

Parameters:
idint

The ID for the script.

namestr, optional

The name of the script.

parent_idint, optional

The ID of the parent job that will trigger this script

user_contextstr, optional

“runner” or “author”, who to execute the script as when run as a template.

paramsList[dict], optional

A definition of the parameters this script accepts in the arguments field.

  • namestr

    The variable’s name as used within your code.

  • labelstr

    The label to present to users when asking them for the value.

  • descriptionstr

    A short sentence or fragment describing this parameter to the end user.

  • typestr

    The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

  • requiredbool

    Whether this param is required.

  • valuestr

    The value you would like to set this param to. Setting this value makes this parameter a fixed param.

  • defaultstr

    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.

  • allowed_valuesList[dict]

    The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

argumentsdict, optional

Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

scheduledict, optional
  • scheduledbool

    If the item is scheduled.

  • scheduled_daysList[int]

    Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

  • scheduled_hoursList[int]

    Hours of the day it is scheduled on.

  • scheduled_minutesList[int]

    Minutes of the day it is scheduled on.

  • scheduled_runs_per_hourint

    Deprecated in favor of scheduled minutes.

  • scheduled_days_of_monthList[int]

    Days of the month it is scheduled on, mutually exclusive with scheduledDays.

notificationsdict, optional
  • urlsList[str]

    URLs to receive a POST request at job completion

  • success_email_subjectstr

    Custom subject line for success e-mail.

  • success_email_bodystr

    Custom body text for success e-mail, written in Markdown.

  • success_email_addressesList[str]

    Addresses to notify by e-mail when the job completes successfully.

  • success_email_from_namestr

    Name from which success emails are sent; defaults to “Civis.”

  • success_email_reply_tostr

    Address for replies to success emails; defaults to the author of the job.

  • failure_email_addressesList[str]

    Addresses to notify by e-mail when the job fails.

  • stall_warning_minutesint

    Stall warning emails will be sent after this amount of minutes.

  • success_onbool

    If success email notifications are on. Defaults to user’s preferences.

  • failure_onbool

    If failure email notifications are on. Defaults to user’s preferences.

next_run_atstr (time), optional

The time of the next scheduled run.

time_zonestr, optional

The time zone of this script.

target_project_idint, optional

Target project to which script outputs will be added.

sourcestr, optional

The body/text of the script.

remote_host_idint, optional

The remote host ID that this script will connect to.

credential_idint, optional

The credential that this script will use.

running_as_idint, optional

The ID of the runner of this script.

Returns:
civis.response.Response
  • idint

    The ID for the script.

  • namestr

    The name of the script.

  • typestr

    The type of the script (e.g SQL, Container, Python, R, JavaScript, dbt)

  • created_atstr (time)

    The time this script was created.

  • updated_atstr (time)

    The time the script was last updated.

  • authordict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • statestr

    The status of the script’s last run.

  • finished_atstr (time)

    The time that the script’s last run finished.

  • categorystr

    The category of the script.

  • projectsList[dict]

    A list of projects containing the script.

    • idint

      The ID for the project.

    • namestr

      The name of the project.

  • parent_idint

    The ID of the parent job that will trigger this script

  • user_contextstr

    “runner” or “author”, who to execute the script as when run as a template.

  • paramsList[dict]

    A definition of the parameters this script accepts in the arguments field.

    • namestr

      The variable’s name as used within your code.

    • labelstr

      The label to present to users when asking them for the value.

    • descriptionstr

      A short sentence or fragment describing this parameter to the end user.

    • typestr

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredbool

      Whether this param is required.

    • valuestr

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstr

      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.

    • allowed_valuesList[dict]

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templatebool

    Whether others scripts use this one as a template.

  • published_as_template_idint

    The ID of the template that this script is backing.

  • from_template_idint

    The ID of the template this script uses, if any.

  • template_dependents_countint

    How many other scripts use this one as a template.

  • template_script_namestr

    The name of the template script.

  • linksdict
    • detailsstr

      The details link to get more information about the script.

    • runsstr

      The runs link to get the run information list for this script.

  • scheduledict
    • scheduledbool

      If the item is scheduled.

    • scheduled_daysList[int]

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hoursList[int]

      Hours of the day it is scheduled on.

    • scheduled_minutesList[int]

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourint

      Deprecated in favor of scheduled minutes.

    • scheduled_days_of_monthList[int]

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict
    • urlsList[str]

      URLs to receive a POST request at job completion

    • success_email_subjectstr

      Custom subject line for success e-mail.

    • success_email_bodystr

      Custom body text for success e-mail, written in Markdown.

    • success_email_addressesList[str]

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestr

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostr

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addressesList[str]

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesint

      Stall warning emails will be sent after this amount of minutes.

    • success_onbool

      If success email notifications are on. Defaults to user’s preferences.

    • failure_onbool

      If failure email notifications are on. Defaults to user’s preferences.

  • running_asdict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • next_run_atstr (time)

    The time of the next scheduled run.

  • time_zonestr

    The time zone of this script.

  • last_rundict
    • id : int

    • state : str

    • created_atstr (time)

      The time that the run was queued.

    • started_atstr (time)

      The time that the run started.

    • finished_atstr (time)

      The time that the run completed.

    • errorstr

      The error message for this run, if present.

  • my_permission_levelstr

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenbool

    The hidden status of the item.

  • target_project_idint

    Target project to which script outputs will be added.

  • archivedstr

    The archival status of the requested item(s).

  • sourcestr

    The body/text of the script.

  • remote_host_idint

    The remote host ID that this script will connect to.

  • credential_idint

    The credential that this script will use.

  • running_as_idint

    The ID of the runner of this script.

patch_javascript_git(id: int, *, git_ref: str = None, git_branch: str = None, git_path: str = None, git_repo_url: str = None, git_ref_type: str = None, pull_from_git: bool = None)

Update an attached git file

Parameters:
idint

The ID of the file.

git_refstr, optional

A git reference specifying an unambiguous version of the file. Can be a branch name, or the full or shortened SHA of a commit.

git_branchstr, optional

The git branch that the file is on.

git_pathstr, optional

The path of the file in the repository.

git_repo_urlstr, optional

The URL of the git repository.

git_ref_typestr, optional

Specifies if the file is versioned by branch or tag.

pull_from_gitbool, optional

Automatically pull latest commit from git. Only works for scripts.

Returns:
civis.response.Response
  • git_refstr

    A git reference specifying an unambiguous version of the file. Can be a branch name, tag or the full or shortened SHA of a commit.

  • git_branchstr

    The git branch that the file is on.

  • git_pathstr

    The path of the file in the repository.

  • git_repodict
    • idint

      The ID for this git repository.

    • repo_urlstr

      The URL for this git repository.

    • created_at : str (time)

    • updated_at : str (time)

  • git_ref_typestr

    Specifies if the file is versioned by branch or tag.

  • pull_from_gitbool

    Automatically pull latest commit from git. Only works for scripts and workflows (assuming you have the feature enabled)

patch_javascript_runs(id: int, run_id: int, *, error: str = None)

Update the given run

Parameters:
idint

ID of the Job

run_idint

ID of the Run

errorstr, optional

The error message to update

Returns:
None

Response code 204: success

patch_python3(id: int, *, name: str = None, parent_id: int = None, user_context: str = None, params: List[dict] = None, arguments: dict = None, schedule: dict = None, notifications: dict = None, next_run_at: str = None, time_zone: str = None, target_project_id: int = None, required_resources: dict = None, instance_type: str = None, source: str = None, cancel_timeout: int = None, docker_image_tag: str = None, partition_label: str = None, running_as_id: int = None)

Update some attributes of this Python Script

Parameters:
idint

The ID for the script.

namestr, optional

The name of the script.

parent_idint, optional

The ID of the parent job that will trigger this script

user_contextstr, optional

“runner” or “author”, who to execute the script as when run as a template.

paramsList[dict], optional

A definition of the parameters this script accepts in the arguments field.

  • namestr

    The variable’s name as used within your code.

  • labelstr

    The label to present to users when asking them for the value.

  • descriptionstr

    A short sentence or fragment describing this parameter to the end user.

  • typestr

    The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

  • requiredbool

    Whether this param is required.

  • valuestr

    The value you would like to set this param to. Setting this value makes this parameter a fixed param.

  • defaultstr

    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.

  • allowed_valuesList[dict]

    The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

argumentsdict, optional

Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

scheduledict, optional
  • scheduledbool

    If the item is scheduled.

  • scheduled_daysList[int]

    Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

  • scheduled_hoursList[int]

    Hours of the day it is scheduled on.

  • scheduled_minutesList[int]

    Minutes of the day it is scheduled on.

  • scheduled_runs_per_hourint

    Deprecated in favor of scheduled minutes.

  • scheduled_days_of_monthList[int]

    Days of the month it is scheduled on, mutually exclusive with scheduledDays.

notificationsdict, optional
  • urlsList[str]

    URLs to receive a POST request at job completion

  • success_email_subjectstr

    Custom subject line for success e-mail.

  • success_email_bodystr

    Custom body text for success e-mail, written in Markdown.

  • success_email_addressesList[str]

    Addresses to notify by e-mail when the job completes successfully.

  • success_email_from_namestr

    Name from which success emails are sent; defaults to “Civis.”

  • success_email_reply_tostr

    Address for replies to success emails; defaults to the author of the job.

  • failure_email_addressesList[str]

    Addresses to notify by e-mail when the job fails.

  • stall_warning_minutesint

    Stall warning emails will be sent after this amount of minutes.

  • success_onbool

    If success email notifications are on. Defaults to user’s preferences.

  • failure_onbool

    If failure email notifications are on. Defaults to user’s preferences.

next_run_atstr (time), optional

The time of the next scheduled run.

time_zonestr, optional

The time zone of this script.

target_project_idint, optional

Target project to which script outputs will be added.

required_resourcesdict, optional
  • cpuint

    The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.

  • memoryint

    The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.

  • disk_spacefloat (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.

instance_typestr, optional

The EC2 instance type to deploy to. Only available for jobs running on kubernetes.

sourcestr, optional

The body/text of the script.

cancel_timeoutint, optional

The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.

docker_image_tagstr, optional

The tag of the docker image to pull from DockerHub.

partition_labelstr, optional

The partition label used to run this object.

running_as_idint, optional

The ID of the runner of this script.

Returns:
civis.response.Response
  • idint

    The ID for the script.

  • namestr

    The name of the script.

  • typestr

    The type of the script (e.g SQL, Container, Python, R, JavaScript, dbt)

  • created_atstr (time)

    The time this script was created.

  • updated_atstr (time)

    The time the script was last updated.

  • authordict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • statestr

    The status of the script’s last run.

  • finished_atstr (time)

    The time that the script’s last run finished.

  • categorystr

    The category of the script.

  • projectsList[dict]

    A list of projects containing the script.

    • idint

      The ID for the project.

    • namestr

      The name of the project.

  • parent_idint

    The ID of the parent job that will trigger this script

  • user_contextstr

    “runner” or “author”, who to execute the script as when run as a template.

  • paramsList[dict]

    A definition of the parameters this script accepts in the arguments field.

    • namestr

      The variable’s name as used within your code.

    • labelstr

      The label to present to users when asking them for the value.

    • descriptionstr

      A short sentence or fragment describing this parameter to the end user.

    • typestr

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredbool

      Whether this param is required.

    • valuestr

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstr

      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.

    • allowed_valuesList[dict]

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templatebool

    Whether others scripts use this one as a template.

  • published_as_template_idint

    The ID of the template that this script is backing.

  • from_template_idint

    The ID of the template this script uses, if any.

  • template_dependents_countint

    How many other scripts use this one as a template.

  • template_script_namestr

    The name of the template script.

  • linksdict
    • detailsstr

      The details link to get more information about the script.

    • runsstr

      The runs link to get the run information list for this script.

  • scheduledict
    • scheduledbool

      If the item is scheduled.

    • scheduled_daysList[int]

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hoursList[int]

      Hours of the day it is scheduled on.

    • scheduled_minutesList[int]

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourint

      Deprecated in favor of scheduled minutes.

    • scheduled_days_of_monthList[int]

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict
    • urlsList[str]

      URLs to receive a POST request at job completion

    • success_email_subjectstr

      Custom subject line for success e-mail.

    • success_email_bodystr

      Custom body text for success e-mail, written in Markdown.

    • success_email_addressesList[str]

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestr

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostr

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addressesList[str]

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesint

      Stall warning emails will be sent after this amount of minutes.

    • success_onbool

      If success email notifications are on. Defaults to user’s preferences.

    • failure_onbool

      If failure email notifications are on. Defaults to user’s preferences.

  • running_asdict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • next_run_atstr (time)

    The time of the next scheduled run.

  • time_zonestr

    The time zone of this script.

  • last_rundict
    • id : int

    • state : str

    • created_atstr (time)

      The time that the run was queued.

    • started_atstr (time)

      The time that the run started.

    • finished_atstr (time)

      The time that the run completed.

    • errorstr

      The error message for this run, if present.

  • my_permission_levelstr

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenbool

    The hidden status of the item.

  • target_project_idint

    Target project to which script outputs will be added.

  • archivedstr

    The archival status of the requested item(s).

  • required_resourcesdict
    • cpuint

      The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.

    • memoryint

      The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.

    • disk_spacefloat (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.

  • instance_typestr

    The EC2 instance type to deploy to. Only available for jobs running on kubernetes.

  • sourcestr

    The body/text of the script.

  • cancel_timeoutint

    The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.

  • docker_image_tagstr

    The tag of the docker image to pull from DockerHub.

  • partition_labelstr

    The partition label used to run this object.

  • running_as_idint

    The ID of the runner of this script.

patch_python3_git(id: int, *, git_ref: str = None, git_branch: str = None, git_path: str = None, git_repo_url: str = None, git_ref_type: str = None, pull_from_git: bool = None)

Update an attached git file

Parameters:
idint

The ID of the file.

git_refstr, optional

A git reference specifying an unambiguous version of the file. Can be a branch name, or the full or shortened SHA of a commit.

git_branchstr, optional

The git branch that the file is on.

git_pathstr, optional

The path of the file in the repository.

git_repo_urlstr, optional

The URL of the git repository.

git_ref_typestr, optional

Specifies if the file is versioned by branch or tag.

pull_from_gitbool, optional

Automatically pull latest commit from git. Only works for scripts.

Returns:
civis.response.Response
  • git_refstr

    A git reference specifying an unambiguous version of the file. Can be a branch name, tag or the full or shortened SHA of a commit.

  • git_branchstr

    The git branch that the file is on.

  • git_pathstr

    The path of the file in the repository.

  • git_repodict
    • idint

      The ID for this git repository.

    • repo_urlstr

      The URL for this git repository.

    • created_at : str (time)

    • updated_at : str (time)

  • git_ref_typestr

    Specifies if the file is versioned by branch or tag.

  • pull_from_gitbool

    Automatically pull latest commit from git. Only works for scripts and workflows (assuming you have the feature enabled)

patch_python3_runs(id: int, run_id: int, *, error: str = None)

Update the given run

Parameters:
idint

ID of the Job

run_idint

ID of the Run

errorstr, optional

The error message to update

Returns:
None

Response code 204: success

patch_r(id: int, *, name: str = None, parent_id: int = None, user_context: str = None, params: List[dict] = None, arguments: dict = None, schedule: dict = None, notifications: dict = None, next_run_at: str = None, time_zone: str = None, target_project_id: int = None, required_resources: dict = None, instance_type: str = None, source: str = None, cancel_timeout: int = None, docker_image_tag: str = None, partition_label: str = None, running_as_id: int = None)

Update some attributes of this R Script

Parameters:
idint

The ID for the script.

namestr, optional

The name of the script.

parent_idint, optional

The ID of the parent job that will trigger this script

user_contextstr, optional

“runner” or “author”, who to execute the script as when run as a template.

paramsList[dict], optional

A definition of the parameters this script accepts in the arguments field.

  • namestr

    The variable’s name as used within your code.

  • labelstr

    The label to present to users when asking them for the value.

  • descriptionstr

    A short sentence or fragment describing this parameter to the end user.

  • typestr

    The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

  • requiredbool

    Whether this param is required.

  • valuestr

    The value you would like to set this param to. Setting this value makes this parameter a fixed param.

  • defaultstr

    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.

  • allowed_valuesList[dict]

    The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

argumentsdict, optional

Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

scheduledict, optional
  • scheduledbool

    If the item is scheduled.

  • scheduled_daysList[int]

    Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

  • scheduled_hoursList[int]

    Hours of the day it is scheduled on.

  • scheduled_minutesList[int]

    Minutes of the day it is scheduled on.

  • scheduled_runs_per_hourint

    Deprecated in favor of scheduled minutes.

  • scheduled_days_of_monthList[int]

    Days of the month it is scheduled on, mutually exclusive with scheduledDays.

notificationsdict, optional
  • urlsList[str]

    URLs to receive a POST request at job completion

  • success_email_subjectstr

    Custom subject line for success e-mail.

  • success_email_bodystr

    Custom body text for success e-mail, written in Markdown.

  • success_email_addressesList[str]

    Addresses to notify by e-mail when the job completes successfully.

  • success_email_from_namestr

    Name from which success emails are sent; defaults to “Civis.”

  • success_email_reply_tostr

    Address for replies to success emails; defaults to the author of the job.

  • failure_email_addressesList[str]

    Addresses to notify by e-mail when the job fails.

  • stall_warning_minutesint

    Stall warning emails will be sent after this amount of minutes.

  • success_onbool

    If success email notifications are on. Defaults to user’s preferences.

  • failure_onbool

    If failure email notifications are on. Defaults to user’s preferences.

next_run_atstr (time), optional

The time of the next scheduled run.

time_zonestr, optional

The time zone of this script.

target_project_idint, optional

Target project to which script outputs will be added.

required_resourcesdict, optional
  • cpuint

    The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.

  • memoryint

    The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.

  • disk_spacefloat (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.

instance_typestr, optional

The EC2 instance type to deploy to. Only available for jobs running on kubernetes.

sourcestr, optional

The body/text of the script.

cancel_timeoutint, optional

The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.

docker_image_tagstr, optional

The tag of the docker image to pull from DockerHub.

partition_labelstr, optional

The partition label used to run this object.

running_as_idint, optional

The ID of the runner of this script.

Returns:
civis.response.Response
  • idint

    The ID for the script.

  • namestr

    The name of the script.

  • typestr

    The type of the script (e.g SQL, Container, Python, R, JavaScript, dbt)

  • created_atstr (time)

    The time this script was created.

  • updated_atstr (time)

    The time the script was last updated.

  • authordict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • statestr

    The status of the script’s last run.

  • finished_atstr (time)

    The time that the script’s last run finished.

  • categorystr

    The category of the script.

  • projectsList[dict]

    A list of projects containing the script.

    • idint

      The ID for the project.

    • namestr

      The name of the project.

  • parent_idint

    The ID of the parent job that will trigger this script

  • user_contextstr

    “runner” or “author”, who to execute the script as when run as a template.

  • paramsList[dict]

    A definition of the parameters this script accepts in the arguments field.

    • namestr

      The variable’s name as used within your code.

    • labelstr

      The label to present to users when asking them for the value.

    • descriptionstr

      A short sentence or fragment describing this parameter to the end user.

    • typestr

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredbool

      Whether this param is required.

    • valuestr

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstr

      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.

    • allowed_valuesList[dict]

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templatebool

    Whether others scripts use this one as a template.

  • published_as_template_idint

    The ID of the template that this script is backing.

  • from_template_idint

    The ID of the template this script uses, if any.

  • template_dependents_countint

    How many other scripts use this one as a template.

  • template_script_namestr

    The name of the template script.

  • linksdict
    • detailsstr

      The details link to get more information about the script.

    • runsstr

      The runs link to get the run information list for this script.

  • scheduledict
    • scheduledbool

      If the item is scheduled.

    • scheduled_daysList[int]

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hoursList[int]

      Hours of the day it is scheduled on.

    • scheduled_minutesList[int]

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourint

      Deprecated in favor of scheduled minutes.

    • scheduled_days_of_monthList[int]

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict
    • urlsList[str]

      URLs to receive a POST request at job completion

    • success_email_subjectstr

      Custom subject line for success e-mail.

    • success_email_bodystr

      Custom body text for success e-mail, written in Markdown.

    • success_email_addressesList[str]

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestr

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostr

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addressesList[str]

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesint

      Stall warning emails will be sent after this amount of minutes.

    • success_onbool

      If success email notifications are on. Defaults to user’s preferences.

    • failure_onbool

      If failure email notifications are on. Defaults to user’s preferences.

  • running_asdict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • next_run_atstr (time)

    The time of the next scheduled run.

  • time_zonestr

    The time zone of this script.

  • last_rundict
    • id : int

    • state : str

    • created_atstr (time)

      The time that the run was queued.

    • started_atstr (time)

      The time that the run started.

    • finished_atstr (time)

      The time that the run completed.

    • errorstr

      The error message for this run, if present.

  • my_permission_levelstr

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenbool

    The hidden status of the item.

  • target_project_idint

    Target project to which script outputs will be added.

  • archivedstr

    The archival status of the requested item(s).

  • required_resourcesdict
    • cpuint

      The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.

    • memoryint

      The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.

    • disk_spacefloat (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.

  • instance_typestr

    The EC2 instance type to deploy to. Only available for jobs running on kubernetes.

  • sourcestr

    The body/text of the script.

  • cancel_timeoutint

    The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.

  • docker_image_tagstr

    The tag of the docker image to pull from DockerHub.

  • partition_labelstr

    The partition label used to run this object.

  • running_as_idint

    The ID of the runner of this script.

patch_r_git(id: int, *, git_ref: str = None, git_branch: str = None, git_path: str = None, git_repo_url: str = None, git_ref_type: str = None, pull_from_git: bool = None)

Update an attached git file

Parameters:
idint

The ID of the file.

git_refstr, optional

A git reference specifying an unambiguous version of the file. Can be a branch name, or the full or shortened SHA of a commit.

git_branchstr, optional

The git branch that the file is on.

git_pathstr, optional

The path of the file in the repository.

git_repo_urlstr, optional

The URL of the git repository.

git_ref_typestr, optional

Specifies if the file is versioned by branch or tag.

pull_from_gitbool, optional

Automatically pull latest commit from git. Only works for scripts.

Returns:
civis.response.Response
  • git_refstr

    A git reference specifying an unambiguous version of the file. Can be a branch name, tag or the full or shortened SHA of a commit.

  • git_branchstr

    The git branch that the file is on.

  • git_pathstr

    The path of the file in the repository.

  • git_repodict
    • idint

      The ID for this git repository.

    • repo_urlstr

      The URL for this git repository.

    • created_at : str (time)

    • updated_at : str (time)

  • git_ref_typestr

    Specifies if the file is versioned by branch or tag.

  • pull_from_gitbool

    Automatically pull latest commit from git. Only works for scripts and workflows (assuming you have the feature enabled)

patch_r_runs(id: int, run_id: int, *, error: str = None)

Update the given run

Parameters:
idint

ID of the Job

run_idint

ID of the Run

errorstr, optional

The error message to update

Returns:
None

Response code 204: success

patch_sql(id: int, *, name: str = None, parent_id: int = None, user_context: str = None, params: List[dict] = None, arguments: dict = None, schedule: dict = None, notifications: dict = None, next_run_at: str = None, time_zone: str = None, target_project_id: int = None, sql: str = None, remote_host_id: int = None, credential_id: int = None, csv_settings: dict = None, running_as_id: int = None)

Update some attributes of this SQL Script

Parameters:
idint

The ID for the script.

namestr, optional

The name of the script.

parent_idint, optional

The ID of the parent job that will trigger this script

user_contextstr, optional

“runner” or “author”, who to execute the script as when run as a template.

paramsList[dict], optional

A definition of the parameters this script accepts in the arguments field.

  • namestr

    The variable’s name as used within your code.

  • labelstr

    The label to present to users when asking them for the value.

  • descriptionstr

    A short sentence or fragment describing this parameter to the end user.

  • typestr

    The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

  • requiredbool

    Whether this param is required.

  • valuestr

    The value you would like to set this param to. Setting this value makes this parameter a fixed param.

  • defaultstr

    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.

  • allowed_valuesList[dict]

    The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

argumentsdict, optional

Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

scheduledict, optional
  • scheduledbool

    If the item is scheduled.

  • scheduled_daysList[int]

    Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

  • scheduled_hoursList[int]

    Hours of the day it is scheduled on.

  • scheduled_minutesList[int]

    Minutes of the day it is scheduled on.

  • scheduled_runs_per_hourint

    Deprecated in favor of scheduled minutes.

  • scheduled_days_of_monthList[int]

    Days of the month it is scheduled on, mutually exclusive with scheduledDays.

notificationsdict, optional
  • urlsList[str]

    URLs to receive a POST request at job completion

  • success_email_subjectstr

    Custom subject line for success e-mail.

  • success_email_bodystr

    Custom body text for success e-mail, written in Markdown.

  • success_email_addressesList[str]

    Addresses to notify by e-mail when the job completes successfully.

  • success_email_from_namestr

    Name from which success emails are sent; defaults to “Civis.”

  • success_email_reply_tostr

    Address for replies to success emails; defaults to the author of the job.

  • failure_email_addressesList[str]

    Addresses to notify by e-mail when the job fails.

  • stall_warning_minutesint

    Stall warning emails will be sent after this amount of minutes.

  • success_onbool

    If success email notifications are on. Defaults to user’s preferences.

  • failure_onbool

    If failure email notifications are on. Defaults to user’s preferences.

next_run_atstr (time), optional

The time of the next scheduled run.

time_zonestr, optional

The time zone of this script.

target_project_idint, optional

Target project to which script outputs will be added.

sqlstr, optional

The raw SQL query for the script.

remote_host_idint, optional

The remote host ID that this script will connect to.

credential_idint, optional

The credential that this script will use.

csv_settingsdict, optional
  • include_headerbool

    Whether or not to include headers in the output data. Default: true

  • compressionstr

    The type of compression to use, if any, one of “none”, “zip”, or “gzip”. Default: gzip

  • column_delimiterstr

    Which delimiter to use, one of “comma”, “tab”, or “pipe”. Default: comma

  • unquotedbool

    Whether or not to quote fields. Default: false

  • force_multifilebool

    Whether or not the csv should be split into multiple files. Default: false

  • filename_prefixstr

    A user specified filename prefix for the output file to have. Default: null

  • max_file_sizeint

    The max file size, in MB, created files will be. Only available when force_multifile is true.

running_as_idint, optional

The ID of the runner of this script.

Returns:
civis.response.Response
  • idint

    The ID for the script.

  • namestr

    The name of the script.

  • typestr

    The type of the script (e.g SQL, Container, Python, R, JavaScript, dbt)

  • created_atstr (time)

    The time this script was created.

  • updated_atstr (time)

    The time the script was last updated.

  • authordict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • statestr

    The status of the script’s last run.

  • finished_atstr (time)

    The time that the script’s last run finished.

  • categorystr

    The category of the script.

  • projectsList[dict]

    A list of projects containing the script.

    • idint

      The ID for the project.

    • namestr

      The name of the project.

  • parent_idint

    The ID of the parent job that will trigger this script

  • user_contextstr

    “runner” or “author”, who to execute the script as when run as a template.

  • paramsList[dict]

    A definition of the parameters this script accepts in the arguments field.

    • namestr

      The variable’s name as used within your code.

    • labelstr

      The label to present to users when asking them for the value.

    • descriptionstr

      A short sentence or fragment describing this parameter to the end user.

    • typestr

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredbool

      Whether this param is required.

    • valuestr

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstr

      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.

    • allowed_valuesList[dict]

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templatebool

    Whether others scripts use this one as a template.

  • published_as_template_idint

    The ID of the template that this script is backing.

  • from_template_idint

    The ID of the template this script uses, if any.

  • template_dependents_countint

    How many other scripts use this one as a template.

  • template_script_namestr

    The name of the template script.

  • linksdict
    • detailsstr

      The details link to get more information about the script.

    • runsstr

      The runs link to get the run information list for this script.

  • scheduledict
    • scheduledbool

      If the item is scheduled.

    • scheduled_daysList[int]

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hoursList[int]

      Hours of the day it is scheduled on.

    • scheduled_minutesList[int]

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourint

      Deprecated in favor of scheduled minutes.

    • scheduled_days_of_monthList[int]

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict
    • urlsList[str]

      URLs to receive a POST request at job completion

    • success_email_subjectstr

      Custom subject line for success e-mail.

    • success_email_bodystr

      Custom body text for success e-mail, written in Markdown.

    • success_email_addressesList[str]

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestr

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostr

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addressesList[str]

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesint

      Stall warning emails will be sent after this amount of minutes.

    • success_onbool

      If success email notifications are on. Defaults to user’s preferences.

    • failure_onbool

      If failure email notifications are on. Defaults to user’s preferences.

  • running_asdict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • next_run_atstr (time)

    The time of the next scheduled run.

  • time_zonestr

    The time zone of this script.

  • last_rundict
    • id : int

    • state : str

    • created_atstr (time)

      The time that the run was queued.

    • started_atstr (time)

      The time that the run started.

    • finished_atstr (time)

      The time that the run completed.

    • errorstr

      The error message for this run, if present.

  • my_permission_levelstr

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenbool

    The hidden status of the item.

  • target_project_idint

    Target project to which script outputs will be added.

  • archivedstr

    The archival status of the requested item(s).

  • sqlstr

    The raw SQL query for the script.

  • expanded_argumentsdict

    Expanded arguments for use in injecting into different environments.

  • remote_host_idint

    The remote host ID that this script will connect to.

  • credential_idint

    The credential that this script will use.

  • code_previewstr

    The code that this script will run with arguments inserted.

  • csv_settingsdict
    • include_headerbool

      Whether or not to include headers in the output data. Default: true

    • compressionstr

      The type of compression to use, if any, one of “none”, “zip”, or “gzip”. Default: gzip

    • column_delimiterstr

      Which delimiter to use, one of “comma”, “tab”, or “pipe”. Default: comma

    • unquotedbool

      Whether or not to quote fields. Default: false

    • force_multifilebool

      Whether or not the csv should be split into multiple files. Default: false

    • filename_prefixstr

      A user specified filename prefix for the output file to have. Default: null

    • max_file_sizeint

      The max file size, in MB, created files will be. Only available when force_multifile is true.

  • running_as_idint

    The ID of the runner of this script.

patch_sql_git(id: int, *, git_ref: str = None, git_branch: str = None, git_path: str = None, git_repo_url: str = None, git_ref_type: str = None, pull_from_git: bool = None)

Update an attached git file

Parameters:
idint

The ID of the file.

git_refstr, optional

A git reference specifying an unambiguous version of the file. Can be a branch name, or the full or shortened SHA of a commit.

git_branchstr, optional

The git branch that the file is on.

git_pathstr, optional

The path of the file in the repository.

git_repo_urlstr, optional

The URL of the git repository.

git_ref_typestr, optional

Specifies if the file is versioned by branch or tag.

pull_from_gitbool, optional

Automatically pull latest commit from git. Only works for scripts.

Returns:
civis.response.Response
  • git_refstr

    A git reference specifying an unambiguous version of the file. Can be a branch name, tag or the full or shortened SHA of a commit.

  • git_branchstr

    The git branch that the file is on.

  • git_pathstr

    The path of the file in the repository.

  • git_repodict
    • idint

      The ID for this git repository.

    • repo_urlstr

      The URL for this git repository.

    • created_at : str (time)

    • updated_at : str (time)

  • git_ref_typestr

    Specifies if the file is versioned by branch or tag.

  • pull_from_gitbool

    Automatically pull latest commit from git. Only works for scripts and workflows (assuming you have the feature enabled)

patch_sql_runs(id: int, run_id: int, *, error: str = None)

Update the given run

Parameters:
idint

ID of the Job

run_idint

ID of the Run

errorstr, optional

The error message to update

Returns:
None

Response code 204: success

post(name: str, remote_host_id: int, credential_id: int, sql: str, *, params: List[dict] = None, arguments: dict = None, template_script_id: int = None, notifications: dict = None, hidden: bool = None)

Create a script

Parameters:
namestr

The name of the script.

remote_host_idint

The database ID.

credential_idint

The credential ID.

sqlstr

The raw SQL query for the script.

paramsList[dict], optional

A definition of the parameters this script accepts in the arguments field. Cannot be set if this script uses a template script.

  • namestr

    The variable’s name as used within your code.

  • labelstr

    The label to present to users when asking them for the value.

  • descriptionstr

    A short sentence or fragment describing this parameter to the end user.

  • typestr

    The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

  • requiredbool

    Whether this param is required.

  • valuestr

    The value you would like to set this param to. Setting this value makes this parameter a fixed param.

  • defaultstr

    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.

  • allowed_valuesList[dict]

    The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

argumentsdict, optional

Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

template_script_idint, optional

The ID of the template script, if any. A script cannot both have a template script and be a template for other scripts.

notificationsdict, optional
  • urlsList[str]

    URLs to receive a POST request at job completion

  • success_email_subjectstr

    Custom subject line for success e-mail.

  • success_email_bodystr

    Custom body text for success e-mail, written in Markdown.

  • success_email_addressesList[str]

    Addresses to notify by e-mail when the job completes successfully.

  • success_email_from_namestr

    Name from which success emails are sent; defaults to “Civis.”

  • success_email_reply_tostr

    Address for replies to success emails; defaults to the author of the job.

  • failure_email_addressesList[str]

    Addresses to notify by e-mail when the job fails.

  • stall_warning_minutesint

    Stall warning emails will be sent after this amount of minutes.

  • success_onbool

    If success email notifications are on. Defaults to user’s preferences.

  • failure_onbool

    If failure email notifications are on. Defaults to user’s preferences.

hiddenbool, optional

The hidden status of the item.

Returns:
civis.response.Response
  • idint

    The ID for the script.

  • namestr

    The name of the script.

  • typestr

    The type of the script (e.g SQL, Container, Python, R, JavaScript, dbt)

  • created_atstr (time)

    The time this script was created.

  • updated_atstr (time)

    The time the script was last updated.

  • authordict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • statestr

    The status of the script’s last run.

  • finished_atstr (time)

    The time that the script’s last run finished.

  • categorystr

    The category of the script.

  • projectsList[dict]

    A list of projects containing the script.

    • idint

      The ID for the project.

    • namestr

      The name of the project.

  • parent_idint

    The ID of the parent job that will trigger this script

  • user_contextstr

    “runner” or “author”, who to execute the script as when run as a template.

  • paramsList[dict]

    A definition of the parameters this script accepts in the arguments field.

    • namestr

      The variable’s name as used within your code.

    • labelstr

      The label to present to users when asking them for the value.

    • descriptionstr

      A short sentence or fragment describing this parameter to the end user.

    • typestr

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredbool

      Whether this param is required.

    • valuestr

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstr

      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.

    • allowed_valuesList[dict]

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templatebool

    Whether others scripts use this one as a template.

  • published_as_template_idint

    The ID of the template that this script is backing.

  • from_template_idint

    The ID of the template this script uses, if any.

  • template_dependents_countint

    How many other scripts use this one as a template.

  • template_script_namestr

    The name of the template script.

  • linksdict
    • detailsstr

      The details link to get more information about the script.

    • runsstr

      The runs link to get the run information list for this script.

  • scheduledict
    • scheduledbool

      If the item is scheduled.

    • scheduled_daysList[int]

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hoursList[int]

      Hours of the day it is scheduled on.

    • scheduled_minutesList[int]

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourint

      Deprecated in favor of scheduled minutes.

    • scheduled_days_of_monthList[int]

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict
    • urlsList[str]

      URLs to receive a POST request at job completion

    • success_email_subjectstr

      Custom subject line for success e-mail.

    • success_email_bodystr

      Custom body text for success e-mail, written in Markdown.

    • success_email_addressesList[str]

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestr

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostr

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addressesList[str]

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesint

      Stall warning emails will be sent after this amount of minutes.

    • success_onbool

      If success email notifications are on. Defaults to user’s preferences.

    • failure_onbool

      If failure email notifications are on. Defaults to user’s preferences.

  • running_asdict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • next_run_atstr (time)

    The time of the next scheduled run.

  • time_zonestr

    The time zone of this script.

  • last_rundict
    • id : int

    • state : str

    • created_atstr (time)

      The time that the run was queued.

    • started_atstr (time)

      The time that the run started.

    • finished_atstr (time)

      The time that the run completed.

    • errorstr

      The error message for this run, if present.

  • my_permission_levelstr

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenbool

    The hidden status of the item.

  • target_project_idint

    Target project to which script outputs will be added.

  • archivedstr

    The archival status of the requested item(s).

  • template_script_idint

    The ID of the template script, if any.

post_cancel(id: int)

Cancel a run

Parameters:
idint

The ID of the job.

Returns:
civis.response.Response
  • idint

    The ID of the run.

  • statestr

    The state of the run, one of ‘queued’, ‘running’ or ‘cancelled’.

  • is_cancel_requestedbool

    True if run cancel requested, else false.

post_containers(required_resources: dict, docker_image_name: str, *, name: str = None, parent_id: int = None, user_context: str = None, params: List[dict] = None, arguments: dict = None, schedule: dict = None, notifications: dict = None, repo_http_uri: str = None, repo_ref: str = None, remote_host_credential_id: int = None, git_credential_id: int = None, docker_command: str = None, docker_image_tag: str = None, instance_type: str = None, cancel_timeout: int = None, time_zone: str = None, partition_label: str = None, hidden: bool = None, target_project_id: int = None, running_as_id: int = None)

Create a container

Parameters:
required_resourcesdict
  • cpuint

    The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.

  • memoryint

    The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.

  • disk_spacefloat (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.

docker_image_namestr

The name of the docker image to pull from DockerHub.

namestr, optional

The name of the container.

parent_idint, optional

The ID of the parent job that will trigger this script

user_contextstr, optional

“runner” or “author”, who to execute the script as when run as a template.

paramsList[dict], optional

A definition of the parameters this script accepts in the arguments field.

  • namestr

    The variable’s name as used within your code.

  • labelstr

    The label to present to users when asking them for the value.

  • descriptionstr

    A short sentence or fragment describing this parameter to the end user.

  • typestr

    The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

  • requiredbool

    Whether this param is required.

  • valuestr

    The value you would like to set this param to. Setting this value makes this parameter a fixed param.

  • defaultstr

    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.

  • allowed_valuesList[dict]

    The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

argumentsdict, optional

Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

scheduledict, optional
  • scheduledbool

    If the item is scheduled.

  • scheduled_daysList[int]

    Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

  • scheduled_hoursList[int]

    Hours of the day it is scheduled on.

  • scheduled_minutesList[int]

    Minutes of the day it is scheduled on.

  • scheduled_runs_per_hourint

    Deprecated in favor of scheduled minutes.

  • scheduled_days_of_monthList[int]

    Days of the month it is scheduled on, mutually exclusive with scheduledDays.

notificationsdict, optional
  • urlsList[str]

    URLs to receive a POST request at job completion

  • success_email_subjectstr

    Custom subject line for success e-mail.

  • success_email_bodystr

    Custom body text for success e-mail, written in Markdown.

  • success_email_addressesList[str]

    Addresses to notify by e-mail when the job completes successfully.

  • success_email_from_namestr

    Name from which success emails are sent; defaults to “Civis.”

  • success_email_reply_tostr

    Address for replies to success emails; defaults to the author of the job.

  • failure_email_addressesList[str]

    Addresses to notify by e-mail when the job fails.

  • stall_warning_minutesint

    Stall warning emails will be sent after this amount of minutes.

  • success_onbool

    If success email notifications are on. Defaults to user’s preferences.

  • failure_onbool

    If failure email notifications are on. Defaults to user’s preferences.

repo_http_uristr, optional

The location of a github repo to clone into the container, e.g. github.com/my-user/my-repo.git.

repo_refstr, optional

The tag or branch of the github repo to clone into the container.

remote_host_credential_idint, optional

The id of the database credentials to pass into the environment of the container.

git_credential_idint, 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_commandstr, optional

The command to run on the container. Will be run via sh as: [“sh”, “-c”, dockerCommand]. Defaults to the Docker image’s ENTRYPOINT/CMD.

docker_image_tagstr, optional

The tag of the docker image to pull from DockerHub.

instance_typestr, optional

The EC2 instance type to deploy to. Only available for jobs running on kubernetes.

cancel_timeoutint, optional

The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.

time_zonestr, optional

The time zone of this script.

partition_labelstr, optional

The partition label used to run this object.

hiddenbool, optional

The hidden status of the item.

target_project_idint, optional

Target project to which script outputs will be added.

running_as_idint, optional

The ID of the runner of this script.

Returns:
civis.response.Response
  • idint

    The ID for the script.

  • from_template_aliasesList[dict]

    An array of the aliases of the template script.

    • idint

      The id of the Alias object.

    • object_idint

      The id of the object

    • aliasstr

      The alias of the object

  • namestr

    The name of the container.

  • typestr

    The type of the script (e.g Container)

  • created_atstr (time)

    The time this script was created.

  • updated_atstr (time)

    The time the script was last updated.

  • authordict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • statestr

    The status of the script’s last run.

  • finished_atstr (time)

    The time that the script’s last run finished.

  • categorystr

    The category of the script.

  • projectsList[dict]

    A list of projects containing the script.

    • idint

      The ID for the project.

    • namestr

      The name of the project.

  • parent_idint

    The ID of the parent job that will trigger this script

  • user_contextstr

    “runner” or “author”, who to execute the script as when run as a template.

  • paramsList[dict]

    A definition of the parameters this script accepts in the arguments field.

    • namestr

      The variable’s name as used within your code.

    • labelstr

      The label to present to users when asking them for the value.

    • descriptionstr

      A short sentence or fragment describing this parameter to the end user.

    • typestr

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredbool

      Whether this param is required.

    • valuestr

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstr

      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.

    • allowed_valuesList[dict]

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templatebool

    Whether others scripts use this one as a template.

  • template_dependents_countint

    How many other scripts use this one as a template.

  • published_as_template_idint

    The ID of the template that this script is backing.

  • from_template_idint

    The ID of the template script.

  • template_script_namestr

    The name of the template script.

  • linksdict
    • detailsstr

      The details link to get more information about the script.

    • runsstr

      The runs link to get the run information list for this script.

  • scheduledict
    • scheduledbool

      If the item is scheduled.

    • scheduled_daysList[int]

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hoursList[int]

      Hours of the day it is scheduled on.

    • scheduled_minutesList[int]

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourint

      Deprecated in favor of scheduled minutes.

    • scheduled_days_of_monthList[int]

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict
    • urlsList[str]

      URLs to receive a POST request at job completion

    • success_email_subjectstr

      Custom subject line for success e-mail.

    • success_email_bodystr

      Custom body text for success e-mail, written in Markdown.

    • success_email_addressesList[str]

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestr

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostr

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addressesList[str]

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesint

      Stall warning emails will be sent after this amount of minutes.

    • success_onbool

      If success email notifications are on. Defaults to user’s preferences.

    • failure_onbool

      If failure email notifications are on. Defaults to user’s preferences.

  • running_asdict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • required_resourcesdict
    • cpuint

      The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.

    • memoryint

      The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.

    • disk_spacefloat (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.

  • repo_http_uristr

    The location of a github repo to clone into the container, e.g. github.com/my-user/my-repo.git.

  • repo_refstr

    The tag or branch of the github repo to clone into the container.

  • remote_host_credential_idint

    The id of the database credentials to pass into the environment of the container.

  • git_credential_idint

    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_commandstr

    The command to run on the container. Will be run via sh as: [“sh”, “-c”, dockerCommand]. Defaults to the Docker image’s ENTRYPOINT/CMD.

  • docker_image_namestr

    The name of the docker image to pull from DockerHub.

  • docker_image_tagstr

    The tag of the docker image to pull from DockerHub.

  • instance_typestr

    The EC2 instance type to deploy to. Only available for jobs running on kubernetes.

  • cancel_timeoutint

    The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.

  • last_rundict
    • id : int

    • state : str

    • created_atstr (time)

      The time that the run was queued.

    • started_atstr (time)

      The time that the run started.

    • finished_atstr (time)

      The time that the run completed.

    • errorstr

      The error message for this run, if present.

  • time_zonestr

    The time zone of this script.

  • partition_labelstr

    The partition label used to run this object.

  • my_permission_levelstr

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenbool

    The hidden status of the item.

  • archivedstr

    The archival status of the requested item(s).

  • target_project_idint

    Target project to which script outputs will be added.

  • running_as_idint

    The ID of the runner of this script.

post_containers_clone(id: int, *, clone_schedule: bool = None, clone_triggers: bool = None, clone_notifications: bool = None)

Clone this Container Script

Parameters:
idint

The ID for the script.

clone_schedulebool, optional

If true, also copy the schedule to the new script.

clone_triggersbool, optional

If true, also copy the triggers to the new script.

clone_notificationsbool, optional

If true, also copy the notifications to the new script.

Returns:
civis.response.Response
  • idint

    The ID for the script.

  • from_template_aliasesList[dict]

    An array of the aliases of the template script.

    • idint

      The id of the Alias object.

    • object_idint

      The id of the object

    • aliasstr

      The alias of the object

  • namestr

    The name of the container.

  • typestr

    The type of the script (e.g Container)

  • created_atstr (time)

    The time this script was created.

  • updated_atstr (time)

    The time the script was last updated.

  • authordict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • statestr

    The status of the script’s last run.

  • finished_atstr (time)

    The time that the script’s last run finished.

  • categorystr

    The category of the script.

  • projectsList[dict]

    A list of projects containing the script.

    • idint

      The ID for the project.

    • namestr

      The name of the project.

  • parent_idint

    The ID of the parent job that will trigger this script

  • user_contextstr

    “runner” or “author”, who to execute the script as when run as a template.

  • paramsList[dict]

    A definition of the parameters this script accepts in the arguments field.

    • namestr

      The variable’s name as used within your code.

    • labelstr

      The label to present to users when asking them for the value.

    • descriptionstr

      A short sentence or fragment describing this parameter to the end user.

    • typestr

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredbool

      Whether this param is required.

    • valuestr

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstr

      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.

    • allowed_valuesList[dict]

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templatebool

    Whether others scripts use this one as a template.

  • template_dependents_countint

    How many other scripts use this one as a template.

  • published_as_template_idint

    The ID of the template that this script is backing.

  • from_template_idint

    The ID of the template script.

  • template_script_namestr

    The name of the template script.

  • linksdict
    • detailsstr

      The details link to get more information about the script.

    • runsstr

      The runs link to get the run information list for this script.

  • scheduledict
    • scheduledbool

      If the item is scheduled.

    • scheduled_daysList[int]

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hoursList[int]

      Hours of the day it is scheduled on.

    • scheduled_minutesList[int]

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourint

      Deprecated in favor of scheduled minutes.

    • scheduled_days_of_monthList[int]

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict
    • urlsList[str]

      URLs to receive a POST request at job completion

    • success_email_subjectstr

      Custom subject line for success e-mail.

    • success_email_bodystr

      Custom body text for success e-mail, written in Markdown.

    • success_email_addressesList[str]

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestr

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostr

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addressesList[str]

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesint

      Stall warning emails will be sent after this amount of minutes.

    • success_onbool

      If success email notifications are on. Defaults to user’s preferences.

    • failure_onbool

      If failure email notifications are on. Defaults to user’s preferences.

  • running_asdict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • required_resourcesdict
    • cpuint

      The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.

    • memoryint

      The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.

    • disk_spacefloat (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.

  • repo_http_uristr

    The location of a github repo to clone into the container, e.g. github.com/my-user/my-repo.git.

  • repo_refstr

    The tag or branch of the github repo to clone into the container.

  • remote_host_credential_idint

    The id of the database credentials to pass into the environment of the container.

  • git_credential_idint

    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_commandstr

    The command to run on the container. Will be run via sh as: [“sh”, “-c”, dockerCommand]. Defaults to the Docker image’s ENTRYPOINT/CMD.

  • docker_image_namestr

    The name of the docker image to pull from DockerHub.

  • docker_image_tagstr

    The tag of the docker image to pull from DockerHub.

  • instance_typestr

    The EC2 instance type to deploy to. Only available for jobs running on kubernetes.

  • cancel_timeoutint

    The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.

  • last_rundict
    • id : int

    • state : str

    • created_atstr (time)

      The time that the run was queued.

    • started_atstr (time)

      The time that the run started.

    • finished_atstr (time)

      The time that the run completed.

    • errorstr

      The error message for this run, if present.

  • time_zonestr

    The time zone of this script.

  • partition_labelstr

    The partition label used to run this object.

  • my_permission_levelstr

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenbool

    The hidden status of the item.

  • archivedstr

    The archival status of the requested item(s).

  • target_project_idint

    Target project to which script outputs will be added.

  • running_as_idint

    The ID of the runner of this script.

post_containers_runs(id: int)

Start a run

Parameters:
idint

The ID of the Container job.

Returns:
civis.response.Response
  • idint

    The ID of the run.

  • container_idint

    The ID of the Container job.

  • statestr

    The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.

  • is_cancel_requestedbool

    True if run cancel requested, else false.

  • created_atstr (time)

    The time the run was created.

  • started_atstr (time)

    The time the run started at.

  • finished_atstr (time)

    The time the run completed.

  • errorstr

    The error, if any, returned by the run.

  • max_memory_usagefloat (float)

    If the run has finished, the maximum amount of memory used during the run, in MB.

  • max_cpu_usagefloat (float)

    If the run has finished, the maximum amount of cpu used during the run, in millicores.

post_containers_runs_logs(id: int, run_id: int, *, message: str = None, level: str = None, messages: List[dict] = None, child_job_id: int = None)

Add log messages

Parameters:
idint

The ID of the script.

run_idint

The ID of the script run.

messagestr, optional

The log message to store.

levelstr, optional

The log level of this message [default: info]

messagesList[dict], optional

If specified, a batch of logs to store. If createdAt timestamps for the logs are supplied, the ordering of this list is not preserved, and the timestamps are used to sort the logs.If createdAt timestamps are not supplied, the ordering of this list is preserved and the logs are given the timestamp of when they were received.

  • messagestr

    The log message to store.

  • levelstr

    The log level of this message [default: info]

  • created_atstr (date-time)

    The timestamp of this message in ISO 8601 format. This is what logs are ordered by, so it is recommended to use timestamps with nanosecond precision. If absent, defaults to the time that the log was received by the API.

child_job_idint, optional

The ID of the child job the message came from.

Returns:
None

Response code 204: success

post_containers_runs_outputs(id: int, run_id: int, object_type: str, object_id: int)

Add an output for a run

Parameters:
idint

The ID of the container script.

run_idint

The ID of the run.

object_typestr

The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue

object_idint

The ID of the output.

Returns:
civis.response.Response
  • object_typestr

    The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue

  • object_idint

    The ID of the output.

  • namestr

    The name of the output.

  • linkstr

    The hypermedia link to the output.

  • value : str

post_custom(from_template_id: int, *, name: str = None, parent_id: int = None, arguments: dict = None, remote_host_id: int = None, credential_id: int = None, schedule: dict = None, notifications: dict = None, time_zone: str = None, hidden: bool = None, target_project_id: int = None, required_resources: dict = None, partition_label: str = None, running_as_id: int = None)

Create a Custom Script

Parameters:
from_template_idint

The ID of the template script.

namestr, optional

The name of the script.

parent_idint, optional

The ID of the parent job that will trigger this script

argumentsdict, optional

Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

remote_host_idint, optional

The remote host ID that this script will connect to.

credential_idint, optional

The credential that this script will use.

scheduledict, optional
  • scheduledbool

    If the item is scheduled.

  • scheduled_daysList[int]

    Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

  • scheduled_hoursList[int]

    Hours of the day it is scheduled on.

  • scheduled_minutesList[int]

    Minutes of the day it is scheduled on.

  • scheduled_runs_per_hourint

    Deprecated in favor of scheduled minutes.

  • scheduled_days_of_monthList[int]

    Days of the month it is scheduled on, mutually exclusive with scheduledDays.

notificationsdict, optional
  • urlsList[str]

    URLs to receive a POST request at job completion

  • success_email_subjectstr

    Custom subject line for success e-mail.

  • success_email_bodystr

    Custom body text for success e-mail, written in Markdown.

  • success_email_addressesList[str]

    Addresses to notify by e-mail when the job completes successfully.

  • success_email_from_namestr

    Name from which success emails are sent; defaults to “Civis.”

  • success_email_reply_tostr

    Address for replies to success emails; defaults to the author of the job.

  • failure_email_addressesList[str]

    Addresses to notify by e-mail when the job fails.

  • stall_warning_minutesint

    Stall warning emails will be sent after this amount of minutes.

  • success_onbool

    If success email notifications are on. Defaults to user’s preferences.

  • failure_onbool

    If failure email notifications are on. Defaults to user’s preferences.

time_zonestr, optional

The time zone of this script.

hiddenbool, optional

The hidden status of the item.

target_project_idint, optional

Target project to which script outputs will be added.

required_resourcesdict, optional
  • cpuint

    The number of CPU shares to allocate for the container. Each core has 1000 shares.

  • memoryint

    The amount of RAM to allocate for the container (in MB).

  • disk_spacefloat (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.

partition_labelstr, optional

The partition label used to run this object. Only applicable for jobs using Docker.

running_as_idint, optional

The ID of the runner of this script.

Returns:
civis.response.Response
  • idint

    The ID for the script.

  • from_template_aliasesList[dict]

    An array of the aliases of the template script.

    • idint

      The id of the Alias object.

    • object_idint

      The id of the object

    • aliasstr

      The alias of the object

  • namestr

    The name of the script.

  • typestr

    The type of the script (e.g Custom)

  • backing_script_typestr

    The type of the script backing this template (e.g Python)

  • created_atstr (time)

    The time this script was created.

  • updated_atstr (time)

    The time the script was last updated.

  • authordict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • statestr

    The status of the script’s last run.

  • finished_atstr (time)

    The time that the script’s last run finished.

  • category : str

  • projectsList[dict]

    A list of projects containing the script.

    • idint

      The ID for the project.

    • namestr

      The name of the project.

  • parent_idint

    The ID of the parent job that will trigger this script

  • paramsList[dict]

    A definition of the parameters this script accepts in the arguments field.

    • namestr

      The variable’s name as used within your code.

    • labelstr

      The label to present to users when asking them for the value.

    • descriptionstr

      A short sentence or fragment describing this parameter to the end user.

    • typestr

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredbool

      Whether this param is required.

    • valuestr

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstr

      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.

    • allowed_valuesList[dict]

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templatebool

    Whether others scripts use this one as a template.

  • published_as_template_idint

    The ID of the template that this script is backing.

  • from_template_idint

    The ID of the template script.

  • ui_report_urlint

    The url of the custom HTML.

  • ui_report_idint

    The id of the report with the custom HTML.

  • ui_report_provide_api_keybool

    Whether the ui report requests an API Key from the report viewer.

  • template_script_namestr

    The name of the template script.

  • template_notestr

    The template’s note.

  • remote_host_idint

    The remote host ID that this script will connect to.

  • credential_idint

    The credential that this script will use.

  • code_previewstr

    The code that this script will run with arguments inserted.

  • scheduledict
    • scheduledbool

      If the item is scheduled.

    • scheduled_daysList[int]

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hoursList[int]

      Hours of the day it is scheduled on.

    • scheduled_minutesList[int]

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourint

      Deprecated in favor of scheduled minutes.

    • scheduled_days_of_monthList[int]

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict
    • urlsList[str]

      URLs to receive a POST request at job completion

    • success_email_subjectstr

      Custom subject line for success e-mail.

    • success_email_bodystr

      Custom body text for success e-mail, written in Markdown.

    • success_email_addressesList[str]

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestr

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostr

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addressesList[str]

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesint

      Stall warning emails will be sent after this amount of minutes.

    • success_onbool

      If success email notifications are on. Defaults to user’s preferences.

    • failure_onbool

      If failure email notifications are on. Defaults to user’s preferences.

  • running_asdict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • time_zonestr

    The time zone of this script.

  • last_rundict
    • id : int

    • state : str

    • created_atstr (time)

      The time that the run was queued.

    • started_atstr (time)

      The time that the run started.

    • finished_atstr (time)

      The time that the run completed.

    • errorstr

      The error message for this run, if present.

  • my_permission_levelstr

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenbool

    The hidden status of the item.

  • archivedstr

    The archival status of the requested item(s).

  • target_project_idint

    Target project to which script outputs will be added.

  • last_successful_rundict
    • id : int

    • state : str

    • created_atstr (time)

      The time that the run was queued.

    • started_atstr (time)

      The time that the run started.

    • finished_atstr (time)

      The time that the run completed.

    • errorstr

      The error message for this run, if present.

  • required_resourcesdict
    • cpuint

      The number of CPU shares to allocate for the container. Each core has 1000 shares.

    • memoryint

      The amount of RAM to allocate for the container (in MB).

    • disk_spacefloat (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.

  • partition_labelstr

    The partition label used to run this object. Only applicable for jobs using Docker.

  • running_as_idint

    The ID of the runner of this script.

post_custom_clone(id: int, *, clone_schedule: bool = None, clone_triggers: bool = None, clone_notifications: bool = None)

Clone this Custom Script

Parameters:
idint

The ID for the script.

clone_schedulebool, optional

If true, also copy the schedule to the new script.

clone_triggersbool, optional

If true, also copy the triggers to the new script.

clone_notificationsbool, optional

If true, also copy the notifications to the new script.

Returns:
civis.response.Response
  • idint

    The ID for the script.

  • from_template_aliasesList[dict]

    An array of the aliases of the template script.

    • idint

      The id of the Alias object.

    • object_idint

      The id of the object

    • aliasstr

      The alias of the object

  • namestr

    The name of the script.

  • typestr

    The type of the script (e.g Custom)

  • backing_script_typestr

    The type of the script backing this template (e.g Python)

  • created_atstr (time)

    The time this script was created.

  • updated_atstr (time)

    The time the script was last updated.

  • authordict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • statestr

    The status of the script’s last run.

  • finished_atstr (time)

    The time that the script’s last run finished.

  • category : str

  • projectsList[dict]

    A list of projects containing the script.

    • idint

      The ID for the project.

    • namestr

      The name of the project.

  • parent_idint

    The ID of the parent job that will trigger this script

  • paramsList[dict]

    A definition of the parameters this script accepts in the arguments field.

    • namestr

      The variable’s name as used within your code.

    • labelstr

      The label to present to users when asking them for the value.

    • descriptionstr

      A short sentence or fragment describing this parameter to the end user.

    • typestr

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredbool

      Whether this param is required.

    • valuestr

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstr

      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.

    • allowed_valuesList[dict]

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templatebool

    Whether others scripts use this one as a template.

  • published_as_template_idint

    The ID of the template that this script is backing.

  • from_template_idint

    The ID of the template script.

  • ui_report_urlint

    The url of the custom HTML.

  • ui_report_idint

    The id of the report with the custom HTML.

  • ui_report_provide_api_keybool

    Whether the ui report requests an API Key from the report viewer.

  • template_script_namestr

    The name of the template script.

  • template_notestr

    The template’s note.

  • remote_host_idint

    The remote host ID that this script will connect to.

  • credential_idint

    The credential that this script will use.

  • code_previewstr

    The code that this script will run with arguments inserted.

  • scheduledict
    • scheduledbool

      If the item is scheduled.

    • scheduled_daysList[int]

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hoursList[int]

      Hours of the day it is scheduled on.

    • scheduled_minutesList[int]

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourint

      Deprecated in favor of scheduled minutes.

    • scheduled_days_of_monthList[int]

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict
    • urlsList[str]

      URLs to receive a POST request at job completion

    • success_email_subjectstr

      Custom subject line for success e-mail.

    • success_email_bodystr

      Custom body text for success e-mail, written in Markdown.

    • success_email_addressesList[str]

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestr

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostr

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addressesList[str]

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesint

      Stall warning emails will be sent after this amount of minutes.

    • success_onbool

      If success email notifications are on. Defaults to user’s preferences.

    • failure_onbool

      If failure email notifications are on. Defaults to user’s preferences.

  • running_asdict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • time_zonestr

    The time zone of this script.

  • last_rundict
    • id : int

    • state : str

    • created_atstr (time)

      The time that the run was queued.

    • started_atstr (time)

      The time that the run started.

    • finished_atstr (time)

      The time that the run completed.

    • errorstr

      The error message for this run, if present.

  • my_permission_levelstr

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenbool

    The hidden status of the item.

  • archivedstr

    The archival status of the requested item(s).

  • target_project_idint

    Target project to which script outputs will be added.

  • last_successful_rundict
    • id : int

    • state : str

    • created_atstr (time)

      The time that the run was queued.

    • started_atstr (time)

      The time that the run started.

    • finished_atstr (time)

      The time that the run completed.

    • errorstr

      The error message for this run, if present.

  • required_resourcesdict
    • cpuint

      The number of CPU shares to allocate for the container. Each core has 1000 shares.

    • memoryint

      The amount of RAM to allocate for the container (in MB).

    • disk_spacefloat (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.

  • partition_labelstr

    The partition label used to run this object. Only applicable for jobs using Docker.

  • running_as_idint

    The ID of the runner of this script.

post_custom_runs(id: int)

Start a run

Parameters:
idint

The ID of the Custom job.

Returns:
civis.response.Response
  • idint

    The ID of the run.

  • custom_idint

    The ID of the Custom job.

  • statestr

    The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.

  • is_cancel_requestedbool

    True if run cancel requested, else false.

  • created_atstr (time)

    The time the run was created.

  • started_atstr (time)

    The time the run started at.

  • finished_atstr (time)

    The time the run completed.

  • errorstr

    The error, if any, returned by the run.

  • max_memory_usagefloat (float)

    If the run has finished, the maximum amount of memory used during the run, in MB. Only available if the backing script is a Python, R, or container script.

  • max_cpu_usagefloat (float)

    If the run has finished, the maximum amount of cpu used during the run, in millicores. Only available if the backing script is a Python, R, or container script.

post_custom_runs_outputs(id: int, run_id: int, object_type: str, object_id: int)

Add an output for a run

Parameters:
idint

The ID of the custom script.

run_idint

The ID of the run.

object_typestr

The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue

object_idint

The ID of the output.

Returns:
civis.response.Response
  • object_typestr

    The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue

  • object_idint

    The ID of the output.

  • namestr

    The name of the output.

  • linkstr

    The hypermedia link to the output.

  • value : str

post_javascript(name: str, source: str, remote_host_id: int, credential_id: int, *, parent_id: int = None, user_context: str = None, params: List[dict] = None, arguments: dict = None, schedule: dict = None, notifications: dict = None, next_run_at: str = None, time_zone: str = None, hidden: bool = None, target_project_id: int = None, running_as_id: int = None)

Create a JavaScript Script

Parameters:
namestr

The name of the script.

sourcestr

The body/text of the script.

remote_host_idint

The remote host ID that this script will connect to.

credential_idint

The credential that this script will use.

parent_idint, optional

The ID of the parent job that will trigger this script

user_contextstr, optional

“runner” or “author”, who to execute the script as when run as a template.

paramsList[dict], optional

A definition of the parameters this script accepts in the arguments field.

  • namestr

    The variable’s name as used within your code.

  • labelstr

    The label to present to users when asking them for the value.

  • descriptionstr

    A short sentence or fragment describing this parameter to the end user.

  • typestr

    The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

  • requiredbool

    Whether this param is required.

  • valuestr

    The value you would like to set this param to. Setting this value makes this parameter a fixed param.

  • defaultstr

    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.

  • allowed_valuesList[dict]

    The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

argumentsdict, optional

Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

scheduledict, optional
  • scheduledbool

    If the item is scheduled.

  • scheduled_daysList[int]

    Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

  • scheduled_hoursList[int]

    Hours of the day it is scheduled on.

  • scheduled_minutesList[int]

    Minutes of the day it is scheduled on.

  • scheduled_runs_per_hourint

    Deprecated in favor of scheduled minutes.

  • scheduled_days_of_monthList[int]

    Days of the month it is scheduled on, mutually exclusive with scheduledDays.

notificationsdict, optional
  • urlsList[str]

    URLs to receive a POST request at job completion

  • success_email_subjectstr

    Custom subject line for success e-mail.

  • success_email_bodystr

    Custom body text for success e-mail, written in Markdown.

  • success_email_addressesList[str]

    Addresses to notify by e-mail when the job completes successfully.

  • success_email_from_namestr

    Name from which success emails are sent; defaults to “Civis.”

  • success_email_reply_tostr

    Address for replies to success emails; defaults to the author of the job.

  • failure_email_addressesList[str]

    Addresses to notify by e-mail when the job fails.

  • stall_warning_minutesint

    Stall warning emails will be sent after this amount of minutes.

  • success_onbool

    If success email notifications are on. Defaults to user’s preferences.

  • failure_onbool

    If failure email notifications are on. Defaults to user’s preferences.

next_run_atstr (time), optional

The time of the next scheduled run.

time_zonestr, optional

The time zone of this script.

hiddenbool, optional

The hidden status of the item.

target_project_idint, optional

Target project to which script outputs will be added.

running_as_idint, optional

The ID of the runner of this script.

Returns:
civis.response.Response
  • idint

    The ID for the script.

  • namestr

    The name of the script.

  • typestr

    The type of the script (e.g SQL, Container, Python, R, JavaScript, dbt)

  • created_atstr (time)

    The time this script was created.

  • updated_atstr (time)

    The time the script was last updated.

  • authordict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • statestr

    The status of the script’s last run.

  • finished_atstr (time)

    The time that the script’s last run finished.

  • categorystr

    The category of the script.

  • projectsList[dict]

    A list of projects containing the script.

    • idint

      The ID for the project.

    • namestr

      The name of the project.

  • parent_idint

    The ID of the parent job that will trigger this script

  • user_contextstr

    “runner” or “author”, who to execute the script as when run as a template.

  • paramsList[dict]

    A definition of the parameters this script accepts in the arguments field.

    • namestr

      The variable’s name as used within your code.

    • labelstr

      The label to present to users when asking them for the value.

    • descriptionstr

      A short sentence or fragment describing this parameter to the end user.

    • typestr

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredbool

      Whether this param is required.

    • valuestr

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstr

      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.

    • allowed_valuesList[dict]

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templatebool

    Whether others scripts use this one as a template.

  • published_as_template_idint

    The ID of the template that this script is backing.

  • from_template_idint

    The ID of the template this script uses, if any.

  • template_dependents_countint

    How many other scripts use this one as a template.

  • template_script_namestr

    The name of the template script.

  • linksdict
    • detailsstr

      The details link to get more information about the script.

    • runsstr

      The runs link to get the run information list for this script.

  • scheduledict
    • scheduledbool

      If the item is scheduled.

    • scheduled_daysList[int]

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hoursList[int]

      Hours of the day it is scheduled on.

    • scheduled_minutesList[int]

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourint

      Deprecated in favor of scheduled minutes.

    • scheduled_days_of_monthList[int]

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict
    • urlsList[str]

      URLs to receive a POST request at job completion

    • success_email_subjectstr

      Custom subject line for success e-mail.

    • success_email_bodystr

      Custom body text for success e-mail, written in Markdown.

    • success_email_addressesList[str]

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestr

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostr

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addressesList[str]

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesint

      Stall warning emails will be sent after this amount of minutes.

    • success_onbool

      If success email notifications are on. Defaults to user’s preferences.

    • failure_onbool

      If failure email notifications are on. Defaults to user’s preferences.

  • running_asdict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • next_run_atstr (time)

    The time of the next scheduled run.

  • time_zonestr

    The time zone of this script.

  • last_rundict
    • id : int

    • state : str

    • created_atstr (time)

      The time that the run was queued.

    • started_atstr (time)

      The time that the run started.

    • finished_atstr (time)

      The time that the run completed.

    • errorstr

      The error message for this run, if present.

  • my_permission_levelstr

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenbool

    The hidden status of the item.

  • target_project_idint

    Target project to which script outputs will be added.

  • archivedstr

    The archival status of the requested item(s).

  • sourcestr

    The body/text of the script.

  • remote_host_idint

    The remote host ID that this script will connect to.

  • credential_idint

    The credential that this script will use.

  • running_as_idint

    The ID of the runner of this script.

post_javascript_clone(id: int, *, clone_schedule: bool = None, clone_triggers: bool = None, clone_notifications: bool = None)

Clone this JavaScript Script

Parameters:
idint

The ID for the script.

clone_schedulebool, optional

If true, also copy the schedule to the new script.

clone_triggersbool, optional

If true, also copy the triggers to the new script.

clone_notificationsbool, optional

If true, also copy the notifications to the new script.

Returns:
civis.response.Response
  • idint

    The ID for the script.

  • namestr

    The name of the script.

  • typestr

    The type of the script (e.g SQL, Container, Python, R, JavaScript, dbt)

  • created_atstr (time)

    The time this script was created.

  • updated_atstr (time)

    The time the script was last updated.

  • authordict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • statestr

    The status of the script’s last run.

  • finished_atstr (time)

    The time that the script’s last run finished.

  • categorystr

    The category of the script.

  • projectsList[dict]

    A list of projects containing the script.

    • idint

      The ID for the project.

    • namestr

      The name of the project.

  • parent_idint

    The ID of the parent job that will trigger this script

  • user_contextstr

    “runner” or “author”, who to execute the script as when run as a template.

  • paramsList[dict]

    A definition of the parameters this script accepts in the arguments field.

    • namestr

      The variable’s name as used within your code.

    • labelstr

      The label to present to users when asking them for the value.

    • descriptionstr

      A short sentence or fragment describing this parameter to the end user.

    • typestr

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredbool

      Whether this param is required.

    • valuestr

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstr

      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.

    • allowed_valuesList[dict]

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templatebool

    Whether others scripts use this one as a template.

  • published_as_template_idint

    The ID of the template that this script is backing.

  • from_template_idint

    The ID of the template this script uses, if any.

  • template_dependents_countint

    How many other scripts use this one as a template.

  • template_script_namestr

    The name of the template script.

  • linksdict
    • detailsstr

      The details link to get more information about the script.

    • runsstr

      The runs link to get the run information list for this script.

  • scheduledict
    • scheduledbool

      If the item is scheduled.

    • scheduled_daysList[int]

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hoursList[int]

      Hours of the day it is scheduled on.

    • scheduled_minutesList[int]

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourint

      Deprecated in favor of scheduled minutes.

    • scheduled_days_of_monthList[int]

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict
    • urlsList[str]

      URLs to receive a POST request at job completion

    • success_email_subjectstr

      Custom subject line for success e-mail.

    • success_email_bodystr

      Custom body text for success e-mail, written in Markdown.

    • success_email_addressesList[str]

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestr

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostr

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addressesList[str]

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesint

      Stall warning emails will be sent after this amount of minutes.

    • success_onbool

      If success email notifications are on. Defaults to user’s preferences.

    • failure_onbool

      If failure email notifications are on. Defaults to user’s preferences.

  • running_asdict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • next_run_atstr (time)

    The time of the next scheduled run.

  • time_zonestr

    The time zone of this script.

  • last_rundict
    • id : int

    • state : str

    • created_atstr (time)

      The time that the run was queued.

    • started_atstr (time)

      The time that the run started.

    • finished_atstr (time)

      The time that the run completed.

    • errorstr

      The error message for this run, if present.

  • my_permission_levelstr

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenbool

    The hidden status of the item.

  • target_project_idint

    Target project to which script outputs will be added.

  • archivedstr

    The archival status of the requested item(s).

  • sourcestr

    The body/text of the script.

  • remote_host_idint

    The remote host ID that this script will connect to.

  • credential_idint

    The credential that this script will use.

  • running_as_idint

    The ID of the runner of this script.

post_javascript_git_checkout(id: int)

Checkout content that the existing git_ref points to and save to the object

Parameters:
idint

The ID of the file.

Returns:
civis.response.Response
  • contentstr

    The file’s contents.

  • typestr

    The file’s type.

  • sizeint

    The file’s size.

  • file_hashstr

    The SHA of the file.

post_javascript_git_checkout_latest(id: int)

Checkout latest commit on the current branch of a script or workflow

Parameters:
idint

The ID of the file.

Returns:
civis.response.Response
  • contentstr

    The file’s contents.

  • typestr

    The file’s type.

  • sizeint

    The file’s size.

  • file_hashstr

    The SHA of the file.

post_javascript_git_commits(id: int, content: str, message: str, file_hash: str)

Commit and push a new version of the file

Parameters:
idint

The ID of the file.

contentstr

The contents to commit to the file.

messagestr

A commit message describing the changes being made.

file_hashstr

The full SHA of the file being replaced.

Returns:
civis.response.Response
  • contentstr

    The file’s contents.

  • typestr

    The file’s type.

  • sizeint

    The file’s size.

  • file_hashstr

    The SHA of the file.

post_javascript_runs(id: int)

Start a run

Parameters:
idint

The ID of the Javascript job.

Returns:
civis.response.Response
  • idint

    The ID of the run.

  • javascript_idint

    The ID of the Javascript job.

  • statestr

    The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.

  • is_cancel_requestedbool

    True if run cancel requested, else false.

  • created_atstr (time)

    The time the run was created.

  • started_atstr (time)

    The time the run started at.

  • finished_atstr (time)

    The time the run completed.

  • errorstr

    The error, if any, returned by the run.

post_javascript_runs_outputs(id: int, run_id: int, object_type: str, object_id: int)

Add an output for a run

Parameters:
idint

The ID of the javascript script.

run_idint

The ID of the run.

object_typestr

The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue

object_idint

The ID of the output.

Returns:
civis.response.Response
  • object_typestr

    The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue

  • object_idint

    The ID of the output.

  • namestr

    The name of the output.

  • linkstr

    The hypermedia link to the output.

  • value : str

post_python3(name: str, source: str, *, parent_id: int = None, user_context: str = None, params: List[dict] = None, arguments: dict = None, schedule: dict = None, notifications: dict = None, next_run_at: str = None, time_zone: str = None, hidden: bool = None, target_project_id: int = None, required_resources: dict = None, instance_type: str = None, cancel_timeout: int = None, docker_image_tag: str = None, partition_label: str = None, running_as_id: int = None)

Create a Python Script

Parameters:
namestr

The name of the script.

sourcestr

The body/text of the script.

parent_idint, optional

The ID of the parent job that will trigger this script

user_contextstr, optional

“runner” or “author”, who to execute the script as when run as a template.

paramsList[dict], optional

A definition of the parameters this script accepts in the arguments field.

  • namestr

    The variable’s name as used within your code.

  • labelstr

    The label to present to users when asking them for the value.

  • descriptionstr

    A short sentence or fragment describing this parameter to the end user.

  • typestr

    The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

  • requiredbool

    Whether this param is required.

  • valuestr

    The value you would like to set this param to. Setting this value makes this parameter a fixed param.

  • defaultstr

    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.

  • allowed_valuesList[dict]

    The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

argumentsdict, optional

Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

scheduledict, optional
  • scheduledbool

    If the item is scheduled.

  • scheduled_daysList[int]

    Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

  • scheduled_hoursList[int]

    Hours of the day it is scheduled on.

  • scheduled_minutesList[int]

    Minutes of the day it is scheduled on.

  • scheduled_runs_per_hourint

    Deprecated in favor of scheduled minutes.

  • scheduled_days_of_monthList[int]

    Days of the month it is scheduled on, mutually exclusive with scheduledDays.

notificationsdict, optional
  • urlsList[str]

    URLs to receive a POST request at job completion

  • success_email_subjectstr

    Custom subject line for success e-mail.

  • success_email_bodystr

    Custom body text for success e-mail, written in Markdown.

  • success_email_addressesList[str]

    Addresses to notify by e-mail when the job completes successfully.

  • success_email_from_namestr

    Name from which success emails are sent; defaults to “Civis.”

  • success_email_reply_tostr

    Address for replies to success emails; defaults to the author of the job.

  • failure_email_addressesList[str]

    Addresses to notify by e-mail when the job fails.

  • stall_warning_minutesint

    Stall warning emails will be sent after this amount of minutes.

  • success_onbool

    If success email notifications are on. Defaults to user’s preferences.

  • failure_onbool

    If failure email notifications are on. Defaults to user’s preferences.

next_run_atstr (time), optional

The time of the next scheduled run.

time_zonestr, optional

The time zone of this script.

hiddenbool, optional

The hidden status of the item.

target_project_idint, optional

Target project to which script outputs will be added.

required_resourcesdict, optional
  • cpuint

    The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.

  • memoryint

    The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.

  • disk_spacefloat (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.

instance_typestr, optional

The EC2 instance type to deploy to. Only available for jobs running on kubernetes.

cancel_timeoutint, optional

The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.

docker_image_tagstr, optional

The tag of the docker image to pull from DockerHub.

partition_labelstr, optional

The partition label used to run this object.

running_as_idint, optional

The ID of the runner of this script.

Returns:
civis.response.Response
  • idint

    The ID for the script.

  • namestr

    The name of the script.

  • typestr

    The type of the script (e.g SQL, Container, Python, R, JavaScript, dbt)

  • created_atstr (time)

    The time this script was created.

  • updated_atstr (time)

    The time the script was last updated.

  • authordict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • statestr

    The status of the script’s last run.

  • finished_atstr (time)

    The time that the script’s last run finished.

  • categorystr

    The category of the script.

  • projectsList[dict]

    A list of projects containing the script.

    • idint

      The ID for the project.

    • namestr

      The name of the project.

  • parent_idint

    The ID of the parent job that will trigger this script

  • user_contextstr

    “runner” or “author”, who to execute the script as when run as a template.

  • paramsList[dict]

    A definition of the parameters this script accepts in the arguments field.

    • namestr

      The variable’s name as used within your code.

    • labelstr

      The label to present to users when asking them for the value.

    • descriptionstr

      A short sentence or fragment describing this parameter to the end user.

    • typestr

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredbool

      Whether this param is required.

    • valuestr

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstr

      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.

    • allowed_valuesList[dict]

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templatebool

    Whether others scripts use this one as a template.

  • published_as_template_idint

    The ID of the template that this script is backing.

  • from_template_idint

    The ID of the template this script uses, if any.

  • template_dependents_countint

    How many other scripts use this one as a template.

  • template_script_namestr

    The name of the template script.

  • linksdict
    • detailsstr

      The details link to get more information about the script.

    • runsstr

      The runs link to get the run information list for this script.

  • scheduledict
    • scheduledbool

      If the item is scheduled.

    • scheduled_daysList[int]

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hoursList[int]

      Hours of the day it is scheduled on.

    • scheduled_minutesList[int]

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourint

      Deprecated in favor of scheduled minutes.

    • scheduled_days_of_monthList[int]

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict
    • urlsList[str]

      URLs to receive a POST request at job completion

    • success_email_subjectstr

      Custom subject line for success e-mail.

    • success_email_bodystr

      Custom body text for success e-mail, written in Markdown.

    • success_email_addressesList[str]

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestr

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostr

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addressesList[str]

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesint

      Stall warning emails will be sent after this amount of minutes.

    • success_onbool

      If success email notifications are on. Defaults to user’s preferences.

    • failure_onbool

      If failure email notifications are on. Defaults to user’s preferences.

  • running_asdict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • next_run_atstr (time)

    The time of the next scheduled run.

  • time_zonestr

    The time zone of this script.

  • last_rundict
    • id : int

    • state : str

    • created_atstr (time)

      The time that the run was queued.

    • started_atstr (time)

      The time that the run started.

    • finished_atstr (time)

      The time that the run completed.

    • errorstr

      The error message for this run, if present.

  • my_permission_levelstr

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenbool

    The hidden status of the item.

  • target_project_idint

    Target project to which script outputs will be added.

  • archivedstr

    The archival status of the requested item(s).

  • required_resourcesdict
    • cpuint

      The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.

    • memoryint

      The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.

    • disk_spacefloat (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.

  • instance_typestr

    The EC2 instance type to deploy to. Only available for jobs running on kubernetes.

  • sourcestr

    The body/text of the script.

  • cancel_timeoutint

    The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.

  • docker_image_tagstr

    The tag of the docker image to pull from DockerHub.

  • partition_labelstr

    The partition label used to run this object.

  • running_as_idint

    The ID of the runner of this script.

post_python3_clone(id: int, *, clone_schedule: bool = None, clone_triggers: bool = None, clone_notifications: bool = None)

Clone this Python Script

Parameters:
idint

The ID for the script.

clone_schedulebool, optional

If true, also copy the schedule to the new script.

clone_triggersbool, optional

If true, also copy the triggers to the new script.

clone_notificationsbool, optional

If true, also copy the notifications to the new script.

Returns:
civis.response.Response
  • idint

    The ID for the script.

  • namestr

    The name of the script.

  • typestr

    The type of the script (e.g SQL, Container, Python, R, JavaScript, dbt)

  • created_atstr (time)

    The time this script was created.

  • updated_atstr (time)

    The time the script was last updated.

  • authordict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • statestr

    The status of the script’s last run.

  • finished_atstr (time)

    The time that the script’s last run finished.

  • categorystr

    The category of the script.

  • projectsList[dict]

    A list of projects containing the script.

    • idint

      The ID for the project.

    • namestr

      The name of the project.

  • parent_idint

    The ID of the parent job that will trigger this script

  • user_contextstr

    “runner” or “author”, who to execute the script as when run as a template.

  • paramsList[dict]

    A definition of the parameters this script accepts in the arguments field.

    • namestr

      The variable’s name as used within your code.

    • labelstr

      The label to present to users when asking them for the value.

    • descriptionstr

      A short sentence or fragment describing this parameter to the end user.

    • typestr

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredbool

      Whether this param is required.

    • valuestr

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstr

      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.

    • allowed_valuesList[dict]

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templatebool

    Whether others scripts use this one as a template.

  • published_as_template_idint

    The ID of the template that this script is backing.

  • from_template_idint

    The ID of the template this script uses, if any.

  • template_dependents_countint

    How many other scripts use this one as a template.

  • template_script_namestr

    The name of the template script.

  • linksdict
    • detailsstr

      The details link to get more information about the script.

    • runsstr

      The runs link to get the run information list for this script.

  • scheduledict
    • scheduledbool

      If the item is scheduled.

    • scheduled_daysList[int]

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hoursList[int]

      Hours of the day it is scheduled on.

    • scheduled_minutesList[int]

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourint

      Deprecated in favor of scheduled minutes.

    • scheduled_days_of_monthList[int]

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict
    • urlsList[str]

      URLs to receive a POST request at job completion

    • success_email_subjectstr

      Custom subject line for success e-mail.

    • success_email_bodystr

      Custom body text for success e-mail, written in Markdown.

    • success_email_addressesList[str]

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestr

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostr

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addressesList[str]

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesint

      Stall warning emails will be sent after this amount of minutes.

    • success_onbool

      If success email notifications are on. Defaults to user’s preferences.

    • failure_onbool

      If failure email notifications are on. Defaults to user’s preferences.

  • running_asdict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • next_run_atstr (time)

    The time of the next scheduled run.

  • time_zonestr

    The time zone of this script.

  • last_rundict
    • id : int

    • state : str

    • created_atstr (time)

      The time that the run was queued.

    • started_atstr (time)

      The time that the run started.

    • finished_atstr (time)

      The time that the run completed.

    • errorstr

      The error message for this run, if present.

  • my_permission_levelstr

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenbool

    The hidden status of the item.

  • target_project_idint

    Target project to which script outputs will be added.

  • archivedstr

    The archival status of the requested item(s).

  • required_resourcesdict
    • cpuint

      The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.

    • memoryint

      The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.

    • disk_spacefloat (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.

  • instance_typestr

    The EC2 instance type to deploy to. Only available for jobs running on kubernetes.

  • sourcestr

    The body/text of the script.

  • cancel_timeoutint

    The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.

  • docker_image_tagstr

    The tag of the docker image to pull from DockerHub.

  • partition_labelstr

    The partition label used to run this object.

  • running_as_idint

    The ID of the runner of this script.

post_python3_git_checkout(id: int)

Checkout content that the existing git_ref points to and save to the object

Parameters:
idint

The ID of the file.

Returns:
civis.response.Response
  • contentstr

    The file’s contents.

  • typestr

    The file’s type.

  • sizeint

    The file’s size.

  • file_hashstr

    The SHA of the file.

post_python3_git_checkout_latest(id: int)

Checkout latest commit on the current branch of a script or workflow

Parameters:
idint

The ID of the file.

Returns:
civis.response.Response
  • contentstr

    The file’s contents.

  • typestr

    The file’s type.

  • sizeint

    The file’s size.

  • file_hashstr

    The SHA of the file.

post_python3_git_commits(id: int, content: str, message: str, file_hash: str)

Commit and push a new version of the file

Parameters:
idint

The ID of the file.

contentstr

The contents to commit to the file.

messagestr

A commit message describing the changes being made.

file_hashstr

The full SHA of the file being replaced.

Returns:
civis.response.Response
  • contentstr

    The file’s contents.

  • typestr

    The file’s type.

  • sizeint

    The file’s size.

  • file_hashstr

    The SHA of the file.

post_python3_runs(id: int)

Start a run

Parameters:
idint

The ID of the Python job.

Returns:
civis.response.Response
  • idint

    The ID of the run.

  • python_idint

    The ID of the Python job.

  • statestr

    The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.

  • is_cancel_requestedbool

    True if run cancel requested, else false.

  • created_atstr (time)

    The time the run was created.

  • started_atstr (time)

    The time the run started at.

  • finished_atstr (time)

    The time the run completed.

  • errorstr

    The error, if any, returned by the run.

  • max_memory_usagefloat (float)

    If the run has finished, the maximum amount of memory used during the run, in MB.

  • max_cpu_usagefloat (float)

    If the run has finished, the maximum amount of cpu used during the run, in millicores.

post_python3_runs_outputs(id: int, run_id: int, object_type: str, object_id: int)

Add an output for a run

Parameters:
idint

The ID of the python script.

run_idint

The ID of the run.

object_typestr

The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue

object_idint

The ID of the output.

Returns:
civis.response.Response
  • object_typestr

    The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue

  • object_idint

    The ID of the output.

  • namestr

    The name of the output.

  • linkstr

    The hypermedia link to the output.

  • value : str

post_r(name: str, source: str, *, parent_id: int = None, user_context: str = None, params: List[dict] = None, arguments: dict = None, schedule: dict = None, notifications: dict = None, next_run_at: str = None, time_zone: str = None, hidden: bool = None, target_project_id: int = None, required_resources: dict = None, instance_type: str = None, cancel_timeout: int = None, docker_image_tag: str = None, partition_label: str = None, running_as_id: int = None)

Create an R Script

Parameters:
namestr

The name of the script.

sourcestr

The body/text of the script.

parent_idint, optional

The ID of the parent job that will trigger this script

user_contextstr, optional

“runner” or “author”, who to execute the script as when run as a template.

paramsList[dict], optional

A definition of the parameters this script accepts in the arguments field.

  • namestr

    The variable’s name as used within your code.

  • labelstr

    The label to present to users when asking them for the value.

  • descriptionstr

    A short sentence or fragment describing this parameter to the end user.

  • typestr

    The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

  • requiredbool

    Whether this param is required.

  • valuestr

    The value you would like to set this param to. Setting this value makes this parameter a fixed param.

  • defaultstr

    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.

  • allowed_valuesList[dict]

    The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

argumentsdict, optional

Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

scheduledict, optional
  • scheduledbool

    If the item is scheduled.

  • scheduled_daysList[int]

    Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

  • scheduled_hoursList[int]

    Hours of the day it is scheduled on.

  • scheduled_minutesList[int]

    Minutes of the day it is scheduled on.

  • scheduled_runs_per_hourint

    Deprecated in favor of scheduled minutes.

  • scheduled_days_of_monthList[int]

    Days of the month it is scheduled on, mutually exclusive with scheduledDays.

notificationsdict, optional
  • urlsList[str]

    URLs to receive a POST request at job completion

  • success_email_subjectstr

    Custom subject line for success e-mail.

  • success_email_bodystr

    Custom body text for success e-mail, written in Markdown.

  • success_email_addressesList[str]

    Addresses to notify by e-mail when the job completes successfully.

  • success_email_from_namestr

    Name from which success emails are sent; defaults to “Civis.”

  • success_email_reply_tostr

    Address for replies to success emails; defaults to the author of the job.

  • failure_email_addressesList[str]

    Addresses to notify by e-mail when the job fails.

  • stall_warning_minutesint

    Stall warning emails will be sent after this amount of minutes.

  • success_onbool

    If success email notifications are on. Defaults to user’s preferences.

  • failure_onbool

    If failure email notifications are on. Defaults to user’s preferences.

next_run_atstr (time), optional

The time of the next scheduled run.

time_zonestr, optional

The time zone of this script.

hiddenbool, optional

The hidden status of the item.

target_project_idint, optional

Target project to which script outputs will be added.

required_resourcesdict, optional
  • cpuint

    The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.

  • memoryint

    The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.

  • disk_spacefloat (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.

instance_typestr, optional

The EC2 instance type to deploy to. Only available for jobs running on kubernetes.

cancel_timeoutint, optional

The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.

docker_image_tagstr, optional

The tag of the docker image to pull from DockerHub.

partition_labelstr, optional

The partition label used to run this object.

running_as_idint, optional

The ID of the runner of this script.

Returns:
civis.response.Response
  • idint

    The ID for the script.

  • namestr

    The name of the script.

  • typestr

    The type of the script (e.g SQL, Container, Python, R, JavaScript, dbt)

  • created_atstr (time)

    The time this script was created.

  • updated_atstr (time)

    The time the script was last updated.

  • authordict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • statestr

    The status of the script’s last run.

  • finished_atstr (time)

    The time that the script’s last run finished.

  • categorystr

    The category of the script.

  • projectsList[dict]

    A list of projects containing the script.

    • idint

      The ID for the project.

    • namestr

      The name of the project.

  • parent_idint

    The ID of the parent job that will trigger this script

  • user_contextstr

    “runner” or “author”, who to execute the script as when run as a template.

  • paramsList[dict]

    A definition of the parameters this script accepts in the arguments field.

    • namestr

      The variable’s name as used within your code.

    • labelstr

      The label to present to users when asking them for the value.

    • descriptionstr

      A short sentence or fragment describing this parameter to the end user.

    • typestr

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredbool

      Whether this param is required.

    • valuestr

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstr

      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.

    • allowed_valuesList[dict]

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templatebool

    Whether others scripts use this one as a template.

  • published_as_template_idint

    The ID of the template that this script is backing.

  • from_template_idint

    The ID of the template this script uses, if any.

  • template_dependents_countint

    How many other scripts use this one as a template.

  • template_script_namestr

    The name of the template script.

  • linksdict
    • detailsstr

      The details link to get more information about the script.

    • runsstr

      The runs link to get the run information list for this script.

  • scheduledict
    • scheduledbool

      If the item is scheduled.

    • scheduled_daysList[int]

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hoursList[int]

      Hours of the day it is scheduled on.

    • scheduled_minutesList[int]

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourint

      Deprecated in favor of scheduled minutes.

    • scheduled_days_of_monthList[int]

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict
    • urlsList[str]

      URLs to receive a POST request at job completion

    • success_email_subjectstr

      Custom subject line for success e-mail.

    • success_email_bodystr

      Custom body text for success e-mail, written in Markdown.

    • success_email_addressesList[str]

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestr

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostr

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addressesList[str]

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesint

      Stall warning emails will be sent after this amount of minutes.

    • success_onbool

      If success email notifications are on. Defaults to user’s preferences.

    • failure_onbool

      If failure email notifications are on. Defaults to user’s preferences.

  • running_asdict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • next_run_atstr (time)

    The time of the next scheduled run.

  • time_zonestr

    The time zone of this script.

  • last_rundict
    • id : int

    • state : str

    • created_atstr (time)

      The time that the run was queued.

    • started_atstr (time)

      The time that the run started.

    • finished_atstr (time)

      The time that the run completed.

    • errorstr

      The error message for this run, if present.

  • my_permission_levelstr

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenbool

    The hidden status of the item.

  • target_project_idint

    Target project to which script outputs will be added.

  • archivedstr

    The archival status of the requested item(s).

  • required_resourcesdict
    • cpuint

      The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.

    • memoryint

      The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.

    • disk_spacefloat (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.

  • instance_typestr

    The EC2 instance type to deploy to. Only available for jobs running on kubernetes.

  • sourcestr

    The body/text of the script.

  • cancel_timeoutint

    The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.

  • docker_image_tagstr

    The tag of the docker image to pull from DockerHub.

  • partition_labelstr

    The partition label used to run this object.

  • running_as_idint

    The ID of the runner of this script.

post_r_clone(id: int, *, clone_schedule: bool = None, clone_triggers: bool = None, clone_notifications: bool = None)

Clone this R Script

Parameters:
idint

The ID for the script.

clone_schedulebool, optional

If true, also copy the schedule to the new script.

clone_triggersbool, optional

If true, also copy the triggers to the new script.

clone_notificationsbool, optional

If true, also copy the notifications to the new script.

Returns:
civis.response.Response
  • idint

    The ID for the script.

  • namestr

    The name of the script.

  • typestr

    The type of the script (e.g SQL, Container, Python, R, JavaScript, dbt)

  • created_atstr (time)

    The time this script was created.

  • updated_atstr (time)

    The time the script was last updated.

  • authordict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • statestr

    The status of the script’s last run.

  • finished_atstr (time)

    The time that the script’s last run finished.

  • categorystr

    The category of the script.

  • projectsList[dict]

    A list of projects containing the script.

    • idint

      The ID for the project.

    • namestr

      The name of the project.

  • parent_idint

    The ID of the parent job that will trigger this script

  • user_contextstr

    “runner” or “author”, who to execute the script as when run as a template.

  • paramsList[dict]

    A definition of the parameters this script accepts in the arguments field.

    • namestr

      The variable’s name as used within your code.

    • labelstr

      The label to present to users when asking them for the value.

    • descriptionstr

      A short sentence or fragment describing this parameter to the end user.

    • typestr

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredbool

      Whether this param is required.

    • valuestr

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstr

      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.

    • allowed_valuesList[dict]

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templatebool

    Whether others scripts use this one as a template.

  • published_as_template_idint

    The ID of the template that this script is backing.

  • from_template_idint

    The ID of the template this script uses, if any.

  • template_dependents_countint

    How many other scripts use this one as a template.

  • template_script_namestr

    The name of the template script.

  • linksdict
    • detailsstr

      The details link to get more information about the script.

    • runsstr

      The runs link to get the run information list for this script.

  • scheduledict
    • scheduledbool

      If the item is scheduled.

    • scheduled_daysList[int]

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hoursList[int]

      Hours of the day it is scheduled on.

    • scheduled_minutesList[int]

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourint

      Deprecated in favor of scheduled minutes.

    • scheduled_days_of_monthList[int]

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict
    • urlsList[str]

      URLs to receive a POST request at job completion

    • success_email_subjectstr

      Custom subject line for success e-mail.

    • success_email_bodystr

      Custom body text for success e-mail, written in Markdown.

    • success_email_addressesList[str]

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestr

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostr

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addressesList[str]

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesint

      Stall warning emails will be sent after this amount of minutes.

    • success_onbool

      If success email notifications are on. Defaults to user’s preferences.

    • failure_onbool

      If failure email notifications are on. Defaults to user’s preferences.

  • running_asdict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • next_run_atstr (time)

    The time of the next scheduled run.

  • time_zonestr

    The time zone of this script.

  • last_rundict
    • id : int

    • state : str

    • created_atstr (time)

      The time that the run was queued.

    • started_atstr (time)

      The time that the run started.

    • finished_atstr (time)

      The time that the run completed.

    • errorstr

      The error message for this run, if present.

  • my_permission_levelstr

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenbool

    The hidden status of the item.

  • target_project_idint

    Target project to which script outputs will be added.

  • archivedstr

    The archival status of the requested item(s).

  • required_resourcesdict
    • cpuint

      The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.

    • memoryint

      The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.

    • disk_spacefloat (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.

  • instance_typestr

    The EC2 instance type to deploy to. Only available for jobs running on kubernetes.

  • sourcestr

    The body/text of the script.

  • cancel_timeoutint

    The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.

  • docker_image_tagstr

    The tag of the docker image to pull from DockerHub.

  • partition_labelstr

    The partition label used to run this object.

  • running_as_idint

    The ID of the runner of this script.

post_r_git_checkout(id: int)

Checkout content that the existing git_ref points to and save to the object

Parameters:
idint

The ID of the file.

Returns:
civis.response.Response
  • contentstr

    The file’s contents.

  • typestr

    The file’s type.

  • sizeint

    The file’s size.

  • file_hashstr

    The SHA of the file.

post_r_git_checkout_latest(id: int)

Checkout latest commit on the current branch of a script or workflow

Parameters:
idint

The ID of the file.

Returns:
civis.response.Response
  • contentstr

    The file’s contents.

  • typestr

    The file’s type.

  • sizeint

    The file’s size.

  • file_hashstr

    The SHA of the file.

post_r_git_commits(id: int, content: str, message: str, file_hash: str)

Commit and push a new version of the file

Parameters:
idint

The ID of the file.

contentstr

The contents to commit to the file.

messagestr

A commit message describing the changes being made.

file_hashstr

The full SHA of the file being replaced.

Returns:
civis.response.Response
  • contentstr

    The file’s contents.

  • typestr

    The file’s type.

  • sizeint

    The file’s size.

  • file_hashstr

    The SHA of the file.

post_r_runs(id: int)

Start a run

Parameters:
idint

The ID of the R job.

Returns:
civis.response.Response
  • idint

    The ID of the run.

  • r_idint

    The ID of the R job.

  • statestr

    The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.

  • is_cancel_requestedbool

    True if run cancel requested, else false.

  • created_atstr (time)

    The time the run was created.

  • started_atstr (time)

    The time the run started at.

  • finished_atstr (time)

    The time the run completed.

  • errorstr

    The error, if any, returned by the run.

  • max_memory_usagefloat (float)

    If the run has finished, the maximum amount of memory used during the run, in MB.

  • max_cpu_usagefloat (float)

    If the run has finished, the maximum amount of cpu used during the run, in millicores.

post_r_runs_outputs(id: int, run_id: int, object_type: str, object_id: int)

Add an output for a run

Parameters:
idint

The ID of the r script.

run_idint

The ID of the run.

object_typestr

The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue

object_idint

The ID of the output.

Returns:
civis.response.Response
  • object_typestr

    The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue

  • object_idint

    The ID of the output.

  • namestr

    The name of the output.

  • linkstr

    The hypermedia link to the output.

  • value : str

post_run(id: int)

Run a script

Parameters:
idint

The ID for the script.

Returns:
None

Response code 204: success

post_sql(name: str, sql: str, remote_host_id: int, credential_id: int, *, parent_id: int = None, user_context: str = None, params: List[dict] = None, arguments: dict = None, schedule: dict = None, notifications: dict = None, next_run_at: str = None, time_zone: str = None, hidden: bool = None, target_project_id: int = None, csv_settings: dict = None, running_as_id: int = None)

Create a SQL Script

Parameters:
namestr

The name of the script.

sqlstr

The raw SQL query for the script.

remote_host_idint

The remote host ID that this script will connect to.

credential_idint

The credential that this script will use.

parent_idint, optional

The ID of the parent job that will trigger this script

user_contextstr, optional

“runner” or “author”, who to execute the script as when run as a template.

paramsList[dict], optional

A definition of the parameters this script accepts in the arguments field.

  • namestr

    The variable’s name as used within your code.

  • labelstr

    The label to present to users when asking them for the value.

  • descriptionstr

    A short sentence or fragment describing this parameter to the end user.

  • typestr

    The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

  • requiredbool

    Whether this param is required.

  • valuestr

    The value you would like to set this param to. Setting this value makes this parameter a fixed param.

  • defaultstr

    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.

  • allowed_valuesList[dict]

    The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

argumentsdict, optional

Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

scheduledict, optional
  • scheduledbool

    If the item is scheduled.

  • scheduled_daysList[int]

    Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

  • scheduled_hoursList[int]

    Hours of the day it is scheduled on.

  • scheduled_minutesList[int]

    Minutes of the day it is scheduled on.

  • scheduled_runs_per_hourint

    Deprecated in favor of scheduled minutes.

  • scheduled_days_of_monthList[int]

    Days of the month it is scheduled on, mutually exclusive with scheduledDays.

notificationsdict, optional
  • urlsList[str]

    URLs to receive a POST request at job completion

  • success_email_subjectstr

    Custom subject line for success e-mail.

  • success_email_bodystr

    Custom body text for success e-mail, written in Markdown.

  • success_email_addressesList[str]

    Addresses to notify by e-mail when the job completes successfully.

  • success_email_from_namestr

    Name from which success emails are sent; defaults to “Civis.”

  • success_email_reply_tostr

    Address for replies to success emails; defaults to the author of the job.

  • failure_email_addressesList[str]

    Addresses to notify by e-mail when the job fails.

  • stall_warning_minutesint

    Stall warning emails will be sent after this amount of minutes.

  • success_onbool

    If success email notifications are on. Defaults to user’s preferences.

  • failure_onbool

    If failure email notifications are on. Defaults to user’s preferences.

next_run_atstr (time), optional

The time of the next scheduled run.

time_zonestr, optional

The time zone of this script.

hiddenbool, optional

The hidden status of the item.

target_project_idint, optional

Target project to which script outputs will be added.

csv_settingsdict, optional
  • include_headerbool

    Whether or not to include headers in the output data. Default: true

  • compressionstr

    The type of compression to use, if any, one of “none”, “zip”, or “gzip”. Default: gzip

  • column_delimiterstr

    Which delimiter to use, one of “comma”, “tab”, or “pipe”. Default: comma

  • unquotedbool

    Whether or not to quote fields. Default: false

  • force_multifilebool

    Whether or not the csv should be split into multiple files. Default: false

  • filename_prefixstr

    A user specified filename prefix for the output file to have. Default: null

  • max_file_sizeint

    The max file size, in MB, created files will be. Only available when force_multifile is true.

running_as_idint, optional

The ID of the runner of this script.

Returns:
civis.response.Response
  • idint

    The ID for the script.

  • namestr

    The name of the script.

  • typestr

    The type of the script (e.g SQL, Container, Python, R, JavaScript, dbt)

  • created_atstr (time)

    The time this script was created.

  • updated_atstr (time)

    The time the script was last updated.

  • authordict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • statestr

    The status of the script’s last run.

  • finished_atstr (time)

    The time that the script’s last run finished.

  • categorystr

    The category of the script.

  • projectsList[dict]

    A list of projects containing the script.

    • idint

      The ID for the project.

    • namestr

      The name of the project.

  • parent_idint

    The ID of the parent job that will trigger this script

  • user_contextstr

    “runner” or “author”, who to execute the script as when run as a template.

  • paramsList[dict]

    A definition of the parameters this script accepts in the arguments field.

    • namestr

      The variable’s name as used within your code.

    • labelstr

      The label to present to users when asking them for the value.

    • descriptionstr

      A short sentence or fragment describing this parameter to the end user.

    • typestr

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredbool

      Whether this param is required.

    • valuestr

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstr

      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.

    • allowed_valuesList[dict]

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templatebool

    Whether others scripts use this one as a template.

  • published_as_template_idint

    The ID of the template that this script is backing.

  • from_template_idint

    The ID of the template this script uses, if any.

  • template_dependents_countint

    How many other scripts use this one as a template.

  • template_script_namestr

    The name of the template script.

  • linksdict
    • detailsstr

      The details link to get more information about the script.

    • runsstr

      The runs link to get the run information list for this script.

  • scheduledict
    • scheduledbool

      If the item is scheduled.

    • scheduled_daysList[int]

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hoursList[int]

      Hours of the day it is scheduled on.

    • scheduled_minutesList[int]

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourint

      Deprecated in favor of scheduled minutes.

    • scheduled_days_of_monthList[int]

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict
    • urlsList[str]

      URLs to receive a POST request at job completion

    • success_email_subjectstr

      Custom subject line for success e-mail.

    • success_email_bodystr

      Custom body text for success e-mail, written in Markdown.

    • success_email_addressesList[str]

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestr

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostr

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addressesList[str]

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesint

      Stall warning emails will be sent after this amount of minutes.

    • success_onbool

      If success email notifications are on. Defaults to user’s preferences.

    • failure_onbool

      If failure email notifications are on. Defaults to user’s preferences.

  • running_asdict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • next_run_atstr (time)

    The time of the next scheduled run.

  • time_zonestr

    The time zone of this script.

  • last_rundict
    • id : int

    • state : str

    • created_atstr (time)

      The time that the run was queued.

    • started_atstr (time)

      The time that the run started.

    • finished_atstr (time)

      The time that the run completed.

    • errorstr

      The error message for this run, if present.

  • my_permission_levelstr

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenbool

    The hidden status of the item.

  • target_project_idint

    Target project to which script outputs will be added.

  • archivedstr

    The archival status of the requested item(s).

  • sqlstr

    The raw SQL query for the script.

  • expanded_argumentsdict

    Expanded arguments for use in injecting into different environments.

  • remote_host_idint

    The remote host ID that this script will connect to.

  • credential_idint

    The credential that this script will use.

  • code_previewstr

    The code that this script will run with arguments inserted.

  • csv_settingsdict
    • include_headerbool

      Whether or not to include headers in the output data. Default: true

    • compressionstr

      The type of compression to use, if any, one of “none”, “zip”, or “gzip”. Default: gzip

    • column_delimiterstr

      Which delimiter to use, one of “comma”, “tab”, or “pipe”. Default: comma

    • unquotedbool

      Whether or not to quote fields. Default: false

    • force_multifilebool

      Whether or not the csv should be split into multiple files. Default: false

    • filename_prefixstr

      A user specified filename prefix for the output file to have. Default: null

    • max_file_sizeint

      The max file size, in MB, created files will be. Only available when force_multifile is true.

  • running_as_idint

    The ID of the runner of this script.

post_sql_clone(id: int, *, clone_schedule: bool = None, clone_triggers: bool = None, clone_notifications: bool = None)

Clone this SQL Script

Parameters:
idint

The ID for the script.

clone_schedulebool, optional

If true, also copy the schedule to the new script.

clone_triggersbool, optional

If true, also copy the triggers to the new script.

clone_notificationsbool, optional

If true, also copy the notifications to the new script.

Returns:
civis.response.Response
  • idint

    The ID for the script.

  • namestr

    The name of the script.

  • typestr

    The type of the script (e.g SQL, Container, Python, R, JavaScript, dbt)

  • created_atstr (time)

    The time this script was created.

  • updated_atstr (time)

    The time the script was last updated.

  • authordict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • statestr

    The status of the script’s last run.

  • finished_atstr (time)

    The time that the script’s last run finished.

  • categorystr

    The category of the script.

  • projectsList[dict]

    A list of projects containing the script.

    • idint

      The ID for the project.

    • namestr

      The name of the project.

  • parent_idint

    The ID of the parent job that will trigger this script

  • user_contextstr

    “runner” or “author”, who to execute the script as when run as a template.

  • paramsList[dict]

    A definition of the parameters this script accepts in the arguments field.

    • namestr

      The variable’s name as used within your code.

    • labelstr

      The label to present to users when asking them for the value.

    • descriptionstr

      A short sentence or fragment describing this parameter to the end user.

    • typestr

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredbool

      Whether this param is required.

    • valuestr

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstr

      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.

    • allowed_valuesList[dict]

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templatebool

    Whether others scripts use this one as a template.

  • published_as_template_idint

    The ID of the template that this script is backing.

  • from_template_idint

    The ID of the template this script uses, if any.

  • template_dependents_countint

    How many other scripts use this one as a template.

  • template_script_namestr

    The name of the template script.

  • linksdict
    • detailsstr

      The details link to get more information about the script.

    • runsstr

      The runs link to get the run information list for this script.

  • scheduledict
    • scheduledbool

      If the item is scheduled.

    • scheduled_daysList[int]

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hoursList[int]

      Hours of the day it is scheduled on.

    • scheduled_minutesList[int]

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourint

      Deprecated in favor of scheduled minutes.

    • scheduled_days_of_monthList[int]

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict
    • urlsList[str]

      URLs to receive a POST request at job completion

    • success_email_subjectstr

      Custom subject line for success e-mail.

    • success_email_bodystr

      Custom body text for success e-mail, written in Markdown.

    • success_email_addressesList[str]

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestr

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostr

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addressesList[str]

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesint

      Stall warning emails will be sent after this amount of minutes.

    • success_onbool

      If success email notifications are on. Defaults to user’s preferences.

    • failure_onbool

      If failure email notifications are on. Defaults to user’s preferences.

  • running_asdict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • next_run_atstr (time)

    The time of the next scheduled run.

  • time_zonestr

    The time zone of this script.

  • last_rundict
    • id : int

    • state : str

    • created_atstr (time)

      The time that the run was queued.

    • started_atstr (time)

      The time that the run started.

    • finished_atstr (time)

      The time that the run completed.

    • errorstr

      The error message for this run, if present.

  • my_permission_levelstr

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenbool

    The hidden status of the item.

  • target_project_idint

    Target project to which script outputs will be added.

  • archivedstr

    The archival status of the requested item(s).

  • sqlstr

    The raw SQL query for the script.

  • expanded_argumentsdict

    Expanded arguments for use in injecting into different environments.

  • remote_host_idint

    The remote host ID that this script will connect to.

  • credential_idint

    The credential that this script will use.

  • code_previewstr

    The code that this script will run with arguments inserted.

  • csv_settingsdict
    • include_headerbool

      Whether or not to include headers in the output data. Default: true

    • compressionstr

      The type of compression to use, if any, one of “none”, “zip”, or “gzip”. Default: gzip

    • column_delimiterstr

      Which delimiter to use, one of “comma”, “tab”, or “pipe”. Default: comma

    • unquotedbool

      Whether or not to quote fields. Default: false

    • force_multifilebool

      Whether or not the csv should be split into multiple files. Default: false

    • filename_prefixstr

      A user specified filename prefix for the output file to have. Default: null

    • max_file_sizeint

      The max file size, in MB, created files will be. Only available when force_multifile is true.

  • running_as_idint

    The ID of the runner of this script.

post_sql_git_checkout(id: int)

Checkout content that the existing git_ref points to and save to the object

Parameters:
idint

The ID of the file.

Returns:
civis.response.Response
  • contentstr

    The file’s contents.

  • typestr

    The file’s type.

  • sizeint

    The file’s size.

  • file_hashstr

    The SHA of the file.

post_sql_git_checkout_latest(id: int)

Checkout latest commit on the current branch of a script or workflow

Parameters:
idint

The ID of the file.

Returns:
civis.response.Response
  • contentstr

    The file’s contents.

  • typestr

    The file’s type.

  • sizeint

    The file’s size.

  • file_hashstr

    The SHA of the file.

post_sql_git_commits(id: int, content: str, message: str, file_hash: str)

Commit and push a new version of the file

Parameters:
idint

The ID of the file.

contentstr

The contents to commit to the file.

messagestr

A commit message describing the changes being made.

file_hashstr

The full SHA of the file being replaced.

Returns:
civis.response.Response
  • contentstr

    The file’s contents.

  • typestr

    The file’s type.

  • sizeint

    The file’s size.

  • file_hashstr

    The SHA of the file.

post_sql_runs(id: int)

Start a run

Parameters:
idint

The ID of the SQL job.

Returns:
civis.response.Response
  • idint

    The ID of the run.

  • sql_idint

    The ID of the SQL job.

  • statestr

    The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.

  • is_cancel_requestedbool

    True if run cancel requested, else false.

  • created_atstr (time)

    The time the run was created.

  • started_atstr (time)

    The time the run started at.

  • finished_atstr (time)

    The time the run completed.

  • errorstr

    The error, if any, returned by the run.

  • outputList[dict]

    A list of the outputs of this script.

    • output_namestr

      The name of the output file.

    • file_idint

      The unique ID of the output file.

    • pathstr

      The temporary link to download this output file, valid for 36 hours.

  • output_cached_onstr (time)

    The time that the output was originally exported, if a cache entry was used by the run.

put_containers(id: int, required_resources: dict, docker_image_name: str, *, name: str = None, parent_id: int = None, user_context: str = None, params: List[dict] = None, arguments: dict = None, schedule: dict = None, notifications: dict = None, repo_http_uri: str = None, repo_ref: str = None, remote_host_credential_id: int = None, git_credential_id: int = None, docker_command: str = None, docker_image_tag: str = None, instance_type: str = None, cancel_timeout: int = None, time_zone: str = None, partition_label: str = None, target_project_id: int = None, running_as_id: int = None)

Edit a container

Parameters:
idint

The ID for the script.

required_resourcesdict
  • cpuint

    The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.

  • memoryint

    The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.

  • disk_spacefloat (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.

docker_image_namestr

The name of the docker image to pull from DockerHub.

namestr, optional

The name of the container.

parent_idint, optional

The ID of the parent job that will trigger this script

user_contextstr, optional

“runner” or “author”, who to execute the script as when run as a template.

paramsList[dict], optional

A definition of the parameters this script accepts in the arguments field.

  • namestr

    The variable’s name as used within your code.

  • labelstr

    The label to present to users when asking them for the value.

  • descriptionstr

    A short sentence or fragment describing this parameter to the end user.

  • typestr

    The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

  • requiredbool

    Whether this param is required.

  • valuestr

    The value you would like to set this param to. Setting this value makes this parameter a fixed param.

  • defaultstr

    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.

  • allowed_valuesList[dict]

    The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

argumentsdict, optional

Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

scheduledict, optional
  • scheduledbool

    If the item is scheduled.

  • scheduled_daysList[int]

    Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

  • scheduled_hoursList[int]

    Hours of the day it is scheduled on.

  • scheduled_minutesList[int]

    Minutes of the day it is scheduled on.

  • scheduled_runs_per_hourint

    Deprecated in favor of scheduled minutes.

  • scheduled_days_of_monthList[int]

    Days of the month it is scheduled on, mutually exclusive with scheduledDays.

notificationsdict, optional
  • urlsList[str]

    URLs to receive a POST request at job completion

  • success_email_subjectstr

    Custom subject line for success e-mail.

  • success_email_bodystr

    Custom body text for success e-mail, written in Markdown.

  • success_email_addressesList[str]

    Addresses to notify by e-mail when the job completes successfully.

  • success_email_from_namestr

    Name from which success emails are sent; defaults to “Civis.”

  • success_email_reply_tostr

    Address for replies to success emails; defaults to the author of the job.

  • failure_email_addressesList[str]

    Addresses to notify by e-mail when the job fails.

  • stall_warning_minutesint

    Stall warning emails will be sent after this amount of minutes.

  • success_onbool

    If success email notifications are on. Defaults to user’s preferences.

  • failure_onbool

    If failure email notifications are on. Defaults to user’s preferences.

repo_http_uristr, optional

The location of a github repo to clone into the container, e.g. github.com/my-user/my-repo.git.

repo_refstr, optional

The tag or branch of the github repo to clone into the container.

remote_host_credential_idint, optional

The id of the database credentials to pass into the environment of the container.

git_credential_idint, 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_commandstr, optional

The command to run on the container. Will be run via sh as: [“sh”, “-c”, dockerCommand]. Defaults to the Docker image’s ENTRYPOINT/CMD.

docker_image_tagstr, optional

The tag of the docker image to pull from DockerHub.

instance_typestr, optional

The EC2 instance type to deploy to. Only available for jobs running on kubernetes.

cancel_timeoutint, optional

The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.

time_zonestr, optional

The time zone of this script.

partition_labelstr, optional

The partition label used to run this object.

target_project_idint, optional

Target project to which script outputs will be added.

running_as_idint, optional

The ID of the runner of this script.

Returns:
civis.response.Response
  • idint

    The ID for the script.

  • from_template_aliasesList[dict]

    An array of the aliases of the template script.

    • idint

      The id of the Alias object.

    • object_idint

      The id of the object

    • aliasstr

      The alias of the object

  • namestr

    The name of the container.

  • typestr

    The type of the script (e.g Container)

  • created_atstr (time)

    The time this script was created.

  • updated_atstr (time)

    The time the script was last updated.

  • authordict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • statestr

    The status of the script’s last run.

  • finished_atstr (time)

    The time that the script’s last run finished.

  • categorystr

    The category of the script.

  • projectsList[dict]

    A list of projects containing the script.

    • idint

      The ID for the project.

    • namestr

      The name of the project.

  • parent_idint

    The ID of the parent job that will trigger this script

  • user_contextstr

    “runner” or “author”, who to execute the script as when run as a template.

  • paramsList[dict]

    A definition of the parameters this script accepts in the arguments field.

    • namestr

      The variable’s name as used within your code.

    • labelstr

      The label to present to users when asking them for the value.

    • descriptionstr

      A short sentence or fragment describing this parameter to the end user.

    • typestr

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredbool

      Whether this param is required.

    • valuestr

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstr

      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.

    • allowed_valuesList[dict]

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templatebool

    Whether others scripts use this one as a template.

  • template_dependents_countint

    How many other scripts use this one as a template.

  • published_as_template_idint

    The ID of the template that this script is backing.

  • from_template_idint

    The ID of the template script.

  • template_script_namestr

    The name of the template script.

  • linksdict
    • detailsstr

      The details link to get more information about the script.

    • runsstr

      The runs link to get the run information list for this script.

  • scheduledict
    • scheduledbool

      If the item is scheduled.

    • scheduled_daysList[int]

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hoursList[int]

      Hours of the day it is scheduled on.

    • scheduled_minutesList[int]

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourint

      Deprecated in favor of scheduled minutes.

    • scheduled_days_of_monthList[int]

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict
    • urlsList[str]

      URLs to receive a POST request at job completion

    • success_email_subjectstr

      Custom subject line for success e-mail.

    • success_email_bodystr

      Custom body text for success e-mail, written in Markdown.

    • success_email_addressesList[str]

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestr

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostr

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addressesList[str]

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesint

      Stall warning emails will be sent after this amount of minutes.

    • success_onbool

      If success email notifications are on. Defaults to user’s preferences.

    • failure_onbool

      If failure email notifications are on. Defaults to user’s preferences.

  • running_asdict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • required_resourcesdict
    • cpuint

      The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.

    • memoryint

      The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.

    • disk_spacefloat (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.

  • repo_http_uristr

    The location of a github repo to clone into the container, e.g. github.com/my-user/my-repo.git.

  • repo_refstr

    The tag or branch of the github repo to clone into the container.

  • remote_host_credential_idint

    The id of the database credentials to pass into the environment of the container.

  • git_credential_idint

    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_commandstr

    The command to run on the container. Will be run via sh as: [“sh”, “-c”, dockerCommand]. Defaults to the Docker image’s ENTRYPOINT/CMD.

  • docker_image_namestr

    The name of the docker image to pull from DockerHub.

  • docker_image_tagstr

    The tag of the docker image to pull from DockerHub.

  • instance_typestr

    The EC2 instance type to deploy to. Only available for jobs running on kubernetes.

  • cancel_timeoutint

    The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.

  • last_rundict
    • id : int

    • state : str

    • created_atstr (time)

      The time that the run was queued.

    • started_atstr (time)

      The time that the run started.

    • finished_atstr (time)

      The time that the run completed.

    • errorstr

      The error message for this run, if present.

  • time_zonestr

    The time zone of this script.

  • partition_labelstr

    The partition label used to run this object.

  • my_permission_levelstr

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenbool

    The hidden status of the item.

  • archivedstr

    The archival status of the requested item(s).

  • target_project_idint

    Target project to which script outputs will be added.

  • running_as_idint

    The ID of the runner of this script.

put_containers_archive(id: int, status: bool)

Update the archive status of this object

Parameters:
idint

The ID of the object.

statusbool

The desired archived status of the object.

Returns:
civis.response.Response
  • idint

    The ID for the script.

  • from_template_aliasesList[dict]

    An array of the aliases of the template script.

    • idint

      The id of the Alias object.

    • object_idint

      The id of the object

    • aliasstr

      The alias of the object

  • namestr

    The name of the container.

  • typestr

    The type of the script (e.g Container)

  • created_atstr (time)

    The time this script was created.

  • updated_atstr (time)

    The time the script was last updated.

  • authordict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • statestr

    The status of the script’s last run.

  • finished_atstr (time)

    The time that the script’s last run finished.

  • categorystr

    The category of the script.

  • projectsList[dict]

    A list of projects containing the script.

    • idint

      The ID for the project.

    • namestr

      The name of the project.

  • parent_idint

    The ID of the parent job that will trigger this script

  • user_contextstr

    “runner” or “author”, who to execute the script as when run as a template.

  • paramsList[dict]

    A definition of the parameters this script accepts in the arguments field.

    • namestr

      The variable’s name as used within your code.

    • labelstr

      The label to present to users when asking them for the value.

    • descriptionstr

      A short sentence or fragment describing this parameter to the end user.

    • typestr

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredbool

      Whether this param is required.

    • valuestr

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstr

      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.

    • allowed_valuesList[dict]

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templatebool

    Whether others scripts use this one as a template.

  • template_dependents_countint

    How many other scripts use this one as a template.

  • published_as_template_idint

    The ID of the template that this script is backing.

  • from_template_idint

    The ID of the template script.

  • template_script_namestr

    The name of the template script.

  • linksdict
    • detailsstr

      The details link to get more information about the script.

    • runsstr

      The runs link to get the run information list for this script.

  • scheduledict
    • scheduledbool

      If the item is scheduled.

    • scheduled_daysList[int]

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hoursList[int]

      Hours of the day it is scheduled on.

    • scheduled_minutesList[int]

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourint

      Deprecated in favor of scheduled minutes.

    • scheduled_days_of_monthList[int]

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict
    • urlsList[str]

      URLs to receive a POST request at job completion

    • success_email_subjectstr

      Custom subject line for success e-mail.

    • success_email_bodystr

      Custom body text for success e-mail, written in Markdown.

    • success_email_addressesList[str]

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestr

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostr

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addressesList[str]

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesint

      Stall warning emails will be sent after this amount of minutes.

    • success_onbool

      If success email notifications are on. Defaults to user’s preferences.

    • failure_onbool

      If failure email notifications are on. Defaults to user’s preferences.

  • running_asdict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • required_resourcesdict
    • cpuint

      The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.

    • memoryint

      The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.

    • disk_spacefloat (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.

  • repo_http_uristr

    The location of a github repo to clone into the container, e.g. github.com/my-user/my-repo.git.

  • repo_refstr

    The tag or branch of the github repo to clone into the container.

  • remote_host_credential_idint

    The id of the database credentials to pass into the environment of the container.

  • git_credential_idint

    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_commandstr

    The command to run on the container. Will be run via sh as: [“sh”, “-c”, dockerCommand]. Defaults to the Docker image’s ENTRYPOINT/CMD.

  • docker_image_namestr

    The name of the docker image to pull from DockerHub.

  • docker_image_tagstr

    The tag of the docker image to pull from DockerHub.

  • instance_typestr

    The EC2 instance type to deploy to. Only available for jobs running on kubernetes.

  • cancel_timeoutint

    The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.

  • last_rundict
    • id : int

    • state : str

    • created_atstr (time)

      The time that the run was queued.

    • started_atstr (time)

      The time that the run started.

    • finished_atstr (time)

      The time that the run completed.

    • errorstr

      The error message for this run, if present.

  • time_zonestr

    The time zone of this script.

  • partition_labelstr

    The partition label used to run this object.

  • my_permission_levelstr

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenbool

    The hidden status of the item.

  • archivedstr

    The archival status of the requested item(s).

  • target_project_idint

    Target project to which script outputs will be added.

  • running_as_idint

    The ID of the runner of this script.

put_containers_projects(id: int, project_id: int)

Add a Container Script to a project

Parameters:
idint

The ID of the Container Script.

project_idint

The ID of the project.

Returns:
None

Response code 204: success

put_containers_shares_groups(id: int, group_ids: List[int], permission_level: str, *, share_email_body: str = None, send_shared_email: bool = None)

Set the permissions groups has on this object

Parameters:
idint

The ID of the resource that is shared.

group_idsList[int]

An array of one or more group IDs.

permission_levelstr

Options are: “read”, “write”, or “manage”.

share_email_bodystr, optional

Custom body text for e-mail sent on a share.

send_shared_emailbool, optional

Send email to the recipients of a share.

Returns:
civis.response.Response
  • readersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • writersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • ownersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • total_user_sharesint

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesint

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_containers_shares_users(id: int, user_ids: List[int], permission_level: str, *, share_email_body: str = None, send_shared_email: bool = None)

Set the permissions users have on this object

Parameters:
idint

The ID of the resource that is shared.

user_idsList[int]

An array of one or more user IDs.

permission_levelstr

Options are: “read”, “write”, or “manage”.

share_email_bodystr, optional

Custom body text for e-mail sent on a share.

send_shared_emailbool, optional

Send email to the recipients of a share.

Returns:
civis.response.Response
  • readersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • writersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • ownersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • total_user_sharesint

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesint

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_containers_transfer(id: int, user_id: int, include_dependencies: bool, *, email_body: str = None, send_email: bool = None)

Transfer ownership of this object to another user

Parameters:
idint

The ID of the resource that is shared.

user_idint

ID of target user

include_dependenciesbool

Whether or not to give manage permissions on all dependencies

email_bodystr, optional

Custom body text for e-mail sent on transfer.

send_emailbool, optional

Send email to the target user of the transfer?

Returns:
civis.response.Response
  • dependenciesList[dict]

    Dependent objects for this object

    • object_typestr

      Dependent object type

    • fco_typestr

      Human readable dependent object type

    • idint

      Dependent object ID

    • namestr

      Dependent object name, or nil if the requesting user cannot read this object

    • permission_levelstr

      Permission level of target user (not user’s groups) for dependent object. Null if no target user or not shareable (e.g. a database table).

    • descriptionstr

      Additional information about the dependency, if relevant

    • sharedbool

      Whether dependent object was successfully shared with target user

put_custom(id: int, *, name: str = None, parent_id: int = None, arguments: dict = None, remote_host_id: int = None, credential_id: int = None, schedule: dict = None, notifications: dict = None, time_zone: str = None, target_project_id: int = None, required_resources: dict = None, partition_label: str = None, running_as_id: int = None)

Replace all attributes of this Custom Script

Parameters:
idint

The ID for the script.

namestr, optional

The name of the script.

parent_idint, optional

The ID of the parent job that will trigger this script

argumentsdict, optional

Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

remote_host_idint, optional

The remote host ID that this script will connect to.

credential_idint, optional

The credential that this script will use.

scheduledict, optional
  • scheduledbool

    If the item is scheduled.

  • scheduled_daysList[int]

    Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

  • scheduled_hoursList[int]

    Hours of the day it is scheduled on.

  • scheduled_minutesList[int]

    Minutes of the day it is scheduled on.

  • scheduled_runs_per_hourint

    Deprecated in favor of scheduled minutes.

  • scheduled_days_of_monthList[int]

    Days of the month it is scheduled on, mutually exclusive with scheduledDays.

notificationsdict, optional
  • urlsList[str]

    URLs to receive a POST request at job completion

  • success_email_subjectstr

    Custom subject line for success e-mail.

  • success_email_bodystr

    Custom body text for success e-mail, written in Markdown.

  • success_email_addressesList[str]

    Addresses to notify by e-mail when the job completes successfully.

  • success_email_from_namestr

    Name from which success emails are sent; defaults to “Civis.”

  • success_email_reply_tostr

    Address for replies to success emails; defaults to the author of the job.

  • failure_email_addressesList[str]

    Addresses to notify by e-mail when the job fails.

  • stall_warning_minutesint

    Stall warning emails will be sent after this amount of minutes.

  • success_onbool

    If success email notifications are on. Defaults to user’s preferences.

  • failure_onbool

    If failure email notifications are on. Defaults to user’s preferences.

time_zonestr, optional

The time zone of this script.

target_project_idint, optional

Target project to which script outputs will be added.

required_resourcesdict, optional
  • cpuint

    The number of CPU shares to allocate for the container. Each core has 1000 shares.

  • memoryint

    The amount of RAM to allocate for the container (in MB).

  • disk_spacefloat (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.

partition_labelstr, optional

The partition label used to run this object. Only applicable for jobs using Docker.

running_as_idint, optional

The ID of the runner of this script.

Returns:
civis.response.Response
  • idint

    The ID for the script.

  • from_template_aliasesList[dict]

    An array of the aliases of the template script.

    • idint

      The id of the Alias object.

    • object_idint

      The id of the object

    • aliasstr

      The alias of the object

  • namestr

    The name of the script.

  • typestr

    The type of the script (e.g Custom)

  • backing_script_typestr

    The type of the script backing this template (e.g Python)

  • created_atstr (time)

    The time this script was created.

  • updated_atstr (time)

    The time the script was last updated.

  • authordict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • statestr

    The status of the script’s last run.

  • finished_atstr (time)

    The time that the script’s last run finished.

  • category : str

  • projectsList[dict]

    A list of projects containing the script.

    • idint

      The ID for the project.

    • namestr

      The name of the project.

  • parent_idint

    The ID of the parent job that will trigger this script

  • paramsList[dict]

    A definition of the parameters this script accepts in the arguments field.

    • namestr

      The variable’s name as used within your code.

    • labelstr

      The label to present to users when asking them for the value.

    • descriptionstr

      A short sentence or fragment describing this parameter to the end user.

    • typestr

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredbool

      Whether this param is required.

    • valuestr

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstr

      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.

    • allowed_valuesList[dict]

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templatebool

    Whether others scripts use this one as a template.

  • published_as_template_idint

    The ID of the template that this script is backing.

  • from_template_idint

    The ID of the template script.

  • ui_report_urlint

    The url of the custom HTML.

  • ui_report_idint

    The id of the report with the custom HTML.

  • ui_report_provide_api_keybool

    Whether the ui report requests an API Key from the report viewer.

  • template_script_namestr

    The name of the template script.

  • template_notestr

    The template’s note.

  • remote_host_idint

    The remote host ID that this script will connect to.

  • credential_idint

    The credential that this script will use.

  • code_previewstr

    The code that this script will run with arguments inserted.

  • scheduledict
    • scheduledbool

      If the item is scheduled.

    • scheduled_daysList[int]

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hoursList[int]

      Hours of the day it is scheduled on.

    • scheduled_minutesList[int]

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourint

      Deprecated in favor of scheduled minutes.

    • scheduled_days_of_monthList[int]

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict
    • urlsList[str]

      URLs to receive a POST request at job completion

    • success_email_subjectstr

      Custom subject line for success e-mail.

    • success_email_bodystr

      Custom body text for success e-mail, written in Markdown.

    • success_email_addressesList[str]

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestr

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostr

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addressesList[str]

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesint

      Stall warning emails will be sent after this amount of minutes.

    • success_onbool

      If success email notifications are on. Defaults to user’s preferences.

    • failure_onbool

      If failure email notifications are on. Defaults to user’s preferences.

  • running_asdict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • time_zonestr

    The time zone of this script.

  • last_rundict
    • id : int

    • state : str

    • created_atstr (time)

      The time that the run was queued.

    • started_atstr (time)

      The time that the run started.

    • finished_atstr (time)

      The time that the run completed.

    • errorstr

      The error message for this run, if present.

  • my_permission_levelstr

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenbool

    The hidden status of the item.

  • archivedstr

    The archival status of the requested item(s).

  • target_project_idint

    Target project to which script outputs will be added.

  • last_successful_rundict
    • id : int

    • state : str

    • created_atstr (time)

      The time that the run was queued.

    • started_atstr (time)

      The time that the run started.

    • finished_atstr (time)

      The time that the run completed.

    • errorstr

      The error message for this run, if present.

  • required_resourcesdict
    • cpuint

      The number of CPU shares to allocate for the container. Each core has 1000 shares.

    • memoryint

      The amount of RAM to allocate for the container (in MB).

    • disk_spacefloat (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.

  • partition_labelstr

    The partition label used to run this object. Only applicable for jobs using Docker.

  • running_as_idint

    The ID of the runner of this script.

put_custom_archive(id: int, status: bool)

Update the archive status of this object

Parameters:
idint

The ID of the object.

statusbool

The desired archived status of the object.

Returns:
civis.response.Response
  • idint

    The ID for the script.

  • from_template_aliasesList[dict]

    An array of the aliases of the template script.

    • idint

      The id of the Alias object.

    • object_idint

      The id of the object

    • aliasstr

      The alias of the object

  • namestr

    The name of the script.

  • typestr

    The type of the script (e.g Custom)

  • backing_script_typestr

    The type of the script backing this template (e.g Python)

  • created_atstr (time)

    The time this script was created.

  • updated_atstr (time)

    The time the script was last updated.

  • authordict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • statestr

    The status of the script’s last run.

  • finished_atstr (time)

    The time that the script’s last run finished.

  • category : str

  • projectsList[dict]

    A list of projects containing the script.

    • idint

      The ID for the project.

    • namestr

      The name of the project.

  • parent_idint

    The ID of the parent job that will trigger this script

  • paramsList[dict]

    A definition of the parameters this script accepts in the arguments field.

    • namestr

      The variable’s name as used within your code.

    • labelstr

      The label to present to users when asking them for the value.

    • descriptionstr

      A short sentence or fragment describing this parameter to the end user.

    • typestr

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredbool

      Whether this param is required.

    • valuestr

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstr

      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.

    • allowed_valuesList[dict]

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templatebool

    Whether others scripts use this one as a template.

  • published_as_template_idint

    The ID of the template that this script is backing.

  • from_template_idint

    The ID of the template script.

  • ui_report_urlint

    The url of the custom HTML.

  • ui_report_idint

    The id of the report with the custom HTML.

  • ui_report_provide_api_keybool

    Whether the ui report requests an API Key from the report viewer.

  • template_script_namestr

    The name of the template script.

  • template_notestr

    The template’s note.

  • remote_host_idint

    The remote host ID that this script will connect to.

  • credential_idint

    The credential that this script will use.

  • code_previewstr

    The code that this script will run with arguments inserted.

  • scheduledict
    • scheduledbool

      If the item is scheduled.

    • scheduled_daysList[int]

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hoursList[int]

      Hours of the day it is scheduled on.

    • scheduled_minutesList[int]

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourint

      Deprecated in favor of scheduled minutes.

    • scheduled_days_of_monthList[int]

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict
    • urlsList[str]

      URLs to receive a POST request at job completion

    • success_email_subjectstr

      Custom subject line for success e-mail.

    • success_email_bodystr

      Custom body text for success e-mail, written in Markdown.

    • success_email_addressesList[str]

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestr

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostr

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addressesList[str]

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesint

      Stall warning emails will be sent after this amount of minutes.

    • success_onbool

      If success email notifications are on. Defaults to user’s preferences.

    • failure_onbool

      If failure email notifications are on. Defaults to user’s preferences.

  • running_asdict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • time_zonestr

    The time zone of this script.

  • last_rundict
    • id : int

    • state : str

    • created_atstr (time)

      The time that the run was queued.

    • started_atstr (time)

      The time that the run started.

    • finished_atstr (time)

      The time that the run completed.

    • errorstr

      The error message for this run, if present.

  • my_permission_levelstr

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenbool

    The hidden status of the item.

  • archivedstr

    The archival status of the requested item(s).

  • target_project_idint

    Target project to which script outputs will be added.

  • last_successful_rundict
    • id : int

    • state : str

    • created_atstr (time)

      The time that the run was queued.

    • started_atstr (time)

      The time that the run started.

    • finished_atstr (time)

      The time that the run completed.

    • errorstr

      The error message for this run, if present.

  • required_resourcesdict
    • cpuint

      The number of CPU shares to allocate for the container. Each core has 1000 shares.

    • memoryint

      The amount of RAM to allocate for the container (in MB).

    • disk_spacefloat (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.

  • partition_labelstr

    The partition label used to run this object. Only applicable for jobs using Docker.

  • running_as_idint

    The ID of the runner of this script.

put_custom_projects(id: int, project_id: int)

Add a Custom Script to a project

Parameters:
idint

The ID of the Custom Script.

project_idint

The ID of the project.

Returns:
None

Response code 204: success

put_custom_shares_groups(id: int, group_ids: List[int], permission_level: str, *, share_email_body: str = None, send_shared_email: bool = None)

Set the permissions groups has on this object

Parameters:
idint

The ID of the resource that is shared.

group_idsList[int]

An array of one or more group IDs.

permission_levelstr

Options are: “read”, “write”, or “manage”.

share_email_bodystr, optional

Custom body text for e-mail sent on a share.

send_shared_emailbool, optional

Send email to the recipients of a share.

Returns:
civis.response.Response
  • readersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • writersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • ownersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • total_user_sharesint

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesint

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_custom_shares_users(id: int, user_ids: List[int], permission_level: str, *, share_email_body: str = None, send_shared_email: bool = None)

Set the permissions users have on this object

Parameters:
idint

The ID of the resource that is shared.

user_idsList[int]

An array of one or more user IDs.

permission_levelstr

Options are: “read”, “write”, or “manage”.

share_email_bodystr, optional

Custom body text for e-mail sent on a share.

send_shared_emailbool, optional

Send email to the recipients of a share.

Returns:
civis.response.Response
  • readersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • writersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • ownersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • total_user_sharesint

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesint

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_custom_transfer(id: int, user_id: int, include_dependencies: bool, *, email_body: str = None, send_email: bool = None)

Transfer ownership of this object to another user

Parameters:
idint

The ID of the resource that is shared.

user_idint

ID of target user

include_dependenciesbool

Whether or not to give manage permissions on all dependencies

email_bodystr, optional

Custom body text for e-mail sent on transfer.

send_emailbool, optional

Send email to the target user of the transfer?

Returns:
civis.response.Response
  • dependenciesList[dict]

    Dependent objects for this object

    • object_typestr

      Dependent object type

    • fco_typestr

      Human readable dependent object type

    • idint

      Dependent object ID

    • namestr

      Dependent object name, or nil if the requesting user cannot read this object

    • permission_levelstr

      Permission level of target user (not user’s groups) for dependent object. Null if no target user or not shareable (e.g. a database table).

    • descriptionstr

      Additional information about the dependency, if relevant

    • sharedbool

      Whether dependent object was successfully shared with target user

put_javascript(id: int, name: str, source: str, remote_host_id: int, credential_id: int, *, parent_id: int = None, user_context: str = None, params: List[dict] = None, arguments: dict = None, schedule: dict = None, notifications: dict = None, next_run_at: str = None, time_zone: str = None, target_project_id: int = None, running_as_id: int = None)

Replace all attributes of this JavaScript Script

Parameters:
idint

The ID for the script.

namestr

The name of the script.

sourcestr

The body/text of the script.

remote_host_idint

The remote host ID that this script will connect to.

credential_idint

The credential that this script will use.

parent_idint, optional

The ID of the parent job that will trigger this script

user_contextstr, optional

“runner” or “author”, who to execute the script as when run as a template.

paramsList[dict], optional

A definition of the parameters this script accepts in the arguments field.

  • namestr

    The variable’s name as used within your code.

  • labelstr

    The label to present to users when asking them for the value.

  • descriptionstr

    A short sentence or fragment describing this parameter to the end user.

  • typestr

    The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

  • requiredbool

    Whether this param is required.

  • valuestr

    The value you would like to set this param to. Setting this value makes this parameter a fixed param.

  • defaultstr

    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.

  • allowed_valuesList[dict]

    The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

argumentsdict, optional

Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

scheduledict, optional
  • scheduledbool

    If the item is scheduled.

  • scheduled_daysList[int]

    Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

  • scheduled_hoursList[int]

    Hours of the day it is scheduled on.

  • scheduled_minutesList[int]

    Minutes of the day it is scheduled on.

  • scheduled_runs_per_hourint

    Deprecated in favor of scheduled minutes.

  • scheduled_days_of_monthList[int]

    Days of the month it is scheduled on, mutually exclusive with scheduledDays.

notificationsdict, optional
  • urlsList[str]

    URLs to receive a POST request at job completion

  • success_email_subjectstr

    Custom subject line for success e-mail.

  • success_email_bodystr

    Custom body text for success e-mail, written in Markdown.

  • success_email_addressesList[str]

    Addresses to notify by e-mail when the job completes successfully.

  • success_email_from_namestr

    Name from which success emails are sent; defaults to “Civis.”

  • success_email_reply_tostr

    Address for replies to success emails; defaults to the author of the job.

  • failure_email_addressesList[str]

    Addresses to notify by e-mail when the job fails.

  • stall_warning_minutesint

    Stall warning emails will be sent after this amount of minutes.

  • success_onbool

    If success email notifications are on. Defaults to user’s preferences.

  • failure_onbool

    If failure email notifications are on. Defaults to user’s preferences.

next_run_atstr (time), optional

The time of the next scheduled run.

time_zonestr, optional

The time zone of this script.

target_project_idint, optional

Target project to which script outputs will be added.

running_as_idint, optional

The ID of the runner of this script.

Returns:
civis.response.Response
  • idint

    The ID for the script.

  • namestr

    The name of the script.

  • typestr

    The type of the script (e.g SQL, Container, Python, R, JavaScript, dbt)

  • created_atstr (time)

    The time this script was created.

  • updated_atstr (time)

    The time the script was last updated.

  • authordict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • statestr

    The status of the script’s last run.

  • finished_atstr (time)

    The time that the script’s last run finished.

  • categorystr

    The category of the script.

  • projectsList[dict]

    A list of projects containing the script.

    • idint

      The ID for the project.

    • namestr

      The name of the project.

  • parent_idint

    The ID of the parent job that will trigger this script

  • user_contextstr

    “runner” or “author”, who to execute the script as when run as a template.

  • paramsList[dict]

    A definition of the parameters this script accepts in the arguments field.

    • namestr

      The variable’s name as used within your code.

    • labelstr

      The label to present to users when asking them for the value.

    • descriptionstr

      A short sentence or fragment describing this parameter to the end user.

    • typestr

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredbool

      Whether this param is required.

    • valuestr

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstr

      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.

    • allowed_valuesList[dict]

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templatebool

    Whether others scripts use this one as a template.

  • published_as_template_idint

    The ID of the template that this script is backing.

  • from_template_idint

    The ID of the template this script uses, if any.

  • template_dependents_countint

    How many other scripts use this one as a template.

  • template_script_namestr

    The name of the template script.

  • linksdict
    • detailsstr

      The details link to get more information about the script.

    • runsstr

      The runs link to get the run information list for this script.

  • scheduledict
    • scheduledbool

      If the item is scheduled.

    • scheduled_daysList[int]

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hoursList[int]

      Hours of the day it is scheduled on.

    • scheduled_minutesList[int]

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourint

      Deprecated in favor of scheduled minutes.

    • scheduled_days_of_monthList[int]

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict
    • urlsList[str]

      URLs to receive a POST request at job completion

    • success_email_subjectstr

      Custom subject line for success e-mail.

    • success_email_bodystr

      Custom body text for success e-mail, written in Markdown.

    • success_email_addressesList[str]

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestr

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostr

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addressesList[str]

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesint

      Stall warning emails will be sent after this amount of minutes.

    • success_onbool

      If success email notifications are on. Defaults to user’s preferences.

    • failure_onbool

      If failure email notifications are on. Defaults to user’s preferences.

  • running_asdict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • next_run_atstr (time)

    The time of the next scheduled run.

  • time_zonestr

    The time zone of this script.

  • last_rundict
    • id : int

    • state : str

    • created_atstr (time)

      The time that the run was queued.

    • started_atstr (time)

      The time that the run started.

    • finished_atstr (time)

      The time that the run completed.

    • errorstr

      The error message for this run, if present.

  • my_permission_levelstr

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenbool

    The hidden status of the item.

  • target_project_idint

    Target project to which script outputs will be added.

  • archivedstr

    The archival status of the requested item(s).

  • sourcestr

    The body/text of the script.

  • remote_host_idint

    The remote host ID that this script will connect to.

  • credential_idint

    The credential that this script will use.

  • running_as_idint

    The ID of the runner of this script.

put_javascript_archive(id: int, status: bool)

Update the archive status of this object

Parameters:
idint

The ID of the object.

statusbool

The desired archived status of the object.

Returns:
civis.response.Response
  • idint

    The ID for the script.

  • namestr

    The name of the script.

  • typestr

    The type of the script (e.g SQL, Container, Python, R, JavaScript, dbt)

  • created_atstr (time)

    The time this script was created.

  • updated_atstr (time)

    The time the script was last updated.

  • authordict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • statestr

    The status of the script’s last run.

  • finished_atstr (time)

    The time that the script’s last run finished.

  • categorystr

    The category of the script.

  • projectsList[dict]

    A list of projects containing the script.

    • idint

      The ID for the project.

    • namestr

      The name of the project.

  • parent_idint

    The ID of the parent job that will trigger this script

  • user_contextstr

    “runner” or “author”, who to execute the script as when run as a template.

  • paramsList[dict]

    A definition of the parameters this script accepts in the arguments field.

    • namestr

      The variable’s name as used within your code.

    • labelstr

      The label to present to users when asking them for the value.

    • descriptionstr

      A short sentence or fragment describing this parameter to the end user.

    • typestr

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredbool

      Whether this param is required.

    • valuestr

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstr

      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.

    • allowed_valuesList[dict]

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templatebool

    Whether others scripts use this one as a template.

  • published_as_template_idint

    The ID of the template that this script is backing.

  • from_template_idint

    The ID of the template this script uses, if any.

  • template_dependents_countint

    How many other scripts use this one as a template.

  • template_script_namestr

    The name of the template script.

  • linksdict
    • detailsstr

      The details link to get more information about the script.

    • runsstr

      The runs link to get the run information list for this script.

  • scheduledict
    • scheduledbool

      If the item is scheduled.

    • scheduled_daysList[int]

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hoursList[int]

      Hours of the day it is scheduled on.

    • scheduled_minutesList[int]

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourint

      Deprecated in favor of scheduled minutes.

    • scheduled_days_of_monthList[int]

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict
    • urlsList[str]

      URLs to receive a POST request at job completion

    • success_email_subjectstr

      Custom subject line for success e-mail.

    • success_email_bodystr

      Custom body text for success e-mail, written in Markdown.

    • success_email_addressesList[str]

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestr

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostr

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addressesList[str]

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesint

      Stall warning emails will be sent after this amount of minutes.

    • success_onbool

      If success email notifications are on. Defaults to user’s preferences.

    • failure_onbool

      If failure email notifications are on. Defaults to user’s preferences.

  • running_asdict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • next_run_atstr (time)

    The time of the next scheduled run.

  • time_zonestr

    The time zone of this script.

  • last_rundict
    • id : int

    • state : str

    • created_atstr (time)

      The time that the run was queued.

    • started_atstr (time)

      The time that the run started.

    • finished_atstr (time)

      The time that the run completed.

    • errorstr

      The error message for this run, if present.

  • my_permission_levelstr

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenbool

    The hidden status of the item.

  • target_project_idint

    Target project to which script outputs will be added.

  • archivedstr

    The archival status of the requested item(s).

  • sourcestr

    The body/text of the script.

  • remote_host_idint

    The remote host ID that this script will connect to.

  • credential_idint

    The credential that this script will use.

  • running_as_idint

    The ID of the runner of this script.

put_javascript_git(id: int, *, git_ref: str = None, git_branch: str = None, git_path: str = None, git_repo_url: str = None, git_ref_type: str = None, pull_from_git: bool = None)

Attach an item to a file in a git repo

Parameters:
idint

The ID of the file.

git_refstr, optional

A git reference specifying an unambiguous version of the file. Can be a branch name, or the full or shortened SHA of a commit.

git_branchstr, optional

The git branch that the file is on.

git_pathstr, optional

The path of the file in the repository.

git_repo_urlstr, optional

The URL of the git repository.

git_ref_typestr, optional

Specifies if the file is versioned by branch or tag.

pull_from_gitbool, optional

Automatically pull latest commit from git. Only works for scripts.

Returns:
civis.response.Response
  • git_refstr

    A git reference specifying an unambiguous version of the file. Can be a branch name, tag or the full or shortened SHA of a commit.

  • git_branchstr

    The git branch that the file is on.

  • git_pathstr

    The path of the file in the repository.

  • git_repodict
    • idint

      The ID for this git repository.

    • repo_urlstr

      The URL for this git repository.

    • created_at : str (time)

    • updated_at : str (time)

  • git_ref_typestr

    Specifies if the file is versioned by branch or tag.

  • pull_from_gitbool

    Automatically pull latest commit from git. Only works for scripts and workflows (assuming you have the feature enabled)

put_javascript_projects(id: int, project_id: int)

Add a JavaScript Script to a project

Parameters:
idint

The ID of the JavaScript Script.

project_idint

The ID of the project.

Returns:
None

Response code 204: success

put_javascript_shares_groups(id: int, group_ids: List[int], permission_level: str, *, share_email_body: str = None, send_shared_email: bool = None)

Set the permissions groups has on this object

Parameters:
idint

The ID of the resource that is shared.

group_idsList[int]

An array of one or more group IDs.

permission_levelstr

Options are: “read”, “write”, or “manage”.

share_email_bodystr, optional

Custom body text for e-mail sent on a share.

send_shared_emailbool, optional

Send email to the recipients of a share.

Returns:
civis.response.Response
  • readersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • writersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • ownersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • total_user_sharesint

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesint

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_javascript_shares_users(id: int, user_ids: List[int], permission_level: str, *, share_email_body: str = None, send_shared_email: bool = None)

Set the permissions users have on this object

Parameters:
idint

The ID of the resource that is shared.

user_idsList[int]

An array of one or more user IDs.

permission_levelstr

Options are: “read”, “write”, or “manage”.

share_email_bodystr, optional

Custom body text for e-mail sent on a share.

send_shared_emailbool, optional

Send email to the recipients of a share.

Returns:
civis.response.Response
  • readersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • writersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • ownersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • total_user_sharesint

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesint

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_javascript_transfer(id: int, user_id: int, include_dependencies: bool, *, email_body: str = None, send_email: bool = None)

Transfer ownership of this object to another user

Parameters:
idint

The ID of the resource that is shared.

user_idint

ID of target user

include_dependenciesbool

Whether or not to give manage permissions on all dependencies

email_bodystr, optional

Custom body text for e-mail sent on transfer.

send_emailbool, optional

Send email to the target user of the transfer?

Returns:
civis.response.Response
  • dependenciesList[dict]

    Dependent objects for this object

    • object_typestr

      Dependent object type

    • fco_typestr

      Human readable dependent object type

    • idint

      Dependent object ID

    • namestr

      Dependent object name, or nil if the requesting user cannot read this object

    • permission_levelstr

      Permission level of target user (not user’s groups) for dependent object. Null if no target user or not shareable (e.g. a database table).

    • descriptionstr

      Additional information about the dependency, if relevant

    • sharedbool

      Whether dependent object was successfully shared with target user

put_python3(id: int, name: str, source: str, *, parent_id: int = None, user_context: str = None, params: List[dict] = None, arguments: dict = None, schedule: dict = None, notifications: dict = None, next_run_at: str = None, time_zone: str = None, target_project_id: int = None, required_resources: dict = None, instance_type: str = None, cancel_timeout: int = None, docker_image_tag: str = None, partition_label: str = None, running_as_id: int = None)

Replace all attributes of this Python Script

Parameters:
idint

The ID for the script.

namestr

The name of the script.

sourcestr

The body/text of the script.

parent_idint, optional

The ID of the parent job that will trigger this script

user_contextstr, optional

“runner” or “author”, who to execute the script as when run as a template.

paramsList[dict], optional

A definition of the parameters this script accepts in the arguments field.

  • namestr

    The variable’s name as used within your code.

  • labelstr

    The label to present to users when asking them for the value.

  • descriptionstr

    A short sentence or fragment describing this parameter to the end user.

  • typestr

    The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

  • requiredbool

    Whether this param is required.

  • valuestr

    The value you would like to set this param to. Setting this value makes this parameter a fixed param.

  • defaultstr

    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.

  • allowed_valuesList[dict]

    The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

argumentsdict, optional

Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

scheduledict, optional
  • scheduledbool

    If the item is scheduled.

  • scheduled_daysList[int]

    Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

  • scheduled_hoursList[int]

    Hours of the day it is scheduled on.

  • scheduled_minutesList[int]

    Minutes of the day it is scheduled on.

  • scheduled_runs_per_hourint

    Deprecated in favor of scheduled minutes.

  • scheduled_days_of_monthList[int]

    Days of the month it is scheduled on, mutually exclusive with scheduledDays.

notificationsdict, optional
  • urlsList[str]

    URLs to receive a POST request at job completion

  • success_email_subjectstr

    Custom subject line for success e-mail.

  • success_email_bodystr

    Custom body text for success e-mail, written in Markdown.

  • success_email_addressesList[str]

    Addresses to notify by e-mail when the job completes successfully.

  • success_email_from_namestr

    Name from which success emails are sent; defaults to “Civis.”

  • success_email_reply_tostr

    Address for replies to success emails; defaults to the author of the job.

  • failure_email_addressesList[str]

    Addresses to notify by e-mail when the job fails.

  • stall_warning_minutesint

    Stall warning emails will be sent after this amount of minutes.

  • success_onbool

    If success email notifications are on. Defaults to user’s preferences.

  • failure_onbool

    If failure email notifications are on. Defaults to user’s preferences.

next_run_atstr (time), optional

The time of the next scheduled run.

time_zonestr, optional

The time zone of this script.

target_project_idint, optional

Target project to which script outputs will be added.

required_resourcesdict, optional
  • cpuint

    The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.

  • memoryint

    The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.

  • disk_spacefloat (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.

instance_typestr, optional

The EC2 instance type to deploy to. Only available for jobs running on kubernetes.

cancel_timeoutint, optional

The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.

docker_image_tagstr, optional

The tag of the docker image to pull from DockerHub.

partition_labelstr, optional

The partition label used to run this object.

running_as_idint, optional

The ID of the runner of this script.

Returns:
civis.response.Response
  • idint

    The ID for the script.

  • namestr

    The name of the script.

  • typestr

    The type of the script (e.g SQL, Container, Python, R, JavaScript, dbt)

  • created_atstr (time)

    The time this script was created.

  • updated_atstr (time)

    The time the script was last updated.

  • authordict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • statestr

    The status of the script’s last run.

  • finished_atstr (time)

    The time that the script’s last run finished.

  • categorystr

    The category of the script.

  • projectsList[dict]

    A list of projects containing the script.

    • idint

      The ID for the project.

    • namestr

      The name of the project.

  • parent_idint

    The ID of the parent job that will trigger this script

  • user_contextstr

    “runner” or “author”, who to execute the script as when run as a template.

  • paramsList[dict]

    A definition of the parameters this script accepts in the arguments field.

    • namestr

      The variable’s name as used within your code.

    • labelstr

      The label to present to users when asking them for the value.

    • descriptionstr

      A short sentence or fragment describing this parameter to the end user.

    • typestr

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredbool

      Whether this param is required.

    • valuestr

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstr

      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.

    • allowed_valuesList[dict]

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templatebool

    Whether others scripts use this one as a template.

  • published_as_template_idint

    The ID of the template that this script is backing.

  • from_template_idint

    The ID of the template this script uses, if any.

  • template_dependents_countint

    How many other scripts use this one as a template.

  • template_script_namestr

    The name of the template script.

  • linksdict
    • detailsstr

      The details link to get more information about the script.

    • runsstr

      The runs link to get the run information list for this script.

  • scheduledict
    • scheduledbool

      If the item is scheduled.

    • scheduled_daysList[int]

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hoursList[int]

      Hours of the day it is scheduled on.

    • scheduled_minutesList[int]

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourint

      Deprecated in favor of scheduled minutes.

    • scheduled_days_of_monthList[int]

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict
    • urlsList[str]

      URLs to receive a POST request at job completion

    • success_email_subjectstr

      Custom subject line for success e-mail.

    • success_email_bodystr

      Custom body text for success e-mail, written in Markdown.

    • success_email_addressesList[str]

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestr

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostr

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addressesList[str]

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesint

      Stall warning emails will be sent after this amount of minutes.

    • success_onbool

      If success email notifications are on. Defaults to user’s preferences.

    • failure_onbool

      If failure email notifications are on. Defaults to user’s preferences.

  • running_asdict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • next_run_atstr (time)

    The time of the next scheduled run.

  • time_zonestr

    The time zone of this script.

  • last_rundict
    • id : int

    • state : str

    • created_atstr (time)

      The time that the run was queued.

    • started_atstr (time)

      The time that the run started.

    • finished_atstr (time)

      The time that the run completed.

    • errorstr

      The error message for this run, if present.

  • my_permission_levelstr

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenbool

    The hidden status of the item.

  • target_project_idint

    Target project to which script outputs will be added.

  • archivedstr

    The archival status of the requested item(s).

  • required_resourcesdict
    • cpuint

      The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.

    • memoryint

      The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.

    • disk_spacefloat (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.

  • instance_typestr

    The EC2 instance type to deploy to. Only available for jobs running on kubernetes.

  • sourcestr

    The body/text of the script.

  • cancel_timeoutint

    The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.

  • docker_image_tagstr

    The tag of the docker image to pull from DockerHub.

  • partition_labelstr

    The partition label used to run this object.

  • running_as_idint

    The ID of the runner of this script.

put_python3_archive(id: int, status: bool)

Update the archive status of this object

Parameters:
idint

The ID of the object.

statusbool

The desired archived status of the object.

Returns:
civis.response.Response
  • idint

    The ID for the script.

  • namestr

    The name of the script.

  • typestr

    The type of the script (e.g SQL, Container, Python, R, JavaScript, dbt)

  • created_atstr (time)

    The time this script was created.

  • updated_atstr (time)

    The time the script was last updated.

  • authordict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • statestr

    The status of the script’s last run.

  • finished_atstr (time)

    The time that the script’s last run finished.

  • categorystr

    The category of the script.

  • projectsList[dict]

    A list of projects containing the script.

    • idint

      The ID for the project.

    • namestr

      The name of the project.

  • parent_idint

    The ID of the parent job that will trigger this script

  • user_contextstr

    “runner” or “author”, who to execute the script as when run as a template.

  • paramsList[dict]

    A definition of the parameters this script accepts in the arguments field.

    • namestr

      The variable’s name as used within your code.

    • labelstr

      The label to present to users when asking them for the value.

    • descriptionstr

      A short sentence or fragment describing this parameter to the end user.

    • typestr

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredbool

      Whether this param is required.

    • valuestr

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstr

      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.

    • allowed_valuesList[dict]

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templatebool

    Whether others scripts use this one as a template.

  • published_as_template_idint

    The ID of the template that this script is backing.

  • from_template_idint

    The ID of the template this script uses, if any.

  • template_dependents_countint

    How many other scripts use this one as a template.

  • template_script_namestr

    The name of the template script.

  • linksdict
    • detailsstr

      The details link to get more information about the script.

    • runsstr

      The runs link to get the run information list for this script.

  • scheduledict
    • scheduledbool

      If the item is scheduled.

    • scheduled_daysList[int]

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hoursList[int]

      Hours of the day it is scheduled on.

    • scheduled_minutesList[int]

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourint

      Deprecated in favor of scheduled minutes.

    • scheduled_days_of_monthList[int]

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict
    • urlsList[str]

      URLs to receive a POST request at job completion

    • success_email_subjectstr

      Custom subject line for success e-mail.

    • success_email_bodystr

      Custom body text for success e-mail, written in Markdown.

    • success_email_addressesList[str]

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestr

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostr

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addressesList[str]

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesint

      Stall warning emails will be sent after this amount of minutes.

    • success_onbool

      If success email notifications are on. Defaults to user’s preferences.

    • failure_onbool

      If failure email notifications are on. Defaults to user’s preferences.

  • running_asdict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • next_run_atstr (time)

    The time of the next scheduled run.

  • time_zonestr

    The time zone of this script.

  • last_rundict
    • id : int

    • state : str

    • created_atstr (time)

      The time that the run was queued.

    • started_atstr (time)

      The time that the run started.

    • finished_atstr (time)

      The time that the run completed.

    • errorstr

      The error message for this run, if present.

  • my_permission_levelstr

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenbool

    The hidden status of the item.

  • target_project_idint

    Target project to which script outputs will be added.

  • archivedstr

    The archival status of the requested item(s).

  • required_resourcesdict
    • cpuint

      The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.

    • memoryint

      The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.

    • disk_spacefloat (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.

  • instance_typestr

    The EC2 instance type to deploy to. Only available for jobs running on kubernetes.

  • sourcestr

    The body/text of the script.

  • cancel_timeoutint

    The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.

  • docker_image_tagstr

    The tag of the docker image to pull from DockerHub.

  • partition_labelstr

    The partition label used to run this object.

  • running_as_idint

    The ID of the runner of this script.

put_python3_git(id: int, *, git_ref: str = None, git_branch: str = None, git_path: str = None, git_repo_url: str = None, git_ref_type: str = None, pull_from_git: bool = None)

Attach an item to a file in a git repo

Parameters:
idint

The ID of the file.

git_refstr, optional

A git reference specifying an unambiguous version of the file. Can be a branch name, or the full or shortened SHA of a commit.

git_branchstr, optional

The git branch that the file is on.

git_pathstr, optional

The path of the file in the repository.

git_repo_urlstr, optional

The URL of the git repository.

git_ref_typestr, optional

Specifies if the file is versioned by branch or tag.

pull_from_gitbool, optional

Automatically pull latest commit from git. Only works for scripts.

Returns:
civis.response.Response
  • git_refstr

    A git reference specifying an unambiguous version of the file. Can be a branch name, tag or the full or shortened SHA of a commit.

  • git_branchstr

    The git branch that the file is on.

  • git_pathstr

    The path of the file in the repository.

  • git_repodict
    • idint

      The ID for this git repository.

    • repo_urlstr

      The URL for this git repository.

    • created_at : str (time)

    • updated_at : str (time)

  • git_ref_typestr

    Specifies if the file is versioned by branch or tag.

  • pull_from_gitbool

    Automatically pull latest commit from git. Only works for scripts and workflows (assuming you have the feature enabled)

put_python3_projects(id: int, project_id: int)

Add a Python Script to a project

Parameters:
idint

The ID of the Python Script.

project_idint

The ID of the project.

Returns:
None

Response code 204: success

put_python3_shares_groups(id: int, group_ids: List[int], permission_level: str, *, share_email_body: str = None, send_shared_email: bool = None)

Set the permissions groups has on this object

Parameters:
idint

The ID of the resource that is shared.

group_idsList[int]

An array of one or more group IDs.

permission_levelstr

Options are: “read”, “write”, or “manage”.

share_email_bodystr, optional

Custom body text for e-mail sent on a share.

send_shared_emailbool, optional

Send email to the recipients of a share.

Returns:
civis.response.Response
  • readersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • writersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • ownersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • total_user_sharesint

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesint

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_python3_shares_users(id: int, user_ids: List[int], permission_level: str, *, share_email_body: str = None, send_shared_email: bool = None)

Set the permissions users have on this object

Parameters:
idint

The ID of the resource that is shared.

user_idsList[int]

An array of one or more user IDs.

permission_levelstr

Options are: “read”, “write”, or “manage”.

share_email_bodystr, optional

Custom body text for e-mail sent on a share.

send_shared_emailbool, optional

Send email to the recipients of a share.

Returns:
civis.response.Response
  • readersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • writersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • ownersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • total_user_sharesint

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesint

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_python3_transfer(id: int, user_id: int, include_dependencies: bool, *, email_body: str = None, send_email: bool = None)

Transfer ownership of this object to another user

Parameters:
idint

The ID of the resource that is shared.

user_idint

ID of target user

include_dependenciesbool

Whether or not to give manage permissions on all dependencies

email_bodystr, optional

Custom body text for e-mail sent on transfer.

send_emailbool, optional

Send email to the target user of the transfer?

Returns:
civis.response.Response
  • dependenciesList[dict]

    Dependent objects for this object

    • object_typestr

      Dependent object type

    • fco_typestr

      Human readable dependent object type

    • idint

      Dependent object ID

    • namestr

      Dependent object name, or nil if the requesting user cannot read this object

    • permission_levelstr

      Permission level of target user (not user’s groups) for dependent object. Null if no target user or not shareable (e.g. a database table).

    • descriptionstr

      Additional information about the dependency, if relevant

    • sharedbool

      Whether dependent object was successfully shared with target user

put_r(id: int, name: str, source: str, *, parent_id: int = None, user_context: str = None, params: List[dict] = None, arguments: dict = None, schedule: dict = None, notifications: dict = None, next_run_at: str = None, time_zone: str = None, target_project_id: int = None, required_resources: dict = None, instance_type: str = None, cancel_timeout: int = None, docker_image_tag: str = None, partition_label: str = None, running_as_id: int = None)

Replace all attributes of this R Script

Parameters:
idint

The ID for the script.

namestr

The name of the script.

sourcestr

The body/text of the script.

parent_idint, optional

The ID of the parent job that will trigger this script

user_contextstr, optional

“runner” or “author”, who to execute the script as when run as a template.

paramsList[dict], optional

A definition of the parameters this script accepts in the arguments field.

  • namestr

    The variable’s name as used within your code.

  • labelstr

    The label to present to users when asking them for the value.

  • descriptionstr

    A short sentence or fragment describing this parameter to the end user.

  • typestr

    The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

  • requiredbool

    Whether this param is required.

  • valuestr

    The value you would like to set this param to. Setting this value makes this parameter a fixed param.

  • defaultstr

    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.

  • allowed_valuesList[dict]

    The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

argumentsdict, optional

Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

scheduledict, optional
  • scheduledbool

    If the item is scheduled.

  • scheduled_daysList[int]

    Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

  • scheduled_hoursList[int]

    Hours of the day it is scheduled on.

  • scheduled_minutesList[int]

    Minutes of the day it is scheduled on.

  • scheduled_runs_per_hourint

    Deprecated in favor of scheduled minutes.

  • scheduled_days_of_monthList[int]

    Days of the month it is scheduled on, mutually exclusive with scheduledDays.

notificationsdict, optional
  • urlsList[str]

    URLs to receive a POST request at job completion

  • success_email_subjectstr

    Custom subject line for success e-mail.

  • success_email_bodystr

    Custom body text for success e-mail, written in Markdown.

  • success_email_addressesList[str]

    Addresses to notify by e-mail when the job completes successfully.

  • success_email_from_namestr

    Name from which success emails are sent; defaults to “Civis.”

  • success_email_reply_tostr

    Address for replies to success emails; defaults to the author of the job.

  • failure_email_addressesList[str]

    Addresses to notify by e-mail when the job fails.

  • stall_warning_minutesint

    Stall warning emails will be sent after this amount of minutes.

  • success_onbool

    If success email notifications are on. Defaults to user’s preferences.

  • failure_onbool

    If failure email notifications are on. Defaults to user’s preferences.

next_run_atstr (time), optional

The time of the next scheduled run.

time_zonestr, optional

The time zone of this script.

target_project_idint, optional

Target project to which script outputs will be added.

required_resourcesdict, optional
  • cpuint

    The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.

  • memoryint

    The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.

  • disk_spacefloat (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.

instance_typestr, optional

The EC2 instance type to deploy to. Only available for jobs running on kubernetes.

cancel_timeoutint, optional

The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.

docker_image_tagstr, optional

The tag of the docker image to pull from DockerHub.

partition_labelstr, optional

The partition label used to run this object.

running_as_idint, optional

The ID of the runner of this script.

Returns:
civis.response.Response
  • idint

    The ID for the script.

  • namestr

    The name of the script.

  • typestr

    The type of the script (e.g SQL, Container, Python, R, JavaScript, dbt)

  • created_atstr (time)

    The time this script was created.

  • updated_atstr (time)

    The time the script was last updated.

  • authordict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • statestr

    The status of the script’s last run.

  • finished_atstr (time)

    The time that the script’s last run finished.

  • categorystr

    The category of the script.

  • projectsList[dict]

    A list of projects containing the script.

    • idint

      The ID for the project.

    • namestr

      The name of the project.

  • parent_idint

    The ID of the parent job that will trigger this script

  • user_contextstr

    “runner” or “author”, who to execute the script as when run as a template.

  • paramsList[dict]

    A definition of the parameters this script accepts in the arguments field.

    • namestr

      The variable’s name as used within your code.

    • labelstr

      The label to present to users when asking them for the value.

    • descriptionstr

      A short sentence or fragment describing this parameter to the end user.

    • typestr

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredbool

      Whether this param is required.

    • valuestr

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstr

      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.

    • allowed_valuesList[dict]

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templatebool

    Whether others scripts use this one as a template.

  • published_as_template_idint

    The ID of the template that this script is backing.

  • from_template_idint

    The ID of the template this script uses, if any.

  • template_dependents_countint

    How many other scripts use this one as a template.

  • template_script_namestr

    The name of the template script.

  • linksdict
    • detailsstr

      The details link to get more information about the script.

    • runsstr

      The runs link to get the run information list for this script.

  • scheduledict
    • scheduledbool

      If the item is scheduled.

    • scheduled_daysList[int]

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hoursList[int]

      Hours of the day it is scheduled on.

    • scheduled_minutesList[int]

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourint

      Deprecated in favor of scheduled minutes.

    • scheduled_days_of_monthList[int]

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict
    • urlsList[str]

      URLs to receive a POST request at job completion

    • success_email_subjectstr

      Custom subject line for success e-mail.

    • success_email_bodystr

      Custom body text for success e-mail, written in Markdown.

    • success_email_addressesList[str]

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestr

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostr

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addressesList[str]

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesint

      Stall warning emails will be sent after this amount of minutes.

    • success_onbool

      If success email notifications are on. Defaults to user’s preferences.

    • failure_onbool

      If failure email notifications are on. Defaults to user’s preferences.

  • running_asdict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • next_run_atstr (time)

    The time of the next scheduled run.

  • time_zonestr

    The time zone of this script.

  • last_rundict
    • id : int

    • state : str

    • created_atstr (time)

      The time that the run was queued.

    • started_atstr (time)

      The time that the run started.

    • finished_atstr (time)

      The time that the run completed.

    • errorstr

      The error message for this run, if present.

  • my_permission_levelstr

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenbool

    The hidden status of the item.

  • target_project_idint

    Target project to which script outputs will be added.

  • archivedstr

    The archival status of the requested item(s).

  • required_resourcesdict
    • cpuint

      The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.

    • memoryint

      The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.

    • disk_spacefloat (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.

  • instance_typestr

    The EC2 instance type to deploy to. Only available for jobs running on kubernetes.

  • sourcestr

    The body/text of the script.

  • cancel_timeoutint

    The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.

  • docker_image_tagstr

    The tag of the docker image to pull from DockerHub.

  • partition_labelstr

    The partition label used to run this object.

  • running_as_idint

    The ID of the runner of this script.

put_r_archive(id: int, status: bool)

Update the archive status of this object

Parameters:
idint

The ID of the object.

statusbool

The desired archived status of the object.

Returns:
civis.response.Response
  • idint

    The ID for the script.

  • namestr

    The name of the script.

  • typestr

    The type of the script (e.g SQL, Container, Python, R, JavaScript, dbt)

  • created_atstr (time)

    The time this script was created.

  • updated_atstr (time)

    The time the script was last updated.

  • authordict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • statestr

    The status of the script’s last run.

  • finished_atstr (time)

    The time that the script’s last run finished.

  • categorystr

    The category of the script.

  • projectsList[dict]

    A list of projects containing the script.

    • idint

      The ID for the project.

    • namestr

      The name of the project.

  • parent_idint

    The ID of the parent job that will trigger this script

  • user_contextstr

    “runner” or “author”, who to execute the script as when run as a template.

  • paramsList[dict]

    A definition of the parameters this script accepts in the arguments field.

    • namestr

      The variable’s name as used within your code.

    • labelstr

      The label to present to users when asking them for the value.

    • descriptionstr

      A short sentence or fragment describing this parameter to the end user.

    • typestr

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredbool

      Whether this param is required.

    • valuestr

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstr

      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.

    • allowed_valuesList[dict]

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templatebool

    Whether others scripts use this one as a template.

  • published_as_template_idint

    The ID of the template that this script is backing.

  • from_template_idint

    The ID of the template this script uses, if any.

  • template_dependents_countint

    How many other scripts use this one as a template.

  • template_script_namestr

    The name of the template script.

  • linksdict
    • detailsstr

      The details link to get more information about the script.

    • runsstr

      The runs link to get the run information list for this script.

  • scheduledict
    • scheduledbool

      If the item is scheduled.

    • scheduled_daysList[int]

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hoursList[int]

      Hours of the day it is scheduled on.

    • scheduled_minutesList[int]

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourint

      Deprecated in favor of scheduled minutes.

    • scheduled_days_of_monthList[int]

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict
    • urlsList[str]

      URLs to receive a POST request at job completion

    • success_email_subjectstr

      Custom subject line for success e-mail.

    • success_email_bodystr

      Custom body text for success e-mail, written in Markdown.

    • success_email_addressesList[str]

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestr

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostr

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addressesList[str]

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesint

      Stall warning emails will be sent after this amount of minutes.

    • success_onbool

      If success email notifications are on. Defaults to user’s preferences.

    • failure_onbool

      If failure email notifications are on. Defaults to user’s preferences.

  • running_asdict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • next_run_atstr (time)

    The time of the next scheduled run.

  • time_zonestr

    The time zone of this script.

  • last_rundict
    • id : int

    • state : str

    • created_atstr (time)

      The time that the run was queued.

    • started_atstr (time)

      The time that the run started.

    • finished_atstr (time)

      The time that the run completed.

    • errorstr

      The error message for this run, if present.

  • my_permission_levelstr

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenbool

    The hidden status of the item.

  • target_project_idint

    Target project to which script outputs will be added.

  • archivedstr

    The archival status of the requested item(s).

  • required_resourcesdict
    • cpuint

      The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.

    • memoryint

      The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.

    • disk_spacefloat (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.

  • instance_typestr

    The EC2 instance type to deploy to. Only available for jobs running on kubernetes.

  • sourcestr

    The body/text of the script.

  • cancel_timeoutint

    The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.

  • docker_image_tagstr

    The tag of the docker image to pull from DockerHub.

  • partition_labelstr

    The partition label used to run this object.

  • running_as_idint

    The ID of the runner of this script.

put_r_git(id: int, *, git_ref: str = None, git_branch: str = None, git_path: str = None, git_repo_url: str = None, git_ref_type: str = None, pull_from_git: bool = None)

Attach an item to a file in a git repo

Parameters:
idint

The ID of the file.

git_refstr, optional

A git reference specifying an unambiguous version of the file. Can be a branch name, or the full or shortened SHA of a commit.

git_branchstr, optional

The git branch that the file is on.

git_pathstr, optional

The path of the file in the repository.

git_repo_urlstr, optional

The URL of the git repository.

git_ref_typestr, optional

Specifies if the file is versioned by branch or tag.

pull_from_gitbool, optional

Automatically pull latest commit from git. Only works for scripts.

Returns:
civis.response.Response
  • git_refstr

    A git reference specifying an unambiguous version of the file. Can be a branch name, tag or the full or shortened SHA of a commit.

  • git_branchstr

    The git branch that the file is on.

  • git_pathstr

    The path of the file in the repository.

  • git_repodict
    • idint

      The ID for this git repository.

    • repo_urlstr

      The URL for this git repository.

    • created_at : str (time)

    • updated_at : str (time)

  • git_ref_typestr

    Specifies if the file is versioned by branch or tag.

  • pull_from_gitbool

    Automatically pull latest commit from git. Only works for scripts and workflows (assuming you have the feature enabled)

put_r_projects(id: int, project_id: int)

Add an R Script to a project

Parameters:
idint

The ID of the R Script.

project_idint

The ID of the project.

Returns:
None

Response code 204: success

put_r_shares_groups(id: int, group_ids: List[int], permission_level: str, *, share_email_body: str = None, send_shared_email: bool = None)

Set the permissions groups has on this object

Parameters:
idint

The ID of the resource that is shared.

group_idsList[int]

An array of one or more group IDs.

permission_levelstr

Options are: “read”, “write”, or “manage”.

share_email_bodystr, optional

Custom body text for e-mail sent on a share.

send_shared_emailbool, optional

Send email to the recipients of a share.

Returns:
civis.response.Response
  • readersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • writersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • ownersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • total_user_sharesint

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesint

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_r_shares_users(id: int, user_ids: List[int], permission_level: str, *, share_email_body: str = None, send_shared_email: bool = None)

Set the permissions users have on this object

Parameters:
idint

The ID of the resource that is shared.

user_idsList[int]

An array of one or more user IDs.

permission_levelstr

Options are: “read”, “write”, or “manage”.

share_email_bodystr, optional

Custom body text for e-mail sent on a share.

send_shared_emailbool, optional

Send email to the recipients of a share.

Returns:
civis.response.Response
  • readersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • writersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • ownersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • total_user_sharesint

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesint

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_r_transfer(id: int, user_id: int, include_dependencies: bool, *, email_body: str = None, send_email: bool = None)

Transfer ownership of this object to another user

Parameters:
idint

The ID of the resource that is shared.

user_idint

ID of target user

include_dependenciesbool

Whether or not to give manage permissions on all dependencies

email_bodystr, optional

Custom body text for e-mail sent on transfer.

send_emailbool, optional

Send email to the target user of the transfer?

Returns:
civis.response.Response
  • dependenciesList[dict]

    Dependent objects for this object

    • object_typestr

      Dependent object type

    • fco_typestr

      Human readable dependent object type

    • idint

      Dependent object ID

    • namestr

      Dependent object name, or nil if the requesting user cannot read this object

    • permission_levelstr

      Permission level of target user (not user’s groups) for dependent object. Null if no target user or not shareable (e.g. a database table).

    • descriptionstr

      Additional information about the dependency, if relevant

    • sharedbool

      Whether dependent object was successfully shared with target user

put_sql(id: int, name: str, sql: str, remote_host_id: int, credential_id: int, *, parent_id: int = None, user_context: str = None, params: List[dict] = None, arguments: dict = None, schedule: dict = None, notifications: dict = None, next_run_at: str = None, time_zone: str = None, target_project_id: int = None, csv_settings: dict = None, running_as_id: int = None)

Replace all attributes of this SQL Script

Parameters:
idint

The ID for the script.

namestr

The name of the script.

sqlstr

The raw SQL query for the script.

remote_host_idint

The remote host ID that this script will connect to.

credential_idint

The credential that this script will use.

parent_idint, optional

The ID of the parent job that will trigger this script

user_contextstr, optional

“runner” or “author”, who to execute the script as when run as a template.

paramsList[dict], optional

A definition of the parameters this script accepts in the arguments field.

  • namestr

    The variable’s name as used within your code.

  • labelstr

    The label to present to users when asking them for the value.

  • descriptionstr

    A short sentence or fragment describing this parameter to the end user.

  • typestr

    The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

  • requiredbool

    Whether this param is required.

  • valuestr

    The value you would like to set this param to. Setting this value makes this parameter a fixed param.

  • defaultstr

    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.

  • allowed_valuesList[dict]

    The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

argumentsdict, optional

Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

scheduledict, optional
  • scheduledbool

    If the item is scheduled.

  • scheduled_daysList[int]

    Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

  • scheduled_hoursList[int]

    Hours of the day it is scheduled on.

  • scheduled_minutesList[int]

    Minutes of the day it is scheduled on.

  • scheduled_runs_per_hourint

    Deprecated in favor of scheduled minutes.

  • scheduled_days_of_monthList[int]

    Days of the month it is scheduled on, mutually exclusive with scheduledDays.

notificationsdict, optional
  • urlsList[str]

    URLs to receive a POST request at job completion

  • success_email_subjectstr

    Custom subject line for success e-mail.

  • success_email_bodystr

    Custom body text for success e-mail, written in Markdown.

  • success_email_addressesList[str]

    Addresses to notify by e-mail when the job completes successfully.

  • success_email_from_namestr

    Name from which success emails are sent; defaults to “Civis.”

  • success_email_reply_tostr

    Address for replies to success emails; defaults to the author of the job.

  • failure_email_addressesList[str]

    Addresses to notify by e-mail when the job fails.

  • stall_warning_minutesint

    Stall warning emails will be sent after this amount of minutes.

  • success_onbool

    If success email notifications are on. Defaults to user’s preferences.

  • failure_onbool

    If failure email notifications are on. Defaults to user’s preferences.

next_run_atstr (time), optional

The time of the next scheduled run.

time_zonestr, optional

The time zone of this script.

target_project_idint, optional

Target project to which script outputs will be added.

csv_settingsdict, optional
  • include_headerbool

    Whether or not to include headers in the output data. Default: true

  • compressionstr

    The type of compression to use, if any, one of “none”, “zip”, or “gzip”. Default: gzip

  • column_delimiterstr

    Which delimiter to use, one of “comma”, “tab”, or “pipe”. Default: comma

  • unquotedbool

    Whether or not to quote fields. Default: false

  • force_multifilebool

    Whether or not the csv should be split into multiple files. Default: false

  • filename_prefixstr

    A user specified filename prefix for the output file to have. Default: null

  • max_file_sizeint

    The max file size, in MB, created files will be. Only available when force_multifile is true.

running_as_idint, optional

The ID of the runner of this script.

Returns:
civis.response.Response
  • idint

    The ID for the script.

  • namestr

    The name of the script.

  • typestr

    The type of the script (e.g SQL, Container, Python, R, JavaScript, dbt)

  • created_atstr (time)

    The time this script was created.

  • updated_atstr (time)

    The time the script was last updated.

  • authordict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • statestr

    The status of the script’s last run.

  • finished_atstr (time)

    The time that the script’s last run finished.

  • categorystr

    The category of the script.

  • projectsList[dict]

    A list of projects containing the script.

    • idint

      The ID for the project.

    • namestr

      The name of the project.

  • parent_idint

    The ID of the parent job that will trigger this script

  • user_contextstr

    “runner” or “author”, who to execute the script as when run as a template.

  • paramsList[dict]

    A definition of the parameters this script accepts in the arguments field.

    • namestr

      The variable’s name as used within your code.

    • labelstr

      The label to present to users when asking them for the value.

    • descriptionstr

      A short sentence or fragment describing this parameter to the end user.

    • typestr

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredbool

      Whether this param is required.

    • valuestr

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstr

      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.

    • allowed_valuesList[dict]

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templatebool

    Whether others scripts use this one as a template.

  • published_as_template_idint

    The ID of the template that this script is backing.

  • from_template_idint

    The ID of the template this script uses, if any.

  • template_dependents_countint

    How many other scripts use this one as a template.

  • template_script_namestr

    The name of the template script.

  • linksdict
    • detailsstr

      The details link to get more information about the script.

    • runsstr

      The runs link to get the run information list for this script.

  • scheduledict
    • scheduledbool

      If the item is scheduled.

    • scheduled_daysList[int]

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hoursList[int]

      Hours of the day it is scheduled on.

    • scheduled_minutesList[int]

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourint

      Deprecated in favor of scheduled minutes.

    • scheduled_days_of_monthList[int]

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict
    • urlsList[str]

      URLs to receive a POST request at job completion

    • success_email_subjectstr

      Custom subject line for success e-mail.

    • success_email_bodystr

      Custom body text for success e-mail, written in Markdown.

    • success_email_addressesList[str]

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestr

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostr

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addressesList[str]

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesint

      Stall warning emails will be sent after this amount of minutes.

    • success_onbool

      If success email notifications are on. Defaults to user’s preferences.

    • failure_onbool

      If failure email notifications are on. Defaults to user’s preferences.

  • running_asdict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • next_run_atstr (time)

    The time of the next scheduled run.

  • time_zonestr

    The time zone of this script.

  • last_rundict
    • id : int

    • state : str

    • created_atstr (time)

      The time that the run was queued.

    • started_atstr (time)

      The time that the run started.

    • finished_atstr (time)

      The time that the run completed.

    • errorstr

      The error message for this run, if present.

  • my_permission_levelstr

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenbool

    The hidden status of the item.

  • target_project_idint

    Target project to which script outputs will be added.

  • archivedstr

    The archival status of the requested item(s).

  • sqlstr

    The raw SQL query for the script.

  • expanded_argumentsdict

    Expanded arguments for use in injecting into different environments.

  • remote_host_idint

    The remote host ID that this script will connect to.

  • credential_idint

    The credential that this script will use.

  • code_previewstr

    The code that this script will run with arguments inserted.

  • csv_settingsdict
    • include_headerbool

      Whether or not to include headers in the output data. Default: true

    • compressionstr

      The type of compression to use, if any, one of “none”, “zip”, or “gzip”. Default: gzip

    • column_delimiterstr

      Which delimiter to use, one of “comma”, “tab”, or “pipe”. Default: comma

    • unquotedbool

      Whether or not to quote fields. Default: false

    • force_multifilebool

      Whether or not the csv should be split into multiple files. Default: false

    • filename_prefixstr

      A user specified filename prefix for the output file to have. Default: null

    • max_file_sizeint

      The max file size, in MB, created files will be. Only available when force_multifile is true.

  • running_as_idint

    The ID of the runner of this script.

put_sql_archive(id: int, status: bool)

Update the archive status of this object

Parameters:
idint

The ID of the object.

statusbool

The desired archived status of the object.

Returns:
civis.response.Response
  • idint

    The ID for the script.

  • namestr

    The name of the script.

  • typestr

    The type of the script (e.g SQL, Container, Python, R, JavaScript, dbt)

  • created_atstr (time)

    The time this script was created.

  • updated_atstr (time)

    The time the script was last updated.

  • authordict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • statestr

    The status of the script’s last run.

  • finished_atstr (time)

    The time that the script’s last run finished.

  • categorystr

    The category of the script.

  • projectsList[dict]

    A list of projects containing the script.

    • idint

      The ID for the project.

    • namestr

      The name of the project.

  • parent_idint

    The ID of the parent job that will trigger this script

  • user_contextstr

    “runner” or “author”, who to execute the script as when run as a template.

  • paramsList[dict]

    A definition of the parameters this script accepts in the arguments field.

    • namestr

      The variable’s name as used within your code.

    • labelstr

      The label to present to users when asking them for the value.

    • descriptionstr

      A short sentence or fragment describing this parameter to the end user.

    • typestr

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredbool

      Whether this param is required.

    • valuestr

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstr

      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.

    • allowed_valuesList[dict]

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templatebool

    Whether others scripts use this one as a template.

  • published_as_template_idint

    The ID of the template that this script is backing.

  • from_template_idint

    The ID of the template this script uses, if any.

  • template_dependents_countint

    How many other scripts use this one as a template.

  • template_script_namestr

    The name of the template script.

  • linksdict
    • detailsstr

      The details link to get more information about the script.

    • runsstr

      The runs link to get the run information list for this script.

  • scheduledict
    • scheduledbool

      If the item is scheduled.

    • scheduled_daysList[int]

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hoursList[int]

      Hours of the day it is scheduled on.

    • scheduled_minutesList[int]

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourint

      Deprecated in favor of scheduled minutes.

    • scheduled_days_of_monthList[int]

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict
    • urlsList[str]

      URLs to receive a POST request at job completion

    • success_email_subjectstr

      Custom subject line for success e-mail.

    • success_email_bodystr

      Custom body text for success e-mail, written in Markdown.

    • success_email_addressesList[str]

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestr

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostr

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addressesList[str]

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesint

      Stall warning emails will be sent after this amount of minutes.

    • success_onbool

      If success email notifications are on. Defaults to user’s preferences.

    • failure_onbool

      If failure email notifications are on. Defaults to user’s preferences.

  • running_asdict
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • next_run_atstr (time)

    The time of the next scheduled run.

  • time_zonestr

    The time zone of this script.

  • last_rundict
    • id : int

    • state : str

    • created_atstr (time)

      The time that the run was queued.

    • started_atstr (time)

      The time that the run started.

    • finished_atstr (time)

      The time that the run completed.

    • errorstr

      The error message for this run, if present.

  • my_permission_levelstr

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenbool

    The hidden status of the item.

  • target_project_idint

    Target project to which script outputs will be added.

  • archivedstr

    The archival status of the requested item(s).

  • sqlstr

    The raw SQL query for the script.

  • expanded_argumentsdict

    Expanded arguments for use in injecting into different environments.

  • remote_host_idint

    The remote host ID that this script will connect to.

  • credential_idint

    The credential that this script will use.

  • code_previewstr

    The code that this script will run with arguments inserted.

  • csv_settingsdict
    • include_headerbool

      Whether or not to include headers in the output data. Default: true

    • compressionstr

      The type of compression to use, if any, one of “none”, “zip”, or “gzip”. Default: gzip

    • column_delimiterstr

      Which delimiter to use, one of “comma”, “tab”, or “pipe”. Default: comma

    • unquotedbool

      Whether or not to quote fields. Default: false

    • force_multifilebool

      Whether or not the csv should be split into multiple files. Default: false

    • filename_prefixstr

      A user specified filename prefix for the output file to have. Default: null

    • max_file_sizeint

      The max file size, in MB, created files will be. Only available when force_multifile is true.

  • running_as_idint

    The ID of the runner of this script.

put_sql_git(id: int, *, git_ref: str = None, git_branch: str = None, git_path: str = None, git_repo_url: str = None, git_ref_type: str = None, pull_from_git: bool = None)

Attach an item to a file in a git repo

Parameters:
idint

The ID of the file.

git_refstr, optional

A git reference specifying an unambiguous version of the file. Can be a branch name, or the full or shortened SHA of a commit.

git_branchstr, optional

The git branch that the file is on.

git_pathstr, optional

The path of the file in the repository.

git_repo_urlstr, optional

The URL of the git repository.

git_ref_typestr, optional

Specifies if the file is versioned by branch or tag.

pull_from_gitbool, optional

Automatically pull latest commit from git. Only works for scripts.

Returns:
civis.response.Response
  • git_refstr

    A git reference specifying an unambiguous version of the file. Can be a branch name, tag or the full or shortened SHA of a commit.

  • git_branchstr

    The git branch that the file is on.

  • git_pathstr

    The path of the file in the repository.

  • git_repodict
    • idint

      The ID for this git repository.

    • repo_urlstr

      The URL for this git repository.

    • created_at : str (time)

    • updated_at : str (time)

  • git_ref_typestr

    Specifies if the file is versioned by branch or tag.

  • pull_from_gitbool

    Automatically pull latest commit from git. Only works for scripts and workflows (assuming you have the feature enabled)

put_sql_projects(id: int, project_id: int)

Add a SQL Script to a project

Parameters:
idint

The ID of the SQL Script.

project_idint

The ID of the project.

Returns:
None

Response code 204: success

put_sql_shares_groups(id: int, group_ids: List[int], permission_level: str, *, share_email_body: str = None, send_shared_email: bool = None)

Set the permissions groups has on this object

Parameters:
idint

The ID of the resource that is shared.

group_idsList[int]

An array of one or more group IDs.

permission_levelstr

Options are: “read”, “write”, or “manage”.

share_email_bodystr, optional

Custom body text for e-mail sent on a share.

send_shared_emailbool, optional

Send email to the recipients of a share.

Returns:
civis.response.Response
  • readersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • writersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • ownersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • total_user_sharesint

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesint

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_sql_shares_users(id: int, user_ids: List[int], permission_level: str, *, share_email_body: str = None, send_shared_email: bool = None)

Set the permissions users have on this object

Parameters:
idint

The ID of the resource that is shared.

user_idsList[int]

An array of one or more user IDs.

permission_levelstr

Options are: “read”, “write”, or “manage”.

share_email_bodystr, optional

Custom body text for e-mail sent on a share.

send_shared_emailbool, optional

Send email to the recipients of a share.

Returns:
civis.response.Response
  • readersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • writersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • ownersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • total_user_sharesint

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesint

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_sql_transfer(id: int, user_id: int, include_dependencies: bool, *, email_body: str = None, send_email: bool = None)

Transfer ownership of this object to another user

Parameters:
idint

The ID of the resource that is shared.

user_idint

ID of target user

include_dependenciesbool

Whether or not to give manage permissions on all dependencies

email_bodystr, optional

Custom body text for e-mail sent on transfer.

send_emailbool, optional

Send email to the target user of the transfer?

Returns:
civis.response.Response
  • dependenciesList[dict]

    Dependent objects for this object

    • object_typestr

      Dependent object type

    • fco_typestr

      Human readable dependent object type

    • idint

      Dependent object ID

    • namestr

      Dependent object name, or nil if the requesting user cannot read this object

    • permission_levelstr

      Permission level of target user (not user’s groups) for dependent object. Null if no target user or not shareable (e.g. a database table).

    • descriptionstr

      Additional information about the dependency, if relevant

    • sharedbool

      Whether dependent object was successfully shared with target user