Title: | R Client for the 'Civis Platform API' |
---|---|
Description: | A convenient interface for making requests directly to the 'Civis Platform API' <https://www.civisanalytics.com/platform/>. Full documentation available 'here' <https://civisanalytics.github.io/civis-r/>. |
Authors: | Patrick Miller [cre, aut], Keith Ingersoll [aut], Bill Lattner [ctb], Anh Le [ctb], Michelangelo D'Agostino [ctb], Sam Weiss [ctb], Stephen Hoover [ctb], Danning Chen [ctb], Elizabeth Sander [ctb], Madison Hobbs [ctb], Anna Bladey [ctb], Sahil Shah [ctb] |
Maintainer: | Patrick Miller <[email protected]> |
License: | BSD_3_clause + file LICENSE |
Version: | 3.0.0 |
Built: | 2024-11-12 05:42:18 UTC |
Source: | https://github.com/civisanalytics/civis-r |
Delete an announcement
admin_delete_announcements(id)
admin_delete_announcements(id)
id |
integer required. The ID of this announcement |
An empty HTTP response
Get a particular announcement
admin_get_announcements(id)
admin_get_announcements(id)
id |
integer required. The ID of this announcement |
A list containing the following elements:
id |
integer, The ID of this announcement |
subject |
string, The subject of this announcement. |
body |
string, The body of this announcement. |
releasedAt |
string, The date and time this announcement was released. |
createdAt |
string, |
updatedAt |
string, |
List announcements
admin_list_announcements( limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
admin_list_announcements( limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
limit |
integer optional. Number of results to return. Defaults to 10. Maximum allowed is 50. |
page_num |
integer optional. Page number of the results to return. Defaults to the first page, 1. |
order |
string optional. The field on which to order the result set. Defaults to released_at. Must be one of: released_at. |
order_dir |
string optional. Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc. |
An array containing the following fields:
id |
integer, The ID of this announcement |
subject |
string, The subject of this announcement. |
body |
string, The body of this announcement. |
releasedAt |
string, The date and time this announcement was released. |
createdAt |
string, |
updatedAt |
string, |
List organizations
admin_list_organizations(status = NULL, org_type = NULL)
admin_list_organizations(status = NULL, org_type = NULL)
status |
array optional. The status of the organization (active/trial/inactive). |
org_type |
array optional. The organization type (platform/ads/survey_vendor/other). |
An array containing the following fields:
id |
integer, The ID of this organization. |
name |
string, The name of this organization. |
slug |
string, The slug of this organization. |
accountManagerId |
integer, The user ID of the Account Manager. |
csSpecialistId |
integer, The user ID of the Client Success Specialist. |
status |
string, The status of the organization (active/trial/inactive). |
orgType |
string, The organization type (platform/ads/survey_vendor/other). |
customBranding |
string, The custom branding settings. |
contractSize |
integer, The monthly contract size. |
maxAnalystUsers |
integer, The max number of full platform users for the org. |
maxReportUsers |
integer, The max number of report-only platform users for the org. |
vertical |
string, The business vertical that the organization belongs to. |
csMetadata |
string, Additional metadata about the organization in JSON format. |
removeFooterInEmails |
boolean, If true, emails sent by platform will not include Civis text. |
salesforceAccountId |
string, The SalesForce Account ID for this organization. |
advancedSettings |
list, A list containing the following elements:
|
tableauRefreshHistory |
array, The number of tableau refreshes used this month. |
Edit an announcement
admin_patch_announcements(id, subject = NULL, body = NULL, released_at = NULL)
admin_patch_announcements(id, subject = NULL, body = NULL, released_at = NULL)
id |
integer required. The ID of this announcement |
subject |
string optional. The subject of this announcement. |
body |
string optional. The body of this announcement. |
released_at |
string optional. The date and time this announcement was released. |
A list containing the following elements:
id |
integer, The ID of this announcement |
subject |
string, The subject of this announcement. |
body |
string, The body of this announcement. |
releasedAt |
string, The date and time this announcement was released. |
createdAt |
string, |
updatedAt |
string, |
Edit a theme
admin_patch_themes( id, name = NULL, organization_ids = NULL, settings_json = NULL, logo_file_id = NULL )
admin_patch_themes( id, name = NULL, organization_ids = NULL, settings_json = NULL, logo_file_id = NULL )
id |
integer required. The ID of this theme. |
name |
string optional. The name of this theme. |
organization_ids |
array optional. List of organization ID's allowed to see this theme. |
settings_json |
string optional. The JSON-encoded theme configuration. |
logo_file_id |
string optional. The ID of the logo image file. |
A list containing the following elements:
id |
integer, The ID of this theme. |
name |
string, The name of this theme. |
organizationIds |
array, List of organization ID's allowed to use this theme. |
settings |
string, The theme configuration object. |
logoFile |
list, A list containing the following elements:
|
createdAt |
string, |
updatedAt |
string, |
Post an announcement
admin_post_announcements(subject, body, released_at = NULL)
admin_post_announcements(subject, body, released_at = NULL)
subject |
string required. The subject of this announcement. |
body |
string required. The body of this announcement. |
released_at |
string optional. The date and time this announcement was released. |
A list containing the following elements:
id |
integer, The ID of this announcement |
subject |
string, The subject of this announcement. |
body |
string, The body of this announcement. |
releasedAt |
string, The date and time this announcement was released. |
createdAt |
string, |
updatedAt |
string, |
Create a theme
admin_post_themes( name, settings_json, organization_ids = NULL, logo_file_id = NULL )
admin_post_themes( name, settings_json, organization_ids = NULL, logo_file_id = NULL )
name |
string required. The name of this theme. |
settings_json |
string required. The JSON-encoded theme configuration. |
organization_ids |
array optional. List of organization ID's allowed to see this theme. |
logo_file_id |
string optional. The ID of the logo image file. |
A list containing the following elements:
id |
integer, The ID of this theme. |
name |
string, The name of this theme. |
organizationIds |
array, List of organization ID's allowed to use this theme. |
settings |
string, The theme configuration object. |
logoFile |
list, A list containing the following elements:
|
createdAt |
string, |
updatedAt |
string, |
Delete an alias
aliases_delete(id)
aliases_delete(id)
id |
integer required. The id of the Alias object. |
An empty HTTP response
Get an Alias
aliases_get(id)
aliases_get(id)
id |
integer required. |
A list containing the following elements:
id |
integer, The id of the Alias object. |
objectId |
integer, The id of the object |
objectType |
string, The type of the object. Valid types include: model, cass_ncoa, container_script, gdoc_export, geocode, media_optimizer, python_script, r_script, salesforce_export, javascript_script, sql_script, project, notebook, workflow, template_script, template_report, service, report, tableau and service_report. |
alias |
string, The alias of the object |
userId |
integer, The id of the user who created the alias |
displayName |
string, The display name of the Alias object. Defaults to object name if not provided. |
Get details about an alias within an FCO type
aliases_get_object_type(object_type, alias)
aliases_get_object_type(object_type, alias)
object_type |
string required. The type of the object. Valid types include: model, cass_ncoa, container_script, gdoc_export, geocode, media_optimizer, python_script, r_script, salesforce_export, javascript_script, sql_script, project, notebook, workflow, template_script, template_report, service, report, tableau and service_report. |
alias |
string required. The alias of the object |
A list containing the following elements:
id |
integer, The id of the Alias object. |
objectId |
integer, The id of the object |
objectType |
string, The type of the object. Valid types include: model, cass_ncoa, container_script, gdoc_export, geocode, media_optimizer, python_script, r_script, salesforce_export, javascript_script, sql_script, project, notebook, workflow, template_script, template_report, service, report, tableau and service_report. |
alias |
string, The alias of the object |
userId |
integer, The id of the user who created the alias |
displayName |
string, The display name of the Alias object. Defaults to object name if not provided. |
List Aliases
aliases_list( object_type = NULL, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
aliases_list( object_type = NULL, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
object_type |
string optional. Filter results by object type. Pass multiple object types with a comma-separatedlist. Valid types include: model, cass_ncoa, container_script, gdoc_export, geocode, media_optimizer, python_script, r_script, salesforce_export, javascript_script, sql_script, project, notebook, workflow, template_script, template_report, service, report, tableau and service_report. |
limit |
integer optional. Number of results to return. Defaults to 50. Maximum allowed is 1000. |
page_num |
integer optional. Page number of the results to return. Defaults to the first page, 1. |
order |
string optional. The field on which to order the result set. Defaults to id. Must be one of: id, object_type. |
order_dir |
string optional. Direction in which to sort, either asc (ascending) or desc (descending) defaulting to asc. |
An array containing the following fields:
id |
integer, The id of the Alias object. |
objectId |
integer, The id of the object |
objectType |
string, The type of the object. Valid types include: model, cass_ncoa, container_script, gdoc_export, geocode, media_optimizer, python_script, r_script, salesforce_export, javascript_script, sql_script, project, notebook, workflow, template_script, template_report, service, report, tableau and service_report. |
alias |
string, The alias of the object |
userId |
integer, The id of the user who created the alias |
displayName |
string, The display name of the Alias object. Defaults to object name if not provided. |
Update some attributes of this Alias
aliases_patch( id, object_id = NULL, object_type = NULL, alias = NULL, display_name = NULL )
aliases_patch( id, object_id = NULL, object_type = NULL, alias = NULL, display_name = NULL )
id |
integer required. The id of the Alias object. |
object_id |
integer optional. The id of the object |
object_type |
string optional. The type of the object. Valid types include: model, cass_ncoa, container_script, gdoc_export, geocode, media_optimizer, python_script, r_script, salesforce_export, javascript_script, sql_script, project, notebook, workflow, template_script, template_report, service, report, tableau and service_report. |
alias |
string optional. The alias of the object |
display_name |
string optional. The display name of the Alias object. Defaults to object name if not provided. |
A list containing the following elements:
id |
integer, The id of the Alias object. |
objectId |
integer, The id of the object |
objectType |
string, The type of the object. Valid types include: model, cass_ncoa, container_script, gdoc_export, geocode, media_optimizer, python_script, r_script, salesforce_export, javascript_script, sql_script, project, notebook, workflow, template_script, template_report, service, report, tableau and service_report. |
alias |
string, The alias of the object |
userId |
integer, The id of the user who created the alias |
displayName |
string, The display name of the Alias object. Defaults to object name if not provided. |
Create an Alias
aliases_post(object_id, object_type, alias, display_name = NULL)
aliases_post(object_id, object_type, alias, display_name = NULL)
object_id |
integer required. The id of the object |
object_type |
string required. The type of the object. Valid types include: model, cass_ncoa, container_script, gdoc_export, geocode, media_optimizer, python_script, r_script, salesforce_export, javascript_script, sql_script, project, notebook, workflow, template_script, template_report, service, report, tableau and service_report. |
alias |
string required. The alias of the object |
display_name |
string optional. The display name of the Alias object. Defaults to object name if not provided. |
A list containing the following elements:
id |
integer, The id of the Alias object. |
objectId |
integer, The id of the object |
objectType |
string, The type of the object. Valid types include: model, cass_ncoa, container_script, gdoc_export, geocode, media_optimizer, python_script, r_script, salesforce_export, javascript_script, sql_script, project, notebook, workflow, template_script, template_report, service, report, tableau and service_report. |
alias |
string, The alias of the object |
userId |
integer, The id of the user who created the alias |
displayName |
string, The display name of the Alias object. Defaults to object name if not provided. |
Replace all attributes of this Alias
aliases_put(id, object_id, object_type, alias, display_name = NULL)
aliases_put(id, object_id, object_type, alias, display_name = NULL)
id |
integer required. The id of the Alias object. |
object_id |
integer required. The id of the object |
object_type |
string required. The type of the object. Valid types include: model, cass_ncoa, container_script, gdoc_export, geocode, media_optimizer, python_script, r_script, salesforce_export, javascript_script, sql_script, project, notebook, workflow, template_script, template_report, service, report, tableau and service_report. |
alias |
string required. The alias of the object |
display_name |
string optional. The display name of the Alias object. Defaults to object name if not provided. |
A list containing the following elements:
id |
integer, The id of the Alias object. |
objectId |
integer, The id of the object |
objectType |
string, The type of the object. Valid types include: model, cass_ncoa, container_script, gdoc_export, geocode, media_optimizer, python_script, r_script, salesforce_export, javascript_script, sql_script, project, notebook, workflow, template_script, template_report, service, report, tableau and service_report. |
alias |
string, The alias of the object |
userId |
integer, The id of the user who created the alias |
displayName |
string, The display name of the Alias object. Defaults to object name if not provided. |
List announcements
announcements_list( limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
announcements_list( limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
limit |
integer optional. Number of results to return. Defaults to 10. Maximum allowed is 50. |
page_num |
integer optional. Page number of the results to return. Defaults to the first page, 1. |
order |
string optional. The field on which to order the result set. Defaults to released_at. Must be one of: released_at. |
order_dir |
string optional. Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc. |
An array containing the following fields:
id |
integer, The ID of this announcement |
subject |
string, The subject of this announcement. |
body |
string, The body of this announcement. |
releasedAt |
string, The date and time this announcement was released. |
createdAt |
string, |
updatedAt |
string, |
Remove an App Instance from a project
apps_delete_instances_projects(id, project_id, slug)
apps_delete_instances_projects(id, project_id, slug)
id |
integer required. The ID of the App Instance. |
project_id |
integer required. The ID of the project. |
slug |
string required. The slug for the application. |
An empty HTTP response
List details of a Decision Application
apps_get(slug)
apps_get(slug)
slug |
string required. The slug for the application. |
A list containing the following elements:
slug |
string, The slug for the application. |
id |
integer, The unique id of the application. |
instanceName |
string, A word that describes an instance of this app. |
name |
string, The name of the application. |
currentRelease |
list, A list containing the following elements:
|
features |
list, App features. |
Return a given app instance
apps_get_instances(id, slug)
apps_get_instances(id, slug)
id |
integer required. The unique id of the instance. |
slug |
string required. The slug for the application. |
A list containing the following elements:
id |
integer, The unique id of the instance. |
name |
string, The name of the instance. |
appReleaseId |
integer, The id of the app release the instance belongs to. |
reportId |
integer, The id of the report the instance belongs to. |
createdAt |
string, The time the instance was created at. |
user |
list, A list containing the following elements:
|
projectId |
integer, The id of the project collecting all the items that belong to this app instance. |
authCodeUrl |
string, |
apiKey |
string, A Civis API key that can be used by this app instance. |
archived |
string, The archival status of the requested item(s). |
Return a given app release
apps_get_releases(id, slug)
apps_get_releases(id, slug)
id |
integer required. The unique id of the release. |
slug |
string required. The slug for the application. |
A list containing the following elements:
id |
integer, The unique id of the release. |
appId |
integer, The id of the app the release belongs to. |
reportTemplateId |
integer, ID of the report template for this release. |
resources |
list, A hash of resources associated with this release. |
archived |
string, The archival status of the requested item(s). |
List apps
apps_list()
apps_list()
An array containing the following fields:
slug |
string, The slug for the application. |
id |
integer, The unique id of the application. |
instanceName |
string, A word that describes an instance of this app. |
name |
string, The name of the application. |
List the instances of a Decision Application
apps_list_instances( slug, archived = NULL, app_release_id = NULL, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
apps_list_instances( slug, archived = NULL, app_release_id = NULL, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
slug |
string required. The slug for the application. |
archived |
string optional. The archival status of the requested item(s). |
app_release_id |
integer optional. If supplied, return only instances matching this release. |
limit |
integer optional. Number of results to return. Defaults to its maximum of 50. |
page_num |
integer optional. Page number of the results to return. Defaults to the first page, 1. |
order |
string optional. The field on which to order the result set. Defaults to id. Must be one of: id, created_at. |
order_dir |
string optional. Direction in which to sort, either asc (ascending) or desc (descending) defaulting to asc. |
An array containing the following fields:
id |
integer, The unique id of the instance. |
name |
string, The name of the instance. |
appReleaseId |
integer, The id of the app release the instance belongs to. |
reportId |
integer, The id of the report the instance belongs to. |
createdAt |
string, The time the instance was created at. |
user |
list, A list containing the following elements:
|
projectId |
integer, The id of the project collecting all the items that belong to this app instance. |
archived |
string, The archival status of the requested item(s). |
List the projects an App Instance belongs to
apps_list_instances_projects(id, slug, hidden = NULL)
apps_list_instances_projects(id, slug, hidden = NULL)
id |
integer required. The ID of the App Instance. |
slug |
string required. The slug for the application. |
boolean optional. If specified to be true, returns hidden items. Defaults to false, returning non-hidden items. |
An array containing the following fields:
id |
integer, The ID for this project. |
author |
list, A list containing the following elements:
|
name |
string, The name of this project. |
description |
string, A description of the project. |
users |
array, An array containing the following fields:
|
autoShare |
boolean, |
createdAt |
string, |
updatedAt |
string, |
archived |
string, The archival status of the requested item(s). |
List the releases of a particular Decision Application
apps_list_releases( slug, archived = NULL, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
apps_list_releases( slug, archived = NULL, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
slug |
string required. The slug for the application. |
archived |
string optional. The archival status of the requested item(s). |
limit |
integer optional. Number of results to return. Defaults to its maximum of 50. |
page_num |
integer optional. Page number of the results to return. Defaults to the first page, 1. |
order |
string optional. The field on which to order the result set. Defaults to id. Must be one of: id. |
order_dir |
string optional. Direction in which to sort, either asc (ascending) or desc (descending) defaulting to asc. |
An array containing the following fields:
id |
integer, The unique id of the release. |
appId |
integer, The id of the app the release belongs to. |
reportTemplateId |
integer, ID of the report template for this release. |
resources |
list, A hash of resources associated with this release. |
archived |
string, The archival status of the requested item(s). |
Update a given app instance
apps_patch_instances(id, slug, name = NULL)
apps_patch_instances(id, slug, name = NULL)
id |
integer required. The unique id of the instance. |
slug |
string required. The slug for the application. |
name |
string optional. The name of the instance. |
A list containing the following elements:
id |
integer, The unique id of the instance. |
name |
string, The name of the instance. |
appReleaseId |
integer, The id of the app release the instance belongs to. |
reportId |
integer, The id of the report the instance belongs to. |
createdAt |
string, The time the instance was created at. |
user |
list, A list containing the following elements:
|
projectId |
integer, The id of the project collecting all the items that belong to this app instance. |
authCodeUrl |
string, |
apiKey |
string, A Civis API key that can be used by this app instance. |
archived |
string, The archival status of the requested item(s). |
Update an existing Decision Application release
apps_patch_releases(slug, id, report_template_id = NULL, resources = NULL)
apps_patch_releases(slug, id, report_template_id = NULL, resources = NULL)
slug |
string required. The slug for the application. |
id |
integer required. The unique id of the release. |
report_template_id |
integer optional. ID of the report template for this release. |
resources |
list optional. A hash of resources associated with this release. |
A list containing the following elements:
id |
integer, The unique id of the release. |
appId |
integer, The id of the app the release belongs to. |
reportTemplateId |
integer, ID of the report template for this release. |
resources |
list, A hash of resources associated with this release. |
archived |
string, The archival status of the requested item(s). |
Create a new instance of an application of the given slug
apps_post_instances(slug, name = NULL)
apps_post_instances(slug, name = NULL)
slug |
string required. The slug for the application. |
name |
string optional. The name of the instance. |
A list containing the following elements:
id |
integer, The unique id of the instance. |
name |
string, The name of the instance. |
appReleaseId |
integer, The id of the app release the instance belongs to. |
reportId |
integer, The id of the report the instance belongs to. |
createdAt |
string, The time the instance was created at. |
user |
list, A list containing the following elements:
|
projectId |
integer, The id of the project collecting all the items that belong to this app instance. |
authCodeUrl |
string, |
apiKey |
string, A Civis API key that can be used by this app instance. |
archived |
string, The archival status of the requested item(s). |
Create a new Decision Application release
apps_post_releases(slug, report_template_id, resources)
apps_post_releases(slug, report_template_id, resources)
slug |
string required. The slug for the application. |
report_template_id |
integer required. ID of the report template for this release. |
resources |
list required. A hash of resources associated with this release. |
A list containing the following elements:
id |
integer, The unique id of the release. |
appId |
integer, The id of the app the release belongs to. |
reportTemplateId |
integer, ID of the report template for this release. |
resources |
list, A hash of resources associated with this release. |
archived |
string, The archival status of the requested item(s). |
Update the Decision Application features for a given organization
apps_put_features(slug, org, features)
apps_put_features(slug, org, features)
slug |
string required. The slug for the application. |
org |
string required. Organization. |
features |
list required. App features. |
A list containing the following elements:
slug |
string, The slug for the application. |
id |
integer, The unique id of the application. |
instanceName |
string, A word that describes an instance of this app. |
name |
string, The name of the application. |
currentRelease |
list, A list containing the following elements:
|
features |
list, App features. |
Update the archive status of this object
apps_put_instances_archive(id, slug, status)
apps_put_instances_archive(id, slug, status)
id |
integer required. The ID of the object. |
slug |
string required. The slug for the application. |
status |
boolean required. The desired archived status of the object. |
A list containing the following elements:
id |
integer, The unique id of the instance. |
name |
string, The name of the instance. |
appReleaseId |
integer, The id of the app release the instance belongs to. |
reportId |
integer, The id of the report the instance belongs to. |
createdAt |
string, The time the instance was created at. |
user |
list, A list containing the following elements:
|
projectId |
integer, The id of the project collecting all the items that belong to this app instance. |
authCodeUrl |
string, |
apiKey |
string, A Civis API key that can be used by this app instance. |
archived |
string, The archival status of the requested item(s). |
Add an App Instance to a project
apps_put_instances_projects(id, project_id, slug)
apps_put_instances_projects(id, project_id, slug)
id |
integer required. The ID of the App Instance. |
project_id |
integer required. The ID of the project. |
slug |
string required. The slug for the application. |
An empty HTTP response
Update the archive status of this object
apps_put_releases_archive(id, slug, status)
apps_put_releases_archive(id, slug, status)
id |
integer required. The ID of the object. |
slug |
string required. The slug for the application. |
status |
boolean required. The desired archived status of the object. |
A list containing the following elements:
id |
integer, The unique id of the release. |
appId |
integer, The id of the app the release belongs to. |
reportTemplateId |
integer, ID of the report template for this release. |
resources |
list, A hash of resources associated with this release. |
archived |
string, The archival status of the requested item(s). |
await
repeatedly calls a Civis API endpoint such as scripts_get_sql_runs
that monitors the status of a script, job, import, or model. It blocks until the function
returns a result with a successful or error status.
If the script, job, import or model results in an error state,
await
throws an error with useful debugging information.
await_all
is a vectorized version of await
. It repeatedly calls a Civis API endpoint for
all values of a vector, e.g. a vector of script, job, import, run, or model ids. It blocks until
all calls have returned a result with a given status, and silently captures jobs that return
errors.
await( f, ..., .status_key = "state", .success_states = c("succeeded", "success"), .error_states = c("failed", "cancelled"), .timeout = NULL, .interval = getOption("civis.default_polling_interval"), .verbose = FALSE ) await_all( f, .x, .y = NULL, ..., .status_key = "state", .success_states = c("succeeded", "success"), .error_states = c("failed", "cancelled"), .timeout = NULL, .interval = NULL, .verbose = FALSE )
await( f, ..., .status_key = "state", .success_states = c("succeeded", "success"), .error_states = c("failed", "cancelled"), .timeout = NULL, .interval = getOption("civis.default_polling_interval"), .verbose = FALSE ) await_all( f, .x, .y = NULL, ..., .status_key = "state", .success_states = c("succeeded", "success"), .error_states = c("failed", "cancelled"), .timeout = NULL, .interval = NULL, .verbose = FALSE )
f |
function to be called repeatedly until a status is reached. |
... |
arguments to |
.status_key |
The name of the element of the list returned by |
.success_states |
list of states indicating remote work has completed successfully.
For most Civis API endpoints, this set of states is the default, |
.error_states |
list of states indicating remote work is in an error state. For most Civis
API endpoints, this set of states is the default, |
.timeout |
Number of seconds after which to timeout. |
.interval |
The interval for retries (in seconds). If |
.verbose |
Print the status of |
.x |
a vector of values to be passed to |
.y |
a vector of values to be passed to |
await
and await_all
can wrap Civis API endpoints in generated_client.R
.
The default values for .status_key
, .success_states
, and .error_states
are suitable for most endpoints. The final status of f
can be obtained using
get_status
.
If an error state is reached, await
throws a civis_await_error
.
await_all
silently captures and returns a civis_await_error
for any job
reaching an error state as an element in the list of results.
If .timeout
is specified and the job fails to reach a success state
within the time limit, await
throws a civis_timeout_error
.
Likewise, await_all
throws a civis_timeout_error
if all jobs fail to
reach a success state within the time limit.
These errors can be caught using try
or tryCatch
.
Useful debugging information can be returned using get_error
and fetch_logs
.
The set of possible states for jobs on Civis platform are:
"succeeded"
, "success"
, "failed"
, "queued"
, "running"
,
and "cancelled"
.
Unless .interval
is specified, retries are attempted with exponentially increasing intervals using
.25 * (1.2^i)) + runif(1, 0, .2)
, where i
is the index of the current retry.
Approximate intervals for a given number of retries are as follows:
1-5: .5s
6-10: 1-5s
11-19: 5-10s
20-29: 10s - 1m
The polling interval can be set to a fixed value globally with
options("civis.default_polling_interval" = INTERVAL_IN_SECONDS)
.
await_all
: Call a function repeatedly for all values of a vector until all have reached a completed status
get_status, get_error, fetch_logs
## Not run: # Executing a query q_id <- queries_post(db_id, query, n_rows, cred_id)[["id"]] r <- await(queries_get, id = q_id) get_status(r) r <- tryCatch(await(queries_get, id = q_id), error = function(e) e) get_error(r) r <- try(await(queries_get, id = q_id)) get_error(r) jobs <- c(1234, 5678) runs <- c(1234, 5678) rs <- await_all(scripts_get_r_runs, .x = jobs, .y = runs) ## End(Not run)
## Not run: # Executing a query q_id <- queries_post(db_id, query, n_rows, cred_id)[["id"]] r <- await(queries_get, id = q_id) get_status(r) r <- tryCatch(await(queries_get, id = q_id), error = function(e) e) get_error(r) r <- try(await(queries_get, id = q_id)) get_error(r) jobs <- c(1234, 5678) runs <- c(1234, 5678) rs <- await_all(scripts_get_r_runs, .x = jobs, .y = runs) ## End(Not run)
Cancel the evaluation of a CivisFuture.
cancel(future, ...)
cancel(future, ...)
future |
CivisFuture object. |
... |
unused for CivisFuture. |
Use civis_file
to use a file in the Civis Platform with
civis_ml.
civis_file(file_id)
civis_file(file_id)
file_id |
The id of a Civis file. |
A civis_file
.
Use civis_file_manifest
to use a manifest file in the Civis Platform
with civis_ml.
civis_file_manifest(file_id)
civis_file_manifest(file_id)
file_id |
The id of a Civis file. |
A civis_file_manifest
An interface for training and scoring data on Civis Platform using a set of Scikit-Learn estimators.
civis_ml( x, dependent_variable, model_type, primary_key = NULL, excluded_columns = NULL, parameters = NULL, fit_params = NULL, cross_validation_parameters = NULL, calibration = NULL, oos_scores_table = NULL, oos_scores_db = NULL, oos_scores_if_exists = c("fail", "append", "drop", "truncate"), model_name = NULL, cpu_requested = NULL, memory_requested = NULL, disk_requested = NULL, notifications = NULL, polling_interval = NULL, validation_data = c("train", "skip"), n_jobs = NULL, verbose = FALSE, civisml_version = "prod" ) civis_ml_fetch_existing(model_id, run_id = NULL) ## S3 method for class 'civis_ml' predict( object, newdata, primary_key = NA, output_table = NULL, output_db = NULL, if_output_exists = c("fail", "append", "drop", "truncate"), n_jobs = NULL, cpu_requested = NULL, memory_requested = NULL, disk_requested = NULL, polling_interval = NULL, verbose = FALSE, dvs_to_predict = NULL, ... )
civis_ml( x, dependent_variable, model_type, primary_key = NULL, excluded_columns = NULL, parameters = NULL, fit_params = NULL, cross_validation_parameters = NULL, calibration = NULL, oos_scores_table = NULL, oos_scores_db = NULL, oos_scores_if_exists = c("fail", "append", "drop", "truncate"), model_name = NULL, cpu_requested = NULL, memory_requested = NULL, disk_requested = NULL, notifications = NULL, polling_interval = NULL, validation_data = c("train", "skip"), n_jobs = NULL, verbose = FALSE, civisml_version = "prod" ) civis_ml_fetch_existing(model_id, run_id = NULL) ## S3 method for class 'civis_ml' predict( object, newdata, primary_key = NA, output_table = NULL, output_db = NULL, if_output_exists = c("fail", "append", "drop", "truncate"), n_jobs = NULL, cpu_requested = NULL, memory_requested = NULL, disk_requested = NULL, polling_interval = NULL, verbose = FALSE, dvs_to_predict = NULL, ... )
x , newdata
|
See the Data Sources section below. |
dependent_variable |
The dependent variable of the training dataset. For a multi-target problem, this should be a vector of column names of dependent variables. Nulls in a single dependent variable will automatically be dropped. |
model_type |
The name of the CivisML workflow. See the Workflows section below. |
primary_key |
Optional, the unique ID (primary key) of the training
dataset. This will be used to index the out-of-sample scores. In
|
excluded_columns |
Optional, a vector of columns which will be considered ineligible to be independent variables. |
parameters |
Optional, parameters for the final stage estimator in a
predefined model, e.g. |
fit_params |
Optional, a mapping from parameter names in the model's
|
cross_validation_parameters |
Optional, parameter grid for learner
parameters, e.g. |
calibration |
Optional, if not |
oos_scores_table |
Optional, if provided, store out-of-sample predictions on training set data to this Redshift "schema.tablename". |
oos_scores_db |
Optional, the name of the database where the
|
oos_scores_if_exists |
Optional, action to take if
|
model_name |
Optional, the prefix of the Platform modeling jobs.
It will have |
cpu_requested |
Optional, the number of CPU shares requested in the Civis Platform for training jobs or prediction child jobs. 1024 shares = 1 CPU. |
memory_requested |
Optional, the memory requested from Civis Platform for training jobs or prediction child jobs, in MiB. |
disk_requested |
Optional, the disk space requested on Civis Platform for training jobs or prediction child jobs, in GB. |
notifications |
Optional, model status notifications. See
|
polling_interval |
Check for job completion every this number of seconds. |
validation_data |
Optional, source for validation data. There are
currently two options: |
n_jobs |
Number of concurrent Platform jobs to use for training and
validation, or multi-file / large table prediction. Defaults to
|
verbose |
Optional, If |
civisml_version |
Optional, a one-length character vector of the CivisML version. The default is "prod", the latest version in production |
model_id |
The |
run_id |
Optional, the |
object |
A |
output_table |
The table in which to put predictions. |
output_db |
The database containing |
if_output_exists |
Action to take if the prediction table already exists. One of |
dvs_to_predict |
Optional, For scoring, this should be a vector of column
names of dependent variables to include in the output table. It must be a
subset of the |
... |
Unused |
A civis_ml
object, a list containing the following elements:
job |
job metadata from |
run |
run metadata from |
outputs |
CivisML metadata from |
metrics |
Parsed CivisML output from
|
model_info |
Parsed CivisML output from
|
You can use the following pre-defined models with civis_ml
. All models
start by imputing missing values with the mean of non-null values in a
column. The "sparse_*"
models include a LASSO regression step
(using glmnet
) to do feature selection before passing data to the
final model. In some models, CivisML uses default parameters from those in
Scikit-Learn, as indicated in the "Altered Defaults" column.
All models also have random_state=42
.
Specific workflows can also be called directly using the R workflow functions.
Name | R Workflow | Model Type | Algorithm | Altered Defaults |
sparse_logistic |
civis_ml_sparse_logistic |
classification | LogisticRegression | C=499999950, tol=1e-08 |
gradient_boosting_classifier |
civis_ml_gradient_boosting_classifier |
classification | GradientBoostingClassifier | n_estimators=500, max_depth=2 |
random_forest_classifier |
civis_ml_random_forest_classifier |
classification | RandomForestClassifier | n_estimators=500 |
extra_trees_classifier |
civis_ml_extra_trees_classifier |
classification | ExtraTreesClassifier | n_estimators=500 |
multilayer_perceptron_classifier |
classification | muffnn.MLPClassifier | ||
stacking_classifier |
classification | StackedClassifier | ||
sparse_linear_regressor |
civis_ml_sparse_linear_regressor |
regression | LinearRegression | |
sparse_ridge_regressor |
civis_ml_sparse_ridge_regressor |
regression | Ridge | |
gradient_boosting_regressor |
civis_ml_gradient_boosting_regressor |
regression | GradientBoostingRegressor | n_estimators=500, max_depth=2 |
random_forest_regressor |
civis_ml_random_forest_regressor |
regression | RandomForestRegressor | n_estimators=500 |
extra_trees_regressor |
civis_ml_extra_trees_regressor |
regression | ExtraTreesRegressor | n_estimators=500 |
multilayer_perceptron_regressor |
regression | muffnn.MLPRegressor | ||
stacking_regressor |
regression | StackedRegressor | ||
Model names can be easily accessed using the global variables CIVIS_ML_REGRESSORS
and CIVIS_ML_CLASSIFIERS
.
The "stacking_classifier"
model stacks together the "gradient_boosting_classifier"
and
"random_forest_classifier"
predefined models together with a
glmnet.LogitNet(alpha=0, n_splits=4, max_iter=10000, tol=1e-5, scoring='log_loss')
.
Defaults for the predefined models are documented in ?civis_ml
. Each column is first
standardized,
and then the model predictions are combined using
LogisticRegressionCV
with penalty='l2'
and tol=1e-08
. The "stacking_regressor"
works similarly, stacking together
the "gradient_boosting_regressor"
and "random_forest_regressor"
models and a
glmnet.ElasticNet(alpha=0, n_splits=4, max_iter=10000, tol=1e-5, scoring='r2')
, combining them using
NonNegativeLinearRegression.
The estimators that are being stacked have the same names as the
associated pre-defined models, and the meta-estimator steps are named
"meta-estimator". Note that although default parameters are provided
for multilayer perceptron models, it is highly recommended that
multilayer perceptrons be run using hyperband.
You can tune hyperparameters using one of two methods: grid search or
hyperband. CivisML will perform grid search if you pass a list
of hyperparameters to the cross_validation_parameters
parameter, where list elements are
hyperparameter names, and the values are vectors of hyperparameter
values to grid search over. You can run hyperparameter optimization in parallel by
setting the n_jobs
parameter to however many jobs you would like to run in
parallel. By default, n_jobs
is dynamically calculated based on
the resources available on your cluster, such that a modeling job will
never take up more than 90
Hyperband
is an efficient approach to hyperparameter optimization, and
recommended over grid search where possible. CivisML will perform
hyperband optimization if you pass the string "hyperband"
to
cross_validation_parameters
. Hyperband is currently only supported for the following models:
"gradient_boosting_classifier"
, "random_forest_classifier"
,
"extra_trees_classifier"
, "multilayer_perceptron_classifier"
,
"stacking_classifier"
,
"gradient_boosting_regressor"
, "random_forest_regressor"
,
"extra_trees_regressor"
, "multilayer_perceptron_regressor"
,
and "stacking_regressor"
.
Hyperband cannot be used to tune GLMs. For this reason, preset GLMs do
not have a hyperband option. Similarly, when
cross_validation_parameters='hyperband'
and the model is
stacking_classifier
or stacking_regressor
, only the GBT and
random forest steps of the stacker are tuned using hyperband. For the specific
distributions used in the predefined hyperband models, see
the detailed table in the Python client documentation.
For building models with civis_ml
, the training data can reside in
four different places, a file in the Civis Platform, a CSV or feather-format file
on the local disk, a data.frame
resident in local the R environment, and finally,
a table in the Civis Platform. Use the following helpers to specify the
data source when calling civis_ml
:
data.frame
civis_ml(x = df, ...)
civis_ml(x = "path/to/data.csv", ...)
civis_ml(x = civis_file(1234))
civis_ml(x = civis_table(table_name = "schema.table", database_name = "database"))
Model outputs will always contain out-of-sample (or out of fold) scores,
which are accessible through fetch_oos_scores
.
These may be stored in a Civis table on Redshift using the
oos_scores
, oos_scores_db
, and oos_scores_if_exists
parameters.
A fitted model can be used to make predictions for data residing in any of
the sources above and a civis_file_manifest
. Similar to
civis_ml
, use the data source helpers as the newdata
argument
to predict.civis_ml
.
A manifest file is a JSON file which specifies the location of many shards of the data to be used for prediction.
A manifest file is the output of a Civis export job with force_multifile = TRUE
set, e.g.
from civis_to_multifile_csv
. Large civis tables (provided using table_name
)
will automatically be exported to manifest files.
Prediction outputs will always be stored as gzipped CSVs in one or more civis files.
Provide an output_table
(and optionally an output_db
,
if it's different from database_name
) to copy these predictions into a
table on Redshift.
civis_file
, civis_table
, and
civis_file_manifest
for specifying data sources.
get_metric
to access model validation metrics.
fetch_logs
for retrieving logs for a (failed) model build,
fetch_oos_scores
for retrieving the out of sample (fold) scores for each training observation, and
fetch_predictions
for retrieving the predictions from a prediction job.
## Not run: # From a data frame: m <- civis_ml(df, model_type = "sparse_logistic", dependent_variable = "Species") # From a table: m <- civis_ml(civis_table("schema.table", "database_name"), model_type = "sparse_logistic", dependent_variable = "Species", oos_scores_table = "schema.scores_table", oos_scores_if_exists = "drop") # From a local file: m <- civis_ml("path/to/file.csv", model_type = "sparse_logistic", dependent_variable = "Species") # From a Civis file: file_id <- write_civis_file("path/to/file.csv", name = "file.csv") m <- civis_ml(civis_file(file_id), model_type = "sparse_logistic", dependent_variable = "Species") pred_job <- predict(m, newdata = df) pred_job <- predict(m, civis_table("schema.table", "database_name"), output_table = "schema.scores_table") pred_job <- predict(m, civis_file(file_id), output_table = "schema.scores_table") m <- civis_ml_fetch_existing(model_id = m$job$id, m$run$id) logs <- fetch_logs(m) yhat <- fetch_oos_scores(m) yhat <- fetch_predictions(pred_job) ## End(Not run)
## Not run: # From a data frame: m <- civis_ml(df, model_type = "sparse_logistic", dependent_variable = "Species") # From a table: m <- civis_ml(civis_table("schema.table", "database_name"), model_type = "sparse_logistic", dependent_variable = "Species", oos_scores_table = "schema.scores_table", oos_scores_if_exists = "drop") # From a local file: m <- civis_ml("path/to/file.csv", model_type = "sparse_logistic", dependent_variable = "Species") # From a Civis file: file_id <- write_civis_file("path/to/file.csv", name = "file.csv") m <- civis_ml(civis_file(file_id), model_type = "sparse_logistic", dependent_variable = "Species") pred_job <- predict(m, newdata = df) pred_job <- predict(m, civis_table("schema.table", "database_name"), output_table = "schema.scores_table") pred_job <- predict(m, civis_file(file_id), output_table = "schema.scores_table") m <- civis_ml_fetch_existing(model_id = m$job$id, m$run$id) logs <- fetch_logs(m) yhat <- fetch_oos_scores(m) yhat <- fetch_predictions(pred_job) ## End(Not run)
List of classification models.
CIVIS_ML_CLASSIFIERS
CIVIS_ML_CLASSIFIERS
An object of class character
of length 6.
CivisML Extra Trees Classifier
civis_ml_extra_trees_classifier( x, dependent_variable, primary_key = NULL, excluded_columns = NULL, n_estimators = 500, criterion = c("gini", "entropy"), max_depth = NULL, min_samples_split = 2, min_samples_leaf = 1, min_weight_fraction_leaf = 0, max_features = "sqrt", max_leaf_nodes = NULL, min_impurity_split = 1e-07, bootstrap = FALSE, random_state = 42, class_weight = NULL, fit_params = NULL, cross_validation_parameters = NULL, calibration = NULL, oos_scores_table = NULL, oos_scores_db = NULL, oos_scores_if_exists = c("fail", "append", "drop", "truncate"), model_name = NULL, cpu_requested = NULL, memory_requested = NULL, disk_requested = NULL, notifications = NULL, polling_interval = NULL, verbose = FALSE, civisml_version = "prod" )
civis_ml_extra_trees_classifier( x, dependent_variable, primary_key = NULL, excluded_columns = NULL, n_estimators = 500, criterion = c("gini", "entropy"), max_depth = NULL, min_samples_split = 2, min_samples_leaf = 1, min_weight_fraction_leaf = 0, max_features = "sqrt", max_leaf_nodes = NULL, min_impurity_split = 1e-07, bootstrap = FALSE, random_state = 42, class_weight = NULL, fit_params = NULL, cross_validation_parameters = NULL, calibration = NULL, oos_scores_table = NULL, oos_scores_db = NULL, oos_scores_if_exists = c("fail", "append", "drop", "truncate"), model_name = NULL, cpu_requested = NULL, memory_requested = NULL, disk_requested = NULL, notifications = NULL, polling_interval = NULL, verbose = FALSE, civisml_version = "prod" )
x |
See the Data Sources section below. |
dependent_variable |
The dependent variable of the training dataset. For a multi-target problem, this should be a vector of column names of dependent variables. Nulls in a single dependent variable will automatically be dropped. |
primary_key |
Optional, the unique ID (primary key) of the training
dataset. This will be used to index the out-of-sample scores. In
|
excluded_columns |
Optional, a vector of columns which will be considered ineligible to be independent variables. |
n_estimators |
The number of boosting stages to perform. Gradient boosting is fairly robust to over-fitting, so a large number usually results in better predictive performance. |
criterion |
The function to measure the quality of a split. Supported
criteria are |
max_depth |
Maximum depth of the individual regression estimators. The maximum depth limits the number of nodes in the tree. Tune this parameter for best performance. The best value depends on the interaction of the input variables. |
min_samples_split |
The minimum number of samples required to split
an internal node. If an integer, then consider |
min_samples_leaf |
The minimum number of samples required to be in
a leaf node. If an integer, then consider |
min_weight_fraction_leaf |
The minimum weighted fraction of the sum total of weights required to be at a leaf node. |
max_features |
The number of features to consider when looking for the best split.
|
max_leaf_nodes |
Grow trees with |
min_impurity_split |
Threshold for early stopping in tree growth. A node will split if its impurity is above the threshold, otherwise it is a leaf. |
bootstrap |
Whether bootstrap samples are used when building trees. |
random_state |
The seed of the random number generator. |
class_weight |
A
Note, the class weights are multiplied with |
fit_params |
Optional, a mapping from parameter names in the model's
|
cross_validation_parameters |
Optional, parameter grid for learner
parameters, e.g. |
calibration |
Optional, if not |
oos_scores_table |
Optional, if provided, store out-of-sample predictions on training set data to this Redshift "schema.tablename". |
oos_scores_db |
Optional, the name of the database where the
|
oos_scores_if_exists |
Optional, action to take if
|
model_name |
Optional, the prefix of the Platform modeling jobs.
It will have |
cpu_requested |
Optional, the number of CPU shares requested in the Civis Platform for training jobs or prediction child jobs. 1024 shares = 1 CPU. |
memory_requested |
Optional, the memory requested from Civis Platform for training jobs or prediction child jobs, in MiB. |
disk_requested |
Optional, the disk space requested on Civis Platform for training jobs or prediction child jobs, in GB. |
notifications |
Optional, model status notifications. See
|
polling_interval |
Check for job completion every this number of seconds. |
verbose |
Optional, If |
civisml_version |
Optional, a one-length character vector of the CivisML version. The default is "prod", the latest version in production |
A civis_ml
object, a list containing the following elements:
job |
job metadata from |
run |
run metadata from |
outputs |
CivisML metadata from |
metrics |
Parsed CivisML output from
|
model_info |
Parsed CivisML output from
|
For building models with civis_ml
, the training data can reside in
four different places, a file in the Civis Platform, a CSV or feather-format file
on the local disk, a data.frame
resident in local the R environment, and finally,
a table in the Civis Platform. Use the following helpers to specify the
data source when calling civis_ml
:
data.frame
civis_ml(x = df, ...)
civis_ml(x = "path/to/data.csv", ...)
civis_ml(x = civis_file(1234))
civis_ml(x = civis_table(table_name = "schema.table", database_name = "database"))
## Not run: df <- iris names(df) <- gsub("\\.", "_", names(df)) m <- civis_ml_extra_trees_classifier(df, dependent_variable = "Species", n_estimators = 100, max_depth = 5, max_features = NULL) yhat <- fetch_oos_scores(m) # Grid Search cv_params <- list( n_estimators = c(100, 200, 500), max_depth = c(2, 3)) m <- civis_ml_extra_trees_classifier(df, dependent_variable = "Species", max_features = NULL, cross_validation_parameters = cv_params) pred_info <- predict(m, civis_table("schema.table", "my_database"), output_table = "schema.scores_table") ## End(Not run)
## Not run: df <- iris names(df) <- gsub("\\.", "_", names(df)) m <- civis_ml_extra_trees_classifier(df, dependent_variable = "Species", n_estimators = 100, max_depth = 5, max_features = NULL) yhat <- fetch_oos_scores(m) # Grid Search cv_params <- list( n_estimators = c(100, 200, 500), max_depth = c(2, 3)) m <- civis_ml_extra_trees_classifier(df, dependent_variable = "Species", max_features = NULL, cross_validation_parameters = cv_params) pred_info <- predict(m, civis_table("schema.table", "my_database"), output_table = "schema.scores_table") ## End(Not run)
CivisML Extra Trees Regressor
civis_ml_extra_trees_regressor( x, dependent_variable, primary_key = NULL, excluded_columns = NULL, n_estimators = 500, criterion = c("mse", "mae"), max_depth = NULL, min_samples_split = 2, min_samples_leaf = 1, min_weight_fraction_leaf = 0, max_features = "sqrt", max_leaf_nodes = NULL, min_impurity_split = 1e-07, bootstrap = FALSE, random_state = 42, fit_params = NULL, cross_validation_parameters = NULL, oos_scores_table = NULL, oos_scores_db = NULL, oos_scores_if_exists = c("fail", "append", "drop", "truncate"), model_name = NULL, cpu_requested = NULL, memory_requested = NULL, disk_requested = NULL, notifications = NULL, polling_interval = NULL, verbose = FALSE, civisml_version = "prod" )
civis_ml_extra_trees_regressor( x, dependent_variable, primary_key = NULL, excluded_columns = NULL, n_estimators = 500, criterion = c("mse", "mae"), max_depth = NULL, min_samples_split = 2, min_samples_leaf = 1, min_weight_fraction_leaf = 0, max_features = "sqrt", max_leaf_nodes = NULL, min_impurity_split = 1e-07, bootstrap = FALSE, random_state = 42, fit_params = NULL, cross_validation_parameters = NULL, oos_scores_table = NULL, oos_scores_db = NULL, oos_scores_if_exists = c("fail", "append", "drop", "truncate"), model_name = NULL, cpu_requested = NULL, memory_requested = NULL, disk_requested = NULL, notifications = NULL, polling_interval = NULL, verbose = FALSE, civisml_version = "prod" )
x |
See the Data Sources section below. |
dependent_variable |
The dependent variable of the training dataset. For a multi-target problem, this should be a vector of column names of dependent variables. Nulls in a single dependent variable will automatically be dropped. |
primary_key |
Optional, the unique ID (primary key) of the training
dataset. This will be used to index the out-of-sample scores. In
|
excluded_columns |
Optional, a vector of columns which will be considered ineligible to be independent variables. |
n_estimators |
The number of boosting stages to perform. Gradient boosting is fairly robust to over-fitting, so a large number usually results in better predictive performance. |
criterion |
The function used to measure the quality of a split.
Supported criteria are |
max_depth |
Maximum depth of the individual regression estimators. The maximum depth limits the number of nodes in the tree. Tune this parameter for best performance. The best value depends on the interaction of the input variables. |
min_samples_split |
The minimum number of samples required to split
an internal node. If an integer, then consider |
min_samples_leaf |
The minimum number of samples required to be in
a leaf node. If an integer, then consider |
min_weight_fraction_leaf |
The minimum weighted fraction of the sum total of weights required to be at a leaf node. |
max_features |
The number of features to consider when looking for the best split.
|
max_leaf_nodes |
Grow trees with |
min_impurity_split |
Threshold for early stopping in tree growth. A node will split if its impurity is above the threshold, otherwise it is a leaf. |
bootstrap |
Whether bootstrap samples are used when building trees. |
random_state |
The seed of the random number generator. |
fit_params |
Optional, a mapping from parameter names in the model's
|
cross_validation_parameters |
Optional, parameter grid for learner
parameters, e.g. |
oos_scores_table |
Optional, if provided, store out-of-sample predictions on training set data to this Redshift "schema.tablename". |
oos_scores_db |
Optional, the name of the database where the
|
oos_scores_if_exists |
Optional, action to take if
|
model_name |
Optional, the prefix of the Platform modeling jobs.
It will have |
cpu_requested |
Optional, the number of CPU shares requested in the Civis Platform for training jobs or prediction child jobs. 1024 shares = 1 CPU. |
memory_requested |
Optional, the memory requested from Civis Platform for training jobs or prediction child jobs, in MiB. |
disk_requested |
Optional, the disk space requested on Civis Platform for training jobs or prediction child jobs, in GB. |
notifications |
Optional, model status notifications. See
|
polling_interval |
Check for job completion every this number of seconds. |
verbose |
Optional, If |
civisml_version |
Optional, a one-length character vector of the CivisML version. The default is "prod", the latest version in production |
A civis_ml
object, a list containing the following elements:
job |
job metadata from |
run |
run metadata from |
outputs |
CivisML metadata from |
metrics |
Parsed CivisML output from
|
model_info |
Parsed CivisML output from
|
For building models with civis_ml
, the training data can reside in
four different places, a file in the Civis Platform, a CSV or feather-format file
on the local disk, a data.frame
resident in local the R environment, and finally,
a table in the Civis Platform. Use the following helpers to specify the
data source when calling civis_ml
:
data.frame
civis_ml(x = df, ...)
civis_ml(x = "path/to/data.csv", ...)
civis_ml(x = civis_file(1234))
civis_ml(x = civis_table(table_name = "schema.table", database_name = "database"))
## Not run: data(ChickWeight) m <- civis_ml_extra_trees_regressor(ChickWeight, dependent_variable = "weight", n_estimators = 100, max_depth = 5, max_features = NULL) yhat <- fetch_oos_scores(m) # Grid Search cv_params <- list( n_estimators = c(100, 200, 500), max_depth = c(2, 3)) m <- civis_ml_extra_trees_regressor(ChickWeight, dependent_variable = "weight", max_features = NULL, cross_validation_parameters = cv_params) pred_info <- predict(m, civis_table("schema.table", "my_database"), output_table = "schema.scores_table") ## End(Not run)
## Not run: data(ChickWeight) m <- civis_ml_extra_trees_regressor(ChickWeight, dependent_variable = "weight", n_estimators = 100, max_depth = 5, max_features = NULL) yhat <- fetch_oos_scores(m) # Grid Search cv_params <- list( n_estimators = c(100, 200, 500), max_depth = c(2, 3)) m <- civis_ml_extra_trees_regressor(ChickWeight, dependent_variable = "weight", max_features = NULL, cross_validation_parameters = cv_params) pred_info <- predict(m, civis_table("schema.table", "my_database"), output_table = "schema.scores_table") ## End(Not run)
CivisML Gradient Boosting Classifier
civis_ml_gradient_boosting_classifier( x, dependent_variable, primary_key = NULL, excluded_columns = NULL, loss = c("deviance", "exponential"), learning_rate = 0.1, n_estimators = 500, subsample = 1, criterion = c("friedman_mse", "mse", "mae"), min_samples_split = 2, min_samples_leaf = 1, min_weight_fraction_leaf = 0, max_depth = 2, min_impurity_split = 1e-07, random_state = 42, max_features = "sqrt", max_leaf_nodes = NULL, presort = c("auto", TRUE, FALSE), fit_params = NULL, cross_validation_parameters = NULL, calibration = NULL, oos_scores_table = NULL, oos_scores_db = NULL, oos_scores_if_exists = c("fail", "append", "drop", "truncate"), model_name = NULL, cpu_requested = NULL, memory_requested = NULL, disk_requested = NULL, notifications = NULL, polling_interval = NULL, verbose = FALSE, civisml_version = "prod" )
civis_ml_gradient_boosting_classifier( x, dependent_variable, primary_key = NULL, excluded_columns = NULL, loss = c("deviance", "exponential"), learning_rate = 0.1, n_estimators = 500, subsample = 1, criterion = c("friedman_mse", "mse", "mae"), min_samples_split = 2, min_samples_leaf = 1, min_weight_fraction_leaf = 0, max_depth = 2, min_impurity_split = 1e-07, random_state = 42, max_features = "sqrt", max_leaf_nodes = NULL, presort = c("auto", TRUE, FALSE), fit_params = NULL, cross_validation_parameters = NULL, calibration = NULL, oos_scores_table = NULL, oos_scores_db = NULL, oos_scores_if_exists = c("fail", "append", "drop", "truncate"), model_name = NULL, cpu_requested = NULL, memory_requested = NULL, disk_requested = NULL, notifications = NULL, polling_interval = NULL, verbose = FALSE, civisml_version = "prod" )
x |
See the Data Sources section below. |
dependent_variable |
The dependent variable of the training dataset. For a multi-target problem, this should be a vector of column names of dependent variables. Nulls in a single dependent variable will automatically be dropped. |
primary_key |
Optional, the unique ID (primary key) of the training
dataset. This will be used to index the out-of-sample scores. In
|
excluded_columns |
Optional, a vector of columns which will be considered ineligible to be independent variables. |
loss |
The loss function to be optimized. |
learning_rate |
The learning rate shrinks the contribution of each tree
by |
n_estimators |
The number of boosting stages to perform. Gradient boosting is fairly robust to over-fitting, so a large number usually results in better predictive performance. |
subsample |
The fraction of samples to be used for fitting individual
base learners. If smaller than 1.0, this results in Stochastic Gradient
Boosting. |
criterion |
The function to measure the quality of a split. The default
value |
min_samples_split |
The minimum number of samples required to split
an internal node. If an integer, then consider |
min_samples_leaf |
The minimum number of samples required to be in
a leaf node. If an integer, then consider |
min_weight_fraction_leaf |
The minimum weighted fraction of the sum total of weights required to be at a leaf node. |
max_depth |
Maximum depth of the individual regression estimators. The maximum depth limits the number of nodes in the tree. Tune this parameter for best performance. The best value depends on the interaction of the input variables. |
min_impurity_split |
Threshold for early stopping in tree growth. A node will split if its impurity is above the threshold, otherwise it is a leaf. |
random_state |
The seed of the random number generator. |
max_features |
The number of features to consider when looking for the best split.
|
max_leaf_nodes |
Grow trees with |
presort |
Whether to presort the data to speed up the finding of best splits in fitting. |
fit_params |
Optional, a mapping from parameter names in the model's
|
cross_validation_parameters |
Optional, parameter grid for learner
parameters, e.g. |
calibration |
Optional, if not |
oos_scores_table |
Optional, if provided, store out-of-sample predictions on training set data to this Redshift "schema.tablename". |
oos_scores_db |
Optional, the name of the database where the
|
oos_scores_if_exists |
Optional, action to take if
|
model_name |
Optional, the prefix of the Platform modeling jobs.
It will have |
cpu_requested |
Optional, the number of CPU shares requested in the Civis Platform for training jobs or prediction child jobs. 1024 shares = 1 CPU. |
memory_requested |
Optional, the memory requested from Civis Platform for training jobs or prediction child jobs, in MiB. |
disk_requested |
Optional, the disk space requested on Civis Platform for training jobs or prediction child jobs, in GB. |
notifications |
Optional, model status notifications. See
|
polling_interval |
Check for job completion every this number of seconds. |
verbose |
Optional, If |
civisml_version |
Optional, a one-length character vector of the CivisML version. The default is "prod", the latest version in production |
A civis_ml
object, a list containing the following elements:
job |
job metadata from |
run |
run metadata from |
outputs |
CivisML metadata from |
metrics |
Parsed CivisML output from
|
model_info |
Parsed CivisML output from
|
For building models with civis_ml
, the training data can reside in
four different places, a file in the Civis Platform, a CSV or feather-format file
on the local disk, a data.frame
resident in local the R environment, and finally,
a table in the Civis Platform. Use the following helpers to specify the
data source when calling civis_ml
:
data.frame
civis_ml(x = df, ...)
civis_ml(x = "path/to/data.csv", ...)
civis_ml(x = civis_file(1234))
civis_ml(x = civis_table(table_name = "schema.table", database_name = "database"))
## Not run: df <- iris names(df) <- gsub("\\.", "_", names(df)) m <- civis_ml_gradient_boosting_classifier(df, dependent_variable = "Species", learning_rate = .01, n_estimators = 100, subsample = .5, max_depth = 5, max_features = NULL) yhat <- fetch_oos_scores(m) # Grid Search cv_params <- list( n_estimators = c(100, 200, 500), learning_rate = c(.01, .1), max_depth = c(2, 3)) m <- civis_ml_gradient_boosting_classifier(df, dependent_variable = "Species", subsample = .5, max_features = NULL, cross_validation_parameters = cv_params) pred_info <- predict(m, civis_table("schema.table", "my_database"), output_table = "schema.scores_table") ## End(Not run)
## Not run: df <- iris names(df) <- gsub("\\.", "_", names(df)) m <- civis_ml_gradient_boosting_classifier(df, dependent_variable = "Species", learning_rate = .01, n_estimators = 100, subsample = .5, max_depth = 5, max_features = NULL) yhat <- fetch_oos_scores(m) # Grid Search cv_params <- list( n_estimators = c(100, 200, 500), learning_rate = c(.01, .1), max_depth = c(2, 3)) m <- civis_ml_gradient_boosting_classifier(df, dependent_variable = "Species", subsample = .5, max_features = NULL, cross_validation_parameters = cv_params) pred_info <- predict(m, civis_table("schema.table", "my_database"), output_table = "schema.scores_table") ## End(Not run)
CivisML Gradient Boosting Regressor
civis_ml_gradient_boosting_regressor( x, dependent_variable, primary_key = NULL, excluded_columns = NULL, loss = c("ls", "lad", "huber", "quantile"), learning_rate = 0.1, n_estimators = 500, subsample = 1, criterion = c("friedman_mse", "mse", "mae"), min_samples_split = 2, min_samples_leaf = 1, min_weight_fraction_leaf = 0, max_depth = 2, min_impurity_split = 1e-07, random_state = 42, max_features = "sqrt", alpha = 0.9, max_leaf_nodes = NULL, presort = c("auto", TRUE, FALSE), fit_params = NULL, cross_validation_parameters = NULL, oos_scores_table = NULL, oos_scores_db = NULL, oos_scores_if_exists = c("fail", "append", "drop", "truncate"), model_name = NULL, cpu_requested = NULL, memory_requested = NULL, disk_requested = NULL, notifications = NULL, polling_interval = NULL, verbose = FALSE, civisml_version = "prod" )
civis_ml_gradient_boosting_regressor( x, dependent_variable, primary_key = NULL, excluded_columns = NULL, loss = c("ls", "lad", "huber", "quantile"), learning_rate = 0.1, n_estimators = 500, subsample = 1, criterion = c("friedman_mse", "mse", "mae"), min_samples_split = 2, min_samples_leaf = 1, min_weight_fraction_leaf = 0, max_depth = 2, min_impurity_split = 1e-07, random_state = 42, max_features = "sqrt", alpha = 0.9, max_leaf_nodes = NULL, presort = c("auto", TRUE, FALSE), fit_params = NULL, cross_validation_parameters = NULL, oos_scores_table = NULL, oos_scores_db = NULL, oos_scores_if_exists = c("fail", "append", "drop", "truncate"), model_name = NULL, cpu_requested = NULL, memory_requested = NULL, disk_requested = NULL, notifications = NULL, polling_interval = NULL, verbose = FALSE, civisml_version = "prod" )
x |
See the Data Sources section below. |
dependent_variable |
The dependent variable of the training dataset. For a multi-target problem, this should be a vector of column names of dependent variables. Nulls in a single dependent variable will automatically be dropped. |
primary_key |
Optional, the unique ID (primary key) of the training
dataset. This will be used to index the out-of-sample scores. In
|
excluded_columns |
Optional, a vector of columns which will be considered ineligible to be independent variables. |
loss |
The loss function to be optimized. |
learning_rate |
The learning rate shrinks the contribution of each tree
by |
n_estimators |
The number of boosting stages to perform. Gradient boosting is fairly robust to over-fitting, so a large number usually results in better predictive performance. |
subsample |
The fraction of samples to be used for fitting individual
base learners. If smaller than 1.0, this results in Stochastic Gradient
Boosting. |
criterion |
The function to measure the quality of a split. The default
value |
min_samples_split |
The minimum number of samples required to split
an internal node. If an integer, then consider |
min_samples_leaf |
The minimum number of samples required to be in
a leaf node. If an integer, then consider |
min_weight_fraction_leaf |
The minimum weighted fraction of the sum total of weights required to be at a leaf node. |
max_depth |
Maximum depth of the individual regression estimators. The maximum depth limits the number of nodes in the tree. Tune this parameter for best performance. The best value depends on the interaction of the input variables. |
min_impurity_split |
Threshold for early stopping in tree growth. A node will split if its impurity is above the threshold, otherwise it is a leaf. |
random_state |
The seed of the random number generator. |
max_features |
The number of features to consider when looking for the best split.
|
alpha |
The alpha-quantile of the |
max_leaf_nodes |
Grow trees with |
presort |
Whether to presort the data to speed up the finding of best splits in fitting. |
fit_params |
Optional, a mapping from parameter names in the model's
|
cross_validation_parameters |
Optional, parameter grid for learner
parameters, e.g. |
oos_scores_table |
Optional, if provided, store out-of-sample predictions on training set data to this Redshift "schema.tablename". |
oos_scores_db |
Optional, the name of the database where the
|
oos_scores_if_exists |
Optional, action to take if
|
model_name |
Optional, the prefix of the Platform modeling jobs.
It will have |
cpu_requested |
Optional, the number of CPU shares requested in the Civis Platform for training jobs or prediction child jobs. 1024 shares = 1 CPU. |
memory_requested |
Optional, the memory requested from Civis Platform for training jobs or prediction child jobs, in MiB. |
disk_requested |
Optional, the disk space requested on Civis Platform for training jobs or prediction child jobs, in GB. |
notifications |
Optional, model status notifications. See
|
polling_interval |
Check for job completion every this number of seconds. |
verbose |
Optional, If |
civisml_version |
Optional, a one-length character vector of the CivisML version. The default is "prod", the latest version in production |
A civis_ml
object, a list containing the following elements:
job |
job metadata from |
run |
run metadata from |
outputs |
CivisML metadata from |
metrics |
Parsed CivisML output from
|
model_info |
Parsed CivisML output from
|
For building models with civis_ml
, the training data can reside in
four different places, a file in the Civis Platform, a CSV or feather-format file
on the local disk, a data.frame
resident in local the R environment, and finally,
a table in the Civis Platform. Use the following helpers to specify the
data source when calling civis_ml
:
data.frame
civis_ml(x = df, ...)
civis_ml(x = "path/to/data.csv", ...)
civis_ml(x = civis_file(1234))
civis_ml(x = civis_table(table_name = "schema.table", database_name = "database"))
## Not run: data(ChickWeight) m <- civis_ml_gradient_boosting_regressor(ChickWeight, dependent_variable = "weight", learning_rate = .01, n_estimators = 100, subsample = .5, max_depth = 5, max_features = NULL) yhat <- fetch_oos_scores(m) # Grid Search cv_params <- list( n_estimators = c(100, 200, 500), learning_rate = c(.01, .1), max_depth = c(2, 3)) m <- civis_ml_gradient_boosting_regressor(ChickWeight, dependent_variable = "weight", subsample = .5, max_features = NULL, cross_validation_parameters = cv_params) pred_info <- predict(m, civis_table("schema.table", "my_database"), output_table = "schema.scores_table") ## End(Not run)
## Not run: data(ChickWeight) m <- civis_ml_gradient_boosting_regressor(ChickWeight, dependent_variable = "weight", learning_rate = .01, n_estimators = 100, subsample = .5, max_depth = 5, max_features = NULL) yhat <- fetch_oos_scores(m) # Grid Search cv_params <- list( n_estimators = c(100, 200, 500), learning_rate = c(.01, .1), max_depth = c(2, 3)) m <- civis_ml_gradient_boosting_regressor(ChickWeight, dependent_variable = "weight", subsample = .5, max_features = NULL, cross_validation_parameters = cv_params) pred_info <- predict(m, civis_table("schema.table", "my_database"), output_table = "schema.scores_table") ## End(Not run)
CivisML Random Forest Classifier
civis_ml_random_forest_classifier( x, dependent_variable, primary_key = NULL, excluded_columns = NULL, n_estimators = 500, criterion = c("gini", "entropy"), max_depth = NULL, min_samples_split = 2, min_samples_leaf = 1, min_weight_fraction_leaf = 0, max_features = "sqrt", max_leaf_nodes = NULL, min_impurity_split = 1e-07, bootstrap = TRUE, random_state = 42, class_weight = NULL, fit_params = NULL, cross_validation_parameters = NULL, calibration = NULL, oos_scores_table = NULL, oos_scores_db = NULL, oos_scores_if_exists = c("fail", "append", "drop", "truncate"), model_name = NULL, cpu_requested = NULL, memory_requested = NULL, disk_requested = NULL, notifications = NULL, polling_interval = NULL, verbose = FALSE, civisml_version = "prod" )
civis_ml_random_forest_classifier( x, dependent_variable, primary_key = NULL, excluded_columns = NULL, n_estimators = 500, criterion = c("gini", "entropy"), max_depth = NULL, min_samples_split = 2, min_samples_leaf = 1, min_weight_fraction_leaf = 0, max_features = "sqrt", max_leaf_nodes = NULL, min_impurity_split = 1e-07, bootstrap = TRUE, random_state = 42, class_weight = NULL, fit_params = NULL, cross_validation_parameters = NULL, calibration = NULL, oos_scores_table = NULL, oos_scores_db = NULL, oos_scores_if_exists = c("fail", "append", "drop", "truncate"), model_name = NULL, cpu_requested = NULL, memory_requested = NULL, disk_requested = NULL, notifications = NULL, polling_interval = NULL, verbose = FALSE, civisml_version = "prod" )
x |
See the Data Sources section below. |
dependent_variable |
The dependent variable of the training dataset. For a multi-target problem, this should be a vector of column names of dependent variables. Nulls in a single dependent variable will automatically be dropped. |
primary_key |
Optional, the unique ID (primary key) of the training
dataset. This will be used to index the out-of-sample scores. In
|
excluded_columns |
Optional, a vector of columns which will be considered ineligible to be independent variables. |
n_estimators |
The number of boosting stages to perform. Gradient boosting is fairly robust to over-fitting, so a large number usually results in better predictive performance. |
criterion |
The function to measure the quality of a split. Supported
criteria are |
max_depth |
Maximum depth of the individual regression estimators. The maximum depth limits the number of nodes in the tree. Tune this parameter for best performance. The best value depends on the interaction of the input variables. |
min_samples_split |
The minimum number of samples required to split
an internal node. If an integer, then consider |
min_samples_leaf |
The minimum number of samples required to be in
a leaf node. If an integer, then consider |
min_weight_fraction_leaf |
The minimum weighted fraction of the sum total of weights required to be at a leaf node. |
max_features |
The number of features to consider when looking for the best split.
|
max_leaf_nodes |
Grow trees with |
min_impurity_split |
Threshold for early stopping in tree growth. A node will split if its impurity is above the threshold, otherwise it is a leaf. |
bootstrap |
Whether bootstrap samples are used when building trees. |
random_state |
The seed of the random number generator. |
class_weight |
A
Note, the class weights are multiplied with |
fit_params |
Optional, a mapping from parameter names in the model's
|
cross_validation_parameters |
Optional, parameter grid for learner
parameters, e.g. |
calibration |
Optional, if not |
oos_scores_table |
Optional, if provided, store out-of-sample predictions on training set data to this Redshift "schema.tablename". |
oos_scores_db |
Optional, the name of the database where the
|
oos_scores_if_exists |
Optional, action to take if
|
model_name |
Optional, the prefix of the Platform modeling jobs.
It will have |
cpu_requested |
Optional, the number of CPU shares requested in the Civis Platform for training jobs or prediction child jobs. 1024 shares = 1 CPU. |
memory_requested |
Optional, the memory requested from Civis Platform for training jobs or prediction child jobs, in MiB. |
disk_requested |
Optional, the disk space requested on Civis Platform for training jobs or prediction child jobs, in GB. |
notifications |
Optional, model status notifications. See
|
polling_interval |
Check for job completion every this number of seconds. |
verbose |
Optional, If |
civisml_version |
Optional, a one-length character vector of the CivisML version. The default is "prod", the latest version in production |
A civis_ml
object, a list containing the following elements:
job |
job metadata from |
run |
run metadata from |
outputs |
CivisML metadata from |
metrics |
Parsed CivisML output from
|
model_info |
Parsed CivisML output from
|
For building models with civis_ml
, the training data can reside in
four different places, a file in the Civis Platform, a CSV or feather-format file
on the local disk, a data.frame
resident in local the R environment, and finally,
a table in the Civis Platform. Use the following helpers to specify the
data source when calling civis_ml
:
data.frame
civis_ml(x = df, ...)
civis_ml(x = "path/to/data.csv", ...)
civis_ml(x = civis_file(1234))
civis_ml(x = civis_table(table_name = "schema.table", database_name = "database"))
## Not run: df <- iris names(df) <- gsub("\\.", "_", names(df)) m <- civis_ml_random_forest_classifier(df, dependent_variable = "Species", n_estimators = 100, max_depth = 5, max_features = NULL) yhat <- fetch_oos_scores(m) # Grid Search cv_params <- list( n_estimators = c(100, 200, 500), max_depth = c(2, 3)) m <- civis_ml_random_forest_classifier(df, dependent_variable = "Species", max_features = NULL, cross_validation_parameters = cv_params) pred_info <- predict(m, civis_table("schema.table", "my_database"), output_table = "schema.scores_table") ## End(Not run)
## Not run: df <- iris names(df) <- gsub("\\.", "_", names(df)) m <- civis_ml_random_forest_classifier(df, dependent_variable = "Species", n_estimators = 100, max_depth = 5, max_features = NULL) yhat <- fetch_oos_scores(m) # Grid Search cv_params <- list( n_estimators = c(100, 200, 500), max_depth = c(2, 3)) m <- civis_ml_random_forest_classifier(df, dependent_variable = "Species", max_features = NULL, cross_validation_parameters = cv_params) pred_info <- predict(m, civis_table("schema.table", "my_database"), output_table = "schema.scores_table") ## End(Not run)
CivisML Random Forest Regressor
civis_ml_random_forest_regressor( x, dependent_variable, primary_key = NULL, excluded_columns = NULL, n_estimators = 500, criterion = c("mse", "mae"), max_depth = NULL, min_samples_split = 2, min_samples_leaf = 1, min_weight_fraction_leaf = 0, max_features = "sqrt", max_leaf_nodes = NULL, min_impurity_split = 1e-07, bootstrap = TRUE, random_state = 42, fit_params = NULL, cross_validation_parameters = NULL, oos_scores_table = NULL, oos_scores_db = NULL, oos_scores_if_exists = c("fail", "append", "drop", "truncate"), model_name = NULL, cpu_requested = NULL, memory_requested = NULL, disk_requested = NULL, notifications = NULL, polling_interval = NULL, verbose = FALSE, civisml_version = "prod" )
civis_ml_random_forest_regressor( x, dependent_variable, primary_key = NULL, excluded_columns = NULL, n_estimators = 500, criterion = c("mse", "mae"), max_depth = NULL, min_samples_split = 2, min_samples_leaf = 1, min_weight_fraction_leaf = 0, max_features = "sqrt", max_leaf_nodes = NULL, min_impurity_split = 1e-07, bootstrap = TRUE, random_state = 42, fit_params = NULL, cross_validation_parameters = NULL, oos_scores_table = NULL, oos_scores_db = NULL, oos_scores_if_exists = c("fail", "append", "drop", "truncate"), model_name = NULL, cpu_requested = NULL, memory_requested = NULL, disk_requested = NULL, notifications = NULL, polling_interval = NULL, verbose = FALSE, civisml_version = "prod" )
x |
See the Data Sources section below. |
dependent_variable |
The dependent variable of the training dataset. For a multi-target problem, this should be a vector of column names of dependent variables. Nulls in a single dependent variable will automatically be dropped. |
primary_key |
Optional, the unique ID (primary key) of the training
dataset. This will be used to index the out-of-sample scores. In
|
excluded_columns |
Optional, a vector of columns which will be considered ineligible to be independent variables. |
n_estimators |
The number of boosting stages to perform. Gradient boosting is fairly robust to over-fitting, so a large number usually results in better predictive performance. |
criterion |
The function used to measure the quality of a split.
Supported criteria are |
max_depth |
Maximum depth of the individual regression estimators. The maximum depth limits the number of nodes in the tree. Tune this parameter for best performance. The best value depends on the interaction of the input variables. |
min_samples_split |
The minimum number of samples required to split
an internal node. If an integer, then consider |
min_samples_leaf |
The minimum number of samples required to be in
a leaf node. If an integer, then consider |
min_weight_fraction_leaf |
The minimum weighted fraction of the sum total of weights required to be at a leaf node. |
max_features |
The number of features to consider when looking for the best split.
|
max_leaf_nodes |
Grow trees with |
min_impurity_split |
Threshold for early stopping in tree growth. A node will split if its impurity is above the threshold, otherwise it is a leaf. |
bootstrap |
Whether bootstrap samples are used when building trees. |
random_state |
The seed of the random number generator. |
fit_params |
Optional, a mapping from parameter names in the model's
|
cross_validation_parameters |
Optional, parameter grid for learner
parameters, e.g. |
oos_scores_table |
Optional, if provided, store out-of-sample predictions on training set data to this Redshift "schema.tablename". |
oos_scores_db |
Optional, the name of the database where the
|
oos_scores_if_exists |
Optional, action to take if
|
model_name |
Optional, the prefix of the Platform modeling jobs.
It will have |
cpu_requested |
Optional, the number of CPU shares requested in the Civis Platform for training jobs or prediction child jobs. 1024 shares = 1 CPU. |
memory_requested |
Optional, the memory requested from Civis Platform for training jobs or prediction child jobs, in MiB. |
disk_requested |
Optional, the disk space requested on Civis Platform for training jobs or prediction child jobs, in GB. |
notifications |
Optional, model status notifications. See
|
polling_interval |
Check for job completion every this number of seconds. |
verbose |
Optional, If |
civisml_version |
Optional, a one-length character vector of the CivisML version. The default is "prod", the latest version in production |
A civis_ml
object, a list containing the following elements:
job |
job metadata from |
run |
run metadata from |
outputs |
CivisML metadata from |
metrics |
Parsed CivisML output from
|
model_info |
Parsed CivisML output from
|
For building models with civis_ml
, the training data can reside in
four different places, a file in the Civis Platform, a CSV or feather-format file
on the local disk, a data.frame
resident in local the R environment, and finally,
a table in the Civis Platform. Use the following helpers to specify the
data source when calling civis_ml
:
data.frame
civis_ml(x = df, ...)
civis_ml(x = "path/to/data.csv", ...)
civis_ml(x = civis_file(1234))
civis_ml(x = civis_table(table_name = "schema.table", database_name = "database"))
## Not run: data(ChickWeight) m <- civis_ml_random_forest_regressor(ChickWeight, dependent_variable = "weight", n_estimators = 100, max_depth = 5, max_features = NULL) yhat <- fetch_oos_scores(m) # Grid Search cv_params <- list( n_estimators = c(100, 200, 500), max_depth = c(2, 3)) m <- civis_ml_random_forest_regressor(ChickWeight, dependent_variable = "weight", max_features = NULL, cross_validation_parameters = cv_params) pred_info <- predict(m, civis_table("schema.table", "my_database"), output_table = "schema.scores_table") ## End(Not run)
## Not run: data(ChickWeight) m <- civis_ml_random_forest_regressor(ChickWeight, dependent_variable = "weight", n_estimators = 100, max_depth = 5, max_features = NULL) yhat <- fetch_oos_scores(m) # Grid Search cv_params <- list( n_estimators = c(100, 200, 500), max_depth = c(2, 3)) m <- civis_ml_random_forest_regressor(ChickWeight, dependent_variable = "weight", max_features = NULL, cross_validation_parameters = cv_params) pred_info <- predict(m, civis_table("schema.table", "my_database"), output_table = "schema.scores_table") ## End(Not run)
List of civis_ml regression models.
CIVIS_ML_REGRESSORS
CIVIS_ML_REGRESSORS
An object of class character
of length 7.
CivisML Sparse Linear Regression
civis_ml_sparse_linear_regressor( x, dependent_variable, primary_key = NULL, excluded_columns = NULL, fit_intercept = TRUE, normalize = FALSE, fit_params = NULL, cross_validation_parameters = NULL, oos_scores_table = NULL, oos_scores_db = NULL, oos_scores_if_exists = c("fail", "append", "drop", "truncate"), model_name = NULL, cpu_requested = NULL, memory_requested = NULL, disk_requested = NULL, notifications = NULL, polling_interval = NULL, verbose = FALSE, civisml_version = "prod" )
civis_ml_sparse_linear_regressor( x, dependent_variable, primary_key = NULL, excluded_columns = NULL, fit_intercept = TRUE, normalize = FALSE, fit_params = NULL, cross_validation_parameters = NULL, oos_scores_table = NULL, oos_scores_db = NULL, oos_scores_if_exists = c("fail", "append", "drop", "truncate"), model_name = NULL, cpu_requested = NULL, memory_requested = NULL, disk_requested = NULL, notifications = NULL, polling_interval = NULL, verbose = FALSE, civisml_version = "prod" )
x |
See the Data Sources section below. |
dependent_variable |
The dependent variable of the training dataset. For a multi-target problem, this should be a vector of column names of dependent variables. Nulls in a single dependent variable will automatically be dropped. |
primary_key |
Optional, the unique ID (primary key) of the training
dataset. This will be used to index the out-of-sample scores. In
|
excluded_columns |
Optional, a vector of columns which will be considered ineligible to be independent variables. |
fit_intercept |
Should an intercept term be included in the model. If
|
normalize |
If |
fit_params |
Optional, a mapping from parameter names in the model's
|
cross_validation_parameters |
Optional, parameter grid for learner
parameters, e.g. |
oos_scores_table |
Optional, if provided, store out-of-sample predictions on training set data to this Redshift "schema.tablename". |
oos_scores_db |
Optional, the name of the database where the
|
oos_scores_if_exists |
Optional, action to take if
|
model_name |
Optional, the prefix of the Platform modeling jobs.
It will have |
cpu_requested |
Optional, the number of CPU shares requested in the Civis Platform for training jobs or prediction child jobs. 1024 shares = 1 CPU. |
memory_requested |
Optional, the memory requested from Civis Platform for training jobs or prediction child jobs, in MiB. |
disk_requested |
Optional, the disk space requested on Civis Platform for training jobs or prediction child jobs, in GB. |
notifications |
Optional, model status notifications. See
|
polling_interval |
Check for job completion every this number of seconds. |
verbose |
Optional, If |
civisml_version |
Optional, a one-length character vector of the CivisML version. The default is "prod", the latest version in production |
A civis_ml
object, a list containing the following elements:
job |
job metadata from |
run |
run metadata from |
outputs |
CivisML metadata from |
metrics |
Parsed CivisML output from
|
model_info |
Parsed CivisML output from
|
For building models with civis_ml
, the training data can reside in
four different places, a file in the Civis Platform, a CSV or feather-format file
on the local disk, a data.frame
resident in local the R environment, and finally,
a table in the Civis Platform. Use the following helpers to specify the
data source when calling civis_ml
:
data.frame
civis_ml(x = df, ...)
civis_ml(x = "path/to/data.csv", ...)
civis_ml(x = civis_file(1234))
civis_ml(x = civis_table(table_name = "schema.table", database_name = "database"))
## Not run: data(ChickWeight) m <- civis_ml_sparse_linear_regressor(ChickWeight, dependent_variable = "weight") yhat <- fetch_oos_scores(m) # make a prediction job, storing in a redshift table pred_info <- predict(m, newdata = civis_table("schema.table", "my_database"), output_table = "schema.scores_table") ## End(Not run)
## Not run: data(ChickWeight) m <- civis_ml_sparse_linear_regressor(ChickWeight, dependent_variable = "weight") yhat <- fetch_oos_scores(m) # make a prediction job, storing in a redshift table pred_info <- predict(m, newdata = civis_table("schema.table", "my_database"), output_table = "schema.scores_table") ## End(Not run)
CivisML Sparse Logistic
civis_ml_sparse_logistic( x, dependent_variable, primary_key = NULL, excluded_columns = NULL, penalty = c("l2", "l1"), dual = FALSE, tol = 1e-08, C = 499999950, fit_intercept = TRUE, intercept_scaling = 1, class_weight = NULL, random_state = 42, solver = c("liblinear", "newton-cg", "lbfgs", "sag"), max_iter = 100, multi_class = c("ovr", "multinomial"), fit_params = NULL, cross_validation_parameters = NULL, calibration = NULL, oos_scores_table = NULL, oos_scores_db = NULL, oos_scores_if_exists = c("fail", "append", "drop", "truncate"), model_name = NULL, cpu_requested = NULL, memory_requested = NULL, disk_requested = NULL, notifications = NULL, polling_interval = NULL, verbose = FALSE, civisml_version = "prod" )
civis_ml_sparse_logistic( x, dependent_variable, primary_key = NULL, excluded_columns = NULL, penalty = c("l2", "l1"), dual = FALSE, tol = 1e-08, C = 499999950, fit_intercept = TRUE, intercept_scaling = 1, class_weight = NULL, random_state = 42, solver = c("liblinear", "newton-cg", "lbfgs", "sag"), max_iter = 100, multi_class = c("ovr", "multinomial"), fit_params = NULL, cross_validation_parameters = NULL, calibration = NULL, oos_scores_table = NULL, oos_scores_db = NULL, oos_scores_if_exists = c("fail", "append", "drop", "truncate"), model_name = NULL, cpu_requested = NULL, memory_requested = NULL, disk_requested = NULL, notifications = NULL, polling_interval = NULL, verbose = FALSE, civisml_version = "prod" )
x |
See the Data Sources section below. |
dependent_variable |
The dependent variable of the training dataset. For a multi-target problem, this should be a vector of column names of dependent variables. Nulls in a single dependent variable will automatically be dropped. |
primary_key |
Optional, the unique ID (primary key) of the training
dataset. This will be used to index the out-of-sample scores. In
|
excluded_columns |
Optional, a vector of columns which will be considered ineligible to be independent variables. |
penalty |
Used to specify the norm used in the penalization. The
|
dual |
Dual or primal formulation. Dual formulation is only implemented
for |
tol |
Tolerance for stopping criteria. |
C |
Inverse of regularization strength, must be a positive float. Smaller values specify stronger regularization. |
fit_intercept |
Should a constant or intercept term be included in the model. |
intercept_scaling |
Useful only when the |
class_weight |
A
Note, the class weights are multiplied with |
random_state |
The seed of the random number generator to use when
shuffling the data. Used only in |
solver |
Algorithm to use in the optimization problem. For small data
Note that |
max_iter |
The maximum number of iterations taken for the solvers to
converge. Useful for the |
multi_class |
The scheme for multi-class problems. When |
fit_params |
Optional, a mapping from parameter names in the model's
|
cross_validation_parameters |
Optional, parameter grid for learner
parameters, e.g. |
calibration |
Optional, if not |
oos_scores_table |
Optional, if provided, store out-of-sample predictions on training set data to this Redshift "schema.tablename". |
oos_scores_db |
Optional, the name of the database where the
|
oos_scores_if_exists |
Optional, action to take if
|
model_name |
Optional, the prefix of the Platform modeling jobs.
It will have |
cpu_requested |
Optional, the number of CPU shares requested in the Civis Platform for training jobs or prediction child jobs. 1024 shares = 1 CPU. |
memory_requested |
Optional, the memory requested from Civis Platform for training jobs or prediction child jobs, in MiB. |
disk_requested |
Optional, the disk space requested on Civis Platform for training jobs or prediction child jobs, in GB. |
notifications |
Optional, model status notifications. See
|
polling_interval |
Check for job completion every this number of seconds. |
verbose |
Optional, If |
civisml_version |
Optional, a one-length character vector of the CivisML version. The default is "prod", the latest version in production |
A civis_ml
object, a list containing the following elements:
job |
job metadata from |
run |
run metadata from |
outputs |
CivisML metadata from |
metrics |
Parsed CivisML output from
|
model_info |
Parsed CivisML output from
|
For building models with civis_ml
, the training data can reside in
four different places, a file in the Civis Platform, a CSV or feather-format file
on the local disk, a data.frame
resident in local the R environment, and finally,
a table in the Civis Platform. Use the following helpers to specify the
data source when calling civis_ml
:
data.frame
civis_ml(x = df, ...)
civis_ml(x = "path/to/data.csv", ...)
civis_ml(x = civis_file(1234))
civis_ml(x = civis_table(table_name = "schema.table", database_name = "database"))
## Not run: df <- iris names(df) <- gsub("\\.", "_", names(df)) m <- civis_ml_sparse_logistic(df, "Species") yhat <- fetch_oos_scores(m) # Grid Search cv_params <- list(C = c(.01, 1, 10, 100, 1000)) m <- civis_ml_sparse_logistic(df, "Species", cross_validation_parameters = cv_params) # make a prediction job, storing in a redshift table pred_info <- predict(m, newdata = civis_table("schema.table", "my_database"), output_table = "schema.scores_table") ## End(Not run)
## Not run: df <- iris names(df) <- gsub("\\.", "_", names(df)) m <- civis_ml_sparse_logistic(df, "Species") yhat <- fetch_oos_scores(m) # Grid Search cv_params <- list(C = c(.01, 1, 10, 100, 1000)) m <- civis_ml_sparse_logistic(df, "Species", cross_validation_parameters = cv_params) # make a prediction job, storing in a redshift table pred_info <- predict(m, newdata = civis_table("schema.table", "my_database"), output_table = "schema.scores_table") ## End(Not run)
CivisML Sparse Ridge Regression
civis_ml_sparse_ridge_regressor( x, dependent_variable, primary_key = NULL, excluded_columns = NULL, alpha = 1, fit_intercept = TRUE, normalize = FALSE, max_iter = NULL, tol = 0.001, solver = c("auto", "svd", "cholesky", "lsqr", "sparse_cg", "sag"), random_state = 42, fit_params = NULL, cross_validation_parameters = NULL, oos_scores_table = NULL, oos_scores_db = NULL, oos_scores_if_exists = c("fail", "append", "drop", "truncate"), model_name = NULL, cpu_requested = NULL, memory_requested = NULL, disk_requested = NULL, notifications = NULL, polling_interval = NULL, verbose = FALSE, civisml_version = "prod" )
civis_ml_sparse_ridge_regressor( x, dependent_variable, primary_key = NULL, excluded_columns = NULL, alpha = 1, fit_intercept = TRUE, normalize = FALSE, max_iter = NULL, tol = 0.001, solver = c("auto", "svd", "cholesky", "lsqr", "sparse_cg", "sag"), random_state = 42, fit_params = NULL, cross_validation_parameters = NULL, oos_scores_table = NULL, oos_scores_db = NULL, oos_scores_if_exists = c("fail", "append", "drop", "truncate"), model_name = NULL, cpu_requested = NULL, memory_requested = NULL, disk_requested = NULL, notifications = NULL, polling_interval = NULL, verbose = FALSE, civisml_version = "prod" )
x |
See the Data Sources section below. |
dependent_variable |
The dependent variable of the training dataset. For a multi-target problem, this should be a vector of column names of dependent variables. Nulls in a single dependent variable will automatically be dropped. |
primary_key |
Optional, the unique ID (primary key) of the training
dataset. This will be used to index the out-of-sample scores. In
|
excluded_columns |
Optional, a vector of columns which will be considered ineligible to be independent variables. |
alpha |
The regularization strength, must be a vector of floats of length n_targets or a single float. Larger values specify stronger regularization. |
fit_intercept |
Should an intercept term be included in the model. If
|
normalize |
If |
max_iter |
Maximum number of iterations for conjugate gradient solver.
For |
tol |
Precision of the solution. |
solver |
Solver to use for the optimization problem.
|
random_state |
The seed of the pseudo random number generator to use
when shuffling the data. Used only when |
fit_params |
Optional, a mapping from parameter names in the model's
|
cross_validation_parameters |
Optional, parameter grid for learner
parameters, e.g. |
oos_scores_table |
Optional, if provided, store out-of-sample predictions on training set data to this Redshift "schema.tablename". |
oos_scores_db |
Optional, the name of the database where the
|
oos_scores_if_exists |
Optional, action to take if
|
model_name |
Optional, the prefix of the Platform modeling jobs.
It will have |
cpu_requested |
Optional, the number of CPU shares requested in the Civis Platform for training jobs or prediction child jobs. 1024 shares = 1 CPU. |
memory_requested |
Optional, the memory requested from Civis Platform for training jobs or prediction child jobs, in MiB. |
disk_requested |
Optional, the disk space requested on Civis Platform for training jobs or prediction child jobs, in GB. |
notifications |
Optional, model status notifications. See
|
polling_interval |
Check for job completion every this number of seconds. |
verbose |
Optional, If |
civisml_version |
Optional, a one-length character vector of the CivisML version. The default is "prod", the latest version in production |
A civis_ml
object, a list containing the following elements:
job |
job metadata from |
run |
run metadata from |
outputs |
CivisML metadata from |
metrics |
Parsed CivisML output from
|
model_info |
Parsed CivisML output from
|
For building models with civis_ml
, the training data can reside in
four different places, a file in the Civis Platform, a CSV or feather-format file
on the local disk, a data.frame
resident in local the R environment, and finally,
a table in the Civis Platform. Use the following helpers to specify the
data source when calling civis_ml
:
data.frame
civis_ml(x = df, ...)
civis_ml(x = "path/to/data.csv", ...)
civis_ml(x = civis_file(1234))
civis_ml(x = civis_table(table_name = "schema.table", database_name = "database"))
## Not run: data(ChickWeight) m <- civis_ml_sparse_ridge_regressor(ChickWeight, dependent_variable = "weight", alpha = 999) yhat <- fetch_oos_scores(m) # Grid search cv_params <- list(alpha = c(.001, .01, .1, 1)) m <- civis_ml_sparse_ridge_regressor(ChickWeight, dependent_variable = "weight", cross_validation_parameters = cv_params, calibration = NULL) # make a prediction job, storing in a redshift table pred_info <- predict(m, newdata = civis_table("schema.table", "my_database"), output_table = "schema.scores_table") ## End(Not run)
## Not run: data(ChickWeight) m <- civis_ml_sparse_ridge_regressor(ChickWeight, dependent_variable = "weight", alpha = 999) yhat <- fetch_oos_scores(m) # Grid search cv_params <- list(alpha = c(.001, .01, .1, 1)) m <- civis_ml_sparse_ridge_regressor(ChickWeight, dependent_variable = "weight", cross_validation_parameters = cv_params, calibration = NULL) # make a prediction job, storing in a redshift table pred_info <- predict(m, newdata = civis_table("schema.table", "my_database"), output_table = "schema.scores_table") ## End(Not run)
This is used as with the future
API as an argument to plan
.
civis_platform(...)
civis_platform(...)
... |
Arguments to |
The result of evaluating expr
.
## Not run: plan(civis_platform) # Specify required resources, image, and tag. fut <- future({2 + 2}, required_resources = list(cpu = 1024, memory = 2048), docker_image_name = "civisanalytics/datascience-r", docker_image_tag = "3") # Evaluate the future later fut <- future({2 + 2}, lazy = TRUE) run(fut) # check if a future has resolved resolved(fut) # block until the future resolves, and return the value or throw error value(fut) # cancel the job cancel(fut) # grab the run logs fetch_logs(fut) # handle errors fut <- future({stop("Error!")}) e <- tryCatch(value(fut), error = function(e) e) get_error(e) ## End(Not run)
## Not run: plan(civis_platform) # Specify required resources, image, and tag. fut <- future({2 + 2}, required_resources = list(cpu = 1024, memory = 2048), docker_image_name = "civisanalytics/datascience-r", docker_image_tag = "3") # Evaluate the future later fut <- future({2 + 2}, lazy = TRUE) run(fut) # check if a future has resolved resolved(fut) # block until the future resolves, and return the value or throw error value(fut) # cancel the job cancel(fut) # grab the run logs fetch_logs(fut) # handle errors fut <- future({stop("Error!")}) e <- tryCatch(value(fut), error = function(e) e) get_error(e) ## End(Not run)
Create a civis_script object from a job and run id.
civis_script(id, run_id = NULL)
civis_script(id, run_id = NULL)
id |
integer, job id of the script. |
run_id |
integer, id of the run. If |
A civis_script
can be any custom, container, R, Python, SQL, or Javacript platform script.
a civis_script
object.
Other script_utils:
fetch_output_file_ids()
,
run_civis()
,
run_template()
Use civis_table
to use a table in the Civis Platform with
civis_ml.
civis_table( table_name, database_name = NULL, sql_where = NULL, sql_limit = NULL )
civis_table( table_name, database_name = NULL, sql_where = NULL, sql_limit = NULL )
table_name |
The table name, as |
database_name |
The name of the database holding |
sql_where |
A |
sql_limit |
A |
A civis_table
.
Split a Redshift table into multiple CSV parts on S3 and return their locations as file IDs and presigned S3 urls.
civis_to_multifile_csv( sql, database, job_name = NULL, hidden = TRUE, include_header = TRUE, compression = "gzip", delimiter = ",", unquoted = FALSE, prefix = NULL )
civis_to_multifile_csv( sql, database, job_name = NULL, hidden = TRUE, include_header = TRUE, compression = "gzip", delimiter = ",", unquoted = FALSE, prefix = NULL )
sql |
string, The SQL select string to be executed. |
database |
string, Name of database where query is run. |
job_name |
string, optional. Name to identify scripted sql job. |
logical, Whether to hide the query in platform. |
|
include_header |
logical, optional. Whether to include headers as an element in the returned list. |
compression |
string, optional, Type of compression to use, if any. One of 'none', 'zip', or 'gzip'. |
delimiter |
string, optional. Which delimiter to use. One of ',', '\t' or '|'. |
unquoted |
logical, optional. Whether or not to quote fields. |
prefix |
string, optional. A user specified filename prefix for the output files to have. |
When tables are large, unloading by splitting them first is faster. When we split a table, each Redshift compute node can dump its data into S3 in parallel with the others. By doing so, we avoid having all compute nodes sending the data through the leader node, which is slow.
This function returns a list that contains the location of the CSV parts as file IDs and presigned S3 urls. The user can use either the file IDs or the presigned S3 urls to download the CSV parts. The content of the list returned by this function is similar to that of the manifest file returned by Amazon S3 UNLOAD statements.
A list with the items:
header: column headers if 'include_header' is TRUE
query: the executed query
entries: a list containing presigned urls for each csv part
compression: the type of compression on each csv part
delimiter: the delimiter used to separate fields
unquoted: whether fields are quoted
## Not run: # Download a table into multiple csv parts sql <- "SELECT * FROM schema.table" database <- "important_database" manifest <- civis_to_multifile_csv(sql=sql, database=database) files <- lapply(manifest[["entries"]], function(x) { download_civis(x$id, x$name) x$name }) ## End(Not run)
## Not run: # Download a table into multiple csv parts sql <- "SELECT * FROM schema.table" database <- "important_database" manifest <- civis_to_multifile_csv(sql=sql, database=database) files <- lapply(manifest[["entries"]], function(x) { download_civis(x$id, x$name) x$name }) ## End(Not run)
Evaluate an expression in Civis Platform
CivisFuture( expr = NULL, envir = parent.frame(), substitute = FALSE, globals = TRUE, packages = NULL, lazy = FALSE, local = TRUE, gc = FALSE, earlySignal = FALSE, label = NULL, required_resources = list(cpu = 1024, memory = 2048, diskSpace = 4), docker_image_name = "civisanalytics/datascience-r", docker_image_tag = "latest", ... ) ## S3 method for class 'CivisFuture' run(future, ...) ## S3 method for class 'CivisFuture' result(future, ...) ## S3 method for class 'CivisFuture' cancel(future, ...) ## S3 method for class 'CivisFuture' resolved(future, ...) ## S3 method for class 'CivisFuture' fetch_logs(object, ...)
CivisFuture( expr = NULL, envir = parent.frame(), substitute = FALSE, globals = TRUE, packages = NULL, lazy = FALSE, local = TRUE, gc = FALSE, earlySignal = FALSE, label = NULL, required_resources = list(cpu = 1024, memory = 2048, diskSpace = 4), docker_image_name = "civisanalytics/datascience-r", docker_image_tag = "latest", ... ) ## S3 method for class 'CivisFuture' run(future, ...) ## S3 method for class 'CivisFuture' result(future, ...) ## S3 method for class 'CivisFuture' cancel(future, ...) ## S3 method for class 'CivisFuture' resolved(future, ...) ## S3 method for class 'CivisFuture' fetch_logs(object, ...)
expr |
An R expression. |
envir |
The environment from where global objects should be identified. |
substitute |
If TRUE, argument |
globals |
(optional) a logical, a character vector, or a named list
to control how globals are handled.
For details, see section 'Globals used by future expressions'
in the help for |
packages |
(optional) a character vector specifying packages to be attached in the R environment evaluating the future. |
lazy |
If FALSE (default), the future is resolved eagerly (starting immediately), otherwise not. |
local |
If TRUE, the expression is evaluated such that all assignments are done to local temporary environment, otherwise the assignments are done to the global environment of the R process evaluating the future. |
gc |
If TRUE, the garbage collector run (in the process that
evaluated the future) only after the value of the future is collected.
Exactly when the values are collected may depend on various factors such
as number of free workers and whether |
earlySignal |
Specified whether conditions should be signaled as soon as possible or not. |
label |
An optional character string label attached to the future. |
required_resources |
resources, see |
docker_image_name |
the image for the container script. |
docker_image_tag |
the tag for the Docker image. |
... |
arguments to |
future |
CivisFuture object. |
object |
CivisFuture |
A CivisFuture
inheriting from Future
that evaluates expr
on the given container.
run
: Run a CivisFuture
result
: Return the value of a CivisFuture
cancel
: Cancel a CivisFuture
resolved
: Check if a CivisFutre has resolved
fetch_logs
: Fetch logs from a CivisFuture
Delete a Cluster Partition
clusters_delete_kubernetes_partitions(id, cluster_partition_id)
clusters_delete_kubernetes_partitions(id, cluster_partition_id)
id |
integer required. The ID of the cluster which this partition belongs to. |
cluster_partition_id |
integer required. The ID of this cluster partition. |
An empty HTTP response
Describe a Kubernetes Cluster
clusters_get_kubernetes(id, include_usage_stats = NULL)
clusters_get_kubernetes(id, include_usage_stats = NULL)
id |
integer required. |
include_usage_stats |
boolean optional. When true, usage stats are returned in instance config objects. Defaults to false. |
A list containing the following elements:
id |
integer, The ID of this cluster. |
organizationId |
string, The id of this cluster's organization. |
organizationName |
string, The name of this cluster's organization. |
organizationSlug |
string, The slug of this cluster's organization. |
clusterPartitions |
array, An array containing the following fields:
|
isNatEnabled |
boolean, Whether this cluster needs a NAT gateway or not. |
hours |
number, The number of hours used this month for this cluster |
Describe an Instance Config
clusters_get_kubernetes_instance_configs( instance_config_id, include_usage_stats = NULL )
clusters_get_kubernetes_instance_configs( instance_config_id, include_usage_stats = NULL )
instance_config_id |
integer required. The ID of this instance config. |
include_usage_stats |
boolean optional. When true, usage stats are returned in instance config objects. Defaults to false. |
A list containing the following elements:
instanceConfigId |
integer, The ID of this InstanceConfig. |
instanceType |
string, An EC2 instance type. Possible values include t2.large, m4.xlarge, m4.2xlarge, m4.4xlarge, m5.12xlarge, and p2.xlarge. |
minInstances |
integer, The minimum number of instances of that type in this cluster. |
maxInstances |
integer, The maximum number of instances of that type in this cluster. |
instanceMaxMemory |
integer, The amount of memory (RAM) available to a single instance of that type in megabytes. |
instanceMaxCpu |
integer, The number of processor shares available to a single instance of that type in millicores. |
instanceMaxDisk |
integer, The amount of disk available to a single instance of that type in gigabytes. |
usageStats |
list, A list containing the following elements:
|
Describe a Cluster Partition
clusters_get_kubernetes_partitions( id, cluster_partition_id, include_usage_stats = NULL )
clusters_get_kubernetes_partitions( id, cluster_partition_id, include_usage_stats = NULL )
id |
integer required. The ID of the cluster which this partition belongs to. |
cluster_partition_id |
integer required. The ID of this cluster partition. |
include_usage_stats |
boolean optional. When true, usage stats are returned in instance config objects. Defaults to false. |
A list containing the following elements:
clusterPartitionId |
integer, The ID of this cluster partition. |
name |
string, The name of the cluster partition. |
labels |
array, Labels associated with this partition. |
instanceConfigs |
array, An array containing the following fields:
|
defaultInstanceConfigId |
integer, The id of the InstanceConfig that is the default for this partition. |
List Kubernetes Clusters
clusters_list_kubernetes( organization_slug = NULL, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
clusters_list_kubernetes( organization_slug = NULL, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
organization_slug |
string optional. The slug of this cluster's organization. |
limit |
integer optional. Number of results to return. Defaults to its maximum of 50. |
page_num |
integer optional. Page number of the results to return. Defaults to the first page, 1. |
order |
string optional. The field on which to order the result set. Defaults to organization_id. Must be one of: organization_id, created_at. |
order_dir |
string optional. Direction in which to sort, either asc (ascending) or desc (descending) defaulting to asc. |
An array containing the following fields:
id |
integer, The ID of this cluster. |
organizationId |
string, The id of this cluster's organization. |
organizationName |
string, The name of this cluster's organization. |
organizationSlug |
string, The slug of this cluster's organization. |
clusterPartitions |
array, An array containing the following fields:
|
isNatEnabled |
boolean, Whether this cluster needs a NAT gateway or not. |
Get stats about deployments associated with a Kubernetes Cluster
clusters_list_kubernetes_deployment_stats(id)
clusters_list_kubernetes_deployment_stats(id)
id |
integer required. The ID of this cluster. |
An array containing the following fields:
baseType |
string, The base type of this deployment |
state |
string, State of the deployment |
count |
integer, Number of deployments of base type and state |
totalCpu |
integer, Total amount of CPU in millicores for deployments of base type and state |
totalMemory |
integer, Total amount of Memory in megabytes for deployments of base type and state |
List the deployments associated with a Kubernetes Cluster
clusters_list_kubernetes_deployments( id, base_type = NULL, state = NULL, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
clusters_list_kubernetes_deployments( id, base_type = NULL, state = NULL, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
id |
integer required. The id of the cluster. |
base_type |
string optional. If specified, return deployments of these base types. It accepts a comma-separated list, possible values are 'Notebook', 'Service', 'Run'. |
state |
string optional. If specified, return deployments in these states. It accepts a comma-separated list, possible values are pending, running, terminated, sleeping |
limit |
integer optional. Number of results to return. Defaults to its maximum of 50. |
page_num |
integer optional. Page number of the results to return. Defaults to the first page, 1. |
order |
string optional. The field on which to order the result set. Defaults to created_at. Must be one of: created_at. |
order_dir |
string optional. Direction in which to sort, either asc (ascending) or desc (descending) defaulting to asc. |
An array containing the following fields:
id |
integer, The id of this deployment. |
name |
string, The name of the deployment. |
baseId |
integer, The id of the base object associated with the deployment. |
baseType |
string, The base type of this deployment. |
state |
string, The state of the deployment. |
cpu |
integer, The CPU in millicores required by the deployment. |
memory |
integer, The memory in MB required by the deployment. |
diskSpace |
integer, The disk space in GB required by the deployment. |
instanceType |
string, The EC2 instance type requested for the deployment. |
author |
list, A list containing the following elements:
|
createdAt |
string, |
updatedAt |
string, |
Get graphs of historical resource usage in an Instance Config
clusters_list_kubernetes_instance_configs_historical_graphs( instance_config_id, timeframe = NULL )
clusters_list_kubernetes_instance_configs_historical_graphs( instance_config_id, timeframe = NULL )
instance_config_id |
integer required. The ID of this instance config. |
timeframe |
string optional. The span of time that the graphs cover. Must be one of 1_day, 1_week. |
A list containing the following elements:
cpuGraphUrl |
string, URL for the graph of historical CPU usage in this instance config. |
memGraphUrl |
string, URL for the graph of historical memory usage in this instance config. |
Get statistics about the current users of an Instance Config
clusters_list_kubernetes_instance_configs_user_statistics( instance_config_id, order = NULL, order_dir = NULL )
clusters_list_kubernetes_instance_configs_user_statistics( instance_config_id, order = NULL, order_dir = NULL )
instance_config_id |
integer required. The ID of this instance config. |
order |
string optional. The field on which to order the result set. Defaults to running_deployments. Must be one of pending_memory_requested, pending_cpu_requested, running_memory_requested, running_cpu_requested, pending_deployments, running_deployments. |
order_dir |
string optional. Direction in which to sort, either asc (ascending) or desc (descending). Defaults to desc. |
An array containing the following fields:
userId |
string, The owning user's ID |
userName |
string, The owning user's name |
pendingDeployments |
integer, The number of deployments belonging to the owning user in "pending" state |
pendingMemoryRequested |
integer, The sum of memory requests (in MB) for deployments belonging to the owning user in "pending" state |
pendingCpuRequested |
integer, The sum of CPU requests (in millicores) for deployments belonging to the owning user in "pending" state |
runningDeployments |
integer, The number of deployments belonging to the owning user in "running" state |
runningMemoryRequested |
integer, The sum of memory requests (in MB) for deployments belonging to the owning user in "running" state |
runningCpuRequested |
integer, The sum of CPU requests (in millicores) for deployments belonging to the owning user in "running" state |
List Cluster Partitions for given cluster
clusters_list_kubernetes_partitions(id, include_usage_stats = NULL)
clusters_list_kubernetes_partitions(id, include_usage_stats = NULL)
id |
integer required. |
include_usage_stats |
boolean optional. When true, usage stats are returned in instance config objects. Defaults to false. |
An array containing the following fields:
clusterPartitionId |
integer, The ID of this cluster partition. |
name |
string, The name of the cluster partition. |
labels |
array, Labels associated with this partition. |
instanceConfigs |
array, An array containing the following fields:
|
defaultInstanceConfigId |
integer, The id of the InstanceConfig that is the default for this partition. |
Update a Kubernetes Cluster
clusters_patch_kubernetes(id, is_nat_enabled = NULL)
clusters_patch_kubernetes(id, is_nat_enabled = NULL)
id |
integer required. The ID of this cluster. |
is_nat_enabled |
boolean optional. Whether this cluster needs a NAT gateway or not. |
A list containing the following elements:
id |
integer, The ID of this cluster. |
organizationId |
string, The id of this cluster's organization. |
organizationName |
string, The name of this cluster's organization. |
organizationSlug |
string, The slug of this cluster's organization. |
clusterPartitions |
array, An array containing the following fields:
|
isNatEnabled |
boolean, Whether this cluster needs a NAT gateway or not. |
hours |
number, The number of hours used this month for this cluster |
Update a Cluster Partition
clusters_patch_kubernetes_partitions( id, cluster_partition_id, instance_configs = NULL, name = NULL, labels = NULL )
clusters_patch_kubernetes_partitions( id, cluster_partition_id, instance_configs = NULL, name = NULL, labels = NULL )
id |
integer required. The ID of the cluster which this partition belongs to. |
cluster_partition_id |
integer required. The ID of this cluster partition. |
instance_configs |
array optional. An array containing the following fields:
|
name |
string optional. The name of the cluster partition. |
labels |
array optional. Labels associated with this partition. |
A list containing the following elements:
clusterPartitionId |
integer, The ID of this cluster partition. |
name |
string, The name of the cluster partition. |
labels |
array, Labels associated with this partition. |
instanceConfigs |
array, An array containing the following fields:
|
defaultInstanceConfigId |
integer, The id of the InstanceConfig that is the default for this partition. |
Create a Kubernetes Cluster
clusters_post_kubernetes( organization_id = NULL, organization_slug = NULL, is_nat_enabled = NULL )
clusters_post_kubernetes( organization_id = NULL, organization_slug = NULL, is_nat_enabled = NULL )
organization_id |
string optional. The id of this cluster's organization. |
organization_slug |
string optional. The slug of this cluster's organization. |
is_nat_enabled |
boolean optional. Whether this cluster needs a NAT gateway or not. |
A list containing the following elements:
id |
integer, The ID of this cluster. |
organizationId |
string, The id of this cluster's organization. |
organizationName |
string, The name of this cluster's organization. |
organizationSlug |
string, The slug of this cluster's organization. |
clusterPartitions |
array, An array containing the following fields:
|
isNatEnabled |
boolean, Whether this cluster needs a NAT gateway or not. |
hours |
number, The number of hours used this month for this cluster |
Create a Cluster Partition for given cluster
clusters_post_kubernetes_partitions(id, instance_configs, name, labels)
clusters_post_kubernetes_partitions(id, instance_configs, name, labels)
id |
integer required. The ID of the cluster which this partition belongs to. |
instance_configs |
array required. An array containing the following fields:
|
name |
string required. The name of the cluster partition. |
labels |
array required. Labels associated with this partition. |
A list containing the following elements:
clusterPartitionId |
integer, The ID of this cluster partition. |
name |
string, The name of the cluster partition. |
labels |
array, Labels associated with this partition. |
instanceConfigs |
array, An array containing the following fields:
|
defaultInstanceConfigId |
integer, The id of the InstanceConfig that is the default for this partition. |
Get civis_ml model coefficients
## S3 method for class 'civis_ml' coef(object, complete = TRUE, ...)
## S3 method for class 'civis_ml' coef(object, complete = TRUE, ...)
object |
civis_ml_model |
complete |
see documentation for generic |
... |
other arguments |
Outputs coefficients with names in the style of 'stats::coef'
a matrix of coefficients, or 'NULL' if none available from CivisML
Get a credential
credentials_get(id)
credentials_get(id)
id |
integer required. The ID of the credential. |
A list containing the following elements:
id |
integer, The ID of the credential. |
name |
string, The name identifying the credential |
type |
string, The credential's type. |
username |
string, The username for the credential. |
description |
string, A long description of the credential. |
owner |
string, The name of the user who this credential belongs to. |
remoteHostId |
integer, The ID of the remote host associated with this credential. |
remoteHostName |
string, The name of the remote host associated with this credential. |
state |
string, The U.S. state for the credential. Only for VAN credentials. |
createdAt |
string, The creation time for this credential. |
updatedAt |
string, The last modification time for this credential. |
List credentials
credentials_list( type = NULL, remote_host_id = NULL, default = NULL, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
credentials_list( type = NULL, remote_host_id = NULL, default = NULL, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
type |
string optional. The type (or types) of credentials to return. One or more of: Amazon Web Services S3, Bitbucket, CASS/NCOA PAF, Certificate, Civis Platform, Custom, Database, Google, Github, Salesforce User, Salesforce Client, and TableauUser. Specify multiple values as a comma-separated list (e.g., "A,B"). |
remote_host_id |
integer optional. The ID of the remote host associated with the credentials to return. |
default |
boolean optional. If true, will return a list with a single credential which is the current user's default credential. |
limit |
integer optional. Number of results to return. Defaults to its maximum of 1000. |
page_num |
integer optional. Page number of the results to return. Defaults to the first page, 1. |
order |
string optional. The field on which to order the result set. Defaults to updated_at. Must be one of: updated_at, created_at, name. |
order_dir |
string optional. Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc. |
An array containing the following fields:
id |
integer, The ID of the credential. |
name |
string, The name identifying the credential |
type |
string, The credential's type. |
username |
string, The username for the credential. |
description |
string, A long description of the credential. |
owner |
string, The name of the user who this credential belongs to. |
remoteHostId |
integer, The ID of the remote host associated with this credential. |
remoteHostName |
string, The name of the remote host associated with this credential. |
state |
string, The U.S. state for the credential. Only for VAN credentials. |
createdAt |
string, The creation time for this credential. |
updatedAt |
string, The last modification time for this credential. |
Create a credential
credentials_post( type, username, password, name = NULL, description = NULL, remote_host_id = NULL, state = NULL, system_credential = NULL )
credentials_post( type, username, password, name = NULL, description = NULL, remote_host_id = NULL, state = NULL, system_credential = NULL )
type |
string required. |
username |
string required. The username for the credential. |
password |
string required. The password for the credential. |
name |
string optional. The name identifying the credential. |
description |
string optional. A long description of the credential. |
remote_host_id |
integer optional. The ID of the remote host associated with the credential. |
state |
string optional. The U.S. state for the credential. Only for VAN credentials. |
system_credential |
boolean optional. |
A list containing the following elements:
id |
integer, The ID of the credential. |
name |
string, The name identifying the credential |
type |
string, The credential's type. |
username |
string, The username for the credential. |
description |
string, A long description of the credential. |
owner |
string, The name of the user who this credential belongs to. |
remoteHostId |
integer, The ID of the remote host associated with this credential. |
remoteHostName |
string, The name of the remote host associated with this credential. |
state |
string, The U.S. state for the credential. Only for VAN credentials. |
createdAt |
string, The creation time for this credential. |
updatedAt |
string, The last modification time for this credential. |
Authenticate against a remote host
credentials_post_authenticate(url, remote_host_type, username, password)
credentials_post_authenticate(url, remote_host_type, username, password)
url |
string required. The URL to your host. |
remote_host_type |
string required. The type of remote host. One of: RemoteHostTypes::Bitbucket, RemoteHostTypes::GitSSH, RemoteHostTypes::Github, RemoteHostTypes::GoogleDoc, RemoteHostTypes::JDBC, RemoteHostTypes::Postgres, RemoteHostTypes::Redshift, RemoteHostTypes::S3Storage, and RemoteHostTypes::Salesforce |
username |
string required. The username for the credential. |
password |
string required. The password for the credential. |
A list containing the following elements:
id |
integer, The ID of the credential. |
name |
string, The name identifying the credential |
type |
string, The credential's type. |
username |
string, The username for the credential. |
description |
string, A long description of the credential. |
owner |
string, The name of the user who this credential belongs to. |
remoteHostId |
integer, The ID of the remote host associated with this credential. |
remoteHostName |
string, The name of the remote host associated with this credential. |
state |
string, The U.S. state for the credential. Only for VAN credentials. |
createdAt |
string, The creation time for this credential. |
updatedAt |
string, The last modification time for this credential. |
Generate a temporary credential for accessing S3
credentials_post_temporary(id, duration = NULL)
credentials_post_temporary(id, duration = NULL)
id |
integer required. The ID of the credential. |
duration |
integer optional. The number of seconds the temporary credential should be valid. Defaults to 15 minutes. Must not be less than 15 minutes or greater than 36 hours. |
A list containing the following elements:
accessKey |
string, The identifier of the credential. |
secretAccessKey |
string, The secret part of the credential. |
sessionToken |
string, The session token identifier. |
Update an existing credential
credentials_put( id, type, username, password, name = NULL, description = NULL, remote_host_id = NULL, state = NULL, system_credential = NULL )
credentials_put( id, type, username, password, name = NULL, description = NULL, remote_host_id = NULL, state = NULL, system_credential = NULL )
id |
integer required. The ID of the credential. |
type |
string required. |
username |
string required. The username for the credential. |
password |
string required. The password for the credential. |
name |
string optional. The name identifying the credential. |
description |
string optional. A long description of the credential. |
remote_host_id |
integer optional. The ID of the remote host associated with the credential. |
state |
string optional. The U.S. state for the credential. Only for VAN credentials. |
system_credential |
boolean optional. |
A list containing the following elements:
id |
integer, The ID of the credential. |
name |
string, The name identifying the credential |
type |
string, The credential's type. |
username |
string, The username for the credential. |
description |
string, A long description of the credential. |
owner |
string, The name of the user who this credential belongs to. |
remoteHostId |
integer, The ID of the remote host associated with this credential. |
remoteHostName |
string, The name of the remote host associated with this credential. |
state |
string, The U.S. state for the credential. Only for VAN credentials. |
createdAt |
string, The creation time for this credential. |
updatedAt |
string, The last modification time for this credential. |
Remove a whitelisted IP address
databases_delete_whitelist_ips(id, whitelisted_ip_id)
databases_delete_whitelist_ips(id, whitelisted_ip_id)
id |
integer required. The ID of the database this rule is applied to. |
whitelisted_ip_id |
integer required. The ID of this whitelisted IP address. |
An empty HTTP response
Show database information
databases_get(id)
databases_get(id)
id |
integer required. The ID for the database. |
A list containing the following elements:
id |
integer, The ID for the database. |
name |
string, The name of the database. |
adapter |
string, The type of the database. |
View details about a whitelisted IP
databases_get_whitelist_ips(id, whitelisted_ip_id)
databases_get_whitelist_ips(id, whitelisted_ip_id)
id |
integer required. The ID of the database this rule is applied to. |
whitelisted_ip_id |
integer required. The ID of this whitelisted IP address. |
A list containing the following elements:
id |
integer, The ID of this whitelisted IP address. |
remoteHostId |
integer, The ID of the database this rule is applied to. |
securityGroupId |
string, The ID of the security group this rule is applied to. |
subnetMask |
string, The subnet mask that is allowed by this rule. |
authorizedBy |
string, The user who authorized this rule. |
isActive |
boolean, True if the rule is applied, false if it has been revoked. |
createdAt |
string, The time this rule was created. |
updatedAt |
string, The time this rule was last updated. |
List databases
databases_list()
databases_list()
An array containing the following fields:
id |
integer, The ID for the database. |
name |
string, The name of the database. |
adapter |
string, The type of the database. |
Get the advanced settings for this database
databases_list_advanced_settings(id)
databases_list_advanced_settings(id)
id |
integer required. The ID of the database this advanced settings object belongs to. |
A list containing the following elements:
exportCachingEnabled |
boolean, Whether or not caching is enabled for export jobs run on this database server. |
List schemas in this database
databases_list_schemas(id)
databases_list_schemas(id)
id |
integer required. The ID of the database. |
An array containing the following fields:
schema |
string, The name of a schema. |
List tables in the specified database, deprecated use "GET /tables" instead
databases_list_tables( id, name = NULL, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
databases_list_tables( id, name = NULL, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
id |
integer required. The ID of the database. |
name |
string optional. If specified, will be used to filter the tables returned. Substring matching is supported (e.g., "name=table" will return both "table1" and "my table"). |
limit |
integer optional. Number of results to return. Defaults to 200. Maximum allowed is 1000. |
page_num |
integer optional. Page number of the results to return. Defaults to the first page, 1. |
order |
string optional. The field on which to order the result set. Defaults to name. Must be one of: name. |
order_dir |
string optional. Direction in which to sort, either asc (ascending) or desc (descending) defaulting to asc. |
An array containing the following fields:
id |
integer, The ID of the table. |
databaseId |
integer, The ID of the database. |
schema |
string, The name of the schema containing the table. |
name |
string, Name of the table. |
description |
string, The description of the table, as specified by the table owner |
isView |
boolean, True if this table represents a view. False if it represents a regular table. |
rowCount |
integer, The number of rows in the table. |
columnCount |
integer, The number of columns in the table. |
sizeMb |
number, The size of the table in megabytes. |
owner |
string, The database username of the table's owner. |
distkey |
string, The column used as the Amazon Redshift distkey. |
sortkeys |
string, The column used as the Amazon Redshift sortkey. |
refreshStatus |
string, How up-to-date the table's statistics on row counts, null counts, distinct counts, and values distributions are. One of: refreshing, stale, or current. |
lastRefresh |
string, The time of the last statistics refresh. |
refreshId |
string, The ID of the most recent statistics refresh. |
lastRun |
list, A list containing the following elements:
|
List tables in the specified database, deprecated use "GET /tables" instead
databases_list_tables_search(id, name = NULL, column_name = NULL)
databases_list_tables_search(id, name = NULL, column_name = NULL)
id |
integer required. The ID of the database. |
name |
string optional. If specified, will be used to filter the tables returned. Substring matching is supported (e.g., "name=table" will return both "table1" and "my table"). |
column_name |
string optional. Search for tables containing a column with the given name. |
An array containing the following fields:
id |
integer, The ID of the table. |
databaseId |
integer, The ID of the database. |
schema |
string, The name of the schema containing the table. |
name |
string, Name of the table. |
description |
string, The description of the table, as specified by the table owner |
isView |
boolean, True if this table represents a view. False if it represents a regular table. |
rowCount |
integer, The number of rows in the table. |
columnCount |
integer, The number of columns in the table. |
sizeMb |
number, The size of the table in megabytes. |
owner |
string, The database username of the table's owner. |
distkey |
string, The column used as the Amazon Redshift distkey. |
sortkeys |
string, The column used as the Amazon Redshift sortkey. |
refreshStatus |
string, How up-to-date the table's statistics on row counts, null counts, distinct counts, and values distributions are. One of: refreshing, stale, or current. |
lastRefresh |
string, The time of the last statistics refresh. |
refreshId |
string, The ID of the most recent statistics refresh. |
lastRun |
list, A list containing the following elements:
|
columnNames |
array, The names of each column in the table. |
List whitelisted IPs for the specified database
databases_list_whitelist_ips(id)
databases_list_whitelist_ips(id)
id |
integer required. The ID for the database. |
An array containing the following fields:
id |
integer, The ID of this whitelisted IP address. |
remoteHostId |
integer, The ID of the database this rule is applied to. |
securityGroupId |
string, The ID of the security group this rule is applied to. |
subnetMask |
string, The subnet mask that is allowed by this rule. |
createdAt |
string, The time this rule was created. |
updatedAt |
string, The time this rule was last updated. |
Update the advanced settings for this database
databases_patch_advanced_settings(id, export_caching_enabled = NULL)
databases_patch_advanced_settings(id, export_caching_enabled = NULL)
id |
integer required. The ID of the database this advanced settings object belongs to. |
export_caching_enabled |
boolean optional. Whether or not caching is enabled for export jobs run on this database server. |
A list containing the following elements:
exportCachingEnabled |
boolean, Whether or not caching is enabled for export jobs run on this database server. |
Creates and enqueues a schema scanner job
databases_post_schemas_scan(id, schema, stats_priority = NULL)
databases_post_schemas_scan(id, schema, stats_priority = NULL)
id |
integer required. The ID of the database. |
schema |
string required. The name of the schema. |
stats_priority |
string optional. When to sync table statistics for every table in the schema. Valid options are the following. Option: 'flag' means to flag stats for the next scheduled run of a full table scan on the database. Option: 'block' means to block this job on stats syncing. Option: 'queue' means to queue a separate job for syncing stats and do not block this job on the queued job. Defaults to 'flag' |
A list containing the following elements:
jobId |
integer, The ID of the job created. |
runId |
integer, The ID of the run created. |
Whitelist an IP address
databases_post_whitelist_ips(id, subnet_mask)
databases_post_whitelist_ips(id, subnet_mask)
id |
integer required. The ID of the database this rule is applied to. |
subnet_mask |
string required. The subnet mask that is allowed by this rule. |
A list containing the following elements:
id |
integer, The ID of this whitelisted IP address. |
remoteHostId |
integer, The ID of the database this rule is applied to. |
securityGroupId |
string, The ID of the security group this rule is applied to. |
subnetMask |
string, The subnet mask that is allowed by this rule. |
authorizedBy |
string, The user who authorized this rule. |
isActive |
boolean, True if the rule is applied, false if it has been revoked. |
createdAt |
string, The time this rule was created. |
updatedAt |
string, The time this rule was last updated. |
Edit the advanced settings for this database
databases_put_advanced_settings(id, export_caching_enabled)
databases_put_advanced_settings(id, export_caching_enabled)
id |
integer required. The ID of the database this advanced settings object belongs to. |
export_caching_enabled |
boolean required. Whether or not caching is enabled for export jobs run on this database server. |
A list containing the following elements:
exportCachingEnabled |
boolean, Whether or not caching is enabled for export jobs run on this database server. |
The current user's default credential.
default_credential()
default_credential()
credential_id, id of the default credential for the current user.
download_civis
downloads a file based on the type of its first
argument, which can be a string "schema.table"
,
a SQL query sql(...)
, or a numeric file ID.
A table or a query from Redshift will be downloaded onto disk as a CSV. A file from Platform files endpoint will be downloaded as is.
A default database can be set using options(civis.default_db = "my_database")
.
If there is only one database available,
this database will automatically be used as the default.
download_civis(x, ...) ## S3 method for class 'character' download_civis( x, database = NULL, file, overwrite = FALSE, progress = FALSE, split = FALSE, job_name = NULL, hidden = TRUE, verbose = FALSE, ... ) ## S3 method for class 'sql' download_civis( x, database = NULL, file, overwrite = FALSE, progress = FALSE, split = FALSE, job_name = NULL, hidden = TRUE, verbose = FALSE, ... ) ## S3 method for class 'numeric' download_civis(x, file, overwrite = FALSE, progress = FALSE, ...)
download_civis(x, ...) ## S3 method for class 'character' download_civis( x, database = NULL, file, overwrite = FALSE, progress = FALSE, split = FALSE, job_name = NULL, hidden = TRUE, verbose = FALSE, ... ) ## S3 method for class 'sql' download_civis( x, database = NULL, file, overwrite = FALSE, progress = FALSE, split = FALSE, job_name = NULL, hidden = TRUE, verbose = FALSE, ... ) ## S3 method for class 'numeric' download_civis(x, file, overwrite = FALSE, progress = FALSE, ...)
x |
|
... |
Currently ignored. |
database |
string, The database. If |
file |
string, The file to write to. |
overwrite |
logical, Whether to overwrite the existing |
progress |
logical, Whether to display a progress bar. |
split |
logical, Whether to download a big table by splitting it into multiple
CSV parts first. See |
job_name |
string, Name of the job (default: |
logical, Whether the job is hidden on Platform. |
|
verbose |
logical, Whether to print detailed updates of job status. |
The file where the downloaded files or tables are written to. It is returned invisibly.
character
: Download a table from Redshift to disk as CSV.
sql
: Download the result of a SQL query from Redshift to disk as CSV.
numeric
: Download a file from Platform files endpoint to disk.
Other io:
query_civis_file()
,
query_civis()
,
read_civis()
,
write_civis_file()
,
write_civis()
## Not run: # Download all columns in a single table into a CSV download_civis("schema.table", database = "my_database", file = "~/Downloads/my_table.csv") # Download data from a SQL select statement into a CSV query <- sql("SELECT * FROM table JOIN other_table USING id WHERE var1 < 23") download_civis(query, database = "my_database", file = "~/Downloads/my_table.csv") # Set a default database options(civis.default_db = "my_database") # Download any file from the files endpoint. file_id <- write_civis_file(df) download_civis(file_id, file = "df.rds", progress = TRUE) df2 <- readRDS("df.rds") identical(df, df2) ## End(Not run)
## Not run: # Download all columns in a single table into a CSV download_civis("schema.table", database = "my_database", file = "~/Downloads/my_table.csv") # Download data from a SQL select statement into a CSV query <- sql("SELECT * FROM table JOIN other_table USING id WHERE var1 < 23") download_civis(query, database = "my_database", file = "~/Downloads/my_table.csv") # Set a default database options(civis.default_db = "my_database") # Download any file from the files endpoint. file_id <- write_civis_file(df) download_civis(file_id, file = "df.rds", progress = TRUE) df2 <- readRDS("df.rds") identical(df, df2) ## End(Not run)
List API endpoints
endpoints_list()
endpoints_list()
An empty HTTP response
Remove a CASS/NCOA Enhancement from a project
enhancements_delete_cass_ncoa_projects(id, project_id)
enhancements_delete_cass_ncoa_projects(id, project_id)
id |
integer required. The ID of the CASS/NCOA Enhancement. |
project_id |
integer required. The ID of the project. |
An empty HTTP response
Cancel a run
enhancements_delete_cass_ncoa_runs(id, run_id)
enhancements_delete_cass_ncoa_runs(id, run_id)
id |
integer required. The ID of the cass_ncoa. |
run_id |
integer required. The ID of the run. |
An empty HTTP response
Remove a Civis Data Match Enhancement from a project
enhancements_delete_civis_data_match_projects(id, project_id)
enhancements_delete_civis_data_match_projects(id, project_id)
id |
integer required. The ID of the Civis Data Match Enhancement. |
project_id |
integer required. The ID of the project. |
An empty HTTP response
Cancel a run
enhancements_delete_civis_data_match_runs(id, run_id)
enhancements_delete_civis_data_match_runs(id, run_id)
id |
integer required. The ID of the civis_data_match. |
run_id |
integer required. The ID of the run. |
An empty HTTP response
Remove a Geocode Enhancement from a project
enhancements_delete_geocode_projects(id, project_id)
enhancements_delete_geocode_projects(id, project_id)
id |
integer required. The ID of the Geocode Enhancement. |
project_id |
integer required. The ID of the project. |
An empty HTTP response
Cancel a run
enhancements_delete_geocode_runs(id, run_id)
enhancements_delete_geocode_runs(id, run_id)
id |
integer required. The ID of the geocode. |
run_id |
integer required. The ID of the run. |
An empty HTTP response
Get a CASS/NCOA Enhancement
enhancements_get_cass_ncoa(id)
enhancements_get_cass_ncoa(id)
id |
integer required. |
A list containing the following elements:
id |
integer, The ID for the enhancement. |
name |
string, The name of the enhancement job. |
type |
string, The type of the enhancement (e.g CASS-NCOA) |
createdAt |
string, The time this enhancement was created. |
updatedAt |
string, The time the enhancement was last updated. |
author |
list, A list containing the following elements:
|
state |
string, The status of the enhancement's last run |
schedule |
list, A list containing the following elements:
|
parentId |
integer, Parent ID that triggers this enhancement. |
notifications |
list, A list containing the following elements:
|
runningAs |
list, A list containing the following elements:
|
source |
list, A list containing the following elements:
|
destination |
list, A list containing the following elements:
|
columnMapping |
list, A list containing the following elements:
|
useDefaultColumnMapping |
boolean, Defaults to true, where the existing column mapping on the input table will be used. If false, a custom column mapping must be provided. |
performNcoa |
boolean, Whether to update addresses for records matching the National Change of Address (NCOA) database. |
ncoaCredentialId |
integer, Credential to use when performing NCOA updates. Required if 'performNcoa' is true. |
outputLevel |
string, The set of fields persisted by a CASS or NCOA enhancement.For CASS enhancements, one of 'cass' or 'all.'For NCOA enhancements, one of 'cass', 'ncoa' , 'coalesced' or 'all'.By default, all fields will be returned. |
limitingSQL |
string, The limiting SQL for the source table. "WHERE" should be omitted (e.g. state='IL'). |
archived |
string, The archival status of the requested item(s). |
Check status of a run
enhancements_get_cass_ncoa_runs(id, run_id)
enhancements_get_cass_ncoa_runs(id, run_id)
id |
integer required. The ID of the cass_ncoa. |
run_id |
integer required. The ID of the run. |
A list containing the following elements:
id |
integer, The ID of the run. |
cassNcoaId |
integer, The ID of the cass_ncoa. |
state |
string, The state of the run, one of 'queued' 'running' 'succeeded' 'failed' or 'cancelled'. |
isCancelRequested |
boolean, True if run cancel requested, else false. |
startedAt |
string, The time the last run started at. |
finishedAt |
string, The time the last run completed. |
error |
string, The error, if any, returned by the run. |
Get a Civis Data Match Enhancement
enhancements_get_civis_data_match(id)
enhancements_get_civis_data_match(id)
id |
integer required. |
A list containing the following elements:
id |
integer, The ID for the enhancement. |
name |
string, The name of the enhancement job. |
type |
string, The type of the enhancement (e.g CASS-NCOA) |
createdAt |
string, The time this enhancement was created. |
updatedAt |
string, The time the enhancement was last updated. |
author |
list, A list containing the following elements:
|
state |
string, The status of the enhancement's last run |
schedule |
list, A list containing the following elements:
|
parentId |
integer, Parent ID that triggers this enhancement. |
notifications |
list, A list containing the following elements:
|
runningAs |
list, A list containing the following elements:
|
inputFieldMapping |
list, The column mapping for the input table. See /enhancements/field_mapping for list of valid fields. |
inputTable |
list, A list containing the following elements:
|
matchTargetId |
integer, The ID of the Civis Data match target. See /match_targets for IDs. |
outputTable |
list, A list containing the following elements:
|
maxMatches |
integer, The maximum number of matches per record in the input table to return. Must be between 0 and 10. 0 returns all matches. |
threshold |
number, The score threshold (between 0 and 1). Matches below this threshold will not be returned. |
archived |
boolean, Whether the Civis Data Match Job has been archived. |
lastRun |
list, A list containing the following elements:
|
Check status of a run
enhancements_get_civis_data_match_runs(id, run_id)
enhancements_get_civis_data_match_runs(id, run_id)
id |
integer required. The ID of the civis_data_match. |
run_id |
integer required. The ID of the run. |
A list containing the following elements:
id |
integer, The ID of the run. |
civisDataMatchId |
integer, The ID of the civis_data_match. |
state |
string, The state of the run, one of 'queued' 'running' 'succeeded' 'failed' or 'cancelled'. |
isCancelRequested |
boolean, True if run cancel requested, else false. |
startedAt |
string, The time the last run started at. |
finishedAt |
string, The time the last run completed. |
error |
string, The error, if any, returned by the run. |
Get a Geocode Enhancement
enhancements_get_geocode(id)
enhancements_get_geocode(id)
id |
integer required. |
A list containing the following elements:
id |
integer, The ID for the enhancement. |
name |
string, The name of the enhancement job. |
type |
string, The type of the enhancement (e.g CASS-NCOA) |
createdAt |
string, The time this enhancement was created. |
updatedAt |
string, The time the enhancement was last updated. |
author |
list, A list containing the following elements:
|
state |
string, The status of the enhancement's last run |
schedule |
list, A list containing the following elements:
|
parentId |
integer, Parent ID that triggers this enhancement. |
notifications |
list, A list containing the following elements:
|
runningAs |
list, A list containing the following elements:
|
remoteHostId |
integer, The ID of the remote host. |
credentialId |
integer, The ID of the remote host credential. |
sourceSchemaAndTable |
string, The source database schema and table. |
multipartKey |
array, The source table primary key. |
limitingSQL |
string, The limiting SQL for the source table. "WHERE" should be omitted (e.g. state='IL'). |
targetSchema |
string, The output table schema. |
targetTable |
string, The output table name. |
country |
string, The country of the addresses to be geocoded; either 'us' or 'ca'. |
provider |
string, The geocoding provider; one of postgis, nominatim, and geocoder_ca. |
outputAddress |
boolean, Whether to output the parsed address. Only guaranteed for the 'postgis' provider. |
archived |
string, The archival status of the requested item(s). |
Check status of a run
enhancements_get_geocode_runs(id, run_id)
enhancements_get_geocode_runs(id, run_id)
id |
integer required. The ID of the geocode. |
run_id |
integer required. The ID of the run. |
A list containing the following elements:
id |
integer, The ID of the run. |
geocodeId |
integer, The ID of the geocode. |
state |
string, The state of the run, one of 'queued' 'running' 'succeeded' 'failed' or 'cancelled'. |
isCancelRequested |
boolean, True if run cancel requested, else false. |
startedAt |
string, The time the last run started at. |
finishedAt |
string, The time the last run completed. |
error |
string, The error, if any, returned by the run. |
List Enhancements
enhancements_list( type = NULL, author = NULL, status = NULL, archived = NULL, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
enhancements_list( type = NULL, author = NULL, status = NULL, archived = NULL, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
type |
string optional. If specified, return items of these types. |
author |
string optional. If specified, return items from this author. Must use user IDs. A comma separated list of IDs is also accepted to return items from multiple authors. |
status |
string optional. If specified, returns items with one of these statuses. It accepts a comma-separated list, possible values are 'running', 'failed', 'succeeded', 'idle', 'scheduled'. |
archived |
string optional. The archival status of the requested item(s). |
limit |
integer optional. Number of results to return. Defaults to 20. Maximum allowed is 50. |
page_num |
integer optional. Page number of the results to return. Defaults to the first page, 1. |
order |
string optional. The field on which to order the result set. Defaults to updated_at. Must be one of: updated_at, name, created_at, last_run.updated_at. |
order_dir |
string optional. Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc. |
An array containing the following fields:
id |
integer, The ID for the enhancement. |
name |
string, The name of the enhancement job. |
type |
string, The type of the enhancement (e.g CASS-NCOA) |
createdAt |
string, The time this enhancement was created. |
updatedAt |
string, The time the enhancement was last updated. |
author |
list, A list containing the following elements:
|
state |
string, The status of the enhancement's last run |
archived |
string, The archival status of the requested item(s). |
List the projects a CASS/NCOA Enhancement belongs to
enhancements_list_cass_ncoa_projects(id, hidden = NULL)
enhancements_list_cass_ncoa_projects(id, hidden = NULL)
id |
integer required. The ID of the CASS/NCOA Enhancement. |
boolean optional. If specified to be true, returns hidden items. Defaults to false, returning non-hidden items. |
An array containing the following fields:
id |
integer, The ID for this project. |
author |
list, A list containing the following elements:
|
name |
string, The name of this project. |
description |
string, A description of the project. |
users |
array, An array containing the following fields:
|
autoShare |
boolean, |
createdAt |
string, |
updatedAt |
string, |
archived |
string, The archival status of the requested item(s). |
List runs for the given cass_ncoa
enhancements_list_cass_ncoa_runs( id, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
enhancements_list_cass_ncoa_runs( id, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
id |
integer required. The ID of the cass_ncoa. |
limit |
integer optional. Number of results to return. Defaults to 20. Maximum allowed is 100. |
page_num |
integer optional. Page number of the results to return. Defaults to the first page, 1. |
order |
string optional. The field on which to order the result set. Defaults to id. Must be one of: id. |
order_dir |
string optional. Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc. |
An array containing the following fields:
id |
integer, The ID of the run. |
cassNcoaId |
integer, The ID of the cass_ncoa. |
state |
string, The state of the run, one of 'queued' 'running' 'succeeded' 'failed' or 'cancelled'. |
isCancelRequested |
boolean, True if run cancel requested, else false. |
startedAt |
string, The time the last run started at. |
finishedAt |
string, The time the last run completed. |
error |
string, The error, if any, returned by the run. |
Get the logs for a run
enhancements_list_cass_ncoa_runs_logs(id, run_id, last_id = NULL, limit = NULL)
enhancements_list_cass_ncoa_runs_logs(id, run_id, last_id = NULL, limit = NULL)
id |
integer required. The ID of the cass_ncoa. |
run_id |
integer required. The ID of the run. |
last_id |
integer optional. The ID of the last log message received. Log entries with this ID value or lower will be omitted.Logs are sorted by ID if this value is provided, and are otherwise sorted by createdAt. |
limit |
integer optional. The maximum number of log messages to return. Default of 10000. |
An array containing the following fields:
id |
integer, The ID of the log. |
createdAt |
string, The time the log was created. |
message |
string, The log message. |
level |
string, The level of the log. One of unknown,fatal,error,warn,info,debug. |
List the outputs for a run
enhancements_list_cass_ncoa_runs_outputs( id, run_id, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
enhancements_list_cass_ncoa_runs_outputs( id, run_id, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
id |
integer required. The ID of the job. |
run_id |
integer required. The ID of the run. |
limit |
integer optional. Number of results to return. Defaults to its maximum of 50. |
page_num |
integer optional. Page number of the results to return. Defaults to the first page, 1. |
order |
string optional. The field on which to order the result set. Defaults to created_at. Must be one of: created_at, id. |
order_dir |
string optional. Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc. |
An array containing the following fields:
objectType |
string, The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue |
objectId |
integer, The ID of the output. |
name |
string, The name of the output. |
link |
string, The hypermedia link to the output. |
value |
string, |
List the projects a Civis Data Match Enhancement belongs to
enhancements_list_civis_data_match_projects(id, hidden = NULL)
enhancements_list_civis_data_match_projects(id, hidden = NULL)
id |
integer required. The ID of the Civis Data Match Enhancement. |
boolean optional. If specified to be true, returns hidden items. Defaults to false, returning non-hidden items. |
An array containing the following fields:
id |
integer, The ID for this project. |
author |
list, A list containing the following elements:
|
name |
string, The name of this project. |
description |
string, A description of the project. |
users |
array, An array containing the following fields:
|
autoShare |
boolean, |
createdAt |
string, |
updatedAt |
string, |
archived |
string, The archival status of the requested item(s). |
List runs for the given civis_data_match
enhancements_list_civis_data_match_runs( id, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
enhancements_list_civis_data_match_runs( id, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
id |
integer required. The ID of the civis_data_match. |
limit |
integer optional. Number of results to return. Defaults to 20. Maximum allowed is 100. |
page_num |
integer optional. Page number of the results to return. Defaults to the first page, 1. |
order |
string optional. The field on which to order the result set. Defaults to id. Must be one of: id. |
order_dir |
string optional. Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc. |
An array containing the following fields:
id |
integer, The ID of the run. |
civisDataMatchId |
integer, The ID of the civis_data_match. |
state |
string, The state of the run, one of 'queued' 'running' 'succeeded' 'failed' or 'cancelled'. |
isCancelRequested |
boolean, True if run cancel requested, else false. |
startedAt |
string, The time the last run started at. |
finishedAt |
string, The time the last run completed. |
error |
string, The error, if any, returned by the run. |
Get the logs for a run
enhancements_list_civis_data_match_runs_logs( id, run_id, last_id = NULL, limit = NULL )
enhancements_list_civis_data_match_runs_logs( id, run_id, last_id = NULL, limit = NULL )
id |
integer required. The ID of the civis_data_match. |
run_id |
integer required. The ID of the run. |
last_id |
integer optional. The ID of the last log message received. Log entries with this ID value or lower will be omitted.Logs are sorted by ID if this value is provided, and are otherwise sorted by createdAt. |
limit |
integer optional. The maximum number of log messages to return. Default of 10000. |
An array containing the following fields:
id |
integer, The ID of the log. |
createdAt |
string, The time the log was created. |
message |
string, The log message. |
level |
string, The level of the log. One of unknown,fatal,error,warn,info,debug. |
List the outputs for a run
enhancements_list_civis_data_match_runs_outputs( id, run_id, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
enhancements_list_civis_data_match_runs_outputs( id, run_id, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
id |
integer required. The ID of the job. |
run_id |
integer required. The ID of the run. |
limit |
integer optional. Number of results to return. Defaults to its maximum of 50. |
page_num |
integer optional. Page number of the results to return. Defaults to the first page, 1. |
order |
string optional. The field on which to order the result set. Defaults to created_at. Must be one of: created_at, id. |
order_dir |
string optional. Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc. |
An array containing the following fields:
objectType |
string, The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue |
objectId |
integer, The ID of the output. |
name |
string, The name of the output. |
link |
string, The hypermedia link to the output. |
value |
string, |
List the fields in a field mapping for Civis Data Match, Data Unification, and Table Deduplication jobs
enhancements_list_field_mapping()
enhancements_list_field_mapping()
An array containing the following fields:
field |
string, The name of the field. |
description |
string, The description of the field. |
List the projects a Geocode Enhancement belongs to
enhancements_list_geocode_projects(id, hidden = NULL)
enhancements_list_geocode_projects(id, hidden = NULL)
id |
integer required. The ID of the Geocode Enhancement. |
boolean optional. If specified to be true, returns hidden items. Defaults to false, returning non-hidden items. |
An array containing the following fields:
id |
integer, The ID for this project. |
author |
list, A list containing the following elements:
|
name |
string, The name of this project. |
description |
string, A description of the project. |
users |
array, An array containing the following fields:
|
autoShare |
boolean, |
createdAt |
string, |
updatedAt |
string, |
archived |
string, The archival status of the requested item(s). |
List runs for the given geocode
enhancements_list_geocode_runs( id, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
enhancements_list_geocode_runs( id, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
id |
integer required. The ID of the geocode. |
limit |
integer optional. Number of results to return. Defaults to 20. Maximum allowed is 100. |
page_num |
integer optional. Page number of the results to return. Defaults to the first page, 1. |
order |
string optional. The field on which to order the result set. Defaults to id. Must be one of: id. |
order_dir |
string optional. Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc. |
An array containing the following fields:
id |
integer, The ID of the run. |
geocodeId |
integer, The ID of the geocode. |
state |
string, The state of the run, one of 'queued' 'running' 'succeeded' 'failed' or 'cancelled'. |
isCancelRequested |
boolean, True if run cancel requested, else false. |
startedAt |
string, The time the last run started at. |
finishedAt |
string, The time the last run completed. |
error |
string, The error, if any, returned by the run. |
Get the logs for a run
enhancements_list_geocode_runs_logs(id, run_id, last_id = NULL, limit = NULL)
enhancements_list_geocode_runs_logs(id, run_id, last_id = NULL, limit = NULL)
id |
integer required. The ID of the geocode. |
run_id |
integer required. The ID of the run. |
last_id |
integer optional. The ID of the last log message received. Log entries with this ID value or lower will be omitted.Logs are sorted by ID if this value is provided, and are otherwise sorted by createdAt. |
limit |
integer optional. The maximum number of log messages to return. Default of 10000. |
An array containing the following fields:
id |
integer, The ID of the log. |
createdAt |
string, The time the log was created. |
message |
string, The log message. |
level |
string, The level of the log. One of unknown,fatal,error,warn,info,debug. |
List the outputs for a run
enhancements_list_geocode_runs_outputs( id, run_id, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
enhancements_list_geocode_runs_outputs( id, run_id, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
id |
integer required. The ID of the job. |
run_id |
integer required. The ID of the run. |
limit |
integer optional. Number of results to return. Defaults to its maximum of 50. |
page_num |
integer optional. Page number of the results to return. Defaults to the first page, 1. |
order |
string optional. The field on which to order the result set. Defaults to created_at. Must be one of: created_at, id. |
order_dir |
string optional. Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc. |
An array containing the following fields:
objectType |
string, The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue |
objectId |
integer, The ID of the output. |
name |
string, The name of the output. |
link |
string, The hypermedia link to the output. |
value |
string, |
List available enhancement types
enhancements_list_types()
enhancements_list_types()
An array containing the following fields:
name |
string, The name of the type. |
Update some attributes of this CASS/NCOA Enhancement
enhancements_patch_cass_ncoa( id, name = NULL, schedule = NULL, parent_id = NULL, notifications = NULL, source = NULL, destination = NULL, column_mapping = NULL, use_default_column_mapping = NULL, perform_ncoa = NULL, ncoa_credential_id = NULL, output_level = NULL, limiting_sql = NULL )
enhancements_patch_cass_ncoa( id, name = NULL, schedule = NULL, parent_id = NULL, notifications = NULL, source = NULL, destination = NULL, column_mapping = NULL, use_default_column_mapping = NULL, perform_ncoa = NULL, ncoa_credential_id = NULL, output_level = NULL, limiting_sql = NULL )
id |
integer required. The ID for the enhancement. |
name |
string optional. The name of the enhancement job. |
schedule |
list optional. A list containing the following elements:
|
parent_id |
integer optional. Parent ID that triggers this enhancement. |
notifications |
list optional. A list containing the following elements:
|
source |
list optional. A list containing the following elements:
|
destination |
list optional. A list containing the following elements:
|
column_mapping |
list optional. A list containing the following elements:
|
use_default_column_mapping |
boolean optional. Defaults to true, where the existing column mapping on the input table will be used. If false, a custom column mapping must be provided. |
perform_ncoa |
boolean optional. Whether to update addresses for records matching the National Change of Address (NCOA) database. |
ncoa_credential_id |
integer optional. Credential to use when performing NCOA updates. Required if 'performNcoa' is true. |
output_level |
string optional. The set of fields persisted by a CASS or NCOA enhancement.For CASS enhancements, one of 'cass' or 'all.'For NCOA enhancements, one of 'cass', 'ncoa' , 'coalesced' or 'all'.By default, all fields will be returned. |
limiting_sql |
string optional. The limiting SQL for the source table. "WHERE" should be omitted (e.g. state='IL'). |
A list containing the following elements:
id |
integer, The ID for the enhancement. |
name |
string, The name of the enhancement job. |
type |
string, The type of the enhancement (e.g CASS-NCOA) |
createdAt |
string, The time this enhancement was created. |
updatedAt |
string, The time the enhancement was last updated. |
author |
list, A list containing the following elements:
|
state |
string, The status of the enhancement's last run |
schedule |
list, A list containing the following elements:
|
parentId |
integer, Parent ID that triggers this enhancement. |
notifications |
list, A list containing the following elements:
|
runningAs |
list, A list containing the following elements:
|
source |
list, A list containing the following elements:
|
destination |
list, A list containing the following elements:
|
columnMapping |
list, A list containing the following elements:
|
useDefaultColumnMapping |
boolean, Defaults to true, where the existing column mapping on the input table will be used. If false, a custom column mapping must be provided. |
performNcoa |
boolean, Whether to update addresses for records matching the National Change of Address (NCOA) database. |
ncoaCredentialId |
integer, Credential to use when performing NCOA updates. Required if 'performNcoa' is true. |
outputLevel |
string, The set of fields persisted by a CASS or NCOA enhancement.For CASS enhancements, one of 'cass' or 'all.'For NCOA enhancements, one of 'cass', 'ncoa' , 'coalesced' or 'all'.By default, all fields will be returned. |
limitingSQL |
string, The limiting SQL for the source table. "WHERE" should be omitted (e.g. state='IL'). |
archived |
string, The archival status of the requested item(s). |
Update some attributes of this Civis Data Match Enhancement
enhancements_patch_civis_data_match( id, name = NULL, schedule = NULL, parent_id = NULL, notifications = NULL, input_field_mapping = NULL, input_table = NULL, match_target_id = NULL, output_table = NULL, max_matches = NULL, threshold = NULL, archived = NULL )
enhancements_patch_civis_data_match( id, name = NULL, schedule = NULL, parent_id = NULL, notifications = NULL, input_field_mapping = NULL, input_table = NULL, match_target_id = NULL, output_table = NULL, max_matches = NULL, threshold = NULL, archived = NULL )
id |
integer required. The ID for the enhancement. |
name |
string optional. The name of the enhancement job. |
schedule |
list optional. A list containing the following elements:
|
parent_id |
integer optional. Parent ID that triggers this enhancement. |
notifications |
list optional. A list containing the following elements:
|
input_field_mapping |
list optional. The column mapping for the input table. See /enhancements/field_mapping for list of valid fields. |
input_table |
list optional. A list containing the following elements:
|
match_target_id |
integer optional. The ID of the Civis Data match target. See /match_targets for IDs. |
output_table |
list optional. A list containing the following elements:
|
max_matches |
integer optional. The maximum number of matches per record in the input table to return. Must be between 0 and 10. 0 returns all matches. |
threshold |
number optional. The score threshold (between 0 and 1). Matches below this threshold will not be returned. |
archived |
boolean optional. Whether the Civis Data Match Job has been archived. |
A list containing the following elements:
id |
integer, The ID for the enhancement. |
name |
string, The name of the enhancement job. |
type |
string, The type of the enhancement (e.g CASS-NCOA) |
createdAt |
string, The time this enhancement was created. |
updatedAt |
string, The time the enhancement was last updated. |
author |
list, A list containing the following elements:
|
state |
string, The status of the enhancement's last run |
schedule |
list, A list containing the following elements:
|
parentId |
integer, Parent ID that triggers this enhancement. |
notifications |
list, A list containing the following elements:
|
runningAs |
list, A list containing the following elements:
|
inputFieldMapping |
list, The column mapping for the input table. See /enhancements/field_mapping for list of valid fields. |
inputTable |
list, A list containing the following elements:
|
matchTargetId |
integer, The ID of the Civis Data match target. See /match_targets for IDs. |
outputTable |
list, A list containing the following elements:
|
maxMatches |
integer, The maximum number of matches per record in the input table to return. Must be between 0 and 10. 0 returns all matches. |
threshold |
number, The score threshold (between 0 and 1). Matches below this threshold will not be returned. |
archived |
boolean, Whether the Civis Data Match Job has been archived. |
lastRun |
list, A list containing the following elements:
|
Update some attributes of this Geocode Enhancement
enhancements_patch_geocode( id, name = NULL, schedule = NULL, parent_id = NULL, notifications = NULL, remote_host_id = NULL, credential_id = NULL, source_schema_and_table = NULL, multipart_key = NULL, limiting_sql = NULL, target_schema = NULL, target_table = NULL, country = NULL, provider = NULL, output_address = NULL )
enhancements_patch_geocode( id, name = NULL, schedule = NULL, parent_id = NULL, notifications = NULL, remote_host_id = NULL, credential_id = NULL, source_schema_and_table = NULL, multipart_key = NULL, limiting_sql = NULL, target_schema = NULL, target_table = NULL, country = NULL, provider = NULL, output_address = NULL )
id |
integer required. The ID for the enhancement. |
name |
string optional. The name of the enhancement job. |
schedule |
list optional. A list containing the following elements:
|
parent_id |
integer optional. Parent ID that triggers this enhancement. |
notifications |
list optional. A list containing the following elements:
|
remote_host_id |
integer optional. The ID of the remote host. |
credential_id |
integer optional. The ID of the remote host credential. |
source_schema_and_table |
string optional. The source database schema and table. |
multipart_key |
array optional. The source table primary key. |
limiting_sql |
string optional. The limiting SQL for the source table. "WHERE" should be omitted (e.g. state='IL'). |
target_schema |
string optional. The output table schema. |
target_table |
string optional. The output table name. |
country |
string optional. The country of the addresses to be geocoded; either 'us' or 'ca'. |
provider |
string optional. The geocoding provider; one of postgis, nominatim, and geocoder_ca. |
output_address |
boolean optional. Whether to output the parsed address. Only guaranteed for the 'postgis' provider. |
A list containing the following elements:
id |
integer, The ID for the enhancement. |
name |
string, The name of the enhancement job. |
type |
string, The type of the enhancement (e.g CASS-NCOA) |
createdAt |
string, The time this enhancement was created. |
updatedAt |
string, The time the enhancement was last updated. |
author |
list, A list containing the following elements:
|
state |
string, The status of the enhancement's last run |
schedule |
list, A list containing the following elements:
|
parentId |
integer, Parent ID that triggers this enhancement. |
notifications |
list, A list containing the following elements:
|
runningAs |
list, A list containing the following elements:
|
remoteHostId |
integer, The ID of the remote host. |
credentialId |
integer, The ID of the remote host credential. |
sourceSchemaAndTable |
string, The source database schema and table. |
multipartKey |
array, The source table primary key. |
limitingSQL |
string, The limiting SQL for the source table. "WHERE" should be omitted (e.g. state='IL'). |
targetSchema |
string, The output table schema. |
targetTable |
string, The output table name. |
country |
string, The country of the addresses to be geocoded; either 'us' or 'ca'. |
provider |
string, The geocoding provider; one of postgis, nominatim, and geocoder_ca. |
outputAddress |
boolean, Whether to output the parsed address. Only guaranteed for the 'postgis' provider. |
archived |
string, The archival status of the requested item(s). |
Create a CASS/NCOA Enhancement
enhancements_post_cass_ncoa( name, source, schedule = NULL, parent_id = NULL, notifications = NULL, destination = NULL, column_mapping = NULL, use_default_column_mapping = NULL, perform_ncoa = NULL, ncoa_credential_id = NULL, output_level = NULL, limiting_sql = NULL )
enhancements_post_cass_ncoa( name, source, schedule = NULL, parent_id = NULL, notifications = NULL, destination = NULL, column_mapping = NULL, use_default_column_mapping = NULL, perform_ncoa = NULL, ncoa_credential_id = NULL, output_level = NULL, limiting_sql = NULL )
name |
string required. The name of the enhancement job. |
source |
list required. A list containing the following elements:
|
schedule |
list optional. A list containing the following elements:
|
parent_id |
integer optional. Parent ID that triggers this enhancement. |
notifications |
list optional. A list containing the following elements:
|
destination |
list optional. A list containing the following elements:
|
column_mapping |
list optional. A list containing the following elements:
|
use_default_column_mapping |
boolean optional. Defaults to true, where the existing column mapping on the input table will be used. If false, a custom column mapping must be provided. |
perform_ncoa |
boolean optional. Whether to update addresses for records matching the National Change of Address (NCOA) database. |
ncoa_credential_id |
integer optional. Credential to use when performing NCOA updates. Required if 'performNcoa' is true. |
output_level |
string optional. The set of fields persisted by a CASS or NCOA enhancement.For CASS enhancements, one of 'cass' or 'all.'For NCOA enhancements, one of 'cass', 'ncoa' , 'coalesced' or 'all'.By default, all fields will be returned. |
limiting_sql |
string optional. The limiting SQL for the source table. "WHERE" should be omitted (e.g. state='IL'). |
A list containing the following elements:
id |
integer, The ID for the enhancement. |
name |
string, The name of the enhancement job. |
type |
string, The type of the enhancement (e.g CASS-NCOA) |
createdAt |
string, The time this enhancement was created. |
updatedAt |
string, The time the enhancement was last updated. |
author |
list, A list containing the following elements:
|
state |
string, The status of the enhancement's last run |
schedule |
list, A list containing the following elements:
|
parentId |
integer, Parent ID that triggers this enhancement. |
notifications |
list, A list containing the following elements:
|
runningAs |
list, A list containing the following elements:
|
source |
list, A list containing the following elements:
|
destination |
list, A list containing the following elements:
|
columnMapping |
list, A list containing the following elements:
|
useDefaultColumnMapping |
boolean, Defaults to true, where the existing column mapping on the input table will be used. If false, a custom column mapping must be provided. |
performNcoa |
boolean, Whether to update addresses for records matching the National Change of Address (NCOA) database. |
ncoaCredentialId |
integer, Credential to use when performing NCOA updates. Required if 'performNcoa' is true. |
outputLevel |
string, The set of fields persisted by a CASS or NCOA enhancement.For CASS enhancements, one of 'cass' or 'all.'For NCOA enhancements, one of 'cass', 'ncoa' , 'coalesced' or 'all'.By default, all fields will be returned. |
limitingSQL |
string, The limiting SQL for the source table. "WHERE" should be omitted (e.g. state='IL'). |
archived |
string, The archival status of the requested item(s). |
Cancel a run
enhancements_post_cass_ncoa_cancel(id)
enhancements_post_cass_ncoa_cancel(id)
id |
integer required. The ID of the job. |
A list containing the following elements:
id |
integer, The ID of the run. |
state |
string, The state of the run, one of 'queued', 'running' or 'cancelled'. |
isCancelRequested |
boolean, True if run cancel requested, else false. |
Start a run
enhancements_post_cass_ncoa_runs(id)
enhancements_post_cass_ncoa_runs(id)
id |
integer required. The ID of the cass_ncoa. |
A list containing the following elements:
id |
integer, The ID of the run. |
cassNcoaId |
integer, The ID of the cass_ncoa. |
state |
string, The state of the run, one of 'queued' 'running' 'succeeded' 'failed' or 'cancelled'. |
isCancelRequested |
boolean, True if run cancel requested, else false. |
startedAt |
string, The time the last run started at. |
finishedAt |
string, The time the last run completed. |
error |
string, The error, if any, returned by the run. |
Create a Civis Data Match Enhancement
enhancements_post_civis_data_match( name, input_field_mapping, input_table, match_target_id, output_table, schedule = NULL, parent_id = NULL, notifications = NULL, max_matches = NULL, threshold = NULL, archived = NULL )
enhancements_post_civis_data_match( name, input_field_mapping, input_table, match_target_id, output_table, schedule = NULL, parent_id = NULL, notifications = NULL, max_matches = NULL, threshold = NULL, archived = NULL )
name |
string required. The name of the enhancement job. |
input_field_mapping |
list required. The column mapping for the input table. See /enhancements/field_mapping for list of valid fields. |
input_table |
list required. A list containing the following elements:
|
match_target_id |
integer required. The ID of the Civis Data match target. See /match_targets for IDs. |
output_table |
list required. A list containing the following elements:
|
schedule |
list optional. A list containing the following elements:
|
parent_id |
integer optional. Parent ID that triggers this enhancement. |
notifications |
list optional. A list containing the following elements:
|
max_matches |
integer optional. The maximum number of matches per record in the input table to return. Must be between 0 and 10. 0 returns all matches. |
threshold |
number optional. The score threshold (between 0 and 1). Matches below this threshold will not be returned. |
archived |
boolean optional. Whether the Civis Data Match Job has been archived. |
A list containing the following elements:
id |
integer, The ID for the enhancement. |
name |
string, The name of the enhancement job. |
type |
string, The type of the enhancement (e.g CASS-NCOA) |
createdAt |
string, The time this enhancement was created. |
updatedAt |
string, The time the enhancement was last updated. |
author |
list, A list containing the following elements:
|
state |
string, The status of the enhancement's last run |
schedule |
list, A list containing the following elements:
|
parentId |
integer, Parent ID that triggers this enhancement. |
notifications |
list, A list containing the following elements:
|
runningAs |
list, A list containing the following elements:
|
inputFieldMapping |
list, The column mapping for the input table. See /enhancements/field_mapping for list of valid fields. |
inputTable |
list, A list containing the following elements:
|
matchTargetId |
integer, The ID of the Civis Data match target. See /match_targets for IDs. |
outputTable |
list, A list containing the following elements:
|
maxMatches |
integer, The maximum number of matches per record in the input table to return. Must be between 0 and 10. 0 returns all matches. |
threshold |
number, The score threshold (between 0 and 1). Matches below this threshold will not be returned. |
archived |
boolean, Whether the Civis Data Match Job has been archived. |
lastRun |
list, A list containing the following elements:
|
Cancel a run
enhancements_post_civis_data_match_cancel(id)
enhancements_post_civis_data_match_cancel(id)
id |
integer required. The ID of the job. |
A list containing the following elements:
id |
integer, The ID of the run. |
state |
string, The state of the run, one of 'queued', 'running' or 'cancelled'. |
isCancelRequested |
boolean, True if run cancel requested, else false. |
Clone this Civis Data Match Enhancement
enhancements_post_civis_data_match_clone( id, clone_schedule = NULL, clone_triggers = NULL, clone_notifications = NULL )
enhancements_post_civis_data_match_clone( id, clone_schedule = NULL, clone_triggers = NULL, clone_notifications = NULL )
id |
integer required. The ID for the enhancement. |
clone_schedule |
boolean optional. If true, also copy the schedule to the new enhancement. |
clone_triggers |
boolean optional. If true, also copy the triggers to the new enhancement. |
clone_notifications |
boolean optional. If true, also copy the notifications to the new enhancement. |
A list containing the following elements:
id |
integer, The ID for the enhancement. |
name |
string, The name of the enhancement job. |
type |
string, The type of the enhancement (e.g CASS-NCOA) |
createdAt |
string, The time this enhancement was created. |
updatedAt |
string, The time the enhancement was last updated. |
author |
list, A list containing the following elements:
|
state |
string, The status of the enhancement's last run |
schedule |
list, A list containing the following elements:
|
parentId |
integer, Parent ID that triggers this enhancement. |
notifications |
list, A list containing the following elements:
|
runningAs |
list, A list containing the following elements:
|
inputFieldMapping |
list, The column mapping for the input table. See /enhancements/field_mapping for list of valid fields. |
inputTable |
list, A list containing the following elements:
|
matchTargetId |
integer, The ID of the Civis Data match target. See /match_targets for IDs. |
outputTable |
list, A list containing the following elements:
|
maxMatches |
integer, The maximum number of matches per record in the input table to return. Must be between 0 and 10. 0 returns all matches. |
threshold |
number, The score threshold (between 0 and 1). Matches below this threshold will not be returned. |
archived |
boolean, Whether the Civis Data Match Job has been archived. |
lastRun |
list, A list containing the following elements:
|
Start a run
enhancements_post_civis_data_match_runs(id)
enhancements_post_civis_data_match_runs(id)
id |
integer required. The ID of the civis_data_match. |
A list containing the following elements:
id |
integer, The ID of the run. |
civisDataMatchId |
integer, The ID of the civis_data_match. |
state |
string, The state of the run, one of 'queued' 'running' 'succeeded' 'failed' or 'cancelled'. |
isCancelRequested |
boolean, True if run cancel requested, else false. |
startedAt |
string, The time the last run started at. |
finishedAt |
string, The time the last run completed. |
error |
string, The error, if any, returned by the run. |
Create a Geocode Enhancement
enhancements_post_geocode( name, remote_host_id, credential_id, source_schema_and_table, schedule = NULL, parent_id = NULL, notifications = NULL, multipart_key = NULL, limiting_sql = NULL, target_schema = NULL, target_table = NULL, country = NULL, provider = NULL, output_address = NULL )
enhancements_post_geocode( name, remote_host_id, credential_id, source_schema_and_table, schedule = NULL, parent_id = NULL, notifications = NULL, multipart_key = NULL, limiting_sql = NULL, target_schema = NULL, target_table = NULL, country = NULL, provider = NULL, output_address = NULL )
name |
string required. The name of the enhancement job. |
remote_host_id |
integer required. The ID of the remote host. |
credential_id |
integer required. The ID of the remote host credential. |
source_schema_and_table |
string required. The source database schema and table. |
schedule |
list optional. A list containing the following elements:
|
parent_id |
integer optional. Parent ID that triggers this enhancement. |
notifications |
list optional. A list containing the following elements:
|
multipart_key |
array optional. The source table primary key. |
limiting_sql |
string optional. The limiting SQL for the source table. "WHERE" should be omitted (e.g. state='IL'). |
target_schema |
string optional. The output table schema. |
target_table |
string optional. The output table name. |
country |
string optional. The country of the addresses to be geocoded; either 'us' or 'ca'. |
provider |
string optional. The geocoding provider; one of postgis, nominatim, and geocoder_ca. |
output_address |
boolean optional. Whether to output the parsed address. Only guaranteed for the 'postgis' provider. |
A list containing the following elements:
id |
integer, The ID for the enhancement. |
name |
string, The name of the enhancement job. |
type |
string, The type of the enhancement (e.g CASS-NCOA) |
createdAt |
string, The time this enhancement was created. |
updatedAt |
string, The time the enhancement was last updated. |
author |
list, A list containing the following elements:
|
state |
string, The status of the enhancement's last run |
schedule |
list, A list containing the following elements:
|
parentId |
integer, Parent ID that triggers this enhancement. |
notifications |
list, A list containing the following elements:
|
runningAs |
list, A list containing the following elements:
|
remoteHostId |
integer, The ID of the remote host. |
credentialId |
integer, The ID of the remote host credential. |
sourceSchemaAndTable |
string, The source database schema and table. |
multipartKey |
array, The source table primary key. |
limitingSQL |
string, The limiting SQL for the source table. "WHERE" should be omitted (e.g. state='IL'). |
targetSchema |
string, The output table schema. |
targetTable |
string, The output table name. |
country |
string, The country of the addresses to be geocoded; either 'us' or 'ca'. |
provider |
string, The geocoding provider; one of postgis, nominatim, and geocoder_ca. |
outputAddress |
boolean, Whether to output the parsed address. Only guaranteed for the 'postgis' provider. |
archived |
string, The archival status of the requested item(s). |
Cancel a run
enhancements_post_geocode_cancel(id)
enhancements_post_geocode_cancel(id)
id |
integer required. The ID of the job. |
A list containing the following elements:
id |
integer, The ID of the run. |
state |
string, The state of the run, one of 'queued', 'running' or 'cancelled'. |
isCancelRequested |
boolean, True if run cancel requested, else false. |
Start a run
enhancements_post_geocode_runs(id)
enhancements_post_geocode_runs(id)
id |
integer required. The ID of the geocode. |
A list containing the following elements:
id |
integer, The ID of the run. |
geocodeId |
integer, The ID of the geocode. |
state |
string, The state of the run, one of 'queued' 'running' 'succeeded' 'failed' or 'cancelled'. |
isCancelRequested |
boolean, True if run cancel requested, else false. |
startedAt |
string, The time the last run started at. |
finishedAt |
string, The time the last run completed. |
error |
string, The error, if any, returned by the run. |
Replace all attributes of this CASS/NCOA Enhancement
enhancements_put_cass_ncoa( id, name, source, schedule = NULL, parent_id = NULL, notifications = NULL, destination = NULL, column_mapping = NULL, use_default_column_mapping = NULL, perform_ncoa = NULL, ncoa_credential_id = NULL, output_level = NULL, limiting_sql = NULL )
enhancements_put_cass_ncoa( id, name, source, schedule = NULL, parent_id = NULL, notifications = NULL, destination = NULL, column_mapping = NULL, use_default_column_mapping = NULL, perform_ncoa = NULL, ncoa_credential_id = NULL, output_level = NULL, limiting_sql = NULL )
id |
integer required. The ID for the enhancement. |
name |
string required. The name of the enhancement job. |
source |
list required. A list containing the following elements:
|
schedule |
list optional. A list containing the following elements:
|
parent_id |
integer optional. Parent ID that triggers this enhancement. |
notifications |
list optional. A list containing the following elements:
|
destination |
list optional. A list containing the following elements:
|
column_mapping |
list optional. A list containing the following elements:
|
use_default_column_mapping |
boolean optional. Defaults to true, where the existing column mapping on the input table will be used. If false, a custom column mapping must be provided. |
perform_ncoa |
boolean optional. Whether to update addresses for records matching the National Change of Address (NCOA) database. |
ncoa_credential_id |
integer optional. Credential to use when performing NCOA updates. Required if 'performNcoa' is true. |
output_level |
string optional. The set of fields persisted by a CASS or NCOA enhancement.For CASS enhancements, one of 'cass' or 'all.'For NCOA enhancements, one of 'cass', 'ncoa' , 'coalesced' or 'all'.By default, all fields will be returned. |
limiting_sql |
string optional. The limiting SQL for the source table. "WHERE" should be omitted (e.g. state='IL'). |
A list containing the following elements:
id |
integer, The ID for the enhancement. |
name |
string, The name of the enhancement job. |
type |
string, The type of the enhancement (e.g CASS-NCOA) |
createdAt |
string, The time this enhancement was created. |
updatedAt |
string, The time the enhancement was last updated. |
author |
list, A list containing the following elements:
|
state |
string, The status of the enhancement's last run |
schedule |
list, A list containing the following elements:
|
parentId |
integer, Parent ID that triggers this enhancement. |
notifications |
list, A list containing the following elements:
|
runningAs |
list, A list containing the following elements:
|
source |
list, A list containing the following elements:
|
destination |
list, A list containing the following elements:
|
columnMapping |
list, A list containing the following elements:
|
useDefaultColumnMapping |
boolean, Defaults to true, where the existing column mapping on the input table will be used. If false, a custom column mapping must be provided. |
performNcoa |
boolean, Whether to update addresses for records matching the National Change of Address (NCOA) database. |
ncoaCredentialId |
integer, Credential to use when performing NCOA updates. Required if 'performNcoa' is true. |
outputLevel |
string, The set of fields persisted by a CASS or NCOA enhancement.For CASS enhancements, one of 'cass' or 'all.'For NCOA enhancements, one of 'cass', 'ncoa' , 'coalesced' or 'all'.By default, all fields will be returned. |
limitingSQL |
string, The limiting SQL for the source table. "WHERE" should be omitted (e.g. state='IL'). |
archived |
string, The archival status of the requested item(s). |
Update the archive status of this object
enhancements_put_cass_ncoa_archive(id, status)
enhancements_put_cass_ncoa_archive(id, status)
id |
integer required. The ID of the object. |
status |
boolean required. The desired archived status of the object. |
A list containing the following elements:
id |
integer, The ID for the enhancement. |
name |
string, The name of the enhancement job. |
type |
string, The type of the enhancement (e.g CASS-NCOA) |
createdAt |
string, The time this enhancement was created. |
updatedAt |
string, The time the enhancement was last updated. |
author |
list, A list containing the following elements:
|
state |
string, The status of the enhancement's last run |
schedule |
list, A list containing the following elements:
|
parentId |
integer, Parent ID that triggers this enhancement. |
notifications |
list, A list containing the following elements:
|
runningAs |
list, A list containing the following elements:
|
source |
list, A list containing the following elements:
|
destination |
list, A list containing the following elements:
|
columnMapping |
list, A list containing the following elements:
|
useDefaultColumnMapping |
boolean, Defaults to true, where the existing column mapping on the input table will be used. If false, a custom column mapping must be provided. |
performNcoa |
boolean, Whether to update addresses for records matching the National Change of Address (NCOA) database. |
ncoaCredentialId |
integer, Credential to use when performing NCOA updates. Required if 'performNcoa' is true. |
outputLevel |
string, The set of fields persisted by a CASS or NCOA enhancement.For CASS enhancements, one of 'cass' or 'all.'For NCOA enhancements, one of 'cass', 'ncoa' , 'coalesced' or 'all'.By default, all fields will be returned. |
limitingSQL |
string, The limiting SQL for the source table. "WHERE" should be omitted (e.g. state='IL'). |
archived |
string, The archival status of the requested item(s). |
Add a CASS/NCOA Enhancement to a project
enhancements_put_cass_ncoa_projects(id, project_id)
enhancements_put_cass_ncoa_projects(id, project_id)
id |
integer required. The ID of the CASS/NCOA Enhancement. |
project_id |
integer required. The ID of the project. |
An empty HTTP response
Replace all attributes of this Civis Data Match Enhancement
enhancements_put_civis_data_match( id, name, input_field_mapping, input_table, match_target_id, output_table, schedule = NULL, parent_id = NULL, notifications = NULL, max_matches = NULL, threshold = NULL, archived = NULL )
enhancements_put_civis_data_match( id, name, input_field_mapping, input_table, match_target_id, output_table, schedule = NULL, parent_id = NULL, notifications = NULL, max_matches = NULL, threshold = NULL, archived = NULL )
id |
integer required. The ID for the enhancement. |
name |
string required. The name of the enhancement job. |
input_field_mapping |
list required. The column mapping for the input table. See /enhancements/field_mapping for list of valid fields. |
input_table |
list required. A list containing the following elements:
|
match_target_id |
integer required. The ID of the Civis Data match target. See /match_targets for IDs. |
output_table |
list required. A list containing the following elements:
|
schedule |
list optional. A list containing the following elements:
|
parent_id |
integer optional. Parent ID that triggers this enhancement. |
notifications |
list optional. A list containing the following elements:
|
max_matches |
integer optional. The maximum number of matches per record in the input table to return. Must be between 0 and 10. 0 returns all matches. |
threshold |
number optional. The score threshold (between 0 and 1). Matches below this threshold will not be returned. |
archived |
boolean optional. Whether the Civis Data Match Job has been archived. |
A list containing the following elements:
id |
integer, The ID for the enhancement. |
name |
string, The name of the enhancement job. |
type |
string, The type of the enhancement (e.g CASS-NCOA) |
createdAt |
string, The time this enhancement was created. |
updatedAt |
string, The time the enhancement was last updated. |
author |
list, A list containing the following elements:
|
state |
string, The status of the enhancement's last run |
schedule |
list, A list containing the following elements:
|
parentId |
integer, Parent ID that triggers this enhancement. |
notifications |
list, A list containing the following elements:
|
runningAs |
list, A list containing the following elements:
|
inputFieldMapping |
list, The column mapping for the input table. See /enhancements/field_mapping for list of valid fields. |
inputTable |
list, A list containing the following elements:
|
matchTargetId |
integer, The ID of the Civis Data match target. See /match_targets for IDs. |
outputTable |
list, A list containing the following elements:
|
maxMatches |
integer, The maximum number of matches per record in the input table to return. Must be between 0 and 10. 0 returns all matches. |
threshold |
number, The score threshold (between 0 and 1). Matches below this threshold will not be returned. |
archived |
boolean, Whether the Civis Data Match Job has been archived. |
lastRun |
list, A list containing the following elements:
|
Update the archive status of this object
enhancements_put_civis_data_match_archive(id, status)
enhancements_put_civis_data_match_archive(id, status)
id |
integer required. The ID of the object. |
status |
boolean required. The desired archived status of the object. |
A list containing the following elements:
id |
integer, The ID for the enhancement. |
name |
string, The name of the enhancement job. |
type |
string, The type of the enhancement (e.g CASS-NCOA) |
createdAt |
string, The time this enhancement was created. |
updatedAt |
string, The time the enhancement was last updated. |
author |
list, A list containing the following elements:
|
state |
string, The status of the enhancement's last run |
schedule |
list, A list containing the following elements:
|
parentId |
integer, Parent ID that triggers this enhancement. |
notifications |
list, A list containing the following elements:
|
runningAs |
list, A list containing the following elements:
|
inputFieldMapping |
list, The column mapping for the input table. See /enhancements/field_mapping for list of valid fields. |
inputTable |
list, A list containing the following elements:
|
matchTargetId |
integer, The ID of the Civis Data match target. See /match_targets for IDs. |
outputTable |
list, A list containing the following elements:
|
maxMatches |
integer, The maximum number of matches per record in the input table to return. Must be between 0 and 10. 0 returns all matches. |
threshold |
number, The score threshold (between 0 and 1). Matches below this threshold will not be returned. |
archived |
boolean, Whether the Civis Data Match Job has been archived. |
lastRun |
list, A list containing the following elements:
|
Add a Civis Data Match Enhancement to a project
enhancements_put_civis_data_match_projects(id, project_id)
enhancements_put_civis_data_match_projects(id, project_id)
id |
integer required. The ID of the Civis Data Match Enhancement. |
project_id |
integer required. The ID of the project. |
An empty HTTP response
Replace all attributes of this Geocode Enhancement
enhancements_put_geocode( id, name, remote_host_id, credential_id, source_schema_and_table, schedule = NULL, parent_id = NULL, notifications = NULL, multipart_key = NULL, limiting_sql = NULL, target_schema = NULL, target_table = NULL, country = NULL, provider = NULL, output_address = NULL )
enhancements_put_geocode( id, name, remote_host_id, credential_id, source_schema_and_table, schedule = NULL, parent_id = NULL, notifications = NULL, multipart_key = NULL, limiting_sql = NULL, target_schema = NULL, target_table = NULL, country = NULL, provider = NULL, output_address = NULL )
id |
integer required. The ID for the enhancement. |
name |
string required. The name of the enhancement job. |
remote_host_id |
integer required. The ID of the remote host. |
credential_id |
integer required. The ID of the remote host credential. |
source_schema_and_table |
string required. The source database schema and table. |
schedule |
list optional. A list containing the following elements:
|
parent_id |
integer optional. Parent ID that triggers this enhancement. |
notifications |
list optional. A list containing the following elements:
|
multipart_key |
array optional. The source table primary key. |
limiting_sql |
string optional. The limiting SQL for the source table. "WHERE" should be omitted (e.g. state='IL'). |
target_schema |
string optional. The output table schema. |
target_table |
string optional. The output table name. |
country |
string optional. The country of the addresses to be geocoded; either 'us' or 'ca'. |
provider |
string optional. The geocoding provider; one of postgis, nominatim, and geocoder_ca. |
output_address |
boolean optional. Whether to output the parsed address. Only guaranteed for the 'postgis' provider. |
A list containing the following elements:
id |
integer, The ID for the enhancement. |
name |
string, The name of the enhancement job. |
type |
string, The type of the enhancement (e.g CASS-NCOA) |
createdAt |
string, The time this enhancement was created. |
updatedAt |
string, The time the enhancement was last updated. |
author |
list, A list containing the following elements:
|
state |
string, The status of the enhancement's last run |
schedule |
list, A list containing the following elements:
|
parentId |
integer, Parent ID that triggers this enhancement. |
notifications |
list, A list containing the following elements:
|
runningAs |
list, A list containing the following elements:
|
remoteHostId |
integer, The ID of the remote host. |
credentialId |
integer, The ID of the remote host credential. |
sourceSchemaAndTable |
string, The source database schema and table. |
multipartKey |
array, The source table primary key. |
limitingSQL |
string, The limiting SQL for the source table. "WHERE" should be omitted (e.g. state='IL'). |
targetSchema |
string, The output table schema. |
targetTable |
string, The output table name. |
country |
string, The country of the addresses to be geocoded; either 'us' or 'ca'. |
provider |
string, The geocoding provider; one of postgis, nominatim, and geocoder_ca. |
outputAddress |
boolean, Whether to output the parsed address. Only guaranteed for the 'postgis' provider. |
archived |
string, The archival status of the requested item(s). |
Update the archive status of this object
enhancements_put_geocode_archive(id, status)
enhancements_put_geocode_archive(id, status)
id |
integer required. The ID of the object. |
status |
boolean required. The desired archived status of the object. |
A list containing the following elements:
id |
integer, The ID for the enhancement. |
name |
string, The name of the enhancement job. |
type |
string, The type of the enhancement (e.g CASS-NCOA) |
createdAt |
string, The time this enhancement was created. |
updatedAt |
string, The time the enhancement was last updated. |
author |
list, A list containing the following elements:
|
state |
string, The status of the enhancement's last run |
schedule |
list, A list containing the following elements:
|
parentId |
integer, Parent ID that triggers this enhancement. |
notifications |
list, A list containing the following elements:
|
runningAs |
list, A list containing the following elements:
|
remoteHostId |
integer, The ID of the remote host. |
credentialId |
integer, The ID of the remote host credential. |
sourceSchemaAndTable |
string, The source database schema and table. |
multipartKey |
array, The source table primary key. |
limitingSQL |
string, The limiting SQL for the source table. "WHERE" should be omitted (e.g. state='IL'). |
targetSchema |
string, The output table schema. |
targetTable |
string, The output table name. |
country |
string, The country of the addresses to be geocoded; either 'us' or 'ca'. |
provider |
string, The geocoding provider; one of postgis, nominatim, and geocoder_ca. |
outputAddress |
boolean, Whether to output the parsed address. Only guaranteed for the 'postgis' provider. |
archived |
string, The archival status of the requested item(s). |
Add a Geocode Enhancement to a project
enhancements_put_geocode_projects(id, project_id)
enhancements_put_geocode_projects(id, project_id)
id |
integer required. The ID of the Geocode Enhancement. |
project_id |
integer required. The ID of the project. |
An empty HTTP response
Get a CSV Export
exports_get_files_csv(id)
exports_get_files_csv(id)
id |
integer required. |
A list containing the following elements:
id |
integer, The ID of this Csv Export job. |
name |
string, The name of this Csv Export job. |
source |
list, A list containing the following elements:
|
destination |
list, A list containing the following elements:
|
includeHeader |
boolean, A boolean value indicating whether or not the header should be included. Defaults to true. |
compression |
string, The compression of the output file. Valid arguments are "gzip" and "none". Defaults to "gzip". |
columnDelimiter |
string, The column delimiter for the output file. Valid arguments are "comma", "tab", and "pipe". Defaults to "comma". |
hidden |
boolean, A boolean value indicating whether or not this request should be hidden. Defaults to false. |
forceMultifile |
boolean, Whether or not the csv should be split into multiple files. Default: false |
maxFileSize |
integer, The max file size, in MB, created files will be. Only available when force_multifile is true. |
List
exports_list( type = NULL, author = NULL, status = NULL, hidden = NULL, archived = NULL, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
exports_list( type = NULL, author = NULL, status = NULL, hidden = NULL, archived = NULL, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
type |
string optional. If specified, return exports of these types. It accepts a comma-separated list, possible values are 'database' and 'gdoc'. |
author |
string optional. If specified, return exports from this author. It accepts a comma-separated list of author ids. |
status |
string optional. If specified, returns export with one of these statuses. It accepts a comma-separated list, possible values are 'running', 'failed', 'succeeded', 'idle', 'scheduled'. |
boolean optional. If specified to be true, returns hidden items. Defaults to false, returning non-hidden items. |
|
archived |
string optional. The archival status of the requested item(s). |
limit |
integer optional. Number of results to return. Defaults to 20. Maximum allowed is 50. |
page_num |
integer optional. Page number of the results to return. Defaults to the first page, 1. |
order |
string optional. The field on which to order the result set. Defaults to updated_at. Must be one of: updated_at, name, created_at, last_run.updated_at. |
order_dir |
string optional. Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc. |
An array containing the following fields:
id |
integer, The ID for this export. |
name |
string, The name of this export. |
type |
string, The type of export. |
createdAt |
string, The creation time for this export. |
updatedAt |
string, The last modification time for this export. |
state |
string, |
lastRun |
list, A list containing the following elements:
|
author |
list, A list containing the following elements:
|
Update some attributes of this CSV Export
exports_patch_files_csv( id, name = NULL, source = NULL, destination = NULL, include_header = NULL, compression = NULL, column_delimiter = NULL, hidden = NULL, force_multifile = NULL, max_file_size = NULL )
exports_patch_files_csv( id, name = NULL, source = NULL, destination = NULL, include_header = NULL, compression = NULL, column_delimiter = NULL, hidden = NULL, force_multifile = NULL, max_file_size = NULL )
id |
integer required. The ID of this Csv Export job. |
name |
string optional. The name of this Csv Export job. |
source |
list optional. A list containing the following elements:
|
destination |
list optional. A list containing the following elements:
|
include_header |
boolean optional. A boolean value indicating whether or not the header should be included. Defaults to true. |
compression |
string optional. The compression of the output file. Valid arguments are "gzip" and "none". Defaults to "gzip". |
column_delimiter |
string optional. The column delimiter for the output file. Valid arguments are "comma", "tab", and "pipe". Defaults to "comma". |
boolean optional. A boolean value indicating whether or not this request should be hidden. Defaults to false. |
|
force_multifile |
boolean optional. Whether or not the csv should be split into multiple files. Default: false |
max_file_size |
integer optional. The max file size, in MB, created files will be. Only available when force_multifile is true. |
A list containing the following elements:
id |
integer, The ID of this Csv Export job. |
name |
string, The name of this Csv Export job. |
source |
list, A list containing the following elements:
|
destination |
list, A list containing the following elements:
|
includeHeader |
boolean, A boolean value indicating whether or not the header should be included. Defaults to true. |
compression |
string, The compression of the output file. Valid arguments are "gzip" and "none". Defaults to "gzip". |
columnDelimiter |
string, The column delimiter for the output file. Valid arguments are "comma", "tab", and "pipe". Defaults to "comma". |
hidden |
boolean, A boolean value indicating whether or not this request should be hidden. Defaults to false. |
forceMultifile |
boolean, Whether or not the csv should be split into multiple files. Default: false |
maxFileSize |
integer, The max file size, in MB, created files will be. Only available when force_multifile is true. |
Create a CSV Export
exports_post_files_csv( source, destination, name = NULL, include_header = NULL, compression = NULL, column_delimiter = NULL, hidden = NULL, force_multifile = NULL, max_file_size = NULL )
exports_post_files_csv( source, destination, name = NULL, include_header = NULL, compression = NULL, column_delimiter = NULL, hidden = NULL, force_multifile = NULL, max_file_size = NULL )
source |
list required. A list containing the following elements:
|
destination |
list required. A list containing the following elements:
|
name |
string optional. The name of this Csv Export job. |
include_header |
boolean optional. A boolean value indicating whether or not the header should be included. Defaults to true. |
compression |
string optional. The compression of the output file. Valid arguments are "gzip" and "none". Defaults to "gzip". |
column_delimiter |
string optional. The column delimiter for the output file. Valid arguments are "comma", "tab", and "pipe". Defaults to "comma". |
boolean optional. A boolean value indicating whether or not this request should be hidden. Defaults to false. |
|
force_multifile |
boolean optional. Whether or not the csv should be split into multiple files. Default: false |
max_file_size |
integer optional. The max file size, in MB, created files will be. Only available when force_multifile is true. |
A list containing the following elements:
id |
integer, The ID of this Csv Export job. |
name |
string, The name of this Csv Export job. |
source |
list, A list containing the following elements:
|
destination |
list, A list containing the following elements:
|
includeHeader |
boolean, A boolean value indicating whether or not the header should be included. Defaults to true. |
compression |
string, The compression of the output file. Valid arguments are "gzip" and "none". Defaults to "gzip". |
columnDelimiter |
string, The column delimiter for the output file. Valid arguments are "comma", "tab", and "pipe". Defaults to "comma". |
hidden |
boolean, A boolean value indicating whether or not this request should be hidden. Defaults to false. |
forceMultifile |
boolean, Whether or not the csv should be split into multiple files. Default: false |
maxFileSize |
integer, The max file size, in MB, created files will be. Only available when force_multifile is true. |
Replace all attributes of this CSV Export
exports_put_files_csv( id, source, destination, name = NULL, include_header = NULL, compression = NULL, column_delimiter = NULL, hidden = NULL, force_multifile = NULL, max_file_size = NULL )
exports_put_files_csv( id, source, destination, name = NULL, include_header = NULL, compression = NULL, column_delimiter = NULL, hidden = NULL, force_multifile = NULL, max_file_size = NULL )
id |
integer required. The ID of this Csv Export job. |
source |
list required. A list containing the following elements:
|
destination |
list required. A list containing the following elements:
|
name |
string optional. The name of this Csv Export job. |
include_header |
boolean optional. A boolean value indicating whether or not the header should be included. Defaults to true. |
compression |
string optional. The compression of the output file. Valid arguments are "gzip" and "none". Defaults to "gzip". |
column_delimiter |
string optional. The column delimiter for the output file. Valid arguments are "comma", "tab", and "pipe". Defaults to "comma". |
boolean optional. A boolean value indicating whether or not this request should be hidden. Defaults to false. |
|
force_multifile |
boolean optional. Whether or not the csv should be split into multiple files. Default: false |
max_file_size |
integer optional. The max file size, in MB, created files will be. Only available when force_multifile is true. |
A list containing the following elements:
id |
integer, The ID of this Csv Export job. |
name |
string, The name of this Csv Export job. |
source |
list, A list containing the following elements:
|
destination |
list, A list containing the following elements:
|
includeHeader |
boolean, A boolean value indicating whether or not the header should be included. Defaults to true. |
compression |
string, The compression of the output file. Valid arguments are "gzip" and "none". Defaults to "gzip". |
columnDelimiter |
string, The column delimiter for the output file. Valid arguments are "comma", "tab", and "pipe". Defaults to "comma". |
hidden |
boolean, A boolean value indicating whether or not this request should be hidden. Defaults to false. |
forceMultifile |
boolean, Whether or not the csv should be split into multiple files. Default: false |
maxFileSize |
integer, The max file size, in MB, created files will be. Only available when force_multifile is true. |
Update the archive status of this object
exports_put_files_csv_archive(id, status)
exports_put_files_csv_archive(id, status)
id |
integer required. The ID of the object. |
status |
boolean required. The desired archived status of the object. |
A list containing the following elements:
id |
integer, The ID of this Csv Export job. |
name |
string, The name of this Csv Export job. |
source |
list, A list containing the following elements:
|
destination |
list, A list containing the following elements:
|
includeHeader |
boolean, A boolean value indicating whether or not the header should be included. Defaults to true. |
compression |
string, The compression of the output file. Valid arguments are "gzip" and "none". Defaults to "gzip". |
columnDelimiter |
string, The column delimiter for the output file. Valid arguments are "comma", "tab", and "pipe". Defaults to "comma". |
hidden |
boolean, A boolean value indicating whether or not this request should be hidden. Defaults to false. |
forceMultifile |
boolean, Whether or not the csv should be split into multiple files. Default: false |
maxFileSize |
integer, The max file size, in MB, created files will be. Only available when force_multifile is true. |
Deactivate a feature for a group
feature_flags_delete_groups(flag_name, group_id)
feature_flags_delete_groups(flag_name, group_id)
flag_name |
string required. The feature flag name. |
group_id |
integer required. Group ID. |
An empty HTTP response
Deactivate a feature for a user
feature_flags_delete_users(flag_name, user_id)
feature_flags_delete_users(flag_name, user_id)
flag_name |
string required. The feature flag name. |
user_id |
integer required. The user ID. |
An empty HTTP response
Show a feature flag
feature_flags_get(name)
feature_flags_get(name)
name |
string required. The name of the feature flag. |
A list containing the following elements:
name |
string, The name of the feature flag |
organizations |
array, An array containing the following fields:
|
groups |
array, An array containing the following fields:
|
users |
array, An array containing the following fields:
|
percentage |
integer, The target percentage of users who should have this feature flag enabled. |
List feature flags
feature_flags_list()
feature_flags_list()
An array containing the following fields:
name |
string, The name of the feature flag. |
userCount |
integer, The number of users with this feature flag enabled. |
description |
string, |
team |
string, |
jira |
string, |
added |
string, |
groupCount |
integer, |
organizationCount |
integer, |
percentage |
integer, The target percentage of users who should have this feature flag enabled. |
activeForMe |
boolean, Whether the feature flag is active for the current user. |
Activate a feature for a group
feature_flags_put_groups(flag_name, group_id)
feature_flags_put_groups(flag_name, group_id)
flag_name |
string required. The feature flag name. |
group_id |
integer required. Group ID. |
A list containing the following elements:
name |
string, The name of the feature flag. |
userCount |
integer, The number of users with this feature flag enabled. |
description |
string, |
team |
string, |
jira |
string, |
added |
string, |
groupCount |
integer, |
organizationCount |
integer, |
percentage |
integer, The target percentage of users who should have this feature flag enabled. |
activeForMe |
boolean, Whether the feature flag is active for the current user. |
Activate a feature for a user
feature_flags_put_users(flag_name, user_id)
feature_flags_put_users(flag_name, user_id)
flag_name |
string required. The feature flag name. |
user_id |
integer required. The user ID. |
A list containing the following elements:
name |
string, The name of the feature flag. |
userCount |
integer, The number of users with this feature flag enabled. |
description |
string, |
team |
string, |
jira |
string, |
added |
string, |
groupCount |
integer, |
organizationCount |
integer, |
percentage |
integer, The target percentage of users who should have this feature flag enabled. |
activeForMe |
boolean, Whether the feature flag is active for the current user. |
Retrieve all results from a paginated endpoint
fetch_all(fn, ...)
fetch_all(fn, ...)
fn |
The API function to be called. |
... |
Arguments passed to |
A list
with the concatenated results of each page of fn
.
Other pagination:
fetch_until()
## Not run: columns <- fetch_all(tables_list_columns, id = 123) column_names <- columns %>% purrr::map_chr("name") ## End(Not run)
## Not run: columns <- fetch_all(tables_list_columns, id = 123) column_names <- columns %>% purrr::map_chr("name") ## End(Not run)
Fetches and generates the client in generated_client.R
fetch_and_generate_client()
fetch_and_generate_client()
Skips autogeneration on windows with R < 3.4.0 and if R_CLIENT_DEV == "TRUE". A valid CIVIS_API_KEY must be set.
Fetch job logs from the Civis Platform
fetch_logs(object, limit = 100, ...)
fetch_logs(object, limit = 100, ...)
object |
A |
limit |
The number of log lines to fetch, the default is 100. |
... |
Extra parameters passed to methods, currently unused. |
A list of log messages with class civis_logs
.
## Not run: m <- civis_ml_fetch_existing(123) fetch_logs(m) import <- write_civis(iris, "scratch.mytest") fetch_logs(import) query_run <- query_civis(123) fetch_logs(query_run) e <- tryCatch(read_civis("asdf;"), error = function(e) e) fetch_logs(e) ## End(Not run)
## Not run: m <- civis_ml_fetch_existing(123) fetch_logs(m) import <- write_civis(iris, "scratch.mytest") fetch_logs(import) query_run <- query_civis(123) fetch_logs(query_run) e <- tryCatch(read_civis("asdf;"), error = function(e) e) fetch_logs(e) ## End(Not run)
Retrieve out of sample/fold predictions
fetch_oos_scores(model, ...)
fetch_oos_scores(model, ...)
model |
A |
... |
Parameters passed to |
Returns the out of sample (or out of fold) predictions for each observation. For a multiclass model, a data frame is returned with one column of predictions for each class.
A data.frame
with out of sample/fold predictions for each
row of the training data, and containing an additional column with
a primary key.
civis_ml
Return output from a civis_script.
fetch_output_file_ids(x, regex = NULL) fetch_output(x, regex = NULL)
fetch_output_file_ids(x, regex = NULL) fetch_output(x, regex = NULL)
x |
civis_script |
regex |
string, regex used to match the run output name. |
If the script has no outputs, the results are a list of length is 0.
A named list of run output file ids with names matching regex
.
fetch_output
: Return output of scripts_list_*_runs_outputs
matching regex
.
Other script_utils:
civis_script()
,
run_civis()
,
run_template()
Other script_utils:
civis_script()
,
run_civis()
,
run_template()
## Not run: out <- fetch_output(civis_script(1234)) # Filter output with regex, then read into memory: ids <- fetch_output_file_ids(civis_script(1234), regex = '.csv') vals <- lapply(ids, read_civis, using = read.csv) ## End(Not run)
## Not run: out <- fetch_output(civis_script(1234)) # Filter output with regex, then read into memory: ids <- fetch_output_file_ids(civis_script(1234), regex = '.csv') vals <- lapply(ids, read_civis, using = read.csv) ## End(Not run)
Retrieve predictions from a CivisML prediction job
fetch_predictions(x, ...)
fetch_predictions(x, ...)
x |
|
... |
arguments passed to |
Predictions can also be downloaded as a csv
directly using download_civis
(see examples).
A data.frame
of predictions containing an additional column with
a primary key. For a multiclass model, a data frame is returned with one
column of predictions for each class.
## Not run: m <- civis_ml("path/to/file.csv", model_type = "sparse_logistic", dependent_variable = "Species") pred_job <- predict(m, newdata = "path/to/newdata.csv") yhat <- fetch_predictions(pred_job) # download instead: download_civis(pred_job$model_info$output_file_ids, path = "my_predictions.csv") ## End(Not run)
## Not run: m <- civis_ml("path/to/file.csv", model_type = "sparse_logistic", dependent_variable = "Species") pred_job <- predict(m, newdata = "path/to/newdata.csv") yhat <- fetch_predictions(pred_job) # download instead: download_civis(pred_job$model_info$output_file_ids, path = "my_predictions.csv") ## End(Not run)
fetch_until
will retrieve paginated results until a condition is met.
This is useful when searching for a particular value or record.
fetch_until(fn, .until, ...)
fetch_until(fn, .until, ...)
fn |
The API function to be called. |
.until |
A function which returns a boolean value.
|
... |
Arguments passed to |
A list
with the concatenated results of each page of fn
.
Other pagination:
fetch_all()
## Not run: columns <- fetch_until(tables_list_columns, .until = function(x) x == "voterbase_id") ## End(Not run)
## Not run: columns <- fetch_until(tables_list_columns, .until = function(x) x == "voterbase_id") ## End(Not run)
Archive a Preprocess CSV (deprecated, use archiving endpoints instead)
files_delete_preprocess_csv(id)
files_delete_preprocess_csv(id)
id |
integer required. |
An empty HTTP response
Remove a File from a project
files_delete_projects(id, project_id)
files_delete_projects(id, project_id)
id |
integer required. The ID of the File. |
project_id |
integer required. The ID of the project. |
An empty HTTP response
Get details about a file
files_get(id, link_expires_at = NULL, inline = NULL)
files_get(id, link_expires_at = NULL, inline = NULL)
id |
integer required. The ID of the file. |
link_expires_at |
string optional. The date and time the download link will expire. Must be a time between now and 36 hours from now. Defaults to 30 minutes from now. |
inline |
boolean optional. If true, will return a url that can be displayed inline in HTML |
A list containing the following elements:
id |
integer, The ID of the file. |
name |
string, The file name. |
createdAt |
string, The date and time the file was created. |
fileSize |
integer, The file size. |
expiresAt |
string, The date and time the file will expire. If not specified, the file will expire in 30 days. To keep a file indefinitely, specify null. |
author |
list, A list containing the following elements:
|
downloadUrl |
string, A JSON string containing information about the URL of the file. |
fileUrl |
string, The URL that may be used to download the file. |
detectedInfo |
list, A list containing the following elements:
|
Get a Preprocess CSV
files_get_preprocess_csv(id)
files_get_preprocess_csv(id)
id |
integer required. |
A list containing the following elements:
id |
integer, The ID of the job created. |
fileId |
integer, The ID of the file. |
inPlace |
boolean, If true, the file is cleaned in place. If false, a new file ID is created. Defaults to true. |
detectTableColumns |
boolean, If true, detect the table columns in the file including the sql types. If false, skip table column detection.Defaults to false. |
forceCharacterSetConversion |
boolean, If true, the file will always be converted to UTF-8 and any character that cannot be converted will be discarded. If false, the character set conversion will only run if the detected character set is not compatible with UTF-8 (e.g., UTF-8, ASCII). |
includeHeader |
boolean, A boolean value indicating whether or not the first row of the file is a header row. If not provided, will attempt to auto-detect whether a header row is present. |
columnDelimiter |
string, The column delimiter for the file. One of "comma", "tab", or "pipe". If not provided, the column delimiter will be auto-detected. |
hidden |
boolean, The hidden status of the item. |
List the projects a File belongs to
files_list_projects(id, hidden = NULL)
files_list_projects(id, hidden = NULL)
id |
integer required. The ID of the File. |
boolean optional. If specified to be true, returns hidden items. Defaults to false, returning non-hidden items. |
An array containing the following fields:
id |
integer, The ID for this project. |
author |
list, A list containing the following elements:
|
name |
string, The name of this project. |
description |
string, A description of the project. |
users |
array, An array containing the following fields:
|
autoShare |
boolean, |
createdAt |
string, |
updatedAt |
string, |
archived |
string, The archival status of the requested item(s). |
Update details about a file
files_patch(id, name = NULL, expires_at = NULL)
files_patch(id, name = NULL, expires_at = NULL)
id |
integer required. The ID of the file. |
name |
string optional. The file name. The extension must match the previous extension. |
expires_at |
string optional. The date and time the file will expire. |
A list containing the following elements:
id |
integer, The ID of the file. |
name |
string, The file name. |
createdAt |
string, The date and time the file was created. |
fileSize |
integer, The file size. |
expiresAt |
string, The date and time the file will expire. If not specified, the file will expire in 30 days. To keep a file indefinitely, specify null. |
author |
list, A list containing the following elements:
|
downloadUrl |
string, A JSON string containing information about the URL of the file. |
fileUrl |
string, The URL that may be used to download the file. |
detectedInfo |
list, A list containing the following elements:
|
Update some attributes of this Preprocess CSV
files_patch_preprocess_csv( id, file_id = NULL, in_place = NULL, detect_table_columns = NULL, force_character_set_conversion = NULL, include_header = NULL, column_delimiter = NULL )
files_patch_preprocess_csv( id, file_id = NULL, in_place = NULL, detect_table_columns = NULL, force_character_set_conversion = NULL, include_header = NULL, column_delimiter = NULL )
id |
integer required. The ID of the job created. |
file_id |
integer optional. The ID of the file. |
in_place |
boolean optional. If true, the file is cleaned in place. If false, a new file ID is created. Defaults to true. |
detect_table_columns |
boolean optional. If true, detect the table columns in the file including the sql types. If false, skip table column detection.Defaults to false. |
force_character_set_conversion |
boolean optional. If true, the file will always be converted to UTF-8 and any character that cannot be converted will be discarded. If false, the character set conversion will only run if the detected character set is not compatible with UTF-8 (e.g., UTF-8, ASCII). |
include_header |
boolean optional. A boolean value indicating whether or not the first row of the file is a header row. If not provided, will attempt to auto-detect whether a header row is present. |
column_delimiter |
string optional. The column delimiter for the file. One of "comma", "tab", or "pipe". If not provided, the column delimiter will be auto-detected. |
A list containing the following elements:
id |
integer, The ID of the job created. |
fileId |
integer, The ID of the file. |
inPlace |
boolean, If true, the file is cleaned in place. If false, a new file ID is created. Defaults to true. |
detectTableColumns |
boolean, If true, detect the table columns in the file including the sql types. If false, skip table column detection.Defaults to false. |
forceCharacterSetConversion |
boolean, If true, the file will always be converted to UTF-8 and any character that cannot be converted will be discarded. If false, the character set conversion will only run if the detected character set is not compatible with UTF-8 (e.g., UTF-8, ASCII). |
includeHeader |
boolean, A boolean value indicating whether or not the first row of the file is a header row. If not provided, will attempt to auto-detect whether a header row is present. |
columnDelimiter |
string, The column delimiter for the file. One of "comma", "tab", or "pipe". If not provided, the column delimiter will be auto-detected. |
hidden |
boolean, The hidden status of the item. |
Initiate an upload of a file into the platform
files_post(name, expires_at = NULL)
files_post(name, expires_at = NULL)
name |
string required. The file name. |
expires_at |
string optional. The date and time the file will expire. If not specified, the file will expire in 30 days. To keep a file indefinitely, specify null. |
A list containing the following elements:
id |
integer, The ID of the file. |
name |
string, The file name. |
createdAt |
string, The date and time the file was created. |
fileSize |
integer, The file size. |
expiresAt |
string, The date and time the file will expire. If not specified, the file will expire in 30 days. To keep a file indefinitely, specify null. |
uploadUrl |
string, The URL that may be used to upload a file. To use the upload URL, initiate a POST request to the given URL with the file you wish to import as the "file" form field. |
uploadFields |
list, A hash containing the form fields to be included with the POST request. |
Initiate a multipart upload
files_post_multipart(name, num_parts, expires_at = NULL)
files_post_multipart(name, num_parts, expires_at = NULL)
name |
string required. The file name. |
num_parts |
integer required. The number of parts in which the file will be uploaded. This parameter determines the number of presigned URLs that are returned. |
expires_at |
string optional. The date and time the file will expire. If not specified, the file will expire in 30 days. To keep a file indefinitely, specify null. |
A list containing the following elements:
id |
integer, The ID of the file. |
name |
string, The file name. |
createdAt |
string, The date and time the file was created. |
fileSize |
integer, The file size. |
expiresAt |
string, The date and time the file will expire. If not specified, the file will expire in 30 days. To keep a file indefinitely, specify null. |
uploadUrls |
array, An array of URLs that may be used to upload file parts. Use separate PUT requests to complete the part uploads. Links expire after 12 hours. |
Complete a multipart upload
files_post_multipart_complete(id)
files_post_multipart_complete(id)
id |
integer required. The ID of the file. |
An empty HTTP response
Create a Preprocess CSV
files_post_preprocess_csv( file_id, in_place = NULL, detect_table_columns = NULL, force_character_set_conversion = NULL, include_header = NULL, column_delimiter = NULL, hidden = NULL )
files_post_preprocess_csv( file_id, in_place = NULL, detect_table_columns = NULL, force_character_set_conversion = NULL, include_header = NULL, column_delimiter = NULL, hidden = NULL )
file_id |
integer required. The ID of the file. |
in_place |
boolean optional. If true, the file is cleaned in place. If false, a new file ID is created. Defaults to true. |
detect_table_columns |
boolean optional. If true, detect the table columns in the file including the sql types. If false, skip table column detection.Defaults to false. |
force_character_set_conversion |
boolean optional. If true, the file will always be converted to UTF-8 and any character that cannot be converted will be discarded. If false, the character set conversion will only run if the detected character set is not compatible with UTF-8 (e.g., UTF-8, ASCII). |
include_header |
boolean optional. A boolean value indicating whether or not the first row of the file is a header row. If not provided, will attempt to auto-detect whether a header row is present. |
column_delimiter |
string optional. The column delimiter for the file. One of "comma", "tab", or "pipe". If not provided, the column delimiter will be auto-detected. |
boolean optional. The hidden status of the item. |
A list containing the following elements:
id |
integer, The ID of the job created. |
fileId |
integer, The ID of the file. |
inPlace |
boolean, If true, the file is cleaned in place. If false, a new file ID is created. Defaults to true. |
detectTableColumns |
boolean, If true, detect the table columns in the file including the sql types. If false, skip table column detection.Defaults to false. |
forceCharacterSetConversion |
boolean, If true, the file will always be converted to UTF-8 and any character that cannot be converted will be discarded. If false, the character set conversion will only run if the detected character set is not compatible with UTF-8 (e.g., UTF-8, ASCII). |
includeHeader |
boolean, A boolean value indicating whether or not the first row of the file is a header row. If not provided, will attempt to auto-detect whether a header row is present. |
columnDelimiter |
string, The column delimiter for the file. One of "comma", "tab", or "pipe". If not provided, the column delimiter will be auto-detected. |
hidden |
boolean, The hidden status of the item. |
Update details about a file
files_put(id, name, expires_at)
files_put(id, name, expires_at)
id |
integer required. The ID of the file. |
name |
string required. The file name. The extension must match the previous extension. |
expires_at |
string required. The date and time the file will expire. |
A list containing the following elements:
id |
integer, The ID of the file. |
name |
string, The file name. |
createdAt |
string, The date and time the file was created. |
fileSize |
integer, The file size. |
expiresAt |
string, The date and time the file will expire. If not specified, the file will expire in 30 days. To keep a file indefinitely, specify null. |
author |
list, A list containing the following elements:
|
downloadUrl |
string, A JSON string containing information about the URL of the file. |
fileUrl |
string, The URL that may be used to download the file. |
detectedInfo |
list, A list containing the following elements:
|
Replace all attributes of this Preprocess CSV
files_put_preprocess_csv( id, file_id, in_place = NULL, detect_table_columns = NULL, force_character_set_conversion = NULL, include_header = NULL, column_delimiter = NULL )
files_put_preprocess_csv( id, file_id, in_place = NULL, detect_table_columns = NULL, force_character_set_conversion = NULL, include_header = NULL, column_delimiter = NULL )
id |
integer required. The ID of the job created. |
file_id |
integer required. The ID of the file. |
in_place |
boolean optional. If true, the file is cleaned in place. If false, a new file ID is created. Defaults to true. |
detect_table_columns |
boolean optional. If true, detect the table columns in the file including the sql types. If false, skip table column detection.Defaults to false. |
force_character_set_conversion |
boolean optional. If true, the file will always be converted to UTF-8 and any character that cannot be converted will be discarded. If false, the character set conversion will only run if the detected character set is not compatible with UTF-8 (e.g., UTF-8, ASCII). |
include_header |
boolean optional. A boolean value indicating whether or not the first row of the file is a header row. If not provided, will attempt to auto-detect whether a header row is present. |
column_delimiter |
string optional. The column delimiter for the file. One of "comma", "tab", or "pipe". If not provided, the column delimiter will be auto-detected. |
A list containing the following elements:
id |
integer, The ID of the job created. |
fileId |
integer, The ID of the file. |
inPlace |
boolean, If true, the file is cleaned in place. If false, a new file ID is created. Defaults to true. |
detectTableColumns |
boolean, If true, detect the table columns in the file including the sql types. If false, skip table column detection.Defaults to false. |
forceCharacterSetConversion |
boolean, If true, the file will always be converted to UTF-8 and any character that cannot be converted will be discarded. If false, the character set conversion will only run if the detected character set is not compatible with UTF-8 (e.g., UTF-8, ASCII). |
includeHeader |
boolean, A boolean value indicating whether or not the first row of the file is a header row. If not provided, will attempt to auto-detect whether a header row is present. |
columnDelimiter |
string, The column delimiter for the file. One of "comma", "tab", or "pipe". If not provided, the column delimiter will be auto-detected. |
hidden |
boolean, The hidden status of the item. |
Update the archive status of this object
files_put_preprocess_csv_archive(id, status)
files_put_preprocess_csv_archive(id, status)
id |
integer required. The ID of the object. |
status |
boolean required. The desired archived status of the object. |
A list containing the following elements:
id |
integer, The ID of the job created. |
fileId |
integer, The ID of the file. |
inPlace |
boolean, If true, the file is cleaned in place. If false, a new file ID is created. Defaults to true. |
detectTableColumns |
boolean, If true, detect the table columns in the file including the sql types. If false, skip table column detection.Defaults to false. |
forceCharacterSetConversion |
boolean, If true, the file will always be converted to UTF-8 and any character that cannot be converted will be discarded. If false, the character set conversion will only run if the detected character set is not compatible with UTF-8 (e.g., UTF-8, ASCII). |
includeHeader |
boolean, A boolean value indicating whether or not the first row of the file is a header row. If not provided, will attempt to auto-detect whether a header row is present. |
columnDelimiter |
string, The column delimiter for the file. One of "comma", "tab", or "pipe". If not provided, the column delimiter will be auto-detected. |
hidden |
boolean, The hidden status of the item. |
Add a File to a project
files_put_projects(id, project_id)
files_put_projects(id, project_id)
id |
integer required. The ID of the File. |
project_id |
integer required. The ID of the project. |
An empty HTTP response
Generate a client
generate_client(spec)
generate_client(spec)
spec |
usually from |
A string containing one documented function for each verb at each endpoint.
Return the database id for a given database name
get_database_id(database_name)
get_database_id(database_name)
database_name |
string, Name of database. |
database_id integer, id of the matching database.
Get error data from civis_errors
get_error(x)
get_error(x)
x |
The error, usually from |
A list containing
f |
The function |
args |
A list of named arguments |
error |
The error message from platform (if any) |
status |
The status |
## Not run: q_id <- queries_post(db_id, query, n_rows, cred_id)[["id"]] r <- tryCatch(await(queries_get, id = q_id), error = function(e) e) print(r) get_error(r) r <- try(await(queries_get, id = q_id)) get_error(r) ## End(Not run)
## Not run: q_id <- queries_post(db_id, query, n_rows, cred_id)[["id"]] r <- tryCatch(await(queries_get, id = q_id), error = function(e) e) print(r) get_error(r) r <- try(await(queries_get, id = q_id)) get_error(r) ## End(Not run)
Get model feature importance
get_feature_importance(model)
get_feature_importance(model)
model |
Object from |
A matrix of features and their importance, ranked in descending order of importance
Derive the job type and version from the given alias.
get_job_type_version(alias)
get_job_type_version(alias)
alias |
A one-length character vector of the CivisML alias |
A list containing the job_type and version
Get model metrics
get_metric(model, name = NULL)
get_metric(model, name = NULL)
model |
Object from |
name |
Name of the metric. If |
The list of possible metrics provided by CivisML is:
Classification:
"accuracy"
, "confusion_matrix"
, "p_correct"
, "pop_incidence_true"
,
"pop_incidence_pred"
, "roc_auc"
, "log_loss"
, "brier_score"
,
"roc_curve"
, "calibration_curve"
, "deciles"
, "score_histogram"
,
"training_histogram"
, "oos_score_table"
.
Regression:
"mad"
, "rmse"
, "r_squared"
, "score_histogram"
, "training_histogram"
,
"y_yhat_plot"
, "y_yhat_outlier_rows"
, "oos_score_table"
The metric given by name
, or all metrics.
Get a script function matching a job type.
get_script_fun(job, verb = c("list", "post"), fun_type = c("outputs", "logs"))
get_script_fun(job, verb = c("list", "post"), fun_type = c("outputs", "logs"))
job |
output of |
verb |
one of |
fun_type |
one of |
container and custom scripts both have the same job type, but can be distinguished
by a non-null fromTemplateId
.
The correct output or log fetching function
(e.g. scripts_list_containers_runs_logs
) based on the job type.
await
Get the status from results of await
get_status(response)
get_status(response)
response |
the results from |
await await_all
Return the table id for a given table
get_table_id(table_name, database = NULL)
get_table_id(table_name, database = NULL)
table_name |
string, Name of table and schema |
database |
string, Name of database where data frame is to be uploaded. If no database is specified,
uses |
table_id integer, id of the matching table.
Other tables:
refresh_table()
,
transfer_table()
Get template IDs for all accessible CivisML versions.
get_template_ids_all_versions()
get_template_ids_all_versions()
A data frame containing the template id, CivisML version, and job type.
Get training template IDs for the specified CivisML version
get_train_template_id(civisml_version = "prod")
get_train_template_id(civisml_version = "prod")
civisml_version |
A one-length character vector of the CivisML version |
The template ID for training
Remove the bookmark on a git repository
git_repos_delete(id)
git_repos_delete(id)
id |
integer required. The ID for this git repository. |
An empty HTTP response
Get a bookmarked git repository
git_repos_get(id)
git_repos_get(id)
id |
integer required. The ID for this git repository. |
A list containing the following elements:
id |
integer, The ID for this git repository. |
repoUrl |
string, The URL for this git repository. |
createdAt |
string, |
updatedAt |
string, |
List bookmarked git repositories
git_repos_list(limit = NULL, page_num = NULL, order = NULL, order_dir = NULL)
git_repos_list(limit = NULL, page_num = NULL, order = NULL, order_dir = NULL)
limit |
integer optional. Number of results to return. Defaults to 20. Maximum allowed is 100. |
page_num |
integer optional. Page number of the results to return. Defaults to the first page, 1. |
order |
string optional. The field on which to order the result set. Defaults to repo_url. Must be one of: repo_url, created_at. |
order_dir |
string optional. Direction in which to sort, either asc (ascending) or desc (descending) defaulting to asc. |
An array containing the following fields:
id |
integer, The ID for this git repository. |
repoUrl |
string, The URL for this git repository. |
createdAt |
string, |
updatedAt |
string, |
Bookmark a git repository
git_repos_post(repo_url)
git_repos_post(repo_url)
repo_url |
string required. The URL for this git repository. |
A list containing the following elements:
id |
integer, The ID for this git repository. |
repoUrl |
string, The URL for this git repository. |
createdAt |
string, |
updatedAt |
string, |
Delete a Group (deprecated)
groups_delete(id)
groups_delete(id)
id |
integer required. |
An empty HTTP response
Remove a user from a group
groups_delete_members(id, user_id)
groups_delete_members(id, user_id)
id |
integer required. The ID of the group. |
user_id |
integer required. The ID of the user. |
An empty HTTP response
Get a Group
groups_get(id)
groups_get(id)
id |
integer required. |
A list containing the following elements:
id |
integer, The ID of this group. |
name |
string, This group's name. |
createdAt |
string, The date and time when this group was created. |
description |
string, The description of the group. |
slug |
string, The slug for this group. |
organizationId |
integer, The ID of the organization this group belongs to. |
organizationName |
string, The name of the organization this group belongs to. |
memberCount |
integer, The total number of members in this group. |
mustAgreeToEula |
boolean, Whether or not members of this group must sign the EULA. |
defaultOtpRequiredForLogin |
boolean, The two factor authentication requirement for this group. |
roleIds |
array, An array of ids of all the roles this group has. |
defaultTimeZone |
string, The default time zone of this group. |
defaultJobsLabel |
string, The default partition label for jobs of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future. |
defaultNotebooksLabel |
string, The default partition label for notebooks of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future. |
defaultServicesLabel |
string, The default partition label for services of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future. |
members |
array, An array containing the following fields:
|
List Groups
groups_list( query = NULL, permission = NULL, include_members = NULL, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
groups_list( query = NULL, permission = NULL, include_members = NULL, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
query |
string optional. If specified, it will filter the groups returned. Infix matching is supported (e.g., "query=group" will return "group" and "group of people" and "my group" and "my group of people"). |
permission |
string optional. A permissions string, one of "read", "write", or "manage". Lists only groups for which the current user has that permission. |
include_members |
boolean optional. Show members of the group. |
limit |
integer optional. Number of results to return. Defaults to 50. Maximum allowed is 1000. |
page_num |
integer optional. Page number of the results to return. Defaults to the first page, 1. |
order |
string optional. The field on which to order the result set. Defaults to name. Must be one of: name, created_at. |
order_dir |
string optional. Direction in which to sort, either asc (ascending) or desc (descending) defaulting to asc. |
An array containing the following fields:
id |
integer, The ID of this group. |
name |
string, This group's name. |
createdAt |
string, The date and time when this group was created. |
slug |
string, The slug for this group. |
organizationId |
integer, The ID of the organization this group belongs to. |
organizationName |
string, The name of the organization this group belongs to. |
memberCount |
integer, The total number of members in this group. |
members |
array, An array containing the following fields:
|
Update some attributes of this Group
groups_patch( id, name = NULL, description = NULL, slug = NULL, organization_id = NULL, must_agree_to_eula = NULL, default_otp_required_for_login = NULL, role_ids = NULL, default_time_zone = NULL, default_jobs_label = NULL, default_notebooks_label = NULL, default_services_label = NULL )
groups_patch( id, name = NULL, description = NULL, slug = NULL, organization_id = NULL, must_agree_to_eula = NULL, default_otp_required_for_login = NULL, role_ids = NULL, default_time_zone = NULL, default_jobs_label = NULL, default_notebooks_label = NULL, default_services_label = NULL )
id |
integer required. The ID of this group. |
name |
string optional. This group's name. |
description |
string optional. The description of the group. |
slug |
string optional. The slug for this group. |
organization_id |
integer optional. The ID of the organization this group belongs to. |
must_agree_to_eula |
boolean optional. Whether or not members of this group must sign the EULA. |
default_otp_required_for_login |
boolean optional. The two factor authentication requirement for this group. |
role_ids |
array optional. An array of ids of all the roles this group has. |
default_time_zone |
string optional. The default time zone of this group. |
default_jobs_label |
string optional. The default partition label for jobs of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future. |
default_notebooks_label |
string optional. The default partition label for notebooks of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future. |
default_services_label |
string optional. The default partition label for services of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future. |
A list containing the following elements:
id |
integer, The ID of this group. |
name |
string, This group's name. |
createdAt |
string, The date and time when this group was created. |
description |
string, The description of the group. |
slug |
string, The slug for this group. |
organizationId |
integer, The ID of the organization this group belongs to. |
organizationName |
string, The name of the organization this group belongs to. |
memberCount |
integer, The total number of members in this group. |
mustAgreeToEula |
boolean, Whether or not members of this group must sign the EULA. |
defaultOtpRequiredForLogin |
boolean, The two factor authentication requirement for this group. |
roleIds |
array, An array of ids of all the roles this group has. |
defaultTimeZone |
string, The default time zone of this group. |
defaultJobsLabel |
string, The default partition label for jobs of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future. |
defaultNotebooksLabel |
string, The default partition label for notebooks of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future. |
defaultServicesLabel |
string, The default partition label for services of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future. |
members |
array, An array containing the following fields:
|
Create a Group
groups_post( name, description = NULL, slug = NULL, organization_id = NULL, must_agree_to_eula = NULL, default_otp_required_for_login = NULL, role_ids = NULL, default_time_zone = NULL, default_jobs_label = NULL, default_notebooks_label = NULL, default_services_label = NULL )
groups_post( name, description = NULL, slug = NULL, organization_id = NULL, must_agree_to_eula = NULL, default_otp_required_for_login = NULL, role_ids = NULL, default_time_zone = NULL, default_jobs_label = NULL, default_notebooks_label = NULL, default_services_label = NULL )
name |
string required. This group's name. |
description |
string optional. The description of the group. |
slug |
string optional. The slug for this group. |
organization_id |
integer optional. The ID of the organization this group belongs to. |
must_agree_to_eula |
boolean optional. Whether or not members of this group must sign the EULA. |
default_otp_required_for_login |
boolean optional. The two factor authentication requirement for this group. |
role_ids |
array optional. An array of ids of all the roles this group has. |
default_time_zone |
string optional. The default time zone of this group. |
default_jobs_label |
string optional. The default partition label for jobs of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future. |
default_notebooks_label |
string optional. The default partition label for notebooks of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future. |
default_services_label |
string optional. The default partition label for services of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future. |
A list containing the following elements:
id |
integer, The ID of this group. |
name |
string, This group's name. |
createdAt |
string, The date and time when this group was created. |
description |
string, The description of the group. |
slug |
string, The slug for this group. |
organizationId |
integer, The ID of the organization this group belongs to. |
organizationName |
string, The name of the organization this group belongs to. |
memberCount |
integer, The total number of members in this group. |
mustAgreeToEula |
boolean, Whether or not members of this group must sign the EULA. |
defaultOtpRequiredForLogin |
boolean, The two factor authentication requirement for this group. |
roleIds |
array, An array of ids of all the roles this group has. |
defaultTimeZone |
string, The default time zone of this group. |
defaultJobsLabel |
string, The default partition label for jobs of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future. |
defaultNotebooksLabel |
string, The default partition label for notebooks of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future. |
defaultServicesLabel |
string, The default partition label for services of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future. |
members |
array, An array containing the following fields:
|
Replace all attributes of this Group
groups_put( id, name, description = NULL, slug = NULL, organization_id = NULL, must_agree_to_eula = NULL, default_otp_required_for_login = NULL, role_ids = NULL, default_time_zone = NULL, default_jobs_label = NULL, default_notebooks_label = NULL, default_services_label = NULL )
groups_put( id, name, description = NULL, slug = NULL, organization_id = NULL, must_agree_to_eula = NULL, default_otp_required_for_login = NULL, role_ids = NULL, default_time_zone = NULL, default_jobs_label = NULL, default_notebooks_label = NULL, default_services_label = NULL )
id |
integer required. The ID of this group. |
name |
string required. This group's name. |
description |
string optional. The description of the group. |
slug |
string optional. The slug for this group. |
organization_id |
integer optional. The ID of the organization this group belongs to. |
must_agree_to_eula |
boolean optional. Whether or not members of this group must sign the EULA. |
default_otp_required_for_login |
boolean optional. The two factor authentication requirement for this group. |
role_ids |
array optional. An array of ids of all the roles this group has. |
default_time_zone |
string optional. The default time zone of this group. |
default_jobs_label |
string optional. The default partition label for jobs of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future. |
default_notebooks_label |
string optional. The default partition label for notebooks of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future. |
default_services_label |
string optional. The default partition label for services of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future. |
A list containing the following elements:
id |
integer, The ID of this group. |
name |
string, This group's name. |
createdAt |
string, The date and time when this group was created. |
description |
string, The description of the group. |
slug |
string, The slug for this group. |
organizationId |
integer, The ID of the organization this group belongs to. |
organizationName |
string, The name of the organization this group belongs to. |
memberCount |
integer, The total number of members in this group. |
mustAgreeToEula |
boolean, Whether or not members of this group must sign the EULA. |
defaultOtpRequiredForLogin |
boolean, The two factor authentication requirement for this group. |
roleIds |
array, An array of ids of all the roles this group has. |
defaultTimeZone |
string, The default time zone of this group. |
defaultJobsLabel |
string, The default partition label for jobs of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future. |
defaultNotebooksLabel |
string, The default partition label for notebooks of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future. |
defaultServicesLabel |
string, The default partition label for services of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future. |
members |
array, An array containing the following fields:
|
Add a user to a group
groups_put_members(id, user_id)
groups_put_members(id, user_id)
id |
integer required. The ID of the group. |
user_id |
integer required. The ID of the user. |
A list containing the following elements:
id |
integer, The ID of this group. |
name |
string, This group's name. |
createdAt |
string, The date and time when this group was created. |
description |
string, The description of the group. |
slug |
string, The slug for this group. |
organizationId |
integer, The ID of the organization this group belongs to. |
organizationName |
string, The name of the organization this group belongs to. |
memberCount |
integer, The total number of members in this group. |
mustAgreeToEula |
boolean, Whether or not members of this group must sign the EULA. |
defaultOtpRequiredForLogin |
boolean, The two factor authentication requirement for this group. |
roleIds |
array, An array of ids of all the roles this group has. |
defaultTimeZone |
string, The default time zone of this group. |
defaultJobsLabel |
string, The default partition label for jobs of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future. |
defaultNotebooksLabel |
string, The default partition label for notebooks of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future. |
defaultServicesLabel |
string, The default partition label for services of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future. |
members |
array, An array containing the following fields:
|
Plot a histogram of the predicted scores or probabilities for a CivisML object
## S3 method for class 'civis_ml' hist(x, name = NULL, ...)
## S3 method for class 'civis_ml' hist(x, name = NULL, ...)
x |
civis_ml object |
name |
name of the class (for multiclass output) |
... |
unused. |
A ggplot2
plot object is returned invisibly.
Archive a CSV Import (deprecated, use archiving endpoints instead)
imports_delete_files_csv(id)
imports_delete_files_csv(id)
id |
integer required. |
An empty HTTP response
Cancel a run
imports_delete_files_runs(id, run_id)
imports_delete_files_runs(id, run_id)
id |
integer required. The ID of the import. |
run_id |
integer required. The ID of the run. |
An empty HTTP response
Remove an Import from a project
imports_delete_projects(id, project_id)
imports_delete_projects(id, project_id)
id |
integer required. The ID of the Import. |
project_id |
integer required. The ID of the project. |
An empty HTTP response
Archive a sync (deprecated, use the /archive endpoint instead)
imports_delete_syncs(id, sync_id)
imports_delete_syncs(id, sync_id)
id |
integer required. The ID of the import to fetch. |
sync_id |
integer required. The ID of the sync to fetch. |
An empty HTTP response
Get details about an import
imports_get(id)
imports_get(id)
id |
integer required. The ID for the import. |
A list containing the following elements:
name |
string, The name of the import. |
syncType |
string, The type of sync to perform; one of Dbsync, AutoImport, GdocImport, GdocExport, and Salesforce. |
source |
list, A list containing the following elements:
|
destination |
list, A list containing the following elements:
|
schedule |
list, A list containing the following elements:
|
notifications |
list, A list containing the following elements:
|
parentId |
integer, Parent id to trigger this import from |
id |
integer, The ID for the import. |
isOutbound |
boolean, |
jobType |
string, The job type of this import. |
syncs |
array, An array containing the following fields:
|
state |
string, |
createdAt |
string, |
updatedAt |
string, |
lastRun |
list, A list containing the following elements:
|
user |
list, A list containing the following elements:
|
runningAs |
list, A list containing the following elements:
|
nextRunAt |
string, The time of the next scheduled run. |
timeZone |
string, The time zone of this import. |
hidden |
boolean, The hidden status of the item. |
archived |
string, The archival status of the requested item(s). |
Get details about a batch import
imports_get_batches(id)
imports_get_batches(id)
id |
integer required. The ID for the import. |
A list containing the following elements:
id |
integer, The ID for the import. |
schema |
string, The destination schema name. This schema must already exist in Redshift. |
table |
string, The destination table name, without the schema prefix. This table must already exist in Redshift. |
remoteHostId |
integer, The ID of the destination database host. |
state |
string, The state of the run; one of "queued", "running", "succeeded", "failed", or "cancelled". |
startedAt |
string, The time the last run started at. |
finishedAt |
string, The time the last run completed. |
error |
string, The error returned by the run, if any. |
hidden |
boolean, The hidden status of the item. |
Get a CSV Import
imports_get_files_csv(id)
imports_get_files_csv(id)
id |
integer required. |
A list containing the following elements:
id |
integer, The ID for the import. |
name |
string, The name of the import. |
source |
list, A list containing the following elements:
|
destination |
list, A list containing the following elements:
|
firstRowIsHeader |
boolean, A boolean value indicating whether or not the first row of the source file is a header row. |
columnDelimiter |
string, The column delimiter for the file. Valid arguments are "comma", "tab", and "pipe". Defaults to "comma". |
escaped |
boolean, A boolean value indicating whether or not the source file has quotes escaped with a backslash.Defaults to false. |
compression |
string, The type of compression of the source file. Valid arguments are "gzip" and "none". Defaults to "none". |
existingTableRows |
string, The behavior if a destination table with the requested name already exists. One of "fail", "truncate", "append", "drop", or "upsert".Defaults to "fail". |
maxErrors |
integer, The maximum number of rows with errors to ignore before failing. This option is not supported for Postgres databases. |
tableColumns |
array, An array containing the following fields:
|
loosenTypes |
boolean, If true, SQL types with precisions/lengths will have these values increased to accommodate data growth in future loads. Type loosening only occurs on table creation. Defaults to false. |
execution |
string, In upsert mode, controls the movement of data in upsert mode. If set to "delayed", the data will be moved after a brief delay. If set to "immediate", the data will be moved immediately. In non-upsert modes, controls the speed at which detailed column stats appear in the data catalogue. Defaults to "delayed", to accommodate concurrent upserts to the same table and speedier non-upsert imports. |
redshiftDestinationOptions |
list, A list containing the following elements:
|
hidden |
boolean, The hidden status of the item. |
Check status of a run
imports_get_files_runs(id, run_id)
imports_get_files_runs(id, run_id)
id |
integer required. The ID of the import. |
run_id |
integer required. The ID of the run. |
A list containing the following elements:
id |
integer, The ID of the run. |
importId |
integer, The ID of the import. |
state |
string, The state of the run, one of 'queued' 'running' 'succeeded' 'failed' or 'cancelled'. |
isCancelRequested |
boolean, True if run cancel requested, else false. |
startedAt |
string, The time the last run started at. |
finishedAt |
string, The time the last run completed. |
error |
string, The error, if any, returned by the run. |
List Imports
imports_list( type = NULL, author = NULL, destination = NULL, source = NULL, status = NULL, hidden = NULL, archived = NULL, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
imports_list( type = NULL, author = NULL, destination = NULL, source = NULL, status = NULL, hidden = NULL, archived = NULL, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
type |
string optional. If specified, return imports of these types. It accepts a comma-separated list, possible values are 'AutoImport', 'DbSync', 'Salesforce', 'GdocImport'. |
author |
string optional. If specified, return imports from this author. It accepts a comma-separated list of author ids. |
destination |
string optional. If specified, returns imports with one of these destinations. It accepts a comma-separated list of remote host ids. |
source |
string optional. If specified, returns imports with one of these sources. It accepts a comma-separated list of remote host ids. 'DbSync' must be specified for 'type'. |
status |
string optional. If specified, returns imports with one of these statuses. It accepts a comma-separated list, possible values are 'running', 'failed', 'succeeded', 'idle', 'scheduled'. |
boolean optional. If specified to be true, returns hidden items. Defaults to false, returning non-hidden items. |
|
archived |
string optional. The archival status of the requested item(s). |
limit |
integer optional. Number of results to return. Defaults to 20. Maximum allowed is 50. |
page_num |
integer optional. Page number of the results to return. Defaults to the first page, 1. |
order |
string optional. The field on which to order the result set. Defaults to updated_at. Must be one of: updated_at, name, created_at, last_run.updated_at. |
order_dir |
string optional. Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc. |
An array containing the following fields:
name |
string, The name of the import. |
syncType |
string, The type of sync to perform; one of Dbsync, AutoImport, GdocImport, GdocExport, and Salesforce. |
source |
list, A list containing the following elements:
|
destination |
list, A list containing the following elements:
|
schedule |
list, A list containing the following elements:
|
id |
integer, The ID for the import. |
isOutbound |
boolean, |
jobType |
string, The job type of this import. |
state |
string, |
createdAt |
string, |
updatedAt |
string, |
lastRun |
list, A list containing the following elements:
|
user |
list, A list containing the following elements:
|
timeZone |
string, The time zone of this import. |
archived |
string, The archival status of the requested item(s). |
List batch imports
imports_list_batches( hidden = NULL, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
imports_list_batches( hidden = NULL, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
boolean optional. If specified to be true, returns hidden items. Defaults to false, returning non-hidden items. |
|
limit |
integer optional. Number of results to return. Defaults to 20. Maximum allowed is 50. |
page_num |
integer optional. Page number of the results to return. Defaults to the first page, 1. |
order |
string optional. The field on which to order the result set. Defaults to updated_at. Must be one of: updated_at, created_at. |
order_dir |
string optional. Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc. |
An array containing the following fields:
id |
integer, The ID for the import. |
schema |
string, The destination schema name. This schema must already exist in Redshift. |
table |
string, The destination table name, without the schema prefix. This table must already exist in Redshift. |
remoteHostId |
integer, The ID of the destination database host. |
state |
string, The state of the run; one of "queued", "running", "succeeded", "failed", or "cancelled". |
startedAt |
string, The time the last run started at. |
finishedAt |
string, The time the last run completed. |
error |
string, The error returned by the run, if any. |
List runs for the given import
imports_list_files_runs( id, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
imports_list_files_runs( id, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
id |
integer required. The ID of the import. |
limit |
integer optional. Number of results to return. Defaults to 20. Maximum allowed is 100. |
page_num |
integer optional. Page number of the results to return. Defaults to the first page, 1. |
order |
string optional. The field on which to order the result set. Defaults to id. Must be one of: id. |
order_dir |
string optional. Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc. |
An array containing the following fields:
id |
integer, The ID of the run. |
importId |
integer, The ID of the import. |
state |
string, The state of the run, one of 'queued' 'running' 'succeeded' 'failed' or 'cancelled'. |
isCancelRequested |
boolean, True if run cancel requested, else false. |
startedAt |
string, The time the last run started at. |
finishedAt |
string, The time the last run completed. |
error |
string, The error, if any, returned by the run. |
Get the logs for a run
imports_list_files_runs_logs(id, run_id, last_id = NULL, limit = NULL)
imports_list_files_runs_logs(id, run_id, last_id = NULL, limit = NULL)
id |
integer required. The ID of the import. |
run_id |
integer required. The ID of the run. |
last_id |
integer optional. The ID of the last log message received. Log entries with this ID value or lower will be omitted.Logs are sorted by ID if this value is provided, and are otherwise sorted by createdAt. |
limit |
integer optional. The maximum number of log messages to return. Default of 10000. |
An array containing the following fields:
id |
integer, The ID of the log. |
createdAt |
string, The time the log was created. |
message |
string, The log message. |
level |
string, The level of the log. One of unknown,fatal,error,warn,info,debug. |
List the projects an Import belongs to
imports_list_projects(id, hidden = NULL)
imports_list_projects(id, hidden = NULL)
id |
integer required. The ID of the Import. |
boolean optional. If specified to be true, returns hidden items. Defaults to false, returning non-hidden items. |
An array containing the following fields:
id |
integer, The ID for this project. |
author |
list, A list containing the following elements:
|
name |
string, The name of this project. |
description |
string, A description of the project. |
users |
array, An array containing the following fields:
|
autoShare |
boolean, |
createdAt |
string, |
updatedAt |
string, |
archived |
string, The archival status of the requested item(s). |
Get the run history of this import
imports_list_runs(id)
imports_list_runs(id)
id |
integer required. |
An array containing the following fields:
id |
integer, |
state |
string, |
createdAt |
string, The time that the run was queued. |
startedAt |
string, The time that the run started. |
finishedAt |
string, The time that the run completed. |
error |
string, The error message for this run, if present. |
Get the logs for a run
imports_list_runs_logs(id, run_id, last_id = NULL, limit = NULL)
imports_list_runs_logs(id, run_id, last_id = NULL, limit = NULL)
id |
integer required. The ID of the import. |
run_id |
integer required. The ID of the run. |
last_id |
integer optional. The ID of the last log message received. Log entries with this ID value or lower will be omitted.Logs are sorted by ID if this value is provided, and are otherwise sorted by createdAt. |
limit |
integer optional. The maximum number of log messages to return. Default of 10000. |
An array containing the following fields:
id |
integer, The ID of the log. |
createdAt |
string, The time the log was created. |
message |
string, The log message. |
level |
string, The level of the log. One of unknown,fatal,error,warn,info,debug. |
Update some attributes of this CSV Import
imports_patch_files_csv( id, name = NULL, source = NULL, destination = NULL, first_row_is_header = NULL, column_delimiter = NULL, escaped = NULL, compression = NULL, existing_table_rows = NULL, max_errors = NULL, table_columns = NULL, loosen_types = NULL, execution = NULL, redshift_destination_options = NULL )
imports_patch_files_csv( id, name = NULL, source = NULL, destination = NULL, first_row_is_header = NULL, column_delimiter = NULL, escaped = NULL, compression = NULL, existing_table_rows = NULL, max_errors = NULL, table_columns = NULL, loosen_types = NULL, execution = NULL, redshift_destination_options = NULL )
id |
integer required. The ID for the import. |
name |
string optional. The name of the import. |
source |
list optional. A list containing the following elements:
|
destination |
list optional. A list containing the following elements:
|
first_row_is_header |
boolean optional. A boolean value indicating whether or not the first row of the source file is a header row. |
column_delimiter |
string optional. The column delimiter for the file. Valid arguments are "comma", "tab", and "pipe". Defaults to "comma". |
escaped |
boolean optional. A boolean value indicating whether or not the source file has quotes escaped with a backslash.Defaults to false. |
compression |
string optional. The type of compression of the source file. Valid arguments are "gzip" and "none". Defaults to "none". |
existing_table_rows |
string optional. The behavior if a destination table with the requested name already exists. One of "fail", "truncate", "append", "drop", or "upsert".Defaults to "fail". |
max_errors |
integer optional. The maximum number of rows with errors to ignore before failing. This option is not supported for Postgres databases. |
table_columns |
array optional. An array containing the following fields:
|
loosen_types |
boolean optional. If true, SQL types with precisions/lengths will have these values increased to accommodate data growth in future loads. Type loosening only occurs on table creation. Defaults to false. |
execution |
string optional. In upsert mode, controls the movement of data in upsert mode. If set to "delayed", the data will be moved after a brief delay. If set to "immediate", the data will be moved immediately. In non-upsert modes, controls the speed at which detailed column stats appear in the data catalogue. Defaults to "delayed", to accommodate concurrent upserts to the same table and speedier non-upsert imports. |
redshift_destination_options |
list optional. A list containing the following elements:
|
A list containing the following elements:
id |
integer, The ID for the import. |
name |
string, The name of the import. |
source |
list, A list containing the following elements:
|
destination |
list, A list containing the following elements:
|
firstRowIsHeader |
boolean, A boolean value indicating whether or not the first row of the source file is a header row. |
columnDelimiter |
string, The column delimiter for the file. Valid arguments are "comma", "tab", and "pipe". Defaults to "comma". |
escaped |
boolean, A boolean value indicating whether or not the source file has quotes escaped with a backslash.Defaults to false. |
compression |
string, The type of compression of the source file. Valid arguments are "gzip" and "none". Defaults to "none". |
existingTableRows |
string, The behavior if a destination table with the requested name already exists. One of "fail", "truncate", "append", "drop", or "upsert".Defaults to "fail". |
maxErrors |
integer, The maximum number of rows with errors to ignore before failing. This option is not supported for Postgres databases. |
tableColumns |
array, An array containing the following fields:
|
loosenTypes |
boolean, If true, SQL types with precisions/lengths will have these values increased to accommodate data growth in future loads. Type loosening only occurs on table creation. Defaults to false. |
execution |
string, In upsert mode, controls the movement of data in upsert mode. If set to "delayed", the data will be moved after a brief delay. If set to "immediate", the data will be moved immediately. In non-upsert modes, controls the speed at which detailed column stats appear in the data catalogue. Defaults to "delayed", to accommodate concurrent upserts to the same table and speedier non-upsert imports. |
redshiftDestinationOptions |
list, A list containing the following elements:
|
hidden |
boolean, The hidden status of the item. |
Create a new import configuration
imports_post( name, sync_type, is_outbound, source = NULL, destination = NULL, schedule = NULL, notifications = NULL, parent_id = NULL, next_run_at = NULL, time_zone = NULL, hidden = NULL )
imports_post( name, sync_type, is_outbound, source = NULL, destination = NULL, schedule = NULL, notifications = NULL, parent_id = NULL, next_run_at = NULL, time_zone = NULL, hidden = NULL )
name |
string required. The name of the import. |
sync_type |
string required. The type of sync to perform; one of Dbsync, AutoImport, GdocImport, GdocExport, and Salesforce. |
is_outbound |
boolean required. |
source |
list optional. A list containing the following elements:
|
destination |
list optional. A list containing the following elements:
|
schedule |
list optional. A list containing the following elements:
|
notifications |
list optional. A list containing the following elements:
|
parent_id |
integer optional. Parent id to trigger this import from |
next_run_at |
string optional. The time of the next scheduled run. |
time_zone |
string optional. The time zone of this import. |
boolean optional. The hidden status of the item. |
A list containing the following elements:
name |
string, The name of the import. |
syncType |
string, The type of sync to perform; one of Dbsync, AutoImport, GdocImport, GdocExport, and Salesforce. |
source |
list, A list containing the following elements:
|
destination |
list, A list containing the following elements:
|
schedule |
list, A list containing the following elements:
|
notifications |
list, A list containing the following elements:
|
parentId |
integer, Parent id to trigger this import from |
id |
integer, The ID for the import. |
isOutbound |
boolean, |
jobType |
string, The job type of this import. |
syncs |
array, An array containing the following fields:
|
state |
string, |
createdAt |
string, |
updatedAt |
string, |
lastRun |
list, A list containing the following elements:
|
user |
list, A list containing the following elements:
|
runningAs |
list, A list containing the following elements:
|
nextRunAt |
string, The time of the next scheduled run. |
timeZone |
string, The time zone of this import. |
hidden |
boolean, The hidden status of the item. |
archived |
string, The archival status of the requested item(s). |
Upload multiple files to Civis
imports_post_batches( file_ids, schema, table, remote_host_id, credential_id, column_delimiter = NULL, first_row_is_header = NULL, compression = NULL, hidden = NULL )
imports_post_batches( file_ids, schema, table, remote_host_id, credential_id, column_delimiter = NULL, first_row_is_header = NULL, compression = NULL, hidden = NULL )
file_ids |
array required. The file IDs for the import. |
schema |
string required. The destination schema name. This schema must already exist in Redshift. |
table |
string required. The destination table name, without the schema prefix. This table must already exist in Redshift. |
remote_host_id |
integer required. The ID of the destination database host. |
credential_id |
integer required. The ID of the credentials to be used when performing the database import. |
column_delimiter |
string optional. The column delimiter for the file. Valid arguments are "comma", "tab", and "pipe". If unspecified, defaults to "comma". |
first_row_is_header |
boolean optional. A boolean value indicating whether or not the first row is a header row. If unspecified, defaults to false. |
compression |
string optional. The type of compression. Valid arguments are "gzip", "zip", and "none". If unspecified, defaults to "gzip". |
boolean optional. The hidden status of the item. |
A list containing the following elements:
id |
integer, The ID for the import. |
schema |
string, The destination schema name. This schema must already exist in Redshift. |
table |
string, The destination table name, without the schema prefix. This table must already exist in Redshift. |
remoteHostId |
integer, The ID of the destination database host. |
state |
string, The state of the run; one of "queued", "running", "succeeded", "failed", or "cancelled". |
startedAt |
string, The time the last run started at. |
finishedAt |
string, The time the last run completed. |
error |
string, The error returned by the run, if any. |
hidden |
boolean, The hidden status of the item. |
Cancel a run
imports_post_cancel(id)
imports_post_cancel(id)
id |
integer required. The ID of the job. |
A list containing the following elements:
id |
integer, The ID of the run. |
state |
string, The state of the run, one of 'queued', 'running' or 'cancelled'. |
isCancelRequested |
boolean, True if run cancel requested, else false. |
Initate an import of a tabular file into the platform
imports_post_files( schema, name, remote_host_id, credential_id, max_errors = NULL, existing_table_rows = NULL, diststyle = NULL, distkey = NULL, sortkey1 = NULL, sortkey2 = NULL, column_delimiter = NULL, first_row_is_header = NULL, multipart = NULL, escaped = NULL, hidden = NULL )
imports_post_files( schema, name, remote_host_id, credential_id, max_errors = NULL, existing_table_rows = NULL, diststyle = NULL, distkey = NULL, sortkey1 = NULL, sortkey2 = NULL, column_delimiter = NULL, first_row_is_header = NULL, multipart = NULL, escaped = NULL, hidden = NULL )
schema |
string required. The schema of the destination table. |
name |
string required. The name of the destination table. |
remote_host_id |
integer required. The id of the destination database host. |
credential_id |
integer required. The id of the credentials to be used when performing the database import. |
max_errors |
integer optional. The maximum number of rows with errors to remove from the import before failing. |
existing_table_rows |
string optional. The behaviour if a table with the requested name already exists. One of "fail", "truncate", "append", or "drop".Defaults to "fail". |
diststyle |
string optional. The diststyle to use for the table. One of "even", "all", or "key". |
distkey |
string optional. The column to use as the distkey for the table. |
sortkey1 |
string optional. The column to use as the sort key for the table. |
sortkey2 |
string optional. The second column in a compound sortkey for the table. |
column_delimiter |
string optional. The column delimiter of the file. If column_delimiter is null or omitted, it will be auto-detected. Valid arguments are "comma", "tab", and "pipe". |
first_row_is_header |
boolean optional. A boolean value indicating whether or not the first row is a header row. If first_row_is_header is null or omitted, it will be auto-detected. |
multipart |
boolean optional. If true, the upload URI will require a 'multipart/form-data' POST request. Defaults to false. |
escaped |
boolean optional. If true, escape quotes with a backslash; otherwise, escape quotes by double-quoting. Defaults to false. |
boolean optional. The hidden status of the item. |
A list containing the following elements:
id |
integer, The id of the import. |
uploadUri |
string, The URI which may be used to upload a tabular file for import. You must use this URI to upload the file you wish imported and then inform the Civis API when your upload is complete using the URI given by the runUri field of this response. |
runUri |
string, The URI to POST to once the file upload is complete. After uploading the file using the URI given in the uploadUri attribute of the response, POST to this URI to initiate the import of your uploaded file into the platform. |
uploadFields |
list, If multipart was set to true, these fields should be included in the multipart upload. |
Create a CSV Import
imports_post_files_csv( source, destination, first_row_is_header, name = NULL, column_delimiter = NULL, escaped = NULL, compression = NULL, existing_table_rows = NULL, max_errors = NULL, table_columns = NULL, loosen_types = NULL, execution = NULL, redshift_destination_options = NULL, hidden = NULL )
imports_post_files_csv( source, destination, first_row_is_header, name = NULL, column_delimiter = NULL, escaped = NULL, compression = NULL, existing_table_rows = NULL, max_errors = NULL, table_columns = NULL, loosen_types = NULL, execution = NULL, redshift_destination_options = NULL, hidden = NULL )
source |
list required. A list containing the following elements:
|
destination |
list required. A list containing the following elements:
|
first_row_is_header |
boolean required. A boolean value indicating whether or not the first row of the source file is a header row. |
name |
string optional. The name of the import. |
column_delimiter |
string optional. The column delimiter for the file. Valid arguments are "comma", "tab", and "pipe". Defaults to "comma". |
escaped |
boolean optional. A boolean value indicating whether or not the source file has quotes escaped with a backslash.Defaults to false. |
compression |
string optional. The type of compression of the source file. Valid arguments are "gzip" and "none". Defaults to "none". |
existing_table_rows |
string optional. The behavior if a destination table with the requested name already exists. One of "fail", "truncate", "append", "drop", or "upsert".Defaults to "fail". |
max_errors |
integer optional. The maximum number of rows with errors to ignore before failing. This option is not supported for Postgres databases. |
table_columns |
array optional. An array containing the following fields:
|
loosen_types |
boolean optional. If true, SQL types with precisions/lengths will have these values increased to accommodate data growth in future loads. Type loosening only occurs on table creation. Defaults to false. |
execution |
string optional. In upsert mode, controls the movement of data in upsert mode. If set to "delayed", the data will be moved after a brief delay. If set to "immediate", the data will be moved immediately. In non-upsert modes, controls the speed at which detailed column stats appear in the data catalogue. Defaults to "delayed", to accommodate concurrent upserts to the same table and speedier non-upsert imports. |
redshift_destination_options |
list optional. A list containing the following elements:
|
boolean optional. The hidden status of the item. |
A list containing the following elements:
id |
integer, The ID for the import. |
name |
string, The name of the import. |
source |
list, A list containing the following elements:
|
destination |
list, A list containing the following elements:
|
firstRowIsHeader |
boolean, A boolean value indicating whether or not the first row of the source file is a header row. |
columnDelimiter |
string, The column delimiter for the file. Valid arguments are "comma", "tab", and "pipe". Defaults to "comma". |
escaped |
boolean, A boolean value indicating whether or not the source file has quotes escaped with a backslash.Defaults to false. |
compression |
string, The type of compression of the source file. Valid arguments are "gzip" and "none". Defaults to "none". |
existingTableRows |
string, The behavior if a destination table with the requested name already exists. One of "fail", "truncate", "append", "drop", or "upsert".Defaults to "fail". |
maxErrors |
integer, The maximum number of rows with errors to ignore before failing. This option is not supported for Postgres databases. |
tableColumns |
array, An array containing the following fields:
|
loosenTypes |
boolean, If true, SQL types with precisions/lengths will have these values increased to accommodate data growth in future loads. Type loosening only occurs on table creation. Defaults to false. |
execution |
string, In upsert mode, controls the movement of data in upsert mode. If set to "delayed", the data will be moved after a brief delay. If set to "immediate", the data will be moved immediately. In non-upsert modes, controls the speed at which detailed column stats appear in the data catalogue. Defaults to "delayed", to accommodate concurrent upserts to the same table and speedier non-upsert imports. |
redshiftDestinationOptions |
list, A list containing the following elements:
|
hidden |
boolean, The hidden status of the item. |
Start a run
imports_post_files_runs(id)
imports_post_files_runs(id)
id |
integer required. The ID of the import. |
A list containing the following elements:
id |
integer, The ID of the run. |
importId |
integer, The ID of the import. |
state |
string, The state of the run, one of 'queued' 'running' 'succeeded' 'failed' or 'cancelled'. |
isCancelRequested |
boolean, True if run cancel requested, else false. |
startedAt |
string, The time the last run started at. |
finishedAt |
string, The time the last run completed. |
error |
string, The error, if any, returned by the run. |
Run an import
imports_post_runs(id)
imports_post_runs(id)
id |
integer required. The ID of the import to run. |
A list containing the following elements:
runId |
integer, The ID of the new run triggered. |
Create a sync
imports_post_syncs(id, source, destination, advanced_options = NULL)
imports_post_syncs(id, source, destination, advanced_options = NULL)
id |
integer required. |
source |
list required. A list containing the following elements:
|
destination |
list required. A list containing the following elements:
|
advanced_options |
list optional. A list containing the following elements:
|
A list containing the following elements:
id |
integer, |
source |
list, A list containing the following elements:
|
destination |
list, A list containing the following elements:
|
advancedOptions |
list, A list containing the following elements:
|
Update an import
imports_put( id, name, sync_type, is_outbound, source = NULL, destination = NULL, schedule = NULL, notifications = NULL, parent_id = NULL, next_run_at = NULL, time_zone = NULL )
imports_put( id, name, sync_type, is_outbound, source = NULL, destination = NULL, schedule = NULL, notifications = NULL, parent_id = NULL, next_run_at = NULL, time_zone = NULL )
id |
integer required. The ID for the import. |
name |
string required. The name of the import. |
sync_type |
string required. The type of sync to perform; one of Dbsync, AutoImport, GdocImport, GdocExport, and Salesforce. |
is_outbound |
boolean required. |
source |
list optional. A list containing the following elements:
|
destination |
list optional. A list containing the following elements:
|
schedule |
list optional. A list containing the following elements:
|
notifications |
list optional. A list containing the following elements:
|
parent_id |
integer optional. Parent id to trigger this import from |
next_run_at |
string optional. The time of the next scheduled run. |
time_zone |
string optional. The time zone of this import. |
A list containing the following elements:
name |
string, The name of the import. |
syncType |
string, The type of sync to perform; one of Dbsync, AutoImport, GdocImport, GdocExport, and Salesforce. |
source |
list, A list containing the following elements:
|
destination |
list, A list containing the following elements:
|
schedule |
list, A list containing the following elements:
|
notifications |
list, A list containing the following elements:
|
parentId |
integer, Parent id to trigger this import from |
id |
integer, The ID for the import. |
isOutbound |
boolean, |
jobType |
string, The job type of this import. |
syncs |
array, An array containing the following fields:
|
state |
string, |
createdAt |
string, |
updatedAt |
string, |
lastRun |
list, A list containing the following elements:
|
user |
list, A list containing the following elements:
|
runningAs |
list, A list containing the following elements:
|
nextRunAt |
string, The time of the next scheduled run. |
timeZone |
string, The time zone of this import. |
hidden |
boolean, The hidden status of the item. |
archived |
string, The archival status of the requested item(s). |
Update the archive status of this object
imports_put_archive(id, status)
imports_put_archive(id, status)
id |
integer required. The ID of the object. |
status |
boolean required. The desired archived status of the object. |
A list containing the following elements:
name |
string, The name of the import. |
syncType |
string, The type of sync to perform; one of Dbsync, AutoImport, GdocImport, GdocExport, and Salesforce. |
source |
list, A list containing the following elements:
|
destination |
list, A list containing the following elements:
|
schedule |
list, A list containing the following elements:
|
notifications |
list, A list containing the following elements:
|
parentId |
integer, Parent id to trigger this import from |
id |
integer, The ID for the import. |
isOutbound |
boolean, |
jobType |
string, The job type of this import. |
syncs |
array, An array containing the following fields:
|
state |
string, |
createdAt |
string, |
updatedAt |
string, |
lastRun |
list, A list containing the following elements:
|
user |
list, A list containing the following elements:
|
runningAs |
list, A list containing the following elements:
|
nextRunAt |
string, The time of the next scheduled run. |
timeZone |
string, The time zone of this import. |
hidden |
boolean, The hidden status of the item. |
archived |
string, The archival status of the requested item(s). |
Replace all attributes of this CSV Import
imports_put_files_csv( id, source, destination, first_row_is_header, name = NULL, column_delimiter = NULL, escaped = NULL, compression = NULL, existing_table_rows = NULL, max_errors = NULL, table_columns = NULL, loosen_types = NULL, execution = NULL, redshift_destination_options = NULL )
imports_put_files_csv( id, source, destination, first_row_is_header, name = NULL, column_delimiter = NULL, escaped = NULL, compression = NULL, existing_table_rows = NULL, max_errors = NULL, table_columns = NULL, loosen_types = NULL, execution = NULL, redshift_destination_options = NULL )
id |
integer required. The ID for the import. |
source |
list required. A list containing the following elements:
|
destination |
list required. A list containing the following elements:
|
first_row_is_header |
boolean required. A boolean value indicating whether or not the first row of the source file is a header row. |
name |
string optional. The name of the import. |
column_delimiter |
string optional. The column delimiter for the file. Valid arguments are "comma", "tab", and "pipe". Defaults to "comma". |
escaped |
boolean optional. A boolean value indicating whether or not the source file has quotes escaped with a backslash.Defaults to false. |
compression |
string optional. The type of compression of the source file. Valid arguments are "gzip" and "none". Defaults to "none". |
existing_table_rows |
string optional. The behavior if a destination table with the requested name already exists. One of "fail", "truncate", "append", "drop", or "upsert".Defaults to "fail". |
max_errors |
integer optional. The maximum number of rows with errors to ignore before failing. This option is not supported for Postgres databases. |
table_columns |
array optional. An array containing the following fields:
|
loosen_types |
boolean optional. If true, SQL types with precisions/lengths will have these values increased to accommodate data growth in future loads. Type loosening only occurs on table creation. Defaults to false. |
execution |
string optional. In upsert mode, controls the movement of data in upsert mode. If set to "delayed", the data will be moved after a brief delay. If set to "immediate", the data will be moved immediately. In non-upsert modes, controls the speed at which detailed column stats appear in the data catalogue. Defaults to "delayed", to accommodate concurrent upserts to the same table and speedier non-upsert imports. |
redshift_destination_options |
list optional. A list containing the following elements:
|
A list containing the following elements:
id |
integer, The ID for the import. |
name |
string, The name of the import. |
source |
list, A list containing the following elements:
|
destination |
list, A list containing the following elements:
|
firstRowIsHeader |
boolean, A boolean value indicating whether or not the first row of the source file is a header row. |
columnDelimiter |
string, The column delimiter for the file. Valid arguments are "comma", "tab", and "pipe". Defaults to "comma". |
escaped |
boolean, A boolean value indicating whether or not the source file has quotes escaped with a backslash.Defaults to false. |
compression |
string, The type of compression of the source file. Valid arguments are "gzip" and "none". Defaults to "none". |
existingTableRows |
string, The behavior if a destination table with the requested name already exists. One of "fail", "truncate", "append", "drop", or "upsert".Defaults to "fail". |
maxErrors |
integer, The maximum number of rows with errors to ignore before failing. This option is not supported for Postgres databases. |
tableColumns |
array, An array containing the following fields:
|
loosenTypes |
boolean, If true, SQL types with precisions/lengths will have these values increased to accommodate data growth in future loads. Type loosening only occurs on table creation. Defaults to false. |
execution |
string, In upsert mode, controls the movement of data in upsert mode. If set to "delayed", the data will be moved after a brief delay. If set to "immediate", the data will be moved immediately. In non-upsert modes, controls the speed at which detailed column stats appear in the data catalogue. Defaults to "delayed", to accommodate concurrent upserts to the same table and speedier non-upsert imports. |
redshiftDestinationOptions |
list, A list containing the following elements:
|
hidden |
boolean, The hidden status of the item. |
Update the archive status of this object
imports_put_files_csv_archive(id, status)
imports_put_files_csv_archive(id, status)
id |
integer required. The ID of the object. |
status |
boolean required. The desired archived status of the object. |
A list containing the following elements:
id |
integer, The ID for the import. |
name |
string, The name of the import. |
source |
list, A list containing the following elements:
|
destination |
list, A list containing the following elements:
|
firstRowIsHeader |
boolean, A boolean value indicating whether or not the first row of the source file is a header row. |
columnDelimiter |
string, The column delimiter for the file. Valid arguments are "comma", "tab", and "pipe". Defaults to "comma". |
escaped |
boolean, A boolean value indicating whether or not the source file has quotes escaped with a backslash.Defaults to false. |
compression |
string, The type of compression of the source file. Valid arguments are "gzip" and "none". Defaults to "none". |
existingTableRows |
string, The behavior if a destination table with the requested name already exists. One of "fail", "truncate", "append", "drop", or "upsert".Defaults to "fail". |
maxErrors |
integer, The maximum number of rows with errors to ignore before failing. This option is not supported for Postgres databases. |
tableColumns |
array, An array containing the following fields:
|
loosenTypes |
boolean, If true, SQL types with precisions/lengths will have these values increased to accommodate data growth in future loads. Type loosening only occurs on table creation. Defaults to false. |
execution |
string, In upsert mode, controls the movement of data in upsert mode. If set to "delayed", the data will be moved after a brief delay. If set to "immediate", the data will be moved immediately. In non-upsert modes, controls the speed at which detailed column stats appear in the data catalogue. Defaults to "delayed", to accommodate concurrent upserts to the same table and speedier non-upsert imports. |
redshiftDestinationOptions |
list, A list containing the following elements:
|
hidden |
boolean, The hidden status of the item. |
Add an Import to a project
imports_put_projects(id, project_id)
imports_put_projects(id, project_id)
id |
integer required. The ID of the Import. |
project_id |
integer required. The ID of the project. |
An empty HTTP response
Update a sync
imports_put_syncs(id, sync_id, source, destination, advanced_options = NULL)
imports_put_syncs(id, sync_id, source, destination, advanced_options = NULL)
id |
integer required. The ID of the import to fetch. |
sync_id |
integer required. The ID of the sync to fetch. |
source |
list required. A list containing the following elements:
|
destination |
list required. A list containing the following elements:
|
advanced_options |
list optional. A list containing the following elements:
|
A list containing the following elements:
id |
integer, |
source |
list, A list containing the following elements:
|
destination |
list, A list containing the following elements:
|
advancedOptions |
list, A list containing the following elements:
|
Update the archive status of this sync
imports_put_syncs_archive(id, sync_id, status = NULL)
imports_put_syncs_archive(id, sync_id, status = NULL)
id |
integer required. The ID of the import to fetch. |
sync_id |
integer required. The ID of the sync to fetch. |
status |
boolean optional. The desired archived status of the sync. |
A list containing the following elements:
id |
integer, |
source |
list, A list containing the following elements:
|
destination |
list, A list containing the following elements:
|
advancedOptions |
list, A list containing the following elements:
|
Remove a Job from a project
jobs_delete_projects(id, project_id)
jobs_delete_projects(id, project_id)
id |
integer required. The ID of the Job. |
project_id |
integer required. The ID of the project. |
An empty HTTP response
Cancel a run
jobs_delete_runs(id, run_id)
jobs_delete_runs(id, run_id)
id |
integer required. The ID of the Job. |
run_id |
integer required. The ID of the Run. |
An empty HTTP response
Show basic job info
jobs_get(id)
jobs_get(id)
id |
integer required. The ID for this job. |
A list containing the following elements:
id |
integer, |
name |
string, |
type |
string, |
fromTemplateId |
integer, |
state |
string, Whether the job is idle, queued, running, cancelled, or failed. |
createdAt |
string, |
updatedAt |
string, |
runs |
array, An array containing the following fields:
|
lastRun |
list, A list containing the following elements:
|
hidden |
boolean, The hidden status of the item. |
archived |
string, The archival status of the requested item(s). |
successEmailSubject |
string, |
successEmailBody |
string, |
runningAsUser |
string, |
runByUser |
string, |
schedule |
list, A list containing the following elements:
|
Check status of a job
jobs_get_runs(id, run_id)
jobs_get_runs(id, run_id)
id |
integer required. The ID of the Job. |
run_id |
integer required. The ID of the Run. |
A list containing the following elements:
id |
integer, |
state |
string, |
createdAt |
string, The time that the run was queued. |
startedAt |
string, The time that the run started. |
finishedAt |
string, The time that the run completed. |
error |
string, The error message for this run, if present. |
List Jobs
jobs_list( state = NULL, type = NULL, q = NULL, permission = NULL, scheduled = NULL, hidden = NULL, archived = NULL, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
jobs_list( state = NULL, type = NULL, q = NULL, permission = NULL, scheduled = NULL, hidden = NULL, archived = NULL, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
state |
string optional. The job's state. One or more of queued, running, succeeded, failed, and cancelled. Specify multiple values as a comma-separated list (e.g., "A,B"). |
type |
string optional. The job's type. Specify multiple values as a comma-separated list (e.g., "A,B"). |
q |
string optional. Query string to search on the id, name, and job type. |
permission |
string optional. A permissions string, one of "read", "write", or "manage". Lists only jobs for which the current user has that permission. |
scheduled |
boolean optional. If the item is scheduled. |
boolean optional. If specified to be true, returns hidden items. Defaults to false, returning non-hidden items. |
|
archived |
string optional. The archival status of the requested item(s). |
limit |
integer optional. Number of results to return. Defaults to its maximum of 50. |
page_num |
integer optional. Page number of the results to return. Defaults to the first page, 1. |
order |
string optional. The field on which to order the result set. Defaults to updated_at. Must be one of: updated_at. |
order_dir |
string optional. Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc. |
An array containing the following fields:
id |
integer, |
name |
string, |
type |
string, |
fromTemplateId |
integer, |
state |
string, Whether the job is idle, queued, running, cancelled, or failed. |
createdAt |
string, |
updatedAt |
string, |
lastRun |
list, A list containing the following elements:
|
archived |
string, The archival status of the requested item(s). |
schedule |
list, A list containing the following elements:
|
Show nested tree of children that this job triggers
jobs_list_children(id)
jobs_list_children(id)
id |
integer required. The ID for this job. |
A list containing the following elements:
id |
integer, |
name |
string, |
type |
string, |
fromTemplateId |
integer, |
state |
string, |
createdAt |
string, |
updatedAt |
string, |
runs |
array, An array containing the following fields:
|
lastRun |
list, A list containing the following elements:
|
children |
array, |
Show chain of parents as a list that this job triggers from
jobs_list_parents(id)
jobs_list_parents(id)
id |
integer required. The ID for this job. |
A list containing the following elements:
id |
integer, |
name |
string, |
type |
string, |
fromTemplateId |
integer, |
state |
string, Whether the job is idle, queued, running, cancelled, or failed. |
createdAt |
string, |
updatedAt |
string, |
runs |
array, An array containing the following fields:
|
lastRun |
list, A list containing the following elements:
|
hidden |
boolean, The hidden status of the item. |
archived |
string, The archival status of the requested item(s). |
successEmailSubject |
string, |
successEmailBody |
string, |
runningAsUser |
string, |
runByUser |
string, |
schedule |
list, A list containing the following elements:
|
List the projects a Job belongs to
jobs_list_projects(id, hidden = NULL)
jobs_list_projects(id, hidden = NULL)
id |
integer required. The ID of the Job. |
boolean optional. If specified to be true, returns hidden items. Defaults to false, returning non-hidden items. |
An array containing the following fields:
id |
integer, The ID for this project. |
author |
list, A list containing the following elements:
|
name |
string, The name of this project. |
description |
string, A description of the project. |
users |
array, An array containing the following fields:
|
autoShare |
boolean, |
createdAt |
string, |
updatedAt |
string, |
archived |
string, The archival status of the requested item(s). |
List runs for the given job
jobs_list_runs( id, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
jobs_list_runs( id, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
id |
integer required. The ID for this job. |
limit |
integer optional. Number of results to return. Defaults to 20. Maximum allowed is 100. |
page_num |
integer optional. Page number of the results to return. Defaults to the first page, 1. |
order |
string optional. The field on which to order the result set. Defaults to id. Must be one of: id. |
order_dir |
string optional. Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc. |
An array containing the following fields:
id |
integer, |
state |
string, |
createdAt |
string, The time that the run was queued. |
startedAt |
string, The time that the run started. |
finishedAt |
string, The time that the run completed. |
error |
string, The error message for this run, if present. |
Get the logs for a run
jobs_list_runs_logs(id, run_id, last_id = NULL, limit = NULL)
jobs_list_runs_logs(id, run_id, last_id = NULL, limit = NULL)
id |
integer required. The ID of the job. |
run_id |
integer required. The ID of the run. |
last_id |
integer optional. The ID of the last log message received. Log entries with this ID value or lower will be omitted.Logs are sorted by ID if this value is provided, and are otherwise sorted by createdAt. |
limit |
integer optional. The maximum number of log messages to return. Default of 10000. |
An array containing the following fields:
id |
integer, The ID of the log. |
createdAt |
string, The time the log was created. |
message |
string, The log message. |
level |
string, The level of the log. One of unknown,fatal,error,warn,info,debug. |
List the outputs for a run
jobs_list_runs_outputs( id, run_id, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
jobs_list_runs_outputs( id, run_id, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
id |
integer required. The ID of the job. |
run_id |
integer required. The ID of the run. |
limit |
integer optional. Number of results to return. Defaults to its maximum of 50. |
page_num |
integer optional. Page number of the results to return. Defaults to the first page, 1. |
order |
string optional. The field on which to order the result set. Defaults to created_at. Must be one of: created_at, id. |
order_dir |
string optional. Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc. |
An array containing the following fields:
objectType |
string, The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue |
objectId |
integer, The ID of the output. |
name |
string, The name of the output. |
link |
string, The hypermedia link to the output. |
value |
string, |
List the workflows a job belongs to
jobs_list_workflows(id, archived = NULL)
jobs_list_workflows(id, archived = NULL)
id |
integer required. |
archived |
string optional. The archival status of the requested item(s). |
An array containing the following fields:
id |
integer, The ID for this workflow. |
name |
string, The name of this workflow. |
description |
string, A description of the workflow. |
valid |
boolean, The validity of the workflow definition. |
fileId |
string, The file id for the s3 file containing the workflow configuration. |
user |
list, A list containing the following elements:
|
state |
string, The state of the workflow. State is "running" if any execution is running, otherwise reflects most recent execution state. |
schedule |
list, A list containing the following elements:
|
allowConcurrentExecutions |
boolean, Whether the workflow can execute when already running. |
timeZone |
string, The time zone of this workflow. |
nextExecutionAt |
string, The time of the next scheduled execution. |
archived |
string, The archival status of the requested item(s). |
createdAt |
string, |
updatedAt |
string, |
Run a job
jobs_post_runs(id)
jobs_post_runs(id)
id |
integer required. The ID for this job. |
A list containing the following elements:
id |
integer, |
state |
string, |
createdAt |
string, The time that the run was queued. |
startedAt |
string, The time that the run started. |
finishedAt |
string, The time that the run completed. |
error |
string, The error message for this run, if present. |
Generate and retrieve trigger email address
jobs_post_trigger_email(id)
jobs_post_trigger_email(id)
id |
integer required. The ID for this job. |
A list containing the following elements:
triggerEmail |
string, Email address which may be used to trigger this job to run. |
Update the archive status of this object
jobs_put_archive(id, status)
jobs_put_archive(id, status)
id |
integer required. The ID of the object. |
status |
boolean required. The desired archived status of the object. |
A list containing the following elements:
id |
integer, |
name |
string, |
type |
string, |
fromTemplateId |
integer, |
state |
string, Whether the job is idle, queued, running, cancelled, or failed. |
createdAt |
string, |
updatedAt |
string, |
runs |
array, An array containing the following fields:
|
lastRun |
list, A list containing the following elements:
|
hidden |
boolean, The hidden status of the item. |
archived |
string, The archival status of the requested item(s). |
successEmailSubject |
string, |
successEmailBody |
string, |
runningAsUser |
string, |
runByUser |
string, |
schedule |
list, A list containing the following elements:
|
Add a Job to a project
jobs_put_projects(id, project_id)
jobs_put_projects(id, project_id)
id |
integer required. The ID of the Job. |
project_id |
integer required. The ID of the project. |
An empty HTTP response
Get details about a JSON Value
json_values_get(id)
json_values_get(id)
id |
integer required. The ID of the JSON Value. |
A list containing the following elements:
id |
integer, The ID of the JSON Value. |
name |
string, The name of the JSON Value. |
value |
string, The deserialized JSON value. |
Update some attributes of this JSON Value
json_values_patch(id, name = NULL, value_str = NULL)
json_values_patch(id, name = NULL, value_str = NULL)
id |
integer required. The ID of the JSON Value. |
name |
string optional. The name of the JSON Value. |
value_str |
string optional. The JSON value to store. Should be a serialized JSON string. Limited to 1000000 bytes. |
A list containing the following elements:
id |
integer, The ID of the JSON Value. |
name |
string, The name of the JSON Value. |
value |
string, The deserialized JSON value. |
Create a JSON Value
json_values_post(value_str, name = NULL)
json_values_post(value_str, name = NULL)
value_str |
string required. The JSON value to store. Should be a serialized JSON string. Limited to 1000000 bytes. |
name |
string optional. The name of the JSON Value. |
A list containing the following elements:
id |
integer, The ID of the JSON Value. |
name |
string, The name of the JSON Value. |
value |
string, The deserialized JSON value. |
Show Match Target info
match_targets_get(id)
match_targets_get(id)
id |
integer required. The ID of the match target |
A list containing the following elements:
id |
integer, The ID of the match target |
name |
string, The name of the match target |
targetFileName |
string, The name of the target file |
createdAt |
string, |
updatedAt |
string, |
archived |
boolean, Whether the match target has been archived. |
List match targets
match_targets_list()
match_targets_list()
An array containing the following fields:
id |
integer, The ID of the match target |
name |
string, The name of the match target |
targetFileName |
string, The name of the target file |
createdAt |
string, |
updatedAt |
string, |
archived |
boolean, Whether the match target has been archived. |
Update a match target
match_targets_patch(id, name = NULL, target_file_name = NULL, archived = NULL)
match_targets_patch(id, name = NULL, target_file_name = NULL, archived = NULL)
id |
integer required. The ID of the match target |
name |
string optional. The name of the match target |
target_file_name |
string optional. The name of the target file |
archived |
boolean optional. Whether the match target has been archived. |
A list containing the following elements:
id |
integer, The ID of the match target |
name |
string, The name of the match target |
targetFileName |
string, The name of the target file |
createdAt |
string, |
updatedAt |
string, |
archived |
boolean, Whether the match target has been archived. |
Create a new match target
match_targets_post(name, target_file_name = NULL, archived = NULL)
match_targets_post(name, target_file_name = NULL, archived = NULL)
name |
string required. The name of the match target |
target_file_name |
string optional. The name of the target file |
archived |
boolean optional. Whether the match target has been archived. |
A list containing the following elements:
id |
integer, The ID of the match target |
name |
string, The name of the match target |
targetFileName |
string, The name of the target file |
createdAt |
string, |
updatedAt |
string, |
archived |
boolean, Whether the match target has been archived. |
Update the archive status of this object
match_targets_put_archive(id, status)
match_targets_put_archive(id, status)
id |
integer required. The ID of the object. |
status |
boolean required. The desired archived status of the object. |
A list containing the following elements:
id |
integer, The ID of the match target |
name |
string, The name of the match target |
targetFileName |
string, The name of the target file |
createdAt |
string, |
updatedAt |
string, |
archived |
boolean, Whether the match target has been archived. |
Cancel a run
media_delete_optimizations_runs(id, run_id)
media_delete_optimizations_runs(id, run_id)
id |
integer required. The ID of the optimization. |
run_id |
integer required. The ID of the run. |
An empty HTTP response
Show a single optimization
media_get_optimizations(id)
media_get_optimizations(id)
id |
integer required. The optimization ID. |
A list containing the following elements:
id |
integer, The optimization ID. |
author |
list, A list containing the following elements:
|
name |
string, The name of the optimization. |
createdAt |
string, |
updatedAt |
string, |
finishedAt |
string, The end time of the last run. |
state |
string, The state of the last run. |
lastRunId |
integer, The ID of the last run. |
spotOrderId |
integer, The ID for the spot order produced by the optimization. |
archived |
string, The archival status of the requested item(s). |
reportLink |
string, A link to the visual report for the optimization. |
spotOrderLink |
string, A link to the json version of the spot order. |
fileLinks |
array, Links to the csv and xml versions of the spot order. |
runs |
array, An array containing the following fields:
|
programs |
array, An array of programs that the Civis Media Optimizer either exclude or limit to.An error will be thrown if exclude_programs is not also set. |
networks |
array, An array of networks that the Civis Media Optimizer either exclude or limit to.An error will be thrown if exclude_networks is not also set. |
excludePrograms |
boolean, If Civis Media Optimizer should exclude the programs in the programs parameter.If this value is set to false, it will make the optimization limit itself to the programs supplied through the programs parameter.An error will be thrown if programs is not also set. |
excludeNetworks |
boolean, If Civis Media Optimizer should exclude the networks in the networks parameter.If this value is set to false, it will make the optimization limit itself to the networks supplied through the networks.An error will be thrown if networks is not also set. |
timeSlotPercentages |
list, The maximum amount of the budget spent on that particular day of the week, daypart, or specific time slot for broadcast and cable. |
Check status of a run
media_get_optimizations_runs(id, run_id)
media_get_optimizations_runs(id, run_id)
id |
integer required. The ID of the optimization. |
run_id |
integer required. The ID of the run. |
A list containing the following elements:
id |
integer, The ID of the run. |
optimizationId |
integer, The ID of the optimization. |
state |
string, The state of the run, one of 'queued' 'running' 'succeeded' 'failed' or 'cancelled'. |
isCancelRequested |
boolean, True if run cancel requested, else false. |
startedAt |
string, The time the last run started at. |
finishedAt |
string, The time the last run completed. |
error |
string, The error, if any, returned by the run. |
Get a Ratecard
media_get_ratecards(id)
media_get_ratecards(id)
id |
integer required. |
A list containing the following elements:
id |
integer, The ratecard ID. |
filename |
string, Name of the ratecard file. |
startOn |
string, First day to which the ratecard applies. |
endOn |
string, Last day to which the ratecard applies. |
dmaNumber |
integer, Number of the DMA associated with the ratecard. |
archived |
string, The archival status of the requested item(s). |
Show a single spot order
media_get_spot_orders(id)
media_get_spot_orders(id)
id |
integer required. The ID for the spot order. |
A list containing the following elements:
id |
integer, The ID for the spot order. |
archived |
string, The archival status of the requested item(s). |
csvS3Uri |
string, S3 URI for the spot order CSV file. |
jsonS3Uri |
string, S3 URI for the spot order JSON file. |
xmlArchiveS3Uri |
string, S3 URI for the spot order XML archive. |
lastTransformJobId |
integer, ID of the spot order transformation job. |
List all Designated Market Areas
media_list_dmas(name = NULL, number = NULL)
media_list_dmas(name = NULL, number = NULL)
name |
string optional. If specified, will be used to filter the DMAs returned. Substring matching is supported with "%" and "*" wildcards (e.g., "name=%region%" will return both "region1" and "my region"). |
number |
integer optional. If specified, will be used to filter the DMAS by number. |
An array containing the following fields:
name |
string, Name for the DMA region. |
number |
integer, Identifier number for a DMA. |
List all optimizations
media_list_optimizations( archived = NULL, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
media_list_optimizations( archived = NULL, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
archived |
string optional. The archival status of the requested item(s). |
limit |
integer optional. Number of results to return. Defaults to 20. Maximum allowed is 50. |
page_num |
integer optional. Page number of the results to return. Defaults to the first page, 1. |
order |
string optional. The field on which to order the result set. Defaults to created_at. Must be one of: created_at, author, name. |
order_dir |
string optional. Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc. |
An array containing the following fields:
id |
integer, The optimization ID. |
author |
list, A list containing the following elements:
|
name |
string, The name of the optimization. |
createdAt |
string, |
updatedAt |
string, |
finishedAt |
string, The end time of the last run. |
state |
string, The state of the last run. |
lastRunId |
integer, The ID of the last run. |
spotOrderId |
integer, The ID for the spot order produced by the optimization. |
archived |
string, The archival status of the requested item(s). |
List runs for the given optimization
media_list_optimizations_runs( id, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
media_list_optimizations_runs( id, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
id |
integer required. The ID of the optimization. |
limit |
integer optional. Number of results to return. Defaults to 20. Maximum allowed is 100. |
page_num |
integer optional. Page number of the results to return. Defaults to the first page, 1. |
order |
string optional. The field on which to order the result set. Defaults to id. Must be one of: id. |
order_dir |
string optional. Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc. |
An array containing the following fields:
id |
integer, The ID of the run. |
optimizationId |
integer, The ID of the optimization. |
state |
string, The state of the run, one of 'queued' 'running' 'succeeded' 'failed' or 'cancelled'. |
isCancelRequested |
boolean, True if run cancel requested, else false. |
startedAt |
string, The time the last run started at. |
finishedAt |
string, The time the last run completed. |
error |
string, The error, if any, returned by the run. |
Get the logs for a run
media_list_optimizations_runs_logs(id, run_id, last_id = NULL, limit = NULL)
media_list_optimizations_runs_logs(id, run_id, last_id = NULL, limit = NULL)
id |
integer required. The ID of the optimization. |
run_id |
integer required. The ID of the run. |
last_id |
integer optional. The ID of the last log message received. Log entries with this ID value or lower will be omitted.Logs are sorted by ID if this value is provided, and are otherwise sorted by createdAt. |
limit |
integer optional. The maximum number of log messages to return. Default of 10000. |
An array containing the following fields:
id |
integer, The ID of the log. |
createdAt |
string, The time the log was created. |
message |
string, The log message. |
level |
string, The level of the log. One of unknown,fatal,error,warn,info,debug. |
List all ratecards
media_list_ratecards(archived = NULL, filename = NULL, dma_number = NULL)
media_list_ratecards(archived = NULL, filename = NULL, dma_number = NULL)
archived |
string optional. The archival status of the requested item(s). |
filename |
string optional. If specified, will be used to filter the ratecards returned. Substring matching is supported with "%" and "*" wildcards (e.g., "filename=%ratecard%" will return both "ratecard 1" and "my ratecard"). |
dma_number |
integer optional. If specified, will be used to filter the ratecards by DMA. |
An array containing the following fields:
id |
integer, The ratecard ID. |
filename |
string, Name of the ratecard file. |
startOn |
string, First day to which the ratecard applies. |
endOn |
string, Last day to which the ratecard applies. |
dmaNumber |
integer, Number of the DMA associated with the ratecard. |
archived |
string, The archival status of the requested item(s). |
List all spot orders
media_list_spot_orders(id = NULL, archived = NULL)
media_list_spot_orders(id = NULL, archived = NULL)
id |
integer optional. The ID for the spot order. |
archived |
string optional. The archival status of the requested item(s). |
An array containing the following fields:
id |
integer, The ID for the spot order. |
archived |
string, The archival status of the requested item(s). |
List all Media Targets
media_list_targets(name = NULL, identifier = NULL, data_source = NULL)
media_list_targets(name = NULL, identifier = NULL, data_source = NULL)
name |
string optional. The name of the target. |
identifier |
string optional. A unique identifier for this target. |
data_source |
string optional. The source of viewership data for this target. |
An array containing the following fields:
name |
string, The name of the target. |
identifier |
string, A unique identifier for this target. |
dataSource |
string, The source of viewership data for this target. |
Edit an existing optimization
media_patch_optimizations( id, name = NULL, runs = NULL, programs = NULL, networks = NULL, exclude_programs = NULL, exclude_networks = NULL, time_slot_percentages = NULL )
media_patch_optimizations( id, name = NULL, runs = NULL, programs = NULL, networks = NULL, exclude_programs = NULL, exclude_networks = NULL, time_slot_percentages = NULL )
id |
integer required. The optimization ID. |
name |
string optional. The name of the optimization. |
runs |
array optional. An array containing the following fields:
|
programs |
array optional. An array of programs that the Civis Media Optimizer either exclude or limit to.An error will be thrown if exclude_programs is not also set. |
networks |
array optional. An array of networks that the Civis Media Optimizer either exclude or limit to.An error will be thrown if exclude_networks is not also set. |
exclude_programs |
boolean optional. If Civis Media Optimizer should exclude the programs in the programs parameter.If this value is set to false, it will make the optimization limit itself to the programs supplied through the programs parameter.An error will be thrown if programs is not also set. |
exclude_networks |
boolean optional. If Civis Media Optimizer should exclude the networks in the networks parameter.If this value is set to false, it will make the optimization limit itself to the networks supplied through the networks.An error will be thrown if networks is not also set. |
time_slot_percentages |
list optional. The maximum amount of the budget spent on that particular day of the week, daypart, or specific time slot for broadcast and cable. |
A list containing the following elements:
id |
integer, The optimization ID. |
author |
list, A list containing the following elements:
|
name |
string, The name of the optimization. |
createdAt |
string, |
updatedAt |
string, |
finishedAt |
string, The end time of the last run. |
state |
string, The state of the last run. |
lastRunId |
integer, The ID of the last run. |
spotOrderId |
integer, The ID for the spot order produced by the optimization. |
archived |
string, The archival status of the requested item(s). |
reportLink |
string, A link to the visual report for the optimization. |
spotOrderLink |
string, A link to the json version of the spot order. |
fileLinks |
array, Links to the csv and xml versions of the spot order. |
runs |
array, An array containing the following fields:
|
programs |
array, An array of programs that the Civis Media Optimizer either exclude or limit to.An error will be thrown if exclude_programs is not also set. |
networks |
array, An array of networks that the Civis Media Optimizer either exclude or limit to.An error will be thrown if exclude_networks is not also set. |
excludePrograms |
boolean, If Civis Media Optimizer should exclude the programs in the programs parameter.If this value is set to false, it will make the optimization limit itself to the programs supplied through the programs parameter.An error will be thrown if programs is not also set. |
excludeNetworks |
boolean, If Civis Media Optimizer should exclude the networks in the networks parameter.If this value is set to false, it will make the optimization limit itself to the networks supplied through the networks.An error will be thrown if networks is not also set. |
timeSlotPercentages |
list, The maximum amount of the budget spent on that particular day of the week, daypart, or specific time slot for broadcast and cable. |
Update some attributes of this Ratecard
media_patch_ratecards( id, filename = NULL, start_on = NULL, end_on = NULL, dma_number = NULL )
media_patch_ratecards( id, filename = NULL, start_on = NULL, end_on = NULL, dma_number = NULL )
id |
integer required. The ratecard ID. |
filename |
string optional. Name of the ratecard file. |
start_on |
string optional. First day to which the ratecard applies. |
end_on |
string optional. Last day to which the ratecard applies. |
dma_number |
integer optional. Number of the DMA associated with the ratecard. |
A list containing the following elements:
id |
integer, The ratecard ID. |
filename |
string, Name of the ratecard file. |
startOn |
string, First day to which the ratecard applies. |
endOn |
string, Last day to which the ratecard applies. |
dmaNumber |
integer, Number of the DMA associated with the ratecard. |
archived |
string, The archival status of the requested item(s). |
Create a new optimization
media_post_optimizations( runs, name = NULL, programs = NULL, networks = NULL, exclude_programs = NULL, exclude_networks = NULL, time_slot_percentages = NULL )
media_post_optimizations( runs, name = NULL, programs = NULL, networks = NULL, exclude_programs = NULL, exclude_networks = NULL, time_slot_percentages = NULL )
runs |
array required. An array containing the following fields:
|
name |
string optional. The name of the optimization. |
programs |
array optional. An array of programs that the Civis Media Optimizer either exclude or limit to.An error will be thrown if exclude_programs is not also set. |
networks |
array optional. An array of networks that the Civis Media Optimizer either exclude or limit to.An error will be thrown if exclude_networks is not also set. |
exclude_programs |
boolean optional. If Civis Media Optimizer should exclude the programs in the programs parameter.If this value is set to false, it will make the optimization limit itself to the programs supplied through the programs parameter.An error will be thrown if programs is not also set. |
exclude_networks |
boolean optional. If Civis Media Optimizer should exclude the networks in the networks parameter.If this value is set to false, it will make the optimization limit itself to the networks supplied through the networks.An error will be thrown if networks is not also set. |
time_slot_percentages |
list optional. The maximum amount of the budget spent on that particular day of the week, daypart, or specific time slot for broadcast and cable. |
A list containing the following elements:
id |
integer, The optimization ID. |
author |
list, A list containing the following elements:
|
name |
string, The name of the optimization. |
createdAt |
string, |
updatedAt |
string, |
finishedAt |
string, The end time of the last run. |
state |
string, The state of the last run. |
lastRunId |
integer, The ID of the last run. |
spotOrderId |
integer, The ID for the spot order produced by the optimization. |
archived |
string, The archival status of the requested item(s). |
reportLink |
string, A link to the visual report for the optimization. |
spotOrderLink |
string, A link to the json version of the spot order. |
fileLinks |
array, Links to the csv and xml versions of the spot order. |
runs |
array, An array containing the following fields:
|
programs |
array, An array of programs that the Civis Media Optimizer either exclude or limit to.An error will be thrown if exclude_programs is not also set. |
networks |
array, An array of networks that the Civis Media Optimizer either exclude or limit to.An error will be thrown if exclude_networks is not also set. |
excludePrograms |
boolean, If Civis Media Optimizer should exclude the programs in the programs parameter.If this value is set to false, it will make the optimization limit itself to the programs supplied through the programs parameter.An error will be thrown if programs is not also set. |
excludeNetworks |
boolean, If Civis Media Optimizer should exclude the networks in the networks parameter.If this value is set to false, it will make the optimization limit itself to the networks supplied through the networks.An error will be thrown if networks is not also set. |
timeSlotPercentages |
list, The maximum amount of the budget spent on that particular day of the week, daypart, or specific time slot for broadcast and cable. |
Clone an existing optimization
media_post_optimizations_clone(id)
media_post_optimizations_clone(id)
id |
integer required. The optimization ID. |
A list containing the following elements:
id |
integer, The optimization ID. |
author |
list, A list containing the following elements:
|
name |
string, The name of the optimization. |
createdAt |
string, |
updatedAt |
string, |
finishedAt |
string, The end time of the last run. |
state |
string, The state of the last run. |
lastRunId |
integer, The ID of the last run. |
spotOrderId |
integer, The ID for the spot order produced by the optimization. |
archived |
string, The archival status of the requested item(s). |
reportLink |
string, A link to the visual report for the optimization. |
spotOrderLink |
string, A link to the json version of the spot order. |
fileLinks |
array, Links to the csv and xml versions of the spot order. |
runs |
array, An array containing the following fields:
|
programs |
array, An array of programs that the Civis Media Optimizer either exclude or limit to.An error will be thrown if exclude_programs is not also set. |
networks |
array, An array of networks that the Civis Media Optimizer either exclude or limit to.An error will be thrown if exclude_networks is not also set. |
excludePrograms |
boolean, If Civis Media Optimizer should exclude the programs in the programs parameter.If this value is set to false, it will make the optimization limit itself to the programs supplied through the programs parameter.An error will be thrown if programs is not also set. |
excludeNetworks |
boolean, If Civis Media Optimizer should exclude the networks in the networks parameter.If this value is set to false, it will make the optimization limit itself to the networks supplied through the networks.An error will be thrown if networks is not also set. |
timeSlotPercentages |
list, The maximum amount of the budget spent on that particular day of the week, daypart, or specific time slot for broadcast and cable. |
Start a run
media_post_optimizations_runs(id)
media_post_optimizations_runs(id)
id |
integer required. The ID of the optimization. |
A list containing the following elements:
id |
integer, The ID of the run. |
optimizationId |
integer, The ID of the optimization. |
state |
string, The state of the run, one of 'queued' 'running' 'succeeded' 'failed' or 'cancelled'. |
isCancelRequested |
boolean, True if run cancel requested, else false. |
startedAt |
string, The time the last run started at. |
finishedAt |
string, The time the last run completed. |
error |
string, The error, if any, returned by the run. |
Create a Ratecard
media_post_ratecards(filename, start_on, end_on, dma_number)
media_post_ratecards(filename, start_on, end_on, dma_number)
filename |
string required. Name of the ratecard file. |
start_on |
string required. First day to which the ratecard applies. |
end_on |
string required. Last day to which the ratecard applies. |
dma_number |
integer required. Number of the DMA associated with the ratecard. |
A list containing the following elements:
id |
integer, The ratecard ID. |
filename |
string, Name of the ratecard file. |
startOn |
string, First day to which the ratecard applies. |
endOn |
string, Last day to which the ratecard applies. |
dmaNumber |
integer, Number of the DMA associated with the ratecard. |
archived |
string, The archival status of the requested item(s). |
Create a spot order
media_post_spot_orders(body = NULL)
media_post_spot_orders(body = NULL)
body |
string optional. CSV body of a spot order. |
A list containing the following elements:
id |
integer, The ID for the spot order. |
archived |
string, The archival status of the requested item(s). |
csvS3Uri |
string, S3 URI for the spot order CSV file. |
jsonS3Uri |
string, S3 URI for the spot order JSON file. |
xmlArchiveS3Uri |
string, S3 URI for the spot order XML archive. |
lastTransformJobId |
integer, ID of the spot order transformation job. |
Update the archive status of this object
media_put_optimizations_archive(id, status)
media_put_optimizations_archive(id, status)
id |
integer required. The ID of the object. |
status |
boolean required. The desired archived status of the object. |
A list containing the following elements:
id |
integer, The optimization ID. |
author |
list, A list containing the following elements:
|
name |
string, The name of the optimization. |
createdAt |
string, |
updatedAt |
string, |
finishedAt |
string, The end time of the last run. |
state |
string, The state of the last run. |
lastRunId |
integer, The ID of the last run. |
spotOrderId |
integer, The ID for the spot order produced by the optimization. |
archived |
string, The archival status of the requested item(s). |
reportLink |
string, A link to the visual report for the optimization. |
spotOrderLink |
string, A link to the json version of the spot order. |
fileLinks |
array, Links to the csv and xml versions of the spot order. |
runs |
array, An array containing the following fields:
|
programs |
array, An array of programs that the Civis Media Optimizer either exclude or limit to.An error will be thrown if exclude_programs is not also set. |
networks |
array, An array of networks that the Civis Media Optimizer either exclude or limit to.An error will be thrown if exclude_networks is not also set. |
excludePrograms |
boolean, If Civis Media Optimizer should exclude the programs in the programs parameter.If this value is set to false, it will make the optimization limit itself to the programs supplied through the programs parameter.An error will be thrown if programs is not also set. |
excludeNetworks |
boolean, If Civis Media Optimizer should exclude the networks in the networks parameter.If this value is set to false, it will make the optimization limit itself to the networks supplied through the networks.An error will be thrown if networks is not also set. |
timeSlotPercentages |
list, The maximum amount of the budget spent on that particular day of the week, daypart, or specific time slot for broadcast and cable. |
Replace all attributes of this Ratecard
media_put_ratecards(id, filename, start_on, end_on, dma_number)
media_put_ratecards(id, filename, start_on, end_on, dma_number)
id |
integer required. The ratecard ID. |
filename |
string required. Name of the ratecard file. |
start_on |
string required. First day to which the ratecard applies. |
end_on |
string required. Last day to which the ratecard applies. |
dma_number |
integer required. Number of the DMA associated with the ratecard. |
A list containing the following elements:
id |
integer, The ratecard ID. |
filename |
string, Name of the ratecard file. |
startOn |
string, First day to which the ratecard applies. |
endOn |
string, Last day to which the ratecard applies. |
dmaNumber |
integer, Number of the DMA associated with the ratecard. |
archived |
string, The archival status of the requested item(s). |
Update the archive status of this object
media_put_ratecards_archive(id, status)
media_put_ratecards_archive(id, status)
id |
integer required. The ID of the object. |
status |
boolean required. The desired archived status of the object. |
A list containing the following elements:
id |
integer, The ratecard ID. |
filename |
string, Name of the ratecard file. |
startOn |
string, First day to which the ratecard applies. |
endOn |
string, Last day to which the ratecard applies. |
dmaNumber |
integer, Number of the DMA associated with the ratecard. |
archived |
string, The archival status of the requested item(s). |
Edit the specified spot order
media_put_spot_orders(id, body = NULL)
media_put_spot_orders(id, body = NULL)
id |
integer required. The ID for the spot order. |
body |
string optional. CSV body of a spot order. |
A list containing the following elements:
id |
integer, The ID for the spot order. |
archived |
string, The archival status of the requested item(s). |
csvS3Uri |
string, S3 URI for the spot order CSV file. |
jsonS3Uri |
string, S3 URI for the spot order JSON file. |
xmlArchiveS3Uri |
string, S3 URI for the spot order XML archive. |
lastTransformJobId |
integer, ID of the spot order transformation job. |
Update the archive status of this object
media_put_spot_orders_archive(id, status)
media_put_spot_orders_archive(id, status)
id |
integer required. The ID of the object. |
status |
boolean required. The desired archived status of the object. |
A list containing the following elements:
id |
integer, The ID for the spot order. |
archived |
string, The archival status of the requested item(s). |
csvS3Uri |
string, S3 URI for the spot order CSV file. |
jsonS3Uri |
string, S3 URI for the spot order JSON file. |
xmlArchiveS3Uri |
string, S3 URI for the spot order XML archive. |
lastTransformJobId |
integer, ID of the spot order transformation job. |
Cancel a build
models_delete_builds(id, build_id)
models_delete_builds(id, build_id)
id |
integer required. The ID of the model. |
build_id |
integer required. The ID of the build. |
An empty HTTP response
Remove a Model from a project
models_delete_projects(id, project_id)
models_delete_projects(id, project_id)
id |
integer required. The ID of the Model. |
project_id |
integer required. The ID of the project. |
An empty HTTP response
Retrieve model configuration
models_get(id)
models_get(id)
id |
integer required. The ID of the model. |
A list containing the following elements:
id |
integer, The ID of the model. |
tableName |
string, The qualified name of the table containing the training set from which to build the model. |
databaseId |
integer, The ID of the database holding the training set table used to build the model. |
credentialId |
integer, The ID of the credential used to read the target table. Defaults to the user's default credential. |
modelName |
string, The name of the model. |
description |
string, A description of the model. |
interactionTerms |
boolean, Whether to search for interaction terms. |
boxCoxTransformation |
boolean, Whether to transform data so that it assumes a normal distribution. Valid only with continuous models. |
modelTypeId |
integer, The ID of the model's type. |
primaryKey |
string, The unique ID (primary key) of the training dataset. |
dependentVariable |
string, The dependent variable of the training dataset. |
dependentVariableOrder |
array, The order of dependent variables, especially useful for Ordinal Modeling. |
excludedColumns |
array, A list of columns which will be considered ineligible to be independent variables. |
limitingSQL |
string, A custom SQL WHERE clause used to filter the rows used to build the model. (e.g., "id > 105"). |
activeBuildId |
integer, The ID of the current active build, the build used to score predictions. |
crossValidationParameters |
list, Cross validation parameter grid for tree methods, e.g. "n_estimators": [100, 200, 500], "learning_rate": [0.01, 0.1], "max_depth": [2, 3]. |
numberOfFolds |
integer, Number of folds for cross validation. Default value is 5. |
notifications |
list, A list containing the following elements:
|
schedule |
list, A list containing the following elements:
|
parentId |
integer, The ID of the parent job that will trigger this model. |
runningAs |
list, A list containing the following elements:
|
timeZone |
string, The time zone of this model. |
lastRun |
list, A list containing the following elements:
|
hidden |
boolean, The hidden status of the item. |
user |
list, A list containing the following elements:
|
createdAt |
string, The time the model was created. |
updatedAt |
string, The time the model was updated. |
currentBuildState |
string, The status of the current model build. One of "succeeded", "failed", "queued", or "running,"or "idle", if no build has been attempted. |
currentBuildException |
string, Exception message, if applicable, of the current model build. |
builds |
array, An array containing the following fields:
|
predictions |
array, An array containing the following fields:
|
lastOutputLocation |
string, The output JSON for the last build. |
archived |
string, The archival status of the requested item(s). |
Check status of a build
models_get_builds(id, build_id)
models_get_builds(id, build_id)
id |
integer required. The ID of the model. |
build_id |
integer required. The ID of the build. |
A list containing the following elements:
id |
integer, The ID of the model build. |
state |
string, The state of the model build.one of 'queued' 'running' 'succeeded' 'failed' or 'cancelled'. |
error |
string, The error, if any, returned by the build. |
name |
string, The name of the model build. |
createdAt |
string, The time the model build was created. |
description |
string, A description of the model build. |
rootMeanSquaredError |
number, A key metric for continuous models. Nil for other model types. |
rSquaredError |
number, A key metric for continuous models. Nil for other model types. |
rocAuc |
number, A key metric for binary, multinomial, and ordinal models. Nil for other model types. |
transformationMetadata |
string, A string representing the full JSON output of the metadata for transformation of column names |
output |
string, A string representing the JSON output for the specified build. Only present when smaller than 10KB in size. |
outputLocation |
string, A URL representing the location of the full JSON output for the specified build.The URL link will be valid for 5 minutes. |
List
models_list( model_name = NULL, training_table_name = NULL, dependent_variable = NULL, author = NULL, status = NULL, hidden = NULL, archived = NULL, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
models_list( model_name = NULL, training_table_name = NULL, dependent_variable = NULL, author = NULL, status = NULL, hidden = NULL, archived = NULL, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
model_name |
string optional. If specified, will be used to filter the models returned. Substring matching is supported. (e.g., "modelName=model" will return both "model1" and "my model"). |
training_table_name |
string optional. If specified, will be used to filter the models returned by the training dataset table name. Substring matching is supported. (e.g., "trainingTableName=table" will return both "table1" and "my_table"). |
dependent_variable |
string optional. If specified, will be used to filter the models returned by the dependent variable column name. Substring matching is supported. (e.g., "dependentVariable=predictor" will return both "predictor" and "my predictor"). |
author |
string optional. If specified, return models from this author. It accepts a comma-separated list of author ids. |
status |
string optional. If specified, returns models with one of these statuses. It accepts a comma-separated list, possible values are 'running', 'failed', 'succeeded', 'idle', 'scheduled'. |
boolean optional. If specified to be true, returns hidden items. Defaults to false, returning non-hidden items. |
|
archived |
string optional. The archival status of the requested item(s). |
limit |
integer optional. Number of results to return. Defaults to its maximum of 50. |
page_num |
integer optional. Page number of the results to return. Defaults to the first page, 1. |
order |
string optional. The field on which to order the result set. Defaults to updated_at. Must be one of: updated_at, name, created_at, last_run.updated_at. |
order_dir |
string optional. Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc. |
An array containing the following fields:
id |
integer, The ID of the model. |
tableName |
string, The qualified name of the table containing the training set from which to build the model. |
databaseId |
integer, The ID of the database holding the training set table used to build the model. |
credentialId |
integer, The ID of the credential used to read the target table. Defaults to the user's default credential. |
modelName |
string, The name of the model. |
description |
string, A description of the model. |
interactionTerms |
boolean, Whether to search for interaction terms. |
boxCoxTransformation |
boolean, Whether to transform data so that it assumes a normal distribution. Valid only with continuous models. |
modelTypeId |
integer, The ID of the model's type. |
primaryKey |
string, The unique ID (primary key) of the training dataset. |
dependentVariable |
string, The dependent variable of the training dataset. |
dependentVariableOrder |
array, The order of dependent variables, especially useful for Ordinal Modeling. |
excludedColumns |
array, A list of columns which will be considered ineligible to be independent variables. |
limitingSQL |
string, A custom SQL WHERE clause used to filter the rows used to build the model. (e.g., "id > 105"). |
crossValidationParameters |
list, Cross validation parameter grid for tree methods, e.g. "n_estimators": [100, 200, 500], "learning_rate": [0.01, 0.1], "max_depth": [2, 3]. |
numberOfFolds |
integer, Number of folds for cross validation. Default value is 5. |
schedule |
list, A list containing the following elements:
|
parentId |
integer, The ID of the parent job that will trigger this model. |
timeZone |
string, The time zone of this model. |
lastRun |
list, A list containing the following elements:
|
user |
list, A list containing the following elements:
|
createdAt |
string, The time the model was created. |
updatedAt |
string, The time the model was updated. |
currentBuildState |
string, The status of the current model build. One of "succeeded", "failed", "queued", or "running,"or "idle", if no build has been attempted. |
currentBuildException |
string, Exception message, if applicable, of the current model build. |
builds |
array, An array containing the following fields:
|
predictions |
array, An array containing the following fields:
|
lastOutputLocation |
string, The output JSON for the last build. |
archived |
string, The archival status of the requested item(s). |
List builds for the given model
models_list_builds( id, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
models_list_builds( id, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
id |
integer required. The ID of the model. |
limit |
integer optional. Number of results to return. Defaults to 20. Maximum allowed is 100. |
page_num |
integer optional. Page number of the results to return. Defaults to the first page, 1. |
order |
string optional. The field on which to order the result set. Defaults to id. Must be one of: id. |
order_dir |
string optional. Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc. |
An array containing the following fields:
id |
integer, The ID of the model build. |
state |
string, The state of the model build.one of 'queued' 'running' 'succeeded' 'failed' or 'cancelled'. |
error |
string, The error, if any, returned by the build. |
name |
string, The name of the model build. |
createdAt |
string, The time the model build was created. |
description |
string, A description of the model build. |
rootMeanSquaredError |
number, A key metric for continuous models. Nil for other model types. |
rSquaredError |
number, A key metric for continuous models. Nil for other model types. |
rocAuc |
number, A key metric for binary, multinomial, and ordinal models. Nil for other model types. |
transformationMetadata |
string, A string representing the full JSON output of the metadata for transformation of column names |
output |
string, A string representing the JSON output for the specified build. Only present when smaller than 10KB in size. |
outputLocation |
string, A URL representing the location of the full JSON output for the specified build.The URL link will be valid for 5 minutes. |
Get the logs for a build
models_list_builds_logs(id, build_id, last_id = NULL, limit = NULL)
models_list_builds_logs(id, build_id, last_id = NULL, limit = NULL)
id |
integer required. The ID of the model. |
build_id |
integer required. The ID of the build. |
last_id |
integer optional. The ID of the last log message received. Log entries with this ID value or lower will be omitted.Logs are sorted by ID if this value is provided, and are otherwise sorted by createdAt. |
limit |
integer optional. The maximum number of log messages to return. Default of 10000. |
An array containing the following fields:
id |
integer, The ID of the log. |
createdAt |
string, The time the log was created. |
message |
string, The log message. |
level |
string, The level of the log. One of unknown,fatal,error,warn,info,debug. |
List the projects a Model belongs to
models_list_projects(id, hidden = NULL)
models_list_projects(id, hidden = NULL)
id |
integer required. The ID of the Model. |
boolean optional. If specified to be true, returns hidden items. Defaults to false, returning non-hidden items. |
An array containing the following fields:
id |
integer, The ID for this project. |
author |
list, A list containing the following elements:
|
name |
string, The name of this project. |
description |
string, A description of the project. |
users |
array, An array containing the following fields:
|
autoShare |
boolean, |
createdAt |
string, |
updatedAt |
string, |
archived |
string, The archival status of the requested item(s). |
Show the model build schedule
models_list_schedules(id)
models_list_schedules(id)
id |
integer required. The ID of the model associated with this schedule. |
A list containing the following elements:
id |
integer, The ID of the model associated with this schedule. |
schedule |
list, A list containing the following elements:
|
List all available model types
models_list_types()
models_list_types()
An array containing the following fields:
id |
integer, The ID of the model type. |
algorithm |
string, The name of the algorithm used to train the model. |
dvType |
string, The type of dependent variable predicted by the model. |
fintAllowed |
boolean, Whether this model type supports searching for interaction terms. |
Update the archive status of this object
models_put_archive(id, status)
models_put_archive(id, status)
id |
integer required. The ID of the object. |
status |
boolean required. The desired archived status of the object. |
A list containing the following elements:
id |
integer, The ID of the model. |
tableName |
string, The qualified name of the table containing the training set from which to build the model. |
databaseId |
integer, The ID of the database holding the training set table used to build the model. |
credentialId |
integer, The ID of the credential used to read the target table. Defaults to the user's default credential. |
modelName |
string, The name of the model. |
description |
string, A description of the model. |
interactionTerms |
boolean, Whether to search for interaction terms. |
boxCoxTransformation |
boolean, Whether to transform data so that it assumes a normal distribution. Valid only with continuous models. |
modelTypeId |
integer, The ID of the model's type. |
primaryKey |
string, The unique ID (primary key) of the training dataset. |
dependentVariable |
string, The dependent variable of the training dataset. |
dependentVariableOrder |
array, The order of dependent variables, especially useful for Ordinal Modeling. |
excludedColumns |
array, A list of columns which will be considered ineligible to be independent variables. |
limitingSQL |
string, A custom SQL WHERE clause used to filter the rows used to build the model. (e.g., "id > 105"). |
activeBuildId |
integer, The ID of the current active build, the build used to score predictions. |
crossValidationParameters |
list, Cross validation parameter grid for tree methods, e.g. "n_estimators": [100, 200, 500], "learning_rate": [0.01, 0.1], "max_depth": [2, 3]. |
numberOfFolds |
integer, Number of folds for cross validation. Default value is 5. |
notifications |
list, A list containing the following elements:
|
schedule |
list, A list containing the following elements:
|
parentId |
integer, The ID of the parent job that will trigger this model. |
runningAs |
list, A list containing the following elements:
|
timeZone |
string, The time zone of this model. |
lastRun |
list, A list containing the following elements:
|
hidden |
boolean, The hidden status of the item. |
user |
list, A list containing the following elements:
|
createdAt |
string, The time the model was created. |
updatedAt |
string, The time the model was updated. |
currentBuildState |
string, The status of the current model build. One of "succeeded", "failed", "queued", or "running,"or "idle", if no build has been attempted. |
currentBuildException |
string, Exception message, if applicable, of the current model build. |
builds |
array, An array containing the following fields:
|
predictions |
array, An array containing the following fields:
|
lastOutputLocation |
string, The output JSON for the last build. |
archived |
string, The archival status of the requested item(s). |
Add a Model to a project
models_put_projects(id, project_id)
models_put_projects(id, project_id)
id |
integer required. The ID of the Model. |
project_id |
integer required. The ID of the project. |
An empty HTTP response
If a future::plan has been set, will be carried out in parallel.
multipart_upload(file, name = "", chunk_size = 32 * 1024, expires_at = NULL)
multipart_upload(file, name = "", chunk_size = 32 * 1024, expires_at = NULL)
file |
the file |
name |
name of the upload, defualts to |
chunk_size |
size of the chunks in bytes |
expires_at |
when the file expires (default never). |
Archive a Notebook (deprecated, use archiving endpoints instead)
notebooks_delete(id)
notebooks_delete(id)
id |
integer required. |
An empty HTTP response
Delete a Notebook deployment
notebooks_delete_deployments(notebook_id, deployment_id)
notebooks_delete_deployments(notebook_id, deployment_id)
notebook_id |
integer required. The ID of the owning Notebook |
deployment_id |
integer required. The ID for this deployment |
An empty HTTP response
Remove a Notebook from a project
notebooks_delete_projects(id, project_id)
notebooks_delete_projects(id, project_id)
id |
integer required. The ID of the Notebook. |
project_id |
integer required. The ID of the project. |
An empty HTTP response
Get a Notebook
notebooks_get(id)
notebooks_get(id)
id |
integer required. |
A list containing the following elements:
id |
integer, The ID for this notebook. |
name |
string, The name of this notebook. |
language |
string, The kernel language of this notebook. |
description |
string, The description of this notebook. |
notebookUrl |
string, Time-limited URL to get the .ipynb file for this notebook. |
notebookPreviewUrl |
string, Time-limited URL to get the .htm preview file for this notebook. |
requirementsUrl |
string, Time-limited URL to get the requirements.txt file for this notebook. |
fileId |
string, The file ID for the S3 file containing the .ipynb file. |
requirementsFileId |
string, The file ID for the S3 file containing the requirements.txt file. |
user |
list, A list containing the following elements:
|
dockerImageName |
string, The name of the docker image to pull from DockerHub. |
dockerImageTag |
string, The tag of the docker image to pull from DockerHub (default: latest). |
instanceType |
string, The EC2 instance type to deploy to. |
memory |
integer, The amount of memory allocated to the notebook. |
cpu |
integer, The amount of cpu allocated to the the notebook. |
createdAt |
string, |
updatedAt |
string, |
mostRecentDeployment |
list, A list containing the following elements:
|
credentials |
array, A list of credential IDs to pass to the notebook. |
environmentVariables |
list, Environment variables to be passed into the Notebook. |
idleTimeout |
integer, How long the notebook will stay alive without any kernel activity. |
gitRepoId |
integer, The ID of the git repository. |
gitRepoUrl |
string, The url of the git repository |
gitRef |
string, The git reference if git repo is specified |
gitPath |
string, The path to the .ipynb file in the git repo that will be started up on notebook launch |
archived |
string, The archival status of the requested item(s). |
hidden |
boolean, The hidden status of the item. |
Get details about a Notebook deployment
notebooks_get_deployments(notebook_id, deployment_id)
notebooks_get_deployments(notebook_id, deployment_id)
notebook_id |
integer required. The ID of the owning Notebook |
deployment_id |
integer required. The ID for this deployment |
A list containing the following elements:
deploymentId |
integer, The ID for this deployment. |
userId |
integer, The ID of the owner. |
host |
string, Domain of the deployment. |
name |
string, Name of the deployment. |
dockerImageName |
string, The name of the docker image to pull from DockerHub. |
dockerImageTag |
string, The tag of the docker image to pull from DockerHub (default: latest). |
displayUrl |
string, A signed URL for viewing the deployed item. |
instanceType |
string, The EC2 instance type requested for the deployment. |
memory |
integer, The memory allocated to the deployment. |
cpu |
integer, The cpu allocated to the deployment. |
state |
string, The state of the deployment. |
stateMessage |
string, A detailed description of the state. |
createdAt |
string, |
updatedAt |
string, |
published |
boolean, |
notebookId |
integer, The ID of owning Notebook |
Get file contents at commit_hash
notebooks_get_git_commits(id, commit_hash)
notebooks_get_git_commits(id, commit_hash)
id |
integer required. The ID of the file. |
commit_hash |
string required. The SHA (full or shortened) of the desired git commit. |
A list containing the following elements:
content |
string, The file's contents. |
type |
string, The file's type. |
size |
integer, The file's size. |
fileHash |
string, The SHA of the file. |
List Notebooks
notebooks_list( hidden = NULL, archived = NULL, author = NULL, status = NULL, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
notebooks_list( hidden = NULL, archived = NULL, author = NULL, status = NULL, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
boolean optional. If specified to be true, returns hidden items. Defaults to false, returning non-hidden items. |
|
archived |
string optional. The archival status of the requested item(s). |
author |
string optional. If specified, return imports from this author. It accepts a comma-separated list of author IDs. |
status |
string optional. If specified, returns notebooks with one of these statuses. It accepts a comma-separated list, possible values are 'running', 'pending', 'idle'. |
limit |
integer optional. Number of results to return. Defaults to 20. Maximum allowed is 50. |
page_num |
integer optional. Page number of the results to return. Defaults to the first page, 1. |
order |
string optional. The field on which to order the result set. Defaults to updated_at. Must be one of: updated_at, name, created_at. |
order_dir |
string optional. Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc. |
An array containing the following fields:
id |
integer, The ID for this notebook. |
name |
string, The name of this notebook. |
language |
string, The kernel language of this notebook. |
description |
string, The description of this notebook. |
user |
list, A list containing the following elements:
|
createdAt |
string, |
updatedAt |
string, |
mostRecentDeployment |
list, A list containing the following elements:
|
archived |
string, The archival status of the requested item(s). |
List deployments for a Notebook
notebooks_list_deployments( notebook_id, deployment_id = NULL, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
notebooks_list_deployments( notebook_id, deployment_id = NULL, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
notebook_id |
integer required. The ID of the owning Notebook |
deployment_id |
integer optional. The ID for this deployment |
limit |
integer optional. Number of results to return. Defaults to 20. Maximum allowed is 50. |
page_num |
integer optional. Page number of the results to return. Defaults to the first page, 1. |
order |
string optional. The field on which to order the result set. Defaults to created_at. Must be one of: created_at. |
order_dir |
string optional. Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc. |
An array containing the following fields:
deploymentId |
integer, The ID for this deployment. |
userId |
integer, The ID of the owner. |
host |
string, Domain of the deployment. |
name |
string, Name of the deployment. |
dockerImageName |
string, The name of the docker image to pull from DockerHub. |
dockerImageTag |
string, The tag of the docker image to pull from DockerHub (default: latest). |
instanceType |
string, The EC2 instance type requested for the deployment. |
memory |
integer, The memory allocated to the deployment. |
cpu |
integer, The cpu allocated to the deployment. |
state |
string, The state of the deployment. |
stateMessage |
string, A detailed description of the state. |
createdAt |
string, |
updatedAt |
string, |
published |
boolean, |
notebookId |
integer, The ID of owning Notebook |
Get the logs for a Notebook deployment
notebooks_list_deployments_logs( id, deployment_id, start_at = NULL, end_at = NULL, limit = NULL )
notebooks_list_deployments_logs( id, deployment_id, start_at = NULL, end_at = NULL, limit = NULL )
id |
integer required. The ID of the owning Notebook. |
deployment_id |
integer required. The ID for this deployment. |
start_at |
string optional. Log entries with a lower timestamp will be omitted. |
end_at |
string optional. Log entries with a higher timestamp will be omitted. |
limit |
integer optional. The maximum number of log messages to return. Default of 10000. |
An array containing the following fields:
message |
string, The log message. |
stream |
string, The stream of the log. One of "stdout", "stderr". |
createdAt |
string, The time the log was created. |
source |
string, The source of the log. One of "system", "user". |
Get the git metadata attached to an item
notebooks_list_git(id)
notebooks_list_git(id)
id |
integer required. The ID of the file. |
A list containing the following elements:
gitRef |
string, A git reference specifying an unambiguous version of the file. Can be a branch name, or the full or shortened SHA of a commit. |
gitBranch |
string, The git branch that the file is on. |
gitPath |
string, The path of the file in the repository. |
gitRepo |
list, A list containing the following elements:
|
pullFromGit |
boolean, Automatically pull latest commit from git. Only works for scripts. |
Get the git commits for an item
notebooks_list_git_commits(id)
notebooks_list_git_commits(id)
id |
integer required. The ID of the file. |
A list containing the following elements:
commitHash |
string, The SHA of the commit. |
authorName |
string, The name of the commit's author. |
date |
string, The commit's timestamp. |
message |
string, The commit message. |
List the projects a Notebook belongs to
notebooks_list_projects(id, hidden = NULL)
notebooks_list_projects(id, hidden = NULL)
id |
integer required. The ID of the Notebook. |
boolean optional. If specified to be true, returns hidden items. Defaults to false, returning non-hidden items. |
An array containing the following fields:
id |
integer, The ID for this project. |
author |
list, A list containing the following elements:
|
name |
string, The name of this project. |
description |
string, A description of the project. |
users |
array, An array containing the following fields:
|
autoShare |
boolean, |
createdAt |
string, |
updatedAt |
string, |
archived |
string, The archival status of the requested item(s). |
Get URLs to update notebook
notebooks_list_update_links(id)
notebooks_list_update_links(id)
id |
integer required. |
A list containing the following elements:
updateUrl |
string, Time-limited URL to PUT new contents of the .ipynb file for this notebook. |
updatePreviewUrl |
string, Time-limited URL to PUT new contents of the .htm preview file for this notebook. |
Update some attributes of this Notebook
notebooks_patch( id, name = NULL, language = NULL, description = NULL, file_id = NULL, requirements_file_id = NULL, requirements = NULL, docker_image_name = NULL, docker_image_tag = NULL, instance_type = NULL, memory = NULL, cpu = NULL, credentials = NULL, environment_variables = NULL, idle_timeout = NULL, git_repo_url = NULL, git_ref = NULL, git_path = NULL )
notebooks_patch( id, name = NULL, language = NULL, description = NULL, file_id = NULL, requirements_file_id = NULL, requirements = NULL, docker_image_name = NULL, docker_image_tag = NULL, instance_type = NULL, memory = NULL, cpu = NULL, credentials = NULL, environment_variables = NULL, idle_timeout = NULL, git_repo_url = NULL, git_ref = NULL, git_path = NULL )
id |
integer required. The ID for this notebook. |
name |
string optional. The name of this notebook. |
language |
string optional. The kernel language of this notebook. |
description |
string optional. The description of this notebook. |
file_id |
string optional. The file ID for the S3 file containing the .ipynb file. |
requirements_file_id |
string optional. The file ID for the S3 file containing the requirements.txt file. |
requirements |
string optional. The requirements txt file. |
docker_image_name |
string optional. The name of the docker image to pull from DockerHub. |
docker_image_tag |
string optional. The tag of the docker image to pull from DockerHub (default: latest). |
instance_type |
string optional. The EC2 instance type to deploy to. |
memory |
integer optional. The amount of memory allocated to the notebook. |
cpu |
integer optional. The amount of cpu allocated to the the notebook. |
credentials |
array optional. A list of credential IDs to pass to the notebook. |
environment_variables |
list optional. Environment variables to be passed into the Notebook. |
idle_timeout |
integer optional. How long the notebook will stay alive without any kernel activity. |
git_repo_url |
string optional. The url of the git repository |
git_ref |
string optional. The git reference if git repo is specified |
git_path |
string optional. The path to the .ipynb file in the git repo that will be started up on notebook launch |
A list containing the following elements:
id |
integer, The ID for this notebook. |
name |
string, The name of this notebook. |
language |
string, The kernel language of this notebook. |
description |
string, The description of this notebook. |
notebookUrl |
string, Time-limited URL to get the .ipynb file for this notebook. |
notebookPreviewUrl |
string, Time-limited URL to get the .htm preview file for this notebook. |
requirementsUrl |
string, Time-limited URL to get the requirements.txt file for this notebook. |
fileId |
string, The file ID for the S3 file containing the .ipynb file. |
requirementsFileId |
string, The file ID for the S3 file containing the requirements.txt file. |
user |
list, A list containing the following elements:
|
dockerImageName |
string, The name of the docker image to pull from DockerHub. |
dockerImageTag |
string, The tag of the docker image to pull from DockerHub (default: latest). |
instanceType |
string, The EC2 instance type to deploy to. |
memory |
integer, The amount of memory allocated to the notebook. |
cpu |
integer, The amount of cpu allocated to the the notebook. |
createdAt |
string, |
updatedAt |
string, |
mostRecentDeployment |
list, A list containing the following elements:
|
credentials |
array, A list of credential IDs to pass to the notebook. |
environmentVariables |
list, Environment variables to be passed into the Notebook. |
idleTimeout |
integer, How long the notebook will stay alive without any kernel activity. |
gitRepoId |
integer, The ID of the git repository. |
gitRepoUrl |
string, The url of the git repository |
gitRef |
string, The git reference if git repo is specified |
gitPath |
string, The path to the .ipynb file in the git repo that will be started up on notebook launch |
archived |
string, The archival status of the requested item(s). |
hidden |
boolean, The hidden status of the item. |
Create a Notebook
notebooks_post( name = NULL, language = NULL, description = NULL, file_id = NULL, requirements_file_id = NULL, requirements = NULL, docker_image_name = NULL, docker_image_tag = NULL, instance_type = NULL, memory = NULL, cpu = NULL, credentials = NULL, environment_variables = NULL, idle_timeout = NULL, git_repo_url = NULL, git_ref = NULL, git_path = NULL, hidden = NULL )
notebooks_post( name = NULL, language = NULL, description = NULL, file_id = NULL, requirements_file_id = NULL, requirements = NULL, docker_image_name = NULL, docker_image_tag = NULL, instance_type = NULL, memory = NULL, cpu = NULL, credentials = NULL, environment_variables = NULL, idle_timeout = NULL, git_repo_url = NULL, git_ref = NULL, git_path = NULL, hidden = NULL )
name |
string optional. The name of this notebook. |
language |
string optional. The kernel language of this notebook. |
description |
string optional. The description of this notebook. |
file_id |
string optional. The file ID for the S3 file containing the .ipynb file. |
requirements_file_id |
string optional. The file ID for the S3 file containing the requirements.txt file. |
requirements |
string optional. The requirements txt file. |
docker_image_name |
string optional. The name of the docker image to pull from DockerHub. |
docker_image_tag |
string optional. The tag of the docker image to pull from DockerHub (default: latest). |
instance_type |
string optional. The EC2 instance type to deploy to. |
memory |
integer optional. The amount of memory allocated to the notebook. |
cpu |
integer optional. The amount of cpu allocated to the the notebook. |
credentials |
array optional. A list of credential IDs to pass to the notebook. |
environment_variables |
list optional. Environment variables to be passed into the Notebook. |
idle_timeout |
integer optional. How long the notebook will stay alive without any kernel activity. |
git_repo_url |
string optional. The url of the git repository |
git_ref |
string optional. The git reference if git repo is specified |
git_path |
string optional. The path to the .ipynb file in the git repo that will be started up on notebook launch |
boolean optional. The hidden status of the item. |
A list containing the following elements:
id |
integer, The ID for this notebook. |
name |
string, The name of this notebook. |
language |
string, The kernel language of this notebook. |
description |
string, The description of this notebook. |
notebookUrl |
string, Time-limited URL to get the .ipynb file for this notebook. |
notebookPreviewUrl |
string, Time-limited URL to get the .htm preview file for this notebook. |
requirementsUrl |
string, Time-limited URL to get the requirements.txt file for this notebook. |
fileId |
string, The file ID for the S3 file containing the .ipynb file. |
requirementsFileId |
string, The file ID for the S3 file containing the requirements.txt file. |
user |
list, A list containing the following elements:
|
dockerImageName |
string, The name of the docker image to pull from DockerHub. |
dockerImageTag |
string, The tag of the docker image to pull from DockerHub (default: latest). |
instanceType |
string, The EC2 instance type to deploy to. |
memory |
integer, The amount of memory allocated to the notebook. |
cpu |
integer, The amount of cpu allocated to the the notebook. |
createdAt |
string, |
updatedAt |
string, |
mostRecentDeployment |
list, A list containing the following elements:
|
credentials |
array, A list of credential IDs to pass to the notebook. |
environmentVariables |
list, Environment variables to be passed into the Notebook. |
idleTimeout |
integer, How long the notebook will stay alive without any kernel activity. |
gitRepoId |
integer, The ID of the git repository. |
gitRepoUrl |
string, The url of the git repository |
gitRef |
string, The git reference if git repo is specified |
gitPath |
string, The path to the .ipynb file in the git repo that will be started up on notebook launch |
archived |
string, The archival status of the requested item(s). |
hidden |
boolean, The hidden status of the item. |
Clone this Notebook
notebooks_post_clone(id)
notebooks_post_clone(id)
id |
integer required. |
A list containing the following elements:
id |
integer, The ID for this notebook. |
name |
string, The name of this notebook. |
language |
string, The kernel language of this notebook. |
description |
string, The description of this notebook. |
notebookUrl |
string, Time-limited URL to get the .ipynb file for this notebook. |
notebookPreviewUrl |
string, Time-limited URL to get the .htm preview file for this notebook. |
requirementsUrl |
string, Time-limited URL to get the requirements.txt file for this notebook. |
fileId |
string, The file ID for the S3 file containing the .ipynb file. |
requirementsFileId |
string, The file ID for the S3 file containing the requirements.txt file. |
user |
list, A list containing the following elements:
|
dockerImageName |
string, The name of the docker image to pull from DockerHub. |
dockerImageTag |
string, The tag of the docker image to pull from DockerHub (default: latest). |
instanceType |
string, The EC2 instance type to deploy to. |
memory |
integer, The amount of memory allocated to the notebook. |
cpu |
integer, The amount of cpu allocated to the the notebook. |
createdAt |
string, |
updatedAt |
string, |
mostRecentDeployment |
list, A list containing the following elements:
|
credentials |
array, A list of credential IDs to pass to the notebook. |
environmentVariables |
list, Environment variables to be passed into the Notebook. |
idleTimeout |
integer, How long the notebook will stay alive without any kernel activity. |
gitRepoId |
integer, The ID of the git repository. |
gitRepoUrl |
string, The url of the git repository |
gitRef |
string, The git reference if git repo is specified |
gitPath |
string, The path to the .ipynb file in the git repo that will be started up on notebook launch |
archived |
string, The archival status of the requested item(s). |
hidden |
boolean, The hidden status of the item. |
Deploy a Notebook
notebooks_post_deployments(notebook_id, deployment_id = NULL, published = NULL)
notebooks_post_deployments(notebook_id, deployment_id = NULL, published = NULL)
notebook_id |
integer required. The ID of the owning Notebook |
deployment_id |
integer optional. The ID for this deployment |
published |
boolean optional. |
A list containing the following elements:
deploymentId |
integer, The ID for this deployment. |
userId |
integer, The ID of the owner. |
host |
string, Domain of the deployment. |
name |
string, Name of the deployment. |
dockerImageName |
string, The name of the docker image to pull from DockerHub. |
dockerImageTag |
string, The tag of the docker image to pull from DockerHub (default: latest). |
displayUrl |
string, A signed URL for viewing the deployed item. |
instanceType |
string, The EC2 instance type requested for the deployment. |
memory |
integer, The memory allocated to the deployment. |
cpu |
integer, The cpu allocated to the deployment. |
state |
string, The state of the deployment. |
stateMessage |
string, A detailed description of the state. |
createdAt |
string, |
updatedAt |
string, |
published |
boolean, |
notebookId |
integer, The ID of owning Notebook |
Commit and push a new version of the file
notebooks_post_git_commits(id, content, message, file_hash)
notebooks_post_git_commits(id, content, message, file_hash)
id |
integer required. The ID of the file. |
content |
string required. The contents to commit to the file. |
message |
string required. A commit message describing the changes being made. |
file_hash |
string required. The full SHA of the file being replaced. |
A list containing the following elements:
content |
string, The file's contents. |
type |
string, The file's type. |
size |
integer, The file's size. |
fileHash |
string, The SHA of the file. |
Replace all attributes of this Notebook
notebooks_put( id, name = NULL, language = NULL, description = NULL, file_id = NULL, requirements_file_id = NULL, requirements = NULL, docker_image_name = NULL, docker_image_tag = NULL, instance_type = NULL, memory = NULL, cpu = NULL, credentials = NULL, environment_variables = NULL, idle_timeout = NULL, git_repo_url = NULL, git_ref = NULL, git_path = NULL )
notebooks_put( id, name = NULL, language = NULL, description = NULL, file_id = NULL, requirements_file_id = NULL, requirements = NULL, docker_image_name = NULL, docker_image_tag = NULL, instance_type = NULL, memory = NULL, cpu = NULL, credentials = NULL, environment_variables = NULL, idle_timeout = NULL, git_repo_url = NULL, git_ref = NULL, git_path = NULL )
id |
integer required. The ID for this notebook. |
name |
string optional. The name of this notebook. |
language |
string optional. The kernel language of this notebook. |
description |
string optional. The description of this notebook. |
file_id |
string optional. The file ID for the S3 file containing the .ipynb file. |
requirements_file_id |
string optional. The file ID for the S3 file containing the requirements.txt file. |
requirements |
string optional. The requirements txt file. |
docker_image_name |
string optional. The name of the docker image to pull from DockerHub. |
docker_image_tag |
string optional. The tag of the docker image to pull from DockerHub (default: latest). |
instance_type |
string optional. The EC2 instance type to deploy to. |
memory |
integer optional. The amount of memory allocated to the notebook. |
cpu |
integer optional. The amount of cpu allocated to the the notebook. |
credentials |
array optional. A list of credential IDs to pass to the notebook. |
environment_variables |
list optional. Environment variables to be passed into the Notebook. |
idle_timeout |
integer optional. How long the notebook will stay alive without any kernel activity. |
git_repo_url |
string optional. The url of the git repository |
git_ref |
string optional. The git reference if git repo is specified |
git_path |
string optional. The path to the .ipynb file in the git repo that will be started up on notebook launch |
A list containing the following elements:
id |
integer, The ID for this notebook. |
name |
string, The name of this notebook. |
language |
string, The kernel language of this notebook. |
description |
string, The description of this notebook. |
notebookUrl |
string, Time-limited URL to get the .ipynb file for this notebook. |
notebookPreviewUrl |
string, Time-limited URL to get the .htm preview file for this notebook. |
requirementsUrl |
string, Time-limited URL to get the requirements.txt file for this notebook. |
fileId |
string, The file ID for the S3 file containing the .ipynb file. |
requirementsFileId |
string, The file ID for the S3 file containing the requirements.txt file. |
user |
list, A list containing the following elements:
|
dockerImageName |
string, The name of the docker image to pull from DockerHub. |
dockerImageTag |
string, The tag of the docker image to pull from DockerHub (default: latest). |
instanceType |
string, The EC2 instance type to deploy to. |
memory |
integer, The amount of memory allocated to the notebook. |
cpu |
integer, The amount of cpu allocated to the the notebook. |
createdAt |
string, |
updatedAt |
string, |
mostRecentDeployment |
list, A list containing the following elements:
|
credentials |
array, A list of credential IDs to pass to the notebook. |
environmentVariables |
list, Environment variables to be passed into the Notebook. |
idleTimeout |
integer, How long the notebook will stay alive without any kernel activity. |
gitRepoId |
integer, The ID of the git repository. |
gitRepoUrl |
string, The url of the git repository |
gitRef |
string, The git reference if git repo is specified |
gitPath |
string, The path to the .ipynb file in the git repo that will be started up on notebook launch |
archived |
string, The archival status of the requested item(s). |
hidden |
boolean, The hidden status of the item. |
Update the archive status of this object
notebooks_put_archive(id, status)
notebooks_put_archive(id, status)
id |
integer required. The ID of the object. |
status |
boolean required. The desired archived status of the object. |
A list containing the following elements:
id |
integer, The ID for this notebook. |
name |
string, The name of this notebook. |
language |
string, The kernel language of this notebook. |
description |
string, The description of this notebook. |
notebookUrl |
string, Time-limited URL to get the .ipynb file for this notebook. |
notebookPreviewUrl |
string, Time-limited URL to get the .htm preview file for this notebook. |
requirementsUrl |
string, Time-limited URL to get the requirements.txt file for this notebook. |
fileId |
string, The file ID for the S3 file containing the .ipynb file. |
requirementsFileId |
string, The file ID for the S3 file containing the requirements.txt file. |
user |
list, A list containing the following elements:
|
dockerImageName |
string, The name of the docker image to pull from DockerHub. |
dockerImageTag |
string, The tag of the docker image to pull from DockerHub (default: latest). |
instanceType |
string, The EC2 instance type to deploy to. |
memory |
integer, The amount of memory allocated to the notebook. |
cpu |
integer, The amount of cpu allocated to the the notebook. |
createdAt |
string, |
updatedAt |
string, |
mostRecentDeployment |
list, A list containing the following elements:
|
credentials |
array, A list of credential IDs to pass to the notebook. |
environmentVariables |
list, Environment variables to be passed into the Notebook. |
idleTimeout |
integer, How long the notebook will stay alive without any kernel activity. |
gitRepoId |
integer, The ID of the git repository. |
gitRepoUrl |
string, The url of the git repository |
gitRef |
string, The git reference if git repo is specified |
gitPath |
string, The path to the .ipynb file in the git repo that will be started up on notebook launch |
archived |
string, The archival status of the requested item(s). |
hidden |
boolean, The hidden status of the item. |
Attach an item to a file in a git repo
notebooks_put_git( id, git_ref = NULL, git_branch = NULL, git_path = NULL, git_repo_url = NULL, pull_from_git = NULL )
notebooks_put_git( id, git_ref = NULL, git_branch = NULL, git_path = NULL, git_repo_url = NULL, pull_from_git = NULL )
id |
integer required. The ID of the file. |
git_ref |
string 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_branch |
string optional. The git branch that the file is on. |
git_path |
string optional. The path of the file in the repository. |
git_repo_url |
string optional. The URL of the git repository. |
pull_from_git |
boolean optional. Automatically pull latest commit from git. Only works for scripts. |
A list containing the following elements:
gitRef |
string, A git reference specifying an unambiguous version of the file. Can be a branch name, or the full or shortened SHA of a commit. |
gitBranch |
string, The git branch that the file is on. |
gitPath |
string, The path of the file in the repository. |
gitRepo |
list, A list containing the following elements:
|
pullFromGit |
boolean, Automatically pull latest commit from git. Only works for scripts. |
Add a Notebook to a project
notebooks_put_projects(id, project_id)
notebooks_put_projects(id, project_id)
id |
integer required. The ID of the Notebook. |
project_id |
integer required. The ID of the project. |
An empty HTTP response
Receive a stream of notifications as they come in
notifications_list(last_event_id = NULL, r = NULL, mock = NULL)
notifications_list(last_event_id = NULL, r = NULL, mock = NULL)
last_event_id |
string optional. allows browser to keep track of last event fired |
r |
string optional. specifies retry/reconnect timeout |
mock |
string optional. used for testing |
An empty HTTP response
List the ontology of column names Civis uses
ontology_list(subset = NULL)
ontology_list(subset = NULL)
subset |
string optional. A subset of fields to return. |
An array containing the following fields:
key |
string, |
title |
string, |
desc |
string, A description of this field. |
aliases |
array, |
Decile plot for classification with civis_ml
## S3 method for class 'civis_ml_classifier' plot(x, name = NULL, ...)
## S3 method for class 'civis_ml_classifier' plot(x, name = NULL, ...)
x |
|
name |
Name of the class in a multiclass model to plot. |
... |
unused. |
A ggplot2
plot object is returned invisibly.
Y-yhat plot for regression with civis_ml
## S3 method for class 'civis_ml_regressor' plot(x, ...)
## S3 method for class 'civis_ml_regressor' plot(x, ...)
x |
|
... |
unused |
A ggplot2
plot object is returned invisibly.
Show the specified prediction
predictions_get(id)
predictions_get(id)
id |
integer required. The ID of the prediction. |
A list containing the following elements:
id |
integer, The ID of the prediction. |
modelId |
integer, The ID of the model used for this prediction. |
scoredTableId |
integer, The ID of the source table for this prediction. |
scoredTableName |
string, The name of the source table for this prediction. |
outputTableName |
string, The name of the output table for this prediction. |
state |
string, The state of the last run of this prediction. |
error |
string, The error, if any, of the last run of this prediction. |
startedAt |
string, The start time of the last run of this prediction. |
finishedAt |
string, The end time of the last run of this prediction. |
lastRun |
list, A list containing the following elements:
|
scoredTables |
array, An array containing the following fields:
|
schedule |
list, A list containing the following elements:
|
limitingSQL |
string, A SQL WHERE clause used to scope the rows to be predicted. |
primaryKey |
array, The primary key or composite keys of the table being predicted. |
List predictions
predictions_list(model_id = NULL)
predictions_list(model_id = NULL)
model_id |
integer optional. If specified, only return predictions associated with this model ID. |
An array containing the following fields:
id |
integer, The ID of the prediction. |
modelId |
integer, The ID of the model used for this prediction. |
scoredTableId |
integer, The ID of the source table for this prediction. |
scoredTableName |
string, The name of the source table for this prediction. |
outputTableName |
string, The name of the output table for this prediction. |
state |
string, The state of the last run of this prediction. |
error |
string, The error, if any, of the last run of this prediction. |
startedAt |
string, The start time of the last run of this prediction. |
finishedAt |
string, The end time of the last run of this prediction. |
lastRun |
list, A list containing the following elements:
|
Show the prediction schedule
predictions_list_schedules(id)
predictions_list_schedules(id)
id |
integer required. ID of the prediction associated with this schedule. |
A list containing the following elements:
id |
integer, ID of the prediction associated with this schedule. |
schedule |
list, A list containing the following elements:
|
scoreOnModelBuild |
boolean, Whether the prediction will run after a rebuild of the associated model. |
Print results from a Civis API call
## S3 method for class 'civis_api' print(x, ...)
## S3 method for class 'civis_api' print(x, ...)
x |
A |
... |
Further arguments passed to |
The 'civis_api' object, invisibly.
## Not run: query_civis("SELECT * FROM schema.my_table", "database", preview_rows = 100) csv_to_civis("file.csv", "my_database", "schema.my_table") print(databases_list(), max = 5) ## End(Not run)
## Not run: query_civis("SELECT * FROM schema.my_table", "database", preview_rows = 100) csv_to_civis("file.csv", "my_database", "schema.my_table") print(databases_list(), max = 5) ## End(Not run)
Archive a project (deprecated, use the /archive endpoint instead)
projects_delete(project_id)
projects_delete(project_id)
project_id |
integer required. |
An empty HTTP response
Remove an item from a Parent Project
projects_delete_parent_projects(id, parent_project_id)
projects_delete_parent_projects(id, parent_project_id)
id |
integer required. The ID of the item. |
parent_project_id |
integer required. The ID of the Parent Project. |
An empty HTTP response
Get a detailed view of a project and the objects in it
projects_get(project_id)
projects_get(project_id)
project_id |
integer required. |
A list containing the following elements:
id |
integer, The ID for this project. |
author |
list, A list containing the following elements:
|
name |
string, The name of this project. |
description |
string, A description of the project. |
users |
array, An array containing the following fields:
|
autoShare |
boolean, |
createdAt |
string, |
updatedAt |
string, |
tables |
array, An array containing the following fields:
|
surveys |
array, An array containing the following fields:
|
scripts |
array, An array containing the following fields:
|
imports |
array, An array containing the following fields:
|
exports |
array, An array containing the following fields:
|
models |
array, An array containing the following fields:
|
notebooks |
array, An array containing the following fields:
|
services |
array, An array containing the following fields:
|
workflows |
array, An array containing the following fields:
|
reports |
array, An array containing the following fields:
|
scriptTemplates |
array, An array containing the following fields:
|
files |
array, An array containing the following fields:
|
enhancements |
array, An array containing the following fields:
|
appInstances |
array, An array containing the following fields:
|
projects |
array, An array containing the following fields:
|
allObjects |
array, An array containing the following fields:
|
note |
string, |
hidden |
boolean, The hidden status of the item. |
archived |
string, The archival status of the requested item(s). |
parentProject |
list, A list containing the following elements:
|
List projects
projects_list( author = NULL, permission = NULL, hidden = NULL, archived = NULL, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
projects_list( author = NULL, permission = NULL, hidden = NULL, archived = NULL, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
author |
string optional. If specified, return projects owned by this author. It accepts a comma-separated list of author ids. |
permission |
string optional. A permissions string, one of "read", "write", or "manage". Lists only projects for which the current user has that permission. |
boolean optional. If specified to be true, returns hidden items. Defaults to false, returning non-hidden items. |
|
archived |
string optional. The archival status of the requested item(s). |
limit |
integer optional. Number of results to return. Defaults to 20. Maximum allowed is 1000. |
page_num |
integer optional. Page number of the results to return. Defaults to the first page, 1. |
order |
string optional. The field on which to order the result set. Defaults to updated_at. Must be one of: updated_at, name, created_at. |
order_dir |
string optional. Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc. |
An array containing the following fields:
id |
integer, The ID for this project. |
author |
list, A list containing the following elements:
|
name |
string, The name of this project. |
description |
string, A description of the project. |
users |
array, An array containing the following fields:
|
autoShare |
boolean, |
createdAt |
string, |
updatedAt |
string, |
archived |
string, The archival status of the requested item(s). |
List the Parent Projects an item belongs to
projects_list_parent_projects(id, hidden = NULL)
projects_list_parent_projects(id, hidden = NULL)
id |
integer required. The ID of the item. |
boolean optional. If specified to be true, returns hidden items. Defaults to false, returning non-hidden items. |
An array containing the following fields:
id |
integer, The ID for this project. |
author |
list, A list containing the following elements:
|
name |
string, The name of this project. |
description |
string, A description of the project. |
users |
array, An array containing the following fields:
|
autoShare |
boolean, |
createdAt |
string, |
updatedAt |
string, |
archived |
string, The archival status of the requested item(s). |
Create a project
projects_post(name, description, note = NULL, hidden = NULL)
projects_post(name, description, note = NULL, hidden = NULL)
name |
string required. The name of this project. |
description |
string required. A description of the project. |
note |
string optional. Notes for the project. |
boolean optional. The hidden status of the item. |
A list containing the following elements:
id |
integer, The ID for this project. |
author |
list, A list containing the following elements:
|
name |
string, The name of this project. |
description |
string, A description of the project. |
users |
array, An array containing the following fields:
|
autoShare |
boolean, |
createdAt |
string, |
updatedAt |
string, |
tables |
array, An array containing the following fields:
|
surveys |
array, An array containing the following fields:
|
scripts |
array, An array containing the following fields:
|
imports |
array, An array containing the following fields:
|
exports |
array, An array containing the following fields:
|
models |
array, An array containing the following fields:
|
notebooks |
array, An array containing the following fields:
|
services |
array, An array containing the following fields:
|
workflows |
array, An array containing the following fields:
|
reports |
array, An array containing the following fields:
|
scriptTemplates |
array, An array containing the following fields:
|
files |
array, An array containing the following fields:
|
enhancements |
array, An array containing the following fields:
|
appInstances |
array, An array containing the following fields:
|
projects |
array, An array containing the following fields:
|
allObjects |
array, An array containing the following fields:
|
note |
string, |
hidden |
boolean, The hidden status of the item. |
archived |
string, The archival status of the requested item(s). |
parentProject |
list, A list containing the following elements:
|
Update a project
projects_put( project_id, name = NULL, description = NULL, note = NULL, auto_share = NULL )
projects_put( project_id, name = NULL, description = NULL, note = NULL, auto_share = NULL )
project_id |
integer required. |
name |
string optional. The name of this project. |
description |
string optional. A description of the project. |
note |
string optional. Notes for the project. |
auto_share |
boolean optional. A toggle for sharing the objects within the project when the project is shared.This does not automatically share new objects to the project. |
A list containing the following elements:
id |
integer, The ID for this project. |
author |
list, A list containing the following elements:
|
name |
string, The name of this project. |
description |
string, A description of the project. |
users |
array, An array containing the following fields:
|
autoShare |
boolean, |
createdAt |
string, |
updatedAt |
string, |
tables |
array, An array containing the following fields:
|
surveys |
array, An array containing the following fields:
|
scripts |
array, An array containing the following fields:
|
imports |
array, An array containing the following fields:
|
exports |
array, An array containing the following fields:
|
models |
array, An array containing the following fields:
|
notebooks |
array, An array containing the following fields:
|
services |
array, An array containing the following fields:
|
workflows |
array, An array containing the following fields:
|
reports |
array, An array containing the following fields:
|
scriptTemplates |
array, An array containing the following fields:
|
files |
array, An array containing the following fields:
|
enhancements |
array, An array containing the following fields:
|
appInstances |
array, An array containing the following fields:
|
projects |
array, An array containing the following fields:
|
allObjects |
array, An array containing the following fields:
|
note |
string, |
hidden |
boolean, The hidden status of the item. |
archived |
string, The archival status of the requested item(s). |
parentProject |
list, A list containing the following elements:
|
Update the archive status of this object
projects_put_archive(id, status)
projects_put_archive(id, status)
id |
integer required. The ID of the object. |
status |
boolean required. The desired archived status of the object. |
A list containing the following elements:
id |
integer, The ID for this project. |
author |
list, A list containing the following elements:
|
name |
string, The name of this project. |
description |
string, A description of the project. |
users |
array, An array containing the following fields:
|
autoShare |
boolean, |
createdAt |
string, |
updatedAt |
string, |
tables |
array, An array containing the following fields:
|
surveys |
array, An array containing the following fields:
|
scripts |
array, An array containing the following fields:
|
imports |
array, An array containing the following fields:
|
exports |
array, An array containing the following fields:
|
models |
array, An array containing the following fields:
|
notebooks |
array, An array containing the following fields:
|
services |
array, An array containing the following fields:
|
workflows |
array, An array containing the following fields:
|
reports |
array, An array containing the following fields:
|
scriptTemplates |
array, An array containing the following fields:
|
files |
array, An array containing the following fields:
|
enhancements |
array, An array containing the following fields:
|
appInstances |
array, An array containing the following fields:
|
projects |
array, An array containing the following fields:
|
allObjects |
array, An array containing the following fields:
|
note |
string, |
hidden |
boolean, The hidden status of the item. |
archived |
string, The archival status of the requested item(s). |
parentProject |
list, A list containing the following elements:
|
Add an item to a Parent Project
projects_put_parent_projects(id, parent_project_id)
projects_put_parent_projects(id, parent_project_id)
id |
integer required. The ID of the item. |
parent_project_id |
integer required. The ID of the Parent Project. |
An empty HTTP response
This function is called when the "Publish To Civis" button is pressed in
the RStudio IDE AddIn menu. It will attempt to save the current changes
of the active document and push it to the appropriate location in Platform.
RMarkdown files will be rendered to html with publish_rmd
and published as a report. Currently only RMarkdown files are supported.
publish_addin()
publish_addin()
publish_rmd
for publishing RMarkdown files
Publish HTML to Platform Reports
publish_html( html_file, report_id = NULL, report_name = NULL, provide_api_key = NULL, project_id = NULL )
publish_html( html_file, report_id = NULL, report_name = NULL, provide_api_key = NULL, project_id = NULL )
html_file |
string, HTML file |
report_id |
integer, ID of an existing report, if provided, the
contents of the report will be replaced. If |
report_name |
string, Title of report in platform |
provide_api_key |
bool, Set to true to include API key in report. |
project_id |
integer, Project_id that the report should be added to. |
publish_rmd
to publish an R Markdown document
to Civis
## Not run: # Uploads html and prints link to report in Platform publish_html("my_beautiful_report.html") ## End(Not run)
## Not run: # Uploads html and prints link to report in Platform publish_html("my_beautiful_report.html") ## End(Not run)
Publish an R Markdown file to Platform Reports
publish_rmd( rmd_file, report_id = NULL, report_name = NULL, provide_api_key = NULL, project_id = NULL, ... )
publish_rmd( rmd_file, report_id = NULL, report_name = NULL, provide_api_key = NULL, project_id = NULL, ... )
rmd_file |
string, R Markdown file (.Rmd) |
report_id |
integer, ID of an existing report, if provided, the
contents of the report will be replaced. If |
report_name |
string, Title of report in platform |
provide_api_key |
bool, Set to true to include API key in report. |
project_id |
integer, Project_id that the report should be added to. |
... |
additional parameters to send to |
This function also supports passing report_id
, report_name
,
provide_api_key
and project_id
as metadata in the report's
YAML front matter. Just as the title of an RMarkdown document can be set
with title: "my title!"
, these parameters can be set like
civis: report_name: "My Report Name" report_id: 9000
Since report_id
is set, this code will overwrite the existing
report with that number, which may be useful when updating a report on
a schedule. Any argument passed in explicitly to publish_rmd
will be used in place of the corresponding argument set in YAML metadata.
rmarkdown::render
depends on a recent version of pandoc
.
pandoc
is distributed with RStudio and thus, publish_rmd
will work in an RStudio environment. Outside of RStudio pandoc
may
be installed or knitr::knit2html
can be used to convert an R
Markdown document into html. The html can then be published to Civis
with publish_html
.
publish_html
to publish html to Civis
## Not run: # Publish a standard report publish_rmd("my_beautiful_doc.Rmd") # Publish a parameterized R Markdown document # See: http://rmarkdown.rstudio.com/developer_parameterized_reports.html params <- list("region" = "east", start = as.Date("2015-02-01")) publish_rmd("my_parameterized_doc.Rmd", params=params) ## End(Not run)
## Not run: # Publish a standard report publish_rmd("my_beautiful_doc.Rmd") # Publish a parameterized R Markdown document # See: http://rmarkdown.rstudio.com/developer_parameterized_reports.html params <- list("region" = "east", start = as.Date("2015-02-01")) publish_rmd("my_parameterized_doc.Rmd", params=params) ## End(Not run)
Cancel a run
queries_delete_runs(id, run_id)
queries_delete_runs(id, run_id)
id |
integer required. The ID of the query. |
run_id |
integer required. The ID of the run. |
An empty HTTP response
Get details about a query
queries_get(id)
queries_get(id)
id |
integer required. The query ID. |
A list containing the following elements:
id |
integer, The query ID. |
database |
integer, The database ID. |
sql |
string, The SQL to execute. |
credential |
integer, The credential ID. |
resultRows |
array, A preview of rows returned by the query. |
resultColumns |
array, A preview of columns returned by the query. |
scriptId |
integer, The ID of the script associated with this query. |
exception |
string, Deprecated and not used. |
error |
string, The error message for this run, if present. |
createdAt |
string, |
updatedAt |
string, |
finishedAt |
string, The end time of the last run. |
state |
string, The state of the last run. |
lastRunId |
integer, The ID of the last run. |
hidden |
boolean, The hidden status of the item. |
name |
string, The name of the query. |
author |
list, A list containing the following elements:
|
startedAt |
string, The start time of the last run. |
reportId |
integer, The ID of the report associated with this query. |
Check status of a run
queries_get_runs(id, run_id)
queries_get_runs(id, run_id)
id |
integer required. The ID of the query. |
run_id |
integer required. The ID of the run. |
A list containing the following elements:
id |
integer, The ID of the run. |
queryId |
integer, The ID of the query. |
state |
string, The state of the run, one of 'queued' 'running' 'succeeded' 'failed' or 'cancelled'. |
isCancelRequested |
boolean, True if run cancel requested, else false. |
startedAt |
string, The time the last run started at. |
finishedAt |
string, The time the last run completed. |
error |
string, The error, if any, returned by the run. |
List
queries_list( database_id = NULL, author_id = NULL, created_before = NULL, exclude_results = NULL, hidden = NULL, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
queries_list( database_id = NULL, author_id = NULL, created_before = NULL, exclude_results = NULL, hidden = NULL, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
database_id |
integer optional. The database ID. |
author_id |
integer optional. The author of the query. |
created_before |
string optional. An upper bound for the creation date of the query. |
exclude_results |
boolean optional. If true, does not return cached query results. |
boolean optional. If specified to be true, returns hidden items. Defaults to false, returning non-hidden items. |
|
limit |
integer optional. Number of results to return. Defaults to 20. Maximum allowed is 50. |
page_num |
integer optional. Page number of the results to return. Defaults to the first page, 1. |
order |
string optional. The field on which to order the result set. Defaults to created_at. Must be one of: created_at. |
order_dir |
string optional. Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc. |
An array containing the following fields:
id |
integer, The query ID. |
database |
integer, The database ID. |
sql |
string, The SQL to execute. |
credential |
integer, The credential ID. |
resultRows |
array, A preview of rows returned by the query. |
resultColumns |
array, A preview of columns returned by the query. |
scriptId |
integer, The ID of the script associated with this query. |
exception |
string, Deprecated and not used. |
error |
string, The error message for this run, if present. |
createdAt |
string, |
updatedAt |
string, |
finishedAt |
string, The end time of the last run. |
state |
string, The state of the last run. |
lastRunId |
integer, The ID of the last run. |
previewRows |
integer, The number of rows to save from the query's result (maximum: 100). |
startedAt |
string, The start time of the last run. |
reportId |
integer, The ID of the report associated with this query. |
List runs for the given query
queries_list_runs( id, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
queries_list_runs( id, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
id |
integer required. The ID of the query. |
limit |
integer optional. Number of results to return. Defaults to 20. Maximum allowed is 100. |
page_num |
integer optional. Page number of the results to return. Defaults to the first page, 1. |
order |
string optional. The field on which to order the result set. Defaults to id. Must be one of: id. |
order_dir |
string optional. Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc. |
An array containing the following fields:
id |
integer, The ID of the run. |
queryId |
integer, The ID of the query. |
state |
string, The state of the run, one of 'queued' 'running' 'succeeded' 'failed' or 'cancelled'. |
isCancelRequested |
boolean, True if run cancel requested, else false. |
startedAt |
string, The time the last run started at. |
finishedAt |
string, The time the last run completed. |
error |
string, The error, if any, returned by the run. |
Get the logs for a run
queries_list_runs_logs(id, run_id, last_id = NULL, limit = NULL)
queries_list_runs_logs(id, run_id, last_id = NULL, limit = NULL)
id |
integer required. The ID of the query. |
run_id |
integer required. The ID of the run. |
last_id |
integer optional. The ID of the last log message received. Log entries with this ID value or lower will be omitted.Logs are sorted by ID if this value is provided, and are otherwise sorted by createdAt. |
limit |
integer optional. The maximum number of log messages to return. Default of 10000. |
An array containing the following fields:
id |
integer, The ID of the log. |
createdAt |
string, The time the log was created. |
message |
string, The log message. |
level |
string, The level of the log. One of unknown,fatal,error,warn,info,debug. |
Execute a query
queries_post( database, sql, preview_rows, credential = NULL, hidden = NULL, interactive = NULL, include_header = NULL, compression = NULL, column_delimiter = NULL, unquoted = NULL, filename_prefix = NULL )
queries_post( database, sql, preview_rows, credential = NULL, hidden = NULL, interactive = NULL, include_header = NULL, compression = NULL, column_delimiter = NULL, unquoted = NULL, filename_prefix = NULL )
database |
integer required. The database ID. |
sql |
string required. The SQL to execute. |
preview_rows |
integer required. The number of rows to save from the query's result (maximum: 100). |
credential |
integer optional. The credential ID. |
boolean optional. The hidden status of the item. |
|
interactive |
boolean optional. Deprecated and not used. |
include_header |
boolean optional. Whether the CSV output should include a header row [default: true]. |
compression |
string optional. The type of compression. One of gzip or zip, or none [default: gzip]. |
column_delimiter |
string optional. The delimiter to use. One of comma or tab, or pipe [default: comma]. |
unquoted |
boolean optional. If true, will not quote fields. |
filename_prefix |
string optional. The output filename prefix. |
A list containing the following elements:
id |
integer, The query ID. |
database |
integer, The database ID. |
sql |
string, The SQL to execute. |
credential |
integer, The credential ID. |
resultRows |
array, A preview of rows returned by the query. |
resultColumns |
array, A preview of columns returned by the query. |
scriptId |
integer, The ID of the script associated with this query. |
exception |
string, Deprecated and not used. |
error |
string, The error message for this run, if present. |
createdAt |
string, |
updatedAt |
string, |
finishedAt |
string, The end time of the last run. |
state |
string, The state of the last run. |
lastRunId |
integer, The ID of the last run. |
hidden |
boolean, The hidden status of the item. |
interactive |
boolean, Deprecated and not used. |
previewRows |
integer, The number of rows to save from the query's result (maximum: 100). |
includeHeader |
boolean, Whether the CSV output should include a header row [default: true]. |
compression |
string, The type of compression. One of gzip or zip, or none [default: gzip]. |
columnDelimiter |
string, The delimiter to use. One of comma or tab, or pipe [default: comma]. |
unquoted |
boolean, If true, will not quote fields. |
filenamePrefix |
string, The output filename prefix. |
startedAt |
string, The start time of the last run. |
reportId |
integer, The ID of the report associated with this query. |
Start a run
queries_post_runs(id)
queries_post_runs(id)
id |
integer required. The ID of the query. |
A list containing the following elements:
id |
integer, The ID of the run. |
queryId |
integer, The ID of the query. |
state |
string, The state of the run, one of 'queued' 'running' 'succeeded' 'failed' or 'cancelled'. |
isCancelRequested |
boolean, True if run cancel requested, else false. |
startedAt |
string, The time the last run started at. |
finishedAt |
string, The time the last run completed. |
error |
string, The error, if any, returned by the run. |
Update the query's associated script
queries_put_scripts(id, script_id)
queries_put_scripts(id, script_id)
id |
integer required. The query ID. |
script_id |
integer required. The ID of the script associated with this query. |
A list containing the following elements:
id |
integer, The query ID. |
database |
integer, The database ID. |
sql |
string, The SQL to execute. |
credential |
integer, The credential ID. |
resultRows |
array, A preview of rows returned by the query. |
resultColumns |
array, A preview of columns returned by the query. |
scriptId |
integer, The ID of the script associated with this query. |
exception |
string, Deprecated and not used. |
error |
string, The error message for this run, if present. |
createdAt |
string, |
updatedAt |
string, |
finishedAt |
string, The end time of the last run. |
state |
string, The state of the last run. |
lastRunId |
integer, The ID of the last run. |
hidden |
boolean, The hidden status of the item. |
name |
string, The name of the query. |
author |
list, A list containing the following elements:
|
startedAt |
string, The start time of the last run. |
reportId |
integer, The ID of the report associated with this query. |
Utility to run queries that return no output.
A default database can be set using options(civis.default_db = "my_database")
.
If there is only one database available,
this database will automatically be used as the default.
query_civis(x, ...) ## S3 method for class 'sql' query_civis(x, database = NULL, verbose = FALSE, ...) ## S3 method for class 'numeric' query_civis(x, verbose = FALSE, ...) ## S3 method for class 'character' query_civis(x, database = NULL, verbose = FALSE, ...)
query_civis(x, ...) ## S3 method for class 'sql' query_civis(x, database = NULL, verbose = FALSE, ...) ## S3 method for class 'numeric' query_civis(x, verbose = FALSE, ...) ## S3 method for class 'character' query_civis(x, database = NULL, verbose = FALSE, ...)
x |
|
... |
arguments passed to |
database |
string, Name of database where query is run. |
verbose |
bool, Print detailed updates of job status. |
sql
: Run a SQL query.
numeric
: Run a SQL query from a previous SQL query id.
character
: Run a SQL query.
read_civis
for downloading results of SQL scripts from Civis Platform as a data frame.
io
Other io:
download_civis()
,
query_civis_file()
,
read_civis()
,
write_civis_file()
,
write_civis()
## Not run: query_civis("GRANT ALL ON schema.my_table TO GROUP admin", "database", credential=0000) ## End(Not run)
## Not run: query_civis("GRANT ALL ON schema.my_table TO GROUP admin", "database", credential=0000) ## End(Not run)
Exports results from a Redshift SQL query, and returns the id of the file on S3 for use
with read_civis
or download_civis
.
query_civis_file(x, ...) ## S3 method for class 'character' query_civis_file( x, database = NULL, job_name = NULL, hidden = TRUE, verbose = verbose, csv_settings = NULL, ... ) ## S3 method for class 'sql' query_civis_file( x, database = NULL, job_name = NULL, hidden = TRUE, verbose = FALSE, csv_settings = NULL, ... ) ## S3 method for class 'numeric' query_civis_file(x, database = NULL, verbose = FALSE, ...)
query_civis_file(x, ...) ## S3 method for class 'character' query_civis_file( x, database = NULL, job_name = NULL, hidden = TRUE, verbose = verbose, csv_settings = NULL, ... ) ## S3 method for class 'sql' query_civis_file( x, database = NULL, job_name = NULL, hidden = TRUE, verbose = FALSE, csv_settings = NULL, ... ) ## S3 method for class 'numeric' query_civis_file(x, database = NULL, verbose = FALSE, ...)
x |
"schema.table", |
... |
Options passed to |
database |
string, Name of database where data frame is to be uploaded.
If no database is specified, uses |
job_name |
string, Name of the job (default: |
bool, Whether the job is hidden. |
|
verbose |
bool, Set to TRUE to print intermediate progress indicators. |
csv_settings |
See |
By default, the export uses the default csv_settings in scripts_post_sql
,
which is a gzipped csv.
character
: Export a "schema.table"
to a file id.
sql
: Export results of a query to a file id.
numeric
: Run an existing sql script and return the file id of the results on S3.
Other io:
download_civis()
,
query_civis()
,
read_civis()
,
write_civis_file()
,
write_civis()
## Not run: id <- query_civis_file("schema.tablename", database = "my_database") df <- read_civis(id, using = read.csv) query <- sql("SELECT * FROM table JOIN other_table USING id WHERE var1 < 23") id <- query_civis_file(query) df <- read_civis(id, using = read.csv) id <- query_civis_file(query_id, credential_id = 0000) df <- read_civis(id, using = read.csv) ## End(Not run)
## Not run: id <- query_civis_file("schema.tablename", database = "my_database") df <- read_civis(id, using = read.csv) query <- sql("SELECT * FROM table JOIN other_table USING id WHERE var1 < 23") id <- query_civis_file(query) df <- read_civis(id, using = read.csv) id <- query_civis_file(query_id, credential_id = 0000) df <- read_civis(id, using = read.csv) ## End(Not run)
read_civis
loads a table from Redshift as a data frame if
given a "schema.table"
or sql("query")
as the first argument, or
loads a file from Amazon S3 (the files endpoint) if a file id is given.
Run outputs from any Civis platform script
are returned if a civis_script
is given.
A default database can be set using options(civis.default_db = "my_database")
.
If there is only one database available,
this database will automatically be used as the default.
read_civis(x, ...) ## S3 method for class 'numeric' read_civis(x, using = read.csv, verbose = FALSE, ...) ## S3 method for class 'character' read_civis(x, database = NULL, ...) ## S3 method for class 'sql' read_civis( x, database = NULL, using = utils::read.csv, job_name = NULL, hidden = TRUE, verbose = FALSE, ... ) ## S3 method for class 'civis_script' read_civis(x, using, regex = NULL, ...)
read_civis(x, ...) ## S3 method for class 'numeric' read_civis(x, using = read.csv, verbose = FALSE, ...) ## S3 method for class 'character' read_civis(x, database = NULL, ...) ## S3 method for class 'sql' read_civis( x, database = NULL, using = utils::read.csv, job_name = NULL, hidden = TRUE, verbose = FALSE, ... ) ## S3 method for class 'civis_script' read_civis(x, using, regex = NULL, ...)
x |
|
... |
arguments passed to |
using |
function, Function to convert the file to a data frame or to unserialize.
the file (e.g. |
verbose |
bool, Set to TRUE to print intermediate progress indicators. |
database |
string, Name of database where data frame is to be uploaded.
If no database is specified, uses |
job_name |
string, Name of the job (default: |
bool, Whether the job is hidden. |
|
regex |
Regex of matching run output names. |
By default, read_civis.numeric
assumes the file is a CSV. For reading
a serialized R object, set using = readRDS
for example.
If using = NULL
, read_civis.civis_script
will return all JSONValues with name matching regex
.
Otherwise all File run outputs matching regex
will be read into memory
with using
.
Results are always a named list.
If the script has no outputs, an empty list will be returned.
numeric
: Return a file as a data frame
character
: Return all columns from a table as a data frame.
sql
: Return a SQL query as a data frame.
civis_script
: Return run outputs of a civis_script
as a named list.
Other io:
download_civis()
,
query_civis_file()
,
query_civis()
,
write_civis_file()
,
write_civis()
## Not run: # Read all columns in a single table df <- read_civis("schema.my_table", database = "my_database") # Read data from a SQL select statement query <- sql("SELECT * FROM table JOIN other_table USING id WHERE var1 < 23") df <- read_civis(query, database = "my_database") # Read an R object from the files endpoint. id <- write_civis_file(df) df <- read_civis(id) # Read a text file or csv from the files endpoint. id <- write_civis_file("my_csv.csv") df <- read_civis(id) # Read JSONValues from a civis script vals <- read_civis(civis_script(1234)) # Read File run outputs from a civis script df <- read_civis(civis_script(1234), regex = '.csv', using = read.csv) obj <- read_civis(civis_script(1234), regex = '.rds', using = readRDS) # Gracefully handle when read_civis.sql returns no rows query <- sql("SELECT * FROM table WHERE 1 = 2") mean_x <- tryCatch({ df <- read_civis(query, database = "my_database") mean(df$x) }, empty_result_error = function(e) { NA }) ## End(Not run)
## Not run: # Read all columns in a single table df <- read_civis("schema.my_table", database = "my_database") # Read data from a SQL select statement query <- sql("SELECT * FROM table JOIN other_table USING id WHERE var1 < 23") df <- read_civis(query, database = "my_database") # Read an R object from the files endpoint. id <- write_civis_file(df) df <- read_civis(id) # Read a text file or csv from the files endpoint. id <- write_civis_file("my_csv.csv") df <- read_civis(id) # Read JSONValues from a civis script vals <- read_civis(civis_script(1234)) # Read File run outputs from a civis script df <- read_civis(civis_script(1234), regex = '.csv', using = read.csv) obj <- read_civis(civis_script(1234), regex = '.rds', using = readRDS) # Gracefully handle when read_civis.sql returns no rows query <- sql("SELECT * FROM table WHERE 1 = 2") mean_x <- tryCatch({ df <- read_civis(query, database = "my_database") mean(df$x) }, empty_result_error = function(e) { NA }) ## End(Not run)
Refreshes a table on Redshift using tables_post_refresh
, which runs the
table scanner and updates table meta-data.
refresh_table(tablename, database = NULL, verbose = FALSE)
refresh_table(tablename, database = NULL, verbose = FALSE)
tablename |
string, Name of table and schema |
database |
string, Name of database where data frame is to be uploaded. If no database is specified,
uses |
verbose |
bool, Set to TRUE to print intermediate progress indicators. |
Returns table meta-data from tables_get
.
Other tables:
get_table_id()
,
transfer_table()
List the remote hosts
remote_hosts_list(type = NULL)
remote_hosts_list(type = NULL)
type |
string optional. The type of remote host. One of: RemoteHostTypes::Bitbucket, RemoteHostTypes::GitSSH, RemoteHostTypes::Github, RemoteHostTypes::GoogleDoc, RemoteHostTypes::JDBC, RemoteHostTypes::Postgres, RemoteHostTypes::Redshift, RemoteHostTypes::S3Storage, and RemoteHostTypes::Salesforce |
An array containing the following fields:
id |
integer, The ID of the remote host. |
name |
string, The name of the remote host. |
type |
string, The type of remote host. One of: RemoteHostTypes::Bitbucket, RemoteHostTypes::GitSSH, RemoteHostTypes::Github, RemoteHostTypes::GoogleDoc, RemoteHostTypes::JDBC, RemoteHostTypes::Postgres, RemoteHostTypes::Redshift, RemoteHostTypes::S3Storage, and RemoteHostTypes::Salesforce |
url |
string, The URL for remote host. |
List data sets available from a remote host
remote_hosts_list_data_sets( id, credential_id = NULL, username = NULL, password = NULL, q = NULL, s = NULL )
remote_hosts_list_data_sets( id, credential_id = NULL, username = NULL, password = NULL, q = NULL, s = NULL )
id |
integer required. The ID of the remote host. |
credential_id |
integer optional. The credential ID. |
username |
string optional. The user name for remote host. |
password |
string optional. The password for remote host. |
q |
string optional. The query string for data set. |
s |
boolean optional. If true will only return schemas, otherwise, the results will be the full path. |
An array containing the following fields:
name |
string, The path to a data_set. |
fullPath |
boolean, Boolean that indicates whether further querying needs to be done before the table can be selected. |
Create a new remote host
remote_hosts_post(name, url, type)
remote_hosts_post(name, url, type)
name |
string required. The human readable name for the remote host. |
url |
string required. The URL to your host. |
type |
string required. The type of remote host. One of: RemoteHostTypes::Bitbucket, RemoteHostTypes::GitSSH, RemoteHostTypes::Github, RemoteHostTypes::GoogleDoc, RemoteHostTypes::JDBC, RemoteHostTypes::Postgres, RemoteHostTypes::Redshift, RemoteHostTypes::S3Storage, and RemoteHostTypes::Salesforce |
A list containing the following elements:
id |
integer, The ID of the remote host. |
name |
string, The name of the remote host. |
type |
string, The type of remote host. One of: RemoteHostTypes::Bitbucket, RemoteHostTypes::GitSSH, RemoteHostTypes::Github, RemoteHostTypes::GoogleDoc, RemoteHostTypes::JDBC, RemoteHostTypes::Postgres, RemoteHostTypes::Redshift, RemoteHostTypes::S3Storage, and RemoteHostTypes::Salesforce |
url |
string, The URL for remote host. |
Authenticate against a remote host using either a credential or a user name and password
remote_hosts_post_authenticate( id, credential_id = NULL, username = NULL, password = NULL )
remote_hosts_post_authenticate( id, credential_id = NULL, username = NULL, password = NULL )
id |
integer required. The ID of the remote host. |
credential_id |
integer optional. The credential ID. |
username |
string optional. The user name for remote host. |
password |
string optional. The password for remote host. |
An empty HTTP response
Revoke permission for this report to perform Civis platform API operations on your behalf
reports_delete_grants(id)
reports_delete_grants(id)
id |
integer required. The ID of this report. |
An empty HTTP response
Remove a Report from a project
reports_delete_projects(id, project_id)
reports_delete_projects(id, project_id)
id |
integer required. The ID of the Report. |
project_id |
integer required. The ID of the project. |
An empty HTTP response
Remove a Service Report from a project
reports_delete_services_projects(id, project_id)
reports_delete_services_projects(id, project_id)
id |
integer required. The ID of the Service Report. |
project_id |
integer required. The ID of the project. |
An empty HTTP response
Show a single report
reports_get(id)
reports_get(id)
id |
integer required. The ID of this report. |
A list containing the following elements:
id |
integer, The ID of this report. |
name |
string, The name of the report. |
user |
list, A list containing the following elements:
|
createdAt |
string, |
updatedAt |
string, |
projects |
array, An array containing the following fields:
|
state |
string, The status of the report's last run. |
finishedAt |
string, The time that the report's last run finished. |
vizUpdatedAt |
string, The time that the report's visualization was last updated. |
script |
list, A list containing the following elements:
|
jobPath |
string, The link to details of the job that backs this report. |
tableauId |
integer, |
type |
string, |
templateId |
integer, The ID of the template used for this report. |
authThumbnailUrl |
string, URL for a thumbnail of the report. |
lastRun |
list, A list containing the following elements:
|
archived |
string, The archival status of the requested item(s). |
hidden |
boolean, The hidden status of the item. |
authDataUrl |
string, |
authCodeUrl |
string, |
config |
string, Any configuration metadata for this report. |
validOutputFile |
boolean, Whether the job (a script or a query) that backs the report currently has a valid output file. |
provideAPIKey |
boolean, Whether the report requests an API Key from the report viewer. |
apiKey |
string, A Civis API key that can be used by this report. |
apiKeyId |
integer, The ID of the API key. Can be used for auditing API use by this report. |
appState |
list, Any application state blob for this report. |
useViewersTableauUsername |
boolean, Apply user level filtering on Tableau reports. |
Get file contents at commit_hash
reports_get_git_commits(id, commit_hash)
reports_get_git_commits(id, commit_hash)
id |
integer required. The ID of the file. |
commit_hash |
string required. The SHA (full or shortened) of the desired git commit. |
A list containing the following elements:
content |
string, The file's contents. |
type |
string, The file's type. |
size |
integer, The file's size. |
fileHash |
string, The SHA of the file. |
Show a single service report
reports_get_services(id)
reports_get_services(id)
id |
integer required. The ID of this report. |
A list containing the following elements:
id |
integer, The ID of this report. |
name |
string, The name of the report. |
user |
list, A list containing the following elements:
|
createdAt |
string, |
updatedAt |
string, |
host |
string, The host for the service report |
displayUrl |
string, The URL to display the service report. |
serviceId |
integer, The id of the backing service |
provideAPIKey |
boolean, Whether the report requests an API Key from the report viewer. |
apiKey |
string, A Civis API key that can be used by this report. |
apiKeyId |
integer, The ID of the API key. Can be used for auditing API use by this report. |
List Reports
reports_list( type = NULL, author = NULL, template_id = NULL, hidden = NULL, archived = NULL, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
reports_list( type = NULL, author = NULL, template_id = NULL, hidden = NULL, archived = NULL, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
type |
string optional. If specified, return report of these types. It accepts a comma-separated list, possible values are 'tableau' or 'other'. |
author |
string optional. If specified, return reports from this author. It accepts a comma-separated list of author ids. |
template_id |
integer optional. If specified, return reports using the provided Template. |
boolean optional. If specified to be true, returns hidden items. Defaults to false, returning non-hidden items. |
|
archived |
string optional. The archival status of the requested item(s). |
limit |
integer optional. Number of results to return. Defaults to 20. Maximum allowed is 50. |
page_num |
integer optional. Page number of the results to return. Defaults to the first page, 1. |
order |
string optional. The field on which to order the result set. Defaults to updated_at. Must be one of: updated_at, name, created_at. |
order_dir |
string optional. Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc. |
An array containing the following fields:
id |
integer, The ID of this report. |
name |
string, The name of the report. |
user |
list, A list containing the following elements:
|
createdAt |
string, |
updatedAt |
string, |
projects |
array, An array containing the following fields:
|
state |
string, The status of the report's last run. |
finishedAt |
string, The time that the report's last run finished. |
vizUpdatedAt |
string, The time that the report's visualization was last updated. |
script |
list, A list containing the following elements:
|
jobPath |
string, The link to details of the job that backs this report. |
tableauId |
integer, |
type |
string, |
templateId |
integer, The ID of the template used for this report. |
authThumbnailUrl |
string, URL for a thumbnail of the report. |
lastRun |
list, A list containing the following elements:
|
archived |
string, The archival status of the requested item(s). |
Get the git metadata attached to an item
reports_list_git(id)
reports_list_git(id)
id |
integer required. The ID of the file. |
A list containing the following elements:
gitRef |
string, A git reference specifying an unambiguous version of the file. Can be a branch name, or the full or shortened SHA of a commit. |
gitBranch |
string, The git branch that the file is on. |
gitPath |
string, The path of the file in the repository. |
gitRepo |
list, A list containing the following elements:
|
pullFromGit |
boolean, Automatically pull latest commit from git. Only works for scripts. |
Get the git commits for an item
reports_list_git_commits(id)
reports_list_git_commits(id)
id |
integer required. The ID of the file. |
A list containing the following elements:
commitHash |
string, The SHA of the commit. |
authorName |
string, The name of the commit's author. |
date |
string, The commit's timestamp. |
message |
string, The commit message. |
List the projects a Report belongs to
reports_list_projects(id, hidden = NULL)
reports_list_projects(id, hidden = NULL)
id |
integer required. The ID of the Report. |
boolean optional. If specified to be true, returns hidden items. Defaults to false, returning non-hidden items. |
An array containing the following fields:
id |
integer, The ID for this project. |
author |
list, A list containing the following elements:
|
name |
string, The name of this project. |
description |
string, A description of the project. |
users |
array, An array containing the following fields:
|
autoShare |
boolean, |
createdAt |
string, |
updatedAt |
string, |
archived |
string, The archival status of the requested item(s). |
List the projects a Service Report belongs to
reports_list_services_projects(id, hidden = NULL)
reports_list_services_projects(id, hidden = NULL)
id |
integer required. The ID of the Service Report. |
boolean optional. If specified to be true, returns hidden items. Defaults to false, returning non-hidden items. |
An array containing the following fields:
id |
integer, The ID for this project. |
author |
list, A list containing the following elements:
|
name |
string, The name of this project. |
description |
string, A description of the project. |
users |
array, An array containing the following fields:
|
autoShare |
boolean, |
createdAt |
string, |
updatedAt |
string, |
archived |
string, The archival status of the requested item(s). |
Update a report
reports_patch( id, name = NULL, script_id = NULL, code_body = NULL, config = NULL, app_state = NULL, provide_api_key = NULL, template_id = NULL, use_viewers_tableau_username = NULL )
reports_patch( id, name = NULL, script_id = NULL, code_body = NULL, config = NULL, app_state = NULL, provide_api_key = NULL, template_id = NULL, use_viewers_tableau_username = NULL )
id |
integer required. The ID of the report to modify. |
name |
string optional. The name of the report. |
script_id |
integer optional. The ID of the job (a script or a query) used to create this report. |
code_body |
string optional. The code for the report visualization. |
config |
string optional. |
app_state |
list optional. The application state blob for this report. |
provide_api_key |
boolean optional. Allow the report to provide an API key to front-end code. |
template_id |
integer optional. The ID of the template used for this report. If null is passed, no template will back this report. Changes to the backing template will reset the report appState. |
use_viewers_tableau_username |
boolean optional. Apply user level filtering on Tableau reports. |
A list containing the following elements:
id |
integer, The ID of this report. |
name |
string, The name of the report. |
user |
list, A list containing the following elements:
|
createdAt |
string, |
updatedAt |
string, |
projects |
array, An array containing the following fields:
|
state |
string, The status of the report's last run. |
finishedAt |
string, The time that the report's last run finished. |
vizUpdatedAt |
string, The time that the report's visualization was last updated. |
script |
list, A list containing the following elements:
|
jobPath |
string, The link to details of the job that backs this report. |
tableauId |
integer, |
type |
string, |
templateId |
integer, The ID of the template used for this report. |
authThumbnailUrl |
string, URL for a thumbnail of the report. |
lastRun |
list, A list containing the following elements:
|
archived |
string, The archival status of the requested item(s). |
hidden |
boolean, The hidden status of the item. |
authDataUrl |
string, |
authCodeUrl |
string, |
config |
string, Any configuration metadata for this report. |
validOutputFile |
boolean, Whether the job (a script or a query) that backs the report currently has a valid output file. |
provideAPIKey |
boolean, Whether the report requests an API Key from the report viewer. |
apiKey |
string, A Civis API key that can be used by this report. |
apiKeyId |
integer, The ID of the API key. Can be used for auditing API use by this report. |
appState |
list, Any application state blob for this report. |
useViewersTableauUsername |
boolean, Apply user level filtering on Tableau reports. |
Update some attributes of this service report
reports_patch_services(id, name = NULL, provide_api_key = NULL)
reports_patch_services(id, name = NULL, provide_api_key = NULL)
id |
integer required. The ID of this report. |
name |
string optional. The name of the service report. |
provide_api_key |
boolean optional. Whether the report requests an API Key from the report viewer. |
A list containing the following elements:
id |
integer, The ID of this report. |
name |
string, The name of the report. |
user |
list, A list containing the following elements:
|
createdAt |
string, |
updatedAt |
string, |
host |
string, The host for the service report |
displayUrl |
string, The URL to display the service report. |
serviceId |
integer, The id of the backing service |
provideAPIKey |
boolean, Whether the report requests an API Key from the report viewer. |
apiKey |
string, A Civis API key that can be used by this report. |
apiKeyId |
integer, The ID of the API key. Can be used for auditing API use by this report. |
Create a report
reports_post( script_id = NULL, name = NULL, code_body = NULL, app_state = NULL, provide_api_key = NULL, template_id = NULL, hidden = NULL )
reports_post( script_id = NULL, name = NULL, code_body = NULL, app_state = NULL, provide_api_key = NULL, template_id = NULL, hidden = NULL )
script_id |
integer optional. The ID of the job (a script or a query) used to create this report. |
name |
string optional. The name of the report. |
code_body |
string optional. The code for the report visualization. |
app_state |
list optional. Any application state blob for this report. |
provide_api_key |
boolean optional. Allow the report to provide an API key to front-end code. |
template_id |
integer optional. The ID of the template used for this report. |
boolean optional. The hidden status of the item. |
A list containing the following elements:
id |
integer, The ID of this report. |
name |
string, The name of the report. |
user |
list, A list containing the following elements:
|
createdAt |
string, |
updatedAt |
string, |
projects |
array, An array containing the following fields:
|
state |
string, The status of the report's last run. |
finishedAt |
string, The time that the report's last run finished. |
vizUpdatedAt |
string, The time that the report's visualization was last updated. |
script |
list, A list containing the following elements:
|
jobPath |
string, The link to details of the job that backs this report. |
tableauId |
integer, |
type |
string, |
templateId |
integer, The ID of the template used for this report. |
authThumbnailUrl |
string, URL for a thumbnail of the report. |
lastRun |
list, A list containing the following elements:
|
archived |
string, The archival status of the requested item(s). |
hidden |
boolean, The hidden status of the item. |
authDataUrl |
string, |
authCodeUrl |
string, |
config |
string, Any configuration metadata for this report. |
validOutputFile |
boolean, Whether the job (a script or a query) that backs the report currently has a valid output file. |
provideAPIKey |
boolean, Whether the report requests an API Key from the report viewer. |
apiKey |
string, A Civis API key that can be used by this report. |
apiKeyId |
integer, The ID of the API key. Can be used for auditing API use by this report. |
appState |
list, Any application state blob for this report. |
useViewersTableauUsername |
boolean, Apply user level filtering on Tableau reports. |
Commit and push a new version of the file
reports_post_git_commits(id, content, message, file_hash)
reports_post_git_commits(id, content, message, file_hash)
id |
integer required. The ID of the file. |
content |
string required. The contents to commit to the file. |
message |
string required. A commit message describing the changes being made. |
file_hash |
string required. The full SHA of the file being replaced. |
A list containing the following elements:
content |
string, The file's contents. |
type |
string, The file's type. |
size |
integer, The file's size. |
fileHash |
string, The SHA of the file. |
Grant this report the ability to perform Civis platform API operations on your behalf
reports_post_grants(id)
reports_post_grants(id)
id |
integer required. The ID of this report. |
A list containing the following elements:
id |
integer, The ID of this report. |
name |
string, The name of the report. |
user |
list, A list containing the following elements:
|
createdAt |
string, |
updatedAt |
string, |
projects |
array, An array containing the following fields:
|
state |
string, The status of the report's last run. |
finishedAt |
string, The time that the report's last run finished. |
vizUpdatedAt |
string, The time that the report's visualization was last updated. |
script |
list, A list containing the following elements:
|
jobPath |
string, The link to details of the job that backs this report. |
tableauId |
integer, |
type |
string, |
templateId |
integer, The ID of the template used for this report. |
authThumbnailUrl |
string, URL for a thumbnail of the report. |
lastRun |
list, A list containing the following elements:
|
archived |
string, The archival status of the requested item(s). |
hidden |
boolean, The hidden status of the item. |
authDataUrl |
string, |
authCodeUrl |
string, |
config |
string, Any configuration metadata for this report. |
validOutputFile |
boolean, Whether the job (a script or a query) that backs the report currently has a valid output file. |
provideAPIKey |
boolean, Whether the report requests an API Key from the report viewer. |
apiKey |
string, A Civis API key that can be used by this report. |
apiKeyId |
integer, The ID of the API key. Can be used for auditing API use by this report. |
appState |
list, Any application state blob for this report. |
useViewersTableauUsername |
boolean, Apply user level filtering on Tableau reports. |
Refresh the data in this Tableau report
reports_post_refresh(id)
reports_post_refresh(id)
id |
integer required. The ID of this report. |
A list containing the following elements:
id |
integer, The ID of this report. |
organization |
list, A list containing the following elements:
|
Create a service report
reports_post_services(service_id, provide_api_key = NULL)
reports_post_services(service_id, provide_api_key = NULL)
service_id |
integer required. The id of the backing service |
provide_api_key |
boolean optional. Whether the report requests an API Key from the report viewer. |
A list containing the following elements:
id |
integer, The ID of this report. |
name |
string, The name of the report. |
user |
list, A list containing the following elements:
|
createdAt |
string, |
updatedAt |
string, |
host |
string, The host for the service report |
displayUrl |
string, The URL to display the service report. |
serviceId |
integer, The id of the backing service |
provideAPIKey |
boolean, Whether the report requests an API Key from the report viewer. |
apiKey |
string, A Civis API key that can be used by this report. |
apiKeyId |
integer, The ID of the API key. Can be used for auditing API use by this report. |
Update the archive status of this object
reports_put_archive(id, status)
reports_put_archive(id, status)
id |
integer required. The ID of the object. |
status |
boolean required. The desired archived status of the object. |
A list containing the following elements:
id |
integer, The ID of this report. |
name |
string, The name of the report. |
user |
list, A list containing the following elements:
|
createdAt |
string, |
updatedAt |
string, |
projects |
array, An array containing the following fields:
|
state |
string, The status of the report's last run. |
finishedAt |
string, The time that the report's last run finished. |
vizUpdatedAt |
string, The time that the report's visualization was last updated. |
script |
list, A list containing the following elements:
|
jobPath |
string, The link to details of the job that backs this report. |
tableauId |
integer, |
type |
string, |
templateId |
integer, The ID of the template used for this report. |
authThumbnailUrl |
string, URL for a thumbnail of the report. |
lastRun |
list, A list containing the following elements:
|
archived |
string, The archival status of the requested item(s). |
hidden |
boolean, The hidden status of the item. |
authDataUrl |
string, |
authCodeUrl |
string, |
config |
string, Any configuration metadata for this report. |
validOutputFile |
boolean, Whether the job (a script or a query) that backs the report currently has a valid output file. |
provideAPIKey |
boolean, Whether the report requests an API Key from the report viewer. |
apiKey |
string, A Civis API key that can be used by this report. |
apiKeyId |
integer, The ID of the API key. Can be used for auditing API use by this report. |
appState |
list, Any application state blob for this report. |
useViewersTableauUsername |
boolean, Apply user level filtering on Tableau reports. |
Attach an item to a file in a git repo
reports_put_git( id, git_ref = NULL, git_branch = NULL, git_path = NULL, git_repo_url = NULL, pull_from_git = NULL )
reports_put_git( id, git_ref = NULL, git_branch = NULL, git_path = NULL, git_repo_url = NULL, pull_from_git = NULL )
id |
integer required. The ID of the file. |
git_ref |
string 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_branch |
string optional. The git branch that the file is on. |
git_path |
string optional. The path of the file in the repository. |
git_repo_url |
string optional. The URL of the git repository. |
pull_from_git |
boolean optional. Automatically pull latest commit from git. Only works for scripts. |
A list containing the following elements:
gitRef |
string, A git reference specifying an unambiguous version of the file. Can be a branch name, or the full or shortened SHA of a commit. |
gitBranch |
string, The git branch that the file is on. |
gitPath |
string, The path of the file in the repository. |
gitRepo |
list, A list containing the following elements:
|
pullFromGit |
boolean, Automatically pull latest commit from git. Only works for scripts. |
Add a Report to a project
reports_put_projects(id, project_id)
reports_put_projects(id, project_id)
id |
integer required. The ID of the Report. |
project_id |
integer required. The ID of the project. |
An empty HTTP response
Add a Service Report to a project
reports_put_services_projects(id, project_id)
reports_put_services_projects(id, project_id)
id |
integer required. The ID of the Service Report. |
project_id |
integer required. The ID of the project. |
An empty HTTP response
Evaluate an R expression in a Civis Platform container
run_civis(expr, ...)
run_civis(expr, ...)
expr |
code to evaluate |
... |
arguments to |
run_civis
blocks until completion. For non-blocking calls,
use futures directly with civis_platform
.
Attempts are made at detecting and installing necessary packages
within the container, and detecting global variables required in expr
.
Other script_utils:
civis_script()
,
fetch_output_file_ids()
,
run_template()
## Not run: run_civis(2+2) # specify required resources, and a specific image run_civis(2+2, required_resources = list(cpu = 1024, memory = 2048), docker_image_name='image', docker_image_tag = 'latest') ## End(Not run)
## Not run: run_civis(2+2) # specify required resources, and a specific image run_civis(2+2, required_resources = list(cpu = 1024, memory = 2048), docker_image_name='image', docker_image_tag = 'latest') ## End(Not run)
Run a template script
run_template(id, arguments, JSONValue = FALSE, ...)
run_template(id, arguments, JSONValue = FALSE, ...)
id |
id of the template script. |
arguments |
list of arguments to the script. |
JSONValue |
bool (default FALSE) If true, returns the JSON values instead of the file_ids |
... |
additional arguments to |
If JSONValue is FALSE, File ids of any run outputs are returned. If JSONValue is TRUE, JSON values of first JSON run output is returned. If there are no JSON outputs, warning message is printed and nothing is returned If there are more than 1 JSON outputs, warning message is printed and the first JSON output is returned.
Other script_utils:
civis_script()
,
fetch_output_file_ids()
,
run_civis()
## Not run: # Try a search for the template id search_list('template name', type = 'template_script') # Run the template run_template(id, arguments = list(arg1 = 1, arg2 = 2), ...) # Run the template and return JSON value outputs run_template(id, arguments = list(arg1 = 1, arg2 = 2), JSONValue=TRUE, ...) ## End(Not run)
## Not run: # Try a search for the template id search_list('template name', type = 'template_script') # Run the template run_template(id, arguments = list(arg1 = 1, arg2 = 2), ...) # Run the template and return JSON value outputs run_template(id, arguments = list(arg1 = 1, arg2 = 2), JSONValue=TRUE, ...) ## End(Not run)
Archive a script (deprecated, use archive endpoints instead)
scripts_delete(id)
scripts_delete(id)
id |
integer required. The ID for the script. |
An empty HTTP response
Archive a container (deprecated, use archive endpoints)
scripts_delete_containers(id)
scripts_delete_containers(id)
id |
integer required. The ID for the script. |
An empty HTTP response
Remove a Container Script from a project
scripts_delete_containers_projects(id, project_id)
scripts_delete_containers_projects(id, project_id)
id |
integer required. The ID of the Container Script. |
project_id |
integer required. The ID of the project. |
An empty HTTP response
Cancel a run
scripts_delete_containers_runs(id, run_id)
scripts_delete_containers_runs(id, run_id)
id |
integer required. The ID of the container. |
run_id |
integer required. The ID of the run. |
An empty HTTP response
Archive a Custom Script (deprecated, use archiving endpoints instead)
scripts_delete_custom(id)
scripts_delete_custom(id)
id |
integer required. |
An empty HTTP response
Remove a Custom Script from a project
scripts_delete_custom_projects(id, project_id)
scripts_delete_custom_projects(id, project_id)
id |
integer required. The ID of the Custom Script. |
project_id |
integer required. The ID of the project. |
An empty HTTP response
Cancel a run
scripts_delete_custom_runs(id, run_id)
scripts_delete_custom_runs(id, run_id)
id |
integer required. The ID of the custom. |
run_id |
integer required. The ID of the run. |
An empty HTTP response
Archive a JavaScript Script (deprecated, use archiving endpoints instead)
scripts_delete_javascript(id)
scripts_delete_javascript(id)
id |
integer required. |
An empty HTTP response
Remove a JavaScript Script from a project
scripts_delete_javascript_projects(id, project_id)
scripts_delete_javascript_projects(id, project_id)
id |
integer required. The ID of the JavaScript Script. |
project_id |
integer required. The ID of the project. |
An empty HTTP response
Cancel a run
scripts_delete_javascript_runs(id, run_id)
scripts_delete_javascript_runs(id, run_id)
id |
integer required. The ID of the javascript. |
run_id |
integer required. The ID of the run. |
An empty HTTP response
Archive a Python Script (deprecated, use archiving endpoints instead)
scripts_delete_python3(id)
scripts_delete_python3(id)
id |
integer required. |
An empty HTTP response
Remove a Python Script from a project
scripts_delete_python3_projects(id, project_id)
scripts_delete_python3_projects(id, project_id)
id |
integer required. The ID of the Python Script. |
project_id |
integer required. The ID of the project. |
An empty HTTP response
Cancel a run
scripts_delete_python3_runs(id, run_id)
scripts_delete_python3_runs(id, run_id)
id |
integer required. The ID of the python. |
run_id |
integer required. The ID of the run. |
An empty HTTP response
Archive an R Script (deprecated, use archiving endpoints instead)
scripts_delete_r(id)
scripts_delete_r(id)
id |
integer required. |
An empty HTTP response
Remove an R Script from a project
scripts_delete_r_projects(id, project_id)
scripts_delete_r_projects(id, project_id)
id |
integer required. The ID of the R Script. |
project_id |
integer required. The ID of the project. |
An empty HTTP response
Cancel a run
scripts_delete_r_runs(id, run_id)
scripts_delete_r_runs(id, run_id)
id |
integer required. The ID of the r. |
run_id |
integer required. The ID of the run. |
An empty HTTP response
Archive a SQL script (deprecated, use archiving endpoints instead)
scripts_delete_sql(id)
scripts_delete_sql(id)
id |
integer required. |
An empty HTTP response
Remove a SQL script from a project
scripts_delete_sql_projects(id, project_id)
scripts_delete_sql_projects(id, project_id)
id |
integer required. The ID of the SQL script. |
project_id |
integer required. The ID of the project. |
An empty HTTP response
Cancel a run
scripts_delete_sql_runs(id, run_id)
scripts_delete_sql_runs(id, run_id)
id |
integer required. The ID of the sql. |
run_id |
integer required. The ID of the run. |
An empty HTTP response
Get details about a script
scripts_get(id)
scripts_get(id)
id |
integer required. The ID for the script. |
A list containing the following elements:
id |
integer, The ID for the script. |
name |
string, The name of the script. |
type |
string, The type of script. |
createdAt |
string, The time this script was created. |
updatedAt |
string, The time this script was last updated. |
author |
list, A list containing the following elements:
|
state |
string, The status of the script's last run. |
finishedAt |
string, The time that the script's last run finished. |
category |
string, The category of the script. |
projects |
array, An array containing the following fields:
|
parentId |
integer, The ID of the parent job that will trigger this script |
userContext |
string, "runner" or "author", who to execute the script as when run as a template. |
params |
array, An array containing the following fields:
|
arguments |
list, Parameter-value pairs to use when running this script. Only settable if this script has defined parameters. |
isTemplate |
boolean, Whether others scripts use this one as a template. |
publishedAsTemplateId |
integer, The ID of the template that this script is backing. |
fromTemplateId |
integer, The ID of the template this script uses, if any. |
templateDependentsCount |
integer, How many other scripts use this one as a template. |
templateScriptName |
string, The name of the template script. |
links |
list, A list containing the following elements:
|
schedule |
list, A list containing the following elements:
|
notifications |
list, A list containing the following elements:
|
runningAs |
list, A list containing the following elements:
|
nextRunAt |
string, The time of the next scheduled run. |
timeZone |
string, The time zone of this script. |
lastRun |
list, A list containing the following elements:
|
hidden |
boolean, The hidden status of the item. |
targetProjectId |
integer, Target project to which script outputs will be added. |
archived |
string, The archival status of the requested item(s). |
sql |
string, The raw SQL query for the script. |
expandedArguments |
list, Expanded arguments for use in injecting into different environments. |
templateScriptId |
integer, The ID of the template script, if any. |
View a container
scripts_get_containers(id)
scripts_get_containers(id)
id |
integer required. The ID for the script. |
A list containing the following elements:
id |
integer, The ID for the script. |
name |
string, The name of the container. |
type |
string, The type of the script (e.g Container) |
createdAt |
string, The time this script was created. |
updatedAt |
string, The time the script was last updated. |
author |
list, A list containing the following elements:
|
state |
string, The status of the script's last run. |
finishedAt |
string, The time that the script's last run finished. |
category |
string, The category of the script. |
projects |
array, An array containing the following fields:
|
parentId |
integer, The ID of the parent job that will trigger this script |
userContext |
string, "runner" or "author", who to execute the script as when run as a template. |
params |
array, An array containing the following fields:
|
arguments |
list, Parameter-value pairs to use when running this script. Only settable if this script has defined parameters. |
isTemplate |
boolean, Whether others scripts use this one as a template. |
templateDependentsCount |
integer, How many other scripts use this one as a template. |
publishedAsTemplateId |
integer, The ID of the template that this script is backing. |
fromTemplateId |
integer, The ID of the template script. |
templateScriptName |
string, The name of the template script. |
links |
list, A list containing the following elements:
|
schedule |
list, A list containing the following elements:
|
notifications |
list, A list containing the following elements:
|
runningAs |
list, A list containing the following elements:
|
requiredResources |
list, A list containing the following elements:
|
repoHttpUri |
string, The location of a github repo to clone into the container, e.g. github.com/my-user/my-repo.git. |
repoRef |
string, The tag or branch of the github repo to clone into the container. |
remoteHostCredentialId |
integer, The id of the database credentials to pass into the environment of the container. |
gitCredentialId |
integer, The id of the git credential to be used when checking out the specified git repo. If not supplied, the first git credential you've submitted will be used. Unnecessary if no git repo is specified or the git repo is public. |
dockerCommand |
string, The command to run on the container. Will be run via sh as: ["sh", "-c", dockerCommand]. Defaults to the Docker image's ENTRYPOINT/CMD. |
dockerImageName |
string, The name of the docker image to pull from DockerHub. |
dockerImageTag |
string, The tag of the docker image to pull from DockerHub. |
instanceType |
string, The EC2 instance type to deploy to. Only available for jobs running on kubernetes. |
cancelTimeout |
integer, 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. |
lastRun |
list, A list containing the following elements:
|
timeZone |
string, The time zone of this script. |
hidden |
boolean, The hidden status of the item. |
archived |
string, The archival status of the requested item(s). |
targetProjectId |
integer, Target project to which script outputs will be added. |
Check status of a run
scripts_get_containers_runs(id, run_id)
scripts_get_containers_runs(id, run_id)
id |
integer required. The ID of the container. |
run_id |
integer required. The ID of the run. |
A list containing the following elements:
id |
integer, The ID of the run. |
containerId |
integer, The ID of the container. |
state |
string, The state of the run, one of 'queued' 'running' 'succeeded' 'failed' or 'cancelled'. |
isCancelRequested |
boolean, True if run cancel requested, else false. |
startedAt |
string, The time the last run started at. |
finishedAt |
string, The time the last run completed. |
error |
string, The error, if any, returned by the run. |
Get a Custom Script
scripts_get_custom(id)
scripts_get_custom(id)
id |
integer required. |
A list containing the following elements:
id |
integer, The ID for the script. |
name |
string, The name of the script. |
type |
string, The type of the script (e.g Custom) |
createdAt |
string, The time this script was created. |
updatedAt |
string, The time the script was last updated. |
author |
list, A list containing the following elements:
|
state |
string, The status of the script's last run. |
finishedAt |
string, The time that the script's last run finished. |
category |
string, |
projects |
array, An array containing the following fields:
|
parentId |
integer, The ID of the parent job that will trigger this script |
params |
array, An array containing the following fields:
|
arguments |
list, Parameter-value pairs to use when running this script. Only settable if this script has defined parameters. |
isTemplate |
boolean, Whether others scripts use this one as a template. |
publishedAsTemplateId |
integer, The ID of the template that this script is backing. |
fromTemplateId |
integer, The ID of the template script. |
uiReportUrl |
integer, The url of the custom HTML. |
uiReportId |
integer, The id of the report with the custom HTML. |
uiReportProvideAPIKey |
boolean, Whether the ui report requests an API Key from the report viewer. |
templateScriptName |
string, The name of the template script. |
templateNote |
string, The template's note. |
remoteHostId |
integer, The remote host ID that this script will connect to. |
credentialId |
integer, The credential that this script will use. |
codePreview |
string, The code that this script will run with arguments inserted. |
schedule |
list, A list containing the following elements:
|
notifications |
list, A list containing the following elements:
|
runningAs |
list, A list containing the following elements:
|
timeZone |
string, The time zone of this script. |
lastRun |
list, A list containing the following elements:
|
hidden |
boolean, The hidden status of the item. |
archived |
string, The archival status of the requested item(s). |
targetProjectId |
integer, Target project to which script outputs will be added. |
lastSuccessfulRun |
list, A list containing the following elements:
|
Check status of a run
scripts_get_custom_runs(id, run_id)
scripts_get_custom_runs(id, run_id)
id |
integer required. The ID of the custom. |
run_id |
integer required. The ID of the run. |
A list containing the following elements:
id |
integer, The ID of the run. |
customId |
integer, The ID of the custom. |
state |
string, The state of the run, one of 'queued' 'running' 'succeeded' 'failed' or 'cancelled'. |
isCancelRequested |
boolean, True if run cancel requested, else false. |
startedAt |
string, The time the last run started at. |
finishedAt |
string, The time the last run completed. |
error |
string, The error, if any, returned by the run. |
Get a JavaScript Script
scripts_get_javascript(id)
scripts_get_javascript(id)
id |
integer required. |
A list containing the following elements:
id |
integer, The ID for the script. |
name |
string, The name of the script. |
type |
string, The type of the script (e.g SQL, Container, Python, R, JavaScript) |
createdAt |
string, The time this script was created. |
updatedAt |
string, The time the script was last updated. |
author |
list, A list containing the following elements:
|
state |
string, The status of the script's last run. |
finishedAt |
string, The time that the script's last run finished. |
category |
string, The category of the script. |
projects |
array, An array containing the following fields:
|
parentId |
integer, The ID of the parent job that will trigger this script |
userContext |
string, "runner" or "author", who to execute the script as when run as a template. |
params |
array, An array containing the following fields:
|
arguments |
list, Parameter-value pairs to use when running this script. Only settable if this script has defined parameters. |
isTemplate |
boolean, Whether others scripts use this one as a template. |
publishedAsTemplateId |
integer, The ID of the template that this script is backing. |
fromTemplateId |
integer, The ID of the template this script uses, if any. |
templateDependentsCount |
integer, How many other scripts use this one as a template. |
templateScriptName |
string, The name of the template script. |
links |
list, A list containing the following elements:
|
schedule |
list, A list containing the following elements:
|
notifications |
list, A list containing the following elements:
|
runningAs |
list, A list containing the following elements:
|
nextRunAt |
string, The time of the next scheduled run. |
timeZone |
string, The time zone of this script. |
lastRun |
list, A list containing the following elements:
|
hidden |
boolean, The hidden status of the item. |
targetProjectId |
integer, Target project to which script outputs will be added. |
archived |
string, The archival status of the requested item(s). |
source |
string, The body/text of the script. |
remoteHostId |
integer, The remote host ID that this script will connect to. |
credentialId |
integer, The credential that this script will use. |
Get file contents at commit_hash
scripts_get_javascript_git_commits(id, commit_hash)
scripts_get_javascript_git_commits(id, commit_hash)
id |
integer required. The ID of the file. |
commit_hash |
string required. The SHA (full or shortened) of the desired git commit. |
A list containing the following elements:
content |
string, The file's contents. |
type |
string, The file's type. |
size |
integer, The file's size. |
fileHash |
string, The SHA of the file. |
Check status of a run
scripts_get_javascript_runs(id, run_id)
scripts_get_javascript_runs(id, run_id)
id |
integer required. The ID of the javascript. |
run_id |
integer required. The ID of the run. |
A list containing the following elements:
id |
integer, The ID of the run. |
javascriptId |
integer, The ID of the javascript. |
state |
string, The state of the run, one of 'queued' 'running' 'succeeded' 'failed' or 'cancelled'. |
isCancelRequested |
boolean, True if run cancel requested, else false. |
startedAt |
string, The time the last run started at. |
finishedAt |
string, The time the last run completed. |
error |
string, The error, if any, returned by the run. |
Get a Python Script
scripts_get_python3(id)
scripts_get_python3(id)
id |
integer required. |
A list containing the following elements:
id |
integer, The ID for the script. |
name |
string, The name of the script. |
type |
string, The type of the script (e.g SQL, Container, Python, R, JavaScript) |
createdAt |
string, The time this script was created. |
updatedAt |
string, The time the script was last updated. |
author |
list, A list containing the following elements:
|
state |
string, The status of the script's last run. |
finishedAt |
string, The time that the script's last run finished. |
category |
string, The category of the script. |
projects |
array, An array containing the following fields:
|
parentId |
integer, The ID of the parent job that will trigger this script |
userContext |
string, "runner" or "author", who to execute the script as when run as a template. |
params |
array, An array containing the following fields:
|
arguments |
list, Parameter-value pairs to use when running this script. Only settable if this script has defined parameters. |
isTemplate |
boolean, Whether others scripts use this one as a template. |
publishedAsTemplateId |
integer, The ID of the template that this script is backing. |
fromTemplateId |
integer, The ID of the template this script uses, if any. |
templateDependentsCount |
integer, How many other scripts use this one as a template. |
templateScriptName |
string, The name of the template script. |
links |
list, A list containing the following elements:
|
schedule |
list, A list containing the following elements:
|
notifications |
list, A list containing the following elements:
|
runningAs |
list, A list containing the following elements:
|
nextRunAt |
string, The time of the next scheduled run. |
timeZone |
string, The time zone of this script. |
lastRun |
list, A list containing the following elements:
|
hidden |
boolean, The hidden status of the item. |
targetProjectId |
integer, Target project to which script outputs will be added. |
archived |
string, The archival status of the requested item(s). |
requiredResources |
list, A list containing the following elements:
|
instanceType |
string, The EC2 instance type to deploy to. Only available for jobs running on kubernetes. |
source |
string, The body/text of the script. |
cancelTimeout |
integer, 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. |
dockerImageTag |
string, The tag of the docker image to pull from DockerHub. |
Get file contents at commit_hash
scripts_get_python3_git_commits(id, commit_hash)
scripts_get_python3_git_commits(id, commit_hash)
id |
integer required. The ID of the file. |
commit_hash |
string required. The SHA (full or shortened) of the desired git commit. |
A list containing the following elements:
content |
string, The file's contents. |
type |
string, The file's type. |
size |
integer, The file's size. |
fileHash |
string, The SHA of the file. |
Check status of a run
scripts_get_python3_runs(id, run_id)
scripts_get_python3_runs(id, run_id)
id |
integer required. The ID of the python. |
run_id |
integer required. The ID of the run. |
A list containing the following elements:
id |
integer, The ID of the run. |
pythonId |
integer, The ID of the python. |
state |
string, The state of the run, one of 'queued' 'running' 'succeeded' 'failed' or 'cancelled'. |
isCancelRequested |
boolean, True if run cancel requested, else false. |
startedAt |
string, The time the last run started at. |
finishedAt |
string, The time the last run completed. |
error |
string, The error, if any, returned by the run. |
Get an R Script
scripts_get_r(id)
scripts_get_r(id)
id |
integer required. |
A list containing the following elements:
id |
integer, The ID for the script. |
name |
string, The name of the script. |
type |
string, The type of the script (e.g SQL, Container, Python, R, JavaScript) |
createdAt |
string, The time this script was created. |
updatedAt |
string, The time the script was last updated. |
author |
list, A list containing the following elements:
|
state |
string, The status of the script's last run. |
finishedAt |
string, The time that the script's last run finished. |
category |
string, The category of the script. |
projects |
array, An array containing the following fields:
|
parentId |
integer, The ID of the parent job that will trigger this script |
userContext |
string, "runner" or "author", who to execute the script as when run as a template. |
params |
array, An array containing the following fields:
|
arguments |
list, Parameter-value pairs to use when running this script. Only settable if this script has defined parameters. |
isTemplate |
boolean, Whether others scripts use this one as a template. |
publishedAsTemplateId |
integer, The ID of the template that this script is backing. |
fromTemplateId |
integer, The ID of the template this script uses, if any. |
templateDependentsCount |
integer, How many other scripts use this one as a template. |
templateScriptName |
string, The name of the template script. |
links |
list, A list containing the following elements:
|
schedule |
list, A list containing the following elements:
|
notifications |
list, A list containing the following elements:
|
runningAs |
list, A list containing the following elements:
|
nextRunAt |
string, The time of the next scheduled run. |
timeZone |
string, The time zone of this script. |
lastRun |
list, A list containing the following elements:
|
hidden |
boolean, The hidden status of the item. |
targetProjectId |
integer, Target project to which script outputs will be added. |
archived |
string, The archival status of the requested item(s). |
requiredResources |
list, A list containing the following elements:
|
instanceType |
string, The EC2 instance type to deploy to. Only available for jobs running on kubernetes. |
source |
string, The body/text of the script. |
cancelTimeout |
integer, 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. |
dockerImageTag |
string, The tag of the docker image to pull from DockerHub. |
Get file contents at commit_hash
scripts_get_r_git_commits(id, commit_hash)
scripts_get_r_git_commits(id, commit_hash)
id |
integer required. The ID of the file. |
commit_hash |
string required. The SHA (full or shortened) of the desired git commit. |
A list containing the following elements:
content |
string, The file's contents. |
type |
string, The file's type. |
size |
integer, The file's size. |
fileHash |
string, The SHA of the file. |
Check status of a run
scripts_get_r_runs(id, run_id)
scripts_get_r_runs(id, run_id)
id |
integer required. The ID of the r. |
run_id |
integer required. The ID of the run. |
A list containing the following elements:
id |
integer, The ID of the run. |
rId |
integer, The ID of the r. |
state |
string, The state of the run, one of 'queued' 'running' 'succeeded' 'failed' or 'cancelled'. |
isCancelRequested |
boolean, True if run cancel requested, else false. |
startedAt |
string, The time the last run started at. |
finishedAt |
string, The time the last run completed. |
error |
string, The error, if any, returned by the run. |
Get a SQL script
scripts_get_sql(id)
scripts_get_sql(id)
id |
integer required. |
A list containing the following elements:
id |
integer, The ID for the script. |
name |
string, The name of the script. |
type |
string, The type of the script (e.g SQL, Container, Python, R, JavaScript) |
createdAt |
string, The time this script was created. |
updatedAt |
string, The time the script was last updated. |
author |
list, A list containing the following elements:
|
state |
string, The status of the script's last run. |
finishedAt |
string, The time that the script's last run finished. |
category |
string, The category of the script. |
projects |
array, An array containing the following fields:
|
parentId |
integer, The ID of the parent job that will trigger this script |
userContext |
string, "runner" or "author", who to execute the script as when run as a template. |
params |
array, An array containing the following fields:
|
arguments |
list, Parameter-value pairs to use when running this script. Only settable if this script has defined parameters. |
isTemplate |
boolean, Whether others scripts use this one as a template. |
publishedAsTemplateId |
integer, The ID of the template that this script is backing. |
fromTemplateId |
integer, The ID of the template this script uses, if any. |
templateDependentsCount |
integer, How many other scripts use this one as a template. |
templateScriptName |
string, The name of the template script. |
links |
list, A list containing the following elements:
|
schedule |
list, A list containing the following elements:
|
notifications |
list, A list containing the following elements:
|
runningAs |
list, A list containing the following elements:
|
nextRunAt |
string, The time of the next scheduled run. |
timeZone |
string, The time zone of this script. |
lastRun |
list, A list containing the following elements:
|
hidden |
boolean, The hidden status of the item. |
targetProjectId |
integer, Target project to which script outputs will be added. |
archived |
string, The archival status of the requested item(s). |
sql |
string, The raw SQL query for the script. |
expandedArguments |
list, Expanded arguments for use in injecting into different environments. |
remoteHostId |
integer, The remote host ID that this script will connect to. |
credentialId |
integer, The credential that this script will use. |
codePreview |
string, The code that this script will run with arguments inserted. |
csvSettings |
list, A list containing the following elements:
|
Get file contents at commit_hash
scripts_get_sql_git_commits(id, commit_hash)
scripts_get_sql_git_commits(id, commit_hash)
id |
integer required. The ID of the file. |
commit_hash |
string required. The SHA (full or shortened) of the desired git commit. |
A list containing the following elements:
content |
string, The file's contents. |
type |
string, The file's type. |
size |
integer, The file's size. |
fileHash |
string, The SHA of the file. |
Check status of a run
scripts_get_sql_runs(id, run_id)
scripts_get_sql_runs(id, run_id)
id |
integer required. The ID of the sql. |
run_id |
integer required. The ID of the run. |
A list containing the following elements:
id |
integer, The ID of this run. |
sqlId |
integer, The ID of this sql. |
state |
string, The state of this run. |
isCancelRequested |
boolean, True if run cancel requested, else false. |
startedAt |
string, The time the last run started. |
finishedAt |
string, The time that this run finished. |
error |
string, The error message for this run, if present. |
output |
array, An array containing the following fields:
|
List Scripts
scripts_list( type = NULL, category = NULL, author = NULL, status = NULL, hidden = NULL, archived = NULL, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
scripts_list( type = NULL, category = NULL, author = NULL, status = NULL, hidden = NULL, archived = NULL, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
type |
string optional. If specified, return items of these types. The valid types are sql, python3, javascript, r, and containers. |
category |
string optional. A job category for filtering scripts. Must be one of script, import, export, and enhancement. |
author |
string optional. If specified, return items from this author. Must use user IDs. A comma separated list of IDs is also accepted to return items from multiple authors. |
status |
string optional. If specified, returns items with one of these statuses. It accepts a comma-separated list, possible values are 'running', 'failed', 'succeeded', 'idle', 'scheduled'. |
boolean optional. If specified to be true, returns hidden items. Defaults to false, returning non-hidden items. |
|
archived |
string optional. The archival status of the requested item(s). |
limit |
integer optional. Number of results to return. Defaults to 20. Maximum allowed is 50. |
page_num |
integer optional. Page number of the results to return. Defaults to the first page, 1. |
order |
string optional. The field on which to order the result set. Defaults to updated_at. Must be one of: updated_at, name, created_at, last_run.updated_at. |
order_dir |
string optional. Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc. |
An array containing the following fields:
id |
integer, The ID for the script. |
name |
string, The name of the script. |
type |
string, The type of the script (e.g SQL, Container, Python, R, JavaScript) |
createdAt |
string, The time this script was created. |
updatedAt |
string, The time the script was last updated. |
author |
list, A list containing the following elements:
|
state |
string, The status of the script's last run. |
finishedAt |
string, The time that the script's last run finished. |
projects |
array, An array containing the following fields:
|
parentId |
integer, The ID of the parent job that will trigger this script |
isTemplate |
boolean, Whether others scripts use this one as a template. |
fromTemplateId |
integer, The ID of the template this script uses, if any. |
links |
list, A list containing the following elements:
|
timeZone |
string, The time zone of this script. |
lastRun |
list, A list containing the following elements:
|
archived |
string, The archival status of the requested item(s). |
templateScriptId |
integer, The ID of the template script, if any. |
List the projects a Container Script belongs to
scripts_list_containers_projects(id, hidden = NULL)
scripts_list_containers_projects(id, hidden = NULL)
id |
integer required. The ID of the Container Script. |
boolean optional. If specified to be true, returns hidden items. Defaults to false, returning non-hidden items. |
An array containing the following fields:
id |
integer, The ID for this project. |
author |
list, A list containing the following elements:
|
name |
string, The name of this project. |
description |
string, A description of the project. |
users |
array, An array containing the following fields:
|
autoShare |
boolean, |
createdAt |
string, |
updatedAt |
string, |
archived |
string, The archival status of the requested item(s). |
List runs for the given container
scripts_list_containers_runs( id, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
scripts_list_containers_runs( id, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
id |
integer required. The ID of the container. |
limit |
integer optional. Number of results to return. Defaults to 20. Maximum allowed is 100. |
page_num |
integer optional. Page number of the results to return. Defaults to the first page, 1. |
order |
string optional. The field on which to order the result set. Defaults to id. Must be one of: id. |
order_dir |
string optional. Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc. |
An array containing the following fields:
id |
integer, The ID of the run. |
containerId |
integer, The ID of the container. |
state |
string, The state of the run, one of 'queued' 'running' 'succeeded' 'failed' or 'cancelled'. |
isCancelRequested |
boolean, True if run cancel requested, else false. |
startedAt |
string, The time the last run started at. |
finishedAt |
string, The time the last run completed. |
error |
string, The error, if any, returned by the run. |
Get the logs for a run
scripts_list_containers_runs_logs(id, run_id, last_id = NULL, limit = NULL)
scripts_list_containers_runs_logs(id, run_id, last_id = NULL, limit = NULL)
id |
integer required. The ID of the container. |
run_id |
integer required. The ID of the run. |
last_id |
integer optional. The ID of the last log message received. Log entries with this ID value or lower will be omitted.Logs are sorted by ID if this value is provided, and are otherwise sorted by createdAt. |
limit |
integer optional. The maximum number of log messages to return. Default of 10000. |
An array containing the following fields:
id |
integer, The ID of the log. |
createdAt |
string, The time the log was created. |
message |
string, The log message. |
level |
string, The level of the log. One of unknown,fatal,error,warn,info,debug. |
List the outputs for a run
scripts_list_containers_runs_outputs( id, run_id, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
scripts_list_containers_runs_outputs( id, run_id, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
id |
integer required. The ID of the container script. |
run_id |
integer required. The ID of the run. |
limit |
integer optional. Number of results to return. Defaults to its maximum of 50. |
page_num |
integer optional. Page number of the results to return. Defaults to the first page, 1. |
order |
string optional. The field on which to order the result set. Defaults to created_at. Must be one of: created_at, id. |
order_dir |
string optional. Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc. |
An array containing the following fields:
objectType |
string, The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue |
objectId |
integer, The ID of the output. |
name |
string, The name of the output. |
link |
string, The hypermedia link to the output. |
value |
string, |
List Custom Scripts
scripts_list_custom( from_template_id = NULL, author = NULL, status = NULL, hidden = NULL, archived = NULL, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
scripts_list_custom( from_template_id = NULL, author = NULL, status = NULL, hidden = NULL, archived = NULL, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
from_template_id |
string optional. If specified, return scripts based on the template with this ID. Specify multiple IDs as a comma-separated list. |
author |
string optional. If specified, return items from this author. Must use user IDs. A comma separated list of IDs is also accepted to return items from multiple authors. |
status |
string optional. If specified, returns items with one of these statuses. It accepts a comma-separated list, possible values are 'running', 'failed', 'succeeded', 'idle', 'scheduled'. |
boolean optional. If specified to be true, returns hidden items. Defaults to false, returning non-hidden items. |
|
archived |
string optional. The archival status of the requested item(s). |
limit |
integer optional. Number of results to return. Defaults to its maximum of 50. |
page_num |
integer optional. Page number of the results to return. Defaults to the first page, 1. |
order |
string optional. The field on which to order the result set. Defaults to updated_at. Must be one of: updated_at, name, created_at. |
order_dir |
string optional. Direction in which to sort, either asc (ascending) or desc (descending) defaulting to asc. |
An array containing the following fields:
id |
integer, The ID for the script. |
name |
string, The name of the script. |
type |
string, The type of the script (e.g Custom) |
createdAt |
string, The time this script was created. |
updatedAt |
string, The time the script was last updated. |
author |
list, A list containing the following elements:
|
state |
string, The status of the script's last run. |
finishedAt |
string, The time that the script's last run finished. |
projects |
array, An array containing the following fields:
|
parentId |
integer, The ID of the parent job that will trigger this script |
fromTemplateId |
integer, The ID of the template script. |
timeZone |
string, The time zone of this script. |
lastRun |
list, A list containing the following elements:
|
archived |
string, The archival status of the requested item(s). |
lastSuccessfulRun |
list, A list containing the following elements:
|
List the projects a Custom Script belongs to
scripts_list_custom_projects(id, hidden = NULL)
scripts_list_custom_projects(id, hidden = NULL)
id |
integer required. The ID of the Custom Script. |
boolean optional. If specified to be true, returns hidden items. Defaults to false, returning non-hidden items. |
An array containing the following fields:
id |
integer, The ID for this project. |
author |
list, A list containing the following elements:
|
name |
string, The name of this project. |
description |
string, A description of the project. |
users |
array, An array containing the following fields:
|
autoShare |
boolean, |
createdAt |
string, |
updatedAt |
string, |
archived |
string, The archival status of the requested item(s). |
List runs for the given custom
scripts_list_custom_runs( id, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
scripts_list_custom_runs( id, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
id |
integer required. The ID of the custom. |
limit |
integer optional. Number of results to return. Defaults to 20. Maximum allowed is 100. |
page_num |
integer optional. Page number of the results to return. Defaults to the first page, 1. |
order |
string optional. The field on which to order the result set. Defaults to id. Must be one of: id. |
order_dir |
string optional. Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc. |
An array containing the following fields:
id |
integer, The ID of the run. |
customId |
integer, The ID of the custom. |
state |
string, The state of the run, one of 'queued' 'running' 'succeeded' 'failed' or 'cancelled'. |
isCancelRequested |
boolean, True if run cancel requested, else false. |
startedAt |
string, The time the last run started at. |
finishedAt |
string, The time the last run completed. |
error |
string, The error, if any, returned by the run. |
Get the logs for a run
scripts_list_custom_runs_logs(id, run_id, last_id = NULL, limit = NULL)
scripts_list_custom_runs_logs(id, run_id, last_id = NULL, limit = NULL)
id |
integer required. The ID of the custom. |
run_id |
integer required. The ID of the run. |
last_id |
integer optional. The ID of the last log message received. Log entries with this ID value or lower will be omitted.Logs are sorted by ID if this value is provided, and are otherwise sorted by createdAt. |
limit |
integer optional. The maximum number of log messages to return. Default of 10000. |
An array containing the following fields:
id |
integer, The ID of the log. |
createdAt |
string, The time the log was created. |
message |
string, The log message. |
level |
string, The level of the log. One of unknown,fatal,error,warn,info,debug. |
List the outputs for a run
scripts_list_custom_runs_outputs( id, run_id, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
scripts_list_custom_runs_outputs( id, run_id, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
id |
integer required. The ID of the custom script. |
run_id |
integer required. The ID of the run. |
limit |
integer optional. Number of results to return. Defaults to its maximum of 50. |
page_num |
integer optional. Page number of the results to return. Defaults to the first page, 1. |
order |
string optional. The field on which to order the result set. Defaults to created_at. Must be one of: created_at, id. |
order_dir |
string optional. Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc. |
An array containing the following fields:
objectType |
string, The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue |
objectId |
integer, The ID of the output. |
name |
string, The name of the output. |
link |
string, The hypermedia link to the output. |
value |
string, |
Get the run history and outputs of this script
scripts_list_history(id)
scripts_list_history(id)
id |
integer required. The ID for the script. |
A list containing the following elements:
id |
integer, The ID of this run. |
sqlId |
integer, The ID of this sql. |
state |
string, The state of this run. |
isCancelRequested |
boolean, True if run cancel requested, else false. |
finishedAt |
string, The time that this run finished. |
error |
string, The error message for this run, if present. |
output |
array, An array containing the following fields:
|
Get the git metadata attached to an item
scripts_list_javascript_git(id)
scripts_list_javascript_git(id)
id |
integer required. The ID of the file. |
A list containing the following elements:
gitRef |
string, A git reference specifying an unambiguous version of the file. Can be a branch name, or the full or shortened SHA of a commit. |
gitBranch |
string, The git branch that the file is on. |
gitPath |
string, The path of the file in the repository. |
gitRepo |
list, A list containing the following elements:
|
pullFromGit |
boolean, Automatically pull latest commit from git. Only works for scripts. |
Get the git commits for an item
scripts_list_javascript_git_commits(id)
scripts_list_javascript_git_commits(id)
id |
integer required. The ID of the file. |
A list containing the following elements:
commitHash |
string, The SHA of the commit. |
authorName |
string, The name of the commit's author. |
date |
string, The commit's timestamp. |
message |
string, The commit message. |
List the projects a JavaScript Script belongs to
scripts_list_javascript_projects(id, hidden = NULL)
scripts_list_javascript_projects(id, hidden = NULL)
id |
integer required. The ID of the JavaScript Script. |
boolean optional. If specified to be true, returns hidden items. Defaults to false, returning non-hidden items. |
An array containing the following fields:
id |
integer, The ID for this project. |
author |
list, A list containing the following elements:
|
name |
string, The name of this project. |
description |
string, A description of the project. |
users |
array, An array containing the following fields:
|
autoShare |
boolean, |
createdAt |
string, |
updatedAt |
string, |
archived |
string, The archival status of the requested item(s). |
List runs for the given javascript
scripts_list_javascript_runs( id, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
scripts_list_javascript_runs( id, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
id |
integer required. The ID of the javascript. |
limit |
integer optional. Number of results to return. Defaults to 20. Maximum allowed is 100. |
page_num |
integer optional. Page number of the results to return. Defaults to the first page, 1. |
order |
string optional. The field on which to order the result set. Defaults to id. Must be one of: id. |
order_dir |
string optional. Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc. |
An array containing the following fields:
id |
integer, The ID of the run. |
javascriptId |
integer, The ID of the javascript. |
state |
string, The state of the run, one of 'queued' 'running' 'succeeded' 'failed' or 'cancelled'. |
isCancelRequested |
boolean, True if run cancel requested, else false. |
startedAt |
string, The time the last run started at. |
finishedAt |
string, The time the last run completed. |
error |
string, The error, if any, returned by the run. |
Get the logs for a run
scripts_list_javascript_runs_logs(id, run_id, last_id = NULL, limit = NULL)
scripts_list_javascript_runs_logs(id, run_id, last_id = NULL, limit = NULL)
id |
integer required. The ID of the javascript. |
run_id |
integer required. The ID of the run. |
last_id |
integer optional. The ID of the last log message received. Log entries with this ID value or lower will be omitted.Logs are sorted by ID if this value is provided, and are otherwise sorted by createdAt. |
limit |
integer optional. The maximum number of log messages to return. Default of 10000. |
An array containing the following fields:
id |
integer, The ID of the log. |
createdAt |
string, The time the log was created. |
message |
string, The log message. |
level |
string, The level of the log. One of unknown,fatal,error,warn,info,debug. |
List the outputs for a run
scripts_list_javascript_runs_outputs( id, run_id, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
scripts_list_javascript_runs_outputs( id, run_id, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
id |
integer required. The ID of the javascript script. |
run_id |
integer required. The ID of the run. |
limit |
integer optional. Number of results to return. Defaults to its maximum of 50. |
page_num |
integer optional. Page number of the results to return. Defaults to the first page, 1. |
order |
string optional. The field on which to order the result set. Defaults to created_at. Must be one of: created_at, id. |
order_dir |
string optional. Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc. |
An array containing the following fields:
objectType |
string, The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue |
objectId |
integer, The ID of the output. |
name |
string, The name of the output. |
link |
string, The hypermedia link to the output. |
value |
string, |
Get the git metadata attached to an item
scripts_list_python3_git(id)
scripts_list_python3_git(id)
id |
integer required. The ID of the file. |
A list containing the following elements:
gitRef |
string, A git reference specifying an unambiguous version of the file. Can be a branch name, or the full or shortened SHA of a commit. |
gitBranch |
string, The git branch that the file is on. |
gitPath |
string, The path of the file in the repository. |
gitRepo |
list, A list containing the following elements:
|
pullFromGit |
boolean, Automatically pull latest commit from git. Only works for scripts. |
Get the git commits for an item
scripts_list_python3_git_commits(id)
scripts_list_python3_git_commits(id)
id |
integer required. The ID of the file. |
A list containing the following elements:
commitHash |
string, The SHA of the commit. |
authorName |
string, The name of the commit's author. |
date |
string, The commit's timestamp. |
message |
string, The commit message. |
List the projects a Python Script belongs to
scripts_list_python3_projects(id, hidden = NULL)
scripts_list_python3_projects(id, hidden = NULL)
id |
integer required. The ID of the Python Script. |
boolean optional. If specified to be true, returns hidden items. Defaults to false, returning non-hidden items. |
An array containing the following fields:
id |
integer, The ID for this project. |
author |
list, A list containing the following elements:
|
name |
string, The name of this project. |
description |
string, A description of the project. |
users |
array, An array containing the following fields:
|
autoShare |
boolean, |
createdAt |
string, |
updatedAt |
string, |
archived |
string, The archival status of the requested item(s). |
List runs for the given python
scripts_list_python3_runs( id, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
scripts_list_python3_runs( id, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
id |
integer required. The ID of the python. |
limit |
integer optional. Number of results to return. Defaults to 20. Maximum allowed is 100. |
page_num |
integer optional. Page number of the results to return. Defaults to the first page, 1. |
order |
string optional. The field on which to order the result set. Defaults to id. Must be one of: id. |
order_dir |
string optional. Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc. |
An array containing the following fields:
id |
integer, The ID of the run. |
pythonId |
integer, The ID of the python. |
state |
string, The state of the run, one of 'queued' 'running' 'succeeded' 'failed' or 'cancelled'. |
isCancelRequested |
boolean, True if run cancel requested, else false. |
startedAt |
string, The time the last run started at. |
finishedAt |
string, The time the last run completed. |
error |
string, The error, if any, returned by the run. |
Get the logs for a run
scripts_list_python3_runs_logs(id, run_id, last_id = NULL, limit = NULL)
scripts_list_python3_runs_logs(id, run_id, last_id = NULL, limit = NULL)
id |
integer required. The ID of the python. |
run_id |
integer required. The ID of the run. |
last_id |
integer optional. The ID of the last log message received. Log entries with this ID value or lower will be omitted.Logs are sorted by ID if this value is provided, and are otherwise sorted by createdAt. |
limit |
integer optional. The maximum number of log messages to return. Default of 10000. |
An array containing the following fields:
id |
integer, The ID of the log. |
createdAt |
string, The time the log was created. |
message |
string, The log message. |
level |
string, The level of the log. One of unknown,fatal,error,warn,info,debug. |
List the outputs for a run
scripts_list_python3_runs_outputs( id, run_id, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
scripts_list_python3_runs_outputs( id, run_id, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
id |
integer required. The ID of the python script. |
run_id |
integer required. The ID of the run. |
limit |
integer optional. Number of results to return. Defaults to its maximum of 50. |
page_num |
integer optional. Page number of the results to return. Defaults to the first page, 1. |
order |
string optional. The field on which to order the result set. Defaults to created_at. Must be one of: created_at, id. |
order_dir |
string optional. Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc. |
An array containing the following fields:
objectType |
string, The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue |
objectId |
integer, The ID of the output. |
name |
string, The name of the output. |
link |
string, The hypermedia link to the output. |
value |
string, |
Get the git metadata attached to an item
scripts_list_r_git(id)
scripts_list_r_git(id)
id |
integer required. The ID of the file. |
A list containing the following elements:
gitRef |
string, A git reference specifying an unambiguous version of the file. Can be a branch name, or the full or shortened SHA of a commit. |
gitBranch |
string, The git branch that the file is on. |
gitPath |
string, The path of the file in the repository. |
gitRepo |
list, A list containing the following elements:
|
pullFromGit |
boolean, Automatically pull latest commit from git. Only works for scripts. |
Get the git commits for an item
scripts_list_r_git_commits(id)
scripts_list_r_git_commits(id)
id |
integer required. The ID of the file. |
A list containing the following elements:
commitHash |
string, The SHA of the commit. |
authorName |
string, The name of the commit's author. |
date |
string, The commit's timestamp. |
message |
string, The commit message. |
List the projects an R Script belongs to
scripts_list_r_projects(id, hidden = NULL)
scripts_list_r_projects(id, hidden = NULL)
id |
integer required. The ID of the R Script. |
boolean optional. If specified to be true, returns hidden items. Defaults to false, returning non-hidden items. |
An array containing the following fields:
id |
integer, The ID for this project. |
author |
list, A list containing the following elements:
|
name |
string, The name of this project. |
description |
string, A description of the project. |
users |
array, An array containing the following fields:
|
autoShare |
boolean, |
createdAt |
string, |
updatedAt |
string, |
archived |
string, The archival status of the requested item(s). |
List runs for the given r
scripts_list_r_runs( id, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
scripts_list_r_runs( id, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
id |
integer required. The ID of the r. |
limit |
integer optional. Number of results to return. Defaults to 20. Maximum allowed is 100. |
page_num |
integer optional. Page number of the results to return. Defaults to the first page, 1. |
order |
string optional. The field on which to order the result set. Defaults to id. Must be one of: id. |
order_dir |
string optional. Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc. |
An array containing the following fields:
id |
integer, The ID of the run. |
rId |
integer, The ID of the r. |
state |
string, The state of the run, one of 'queued' 'running' 'succeeded' 'failed' or 'cancelled'. |
isCancelRequested |
boolean, True if run cancel requested, else false. |
startedAt |
string, The time the last run started at. |
finishedAt |
string, The time the last run completed. |
error |
string, The error, if any, returned by the run. |
Get the logs for a run
scripts_list_r_runs_logs(id, run_id, last_id = NULL, limit = NULL)
scripts_list_r_runs_logs(id, run_id, last_id = NULL, limit = NULL)
id |
integer required. The ID of the r. |
run_id |
integer required. The ID of the run. |
last_id |
integer optional. The ID of the last log message received. Log entries with this ID value or lower will be omitted.Logs are sorted by ID if this value is provided, and are otherwise sorted by createdAt. |
limit |
integer optional. The maximum number of log messages to return. Default of 10000. |
An array containing the following fields:
id |
integer, The ID of the log. |
createdAt |
string, The time the log was created. |
message |
string, The log message. |
level |
string, The level of the log. One of unknown,fatal,error,warn,info,debug. |
List the outputs for a run
scripts_list_r_runs_outputs( id, run_id, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
scripts_list_r_runs_outputs( id, run_id, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
id |
integer required. The ID of the r script. |
run_id |
integer required. The ID of the run. |
limit |
integer optional. Number of results to return. Defaults to its maximum of 50. |
page_num |
integer optional. Page number of the results to return. Defaults to the first page, 1. |
order |
string optional. The field on which to order the result set. Defaults to created_at. Must be one of: created_at, id. |
order_dir |
string optional. Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc. |
An array containing the following fields:
objectType |
string, The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue |
objectId |
integer, The ID of the output. |
name |
string, The name of the output. |
link |
string, The hypermedia link to the output. |
value |
string, |
Get the git metadata attached to an item
scripts_list_sql_git(id)
scripts_list_sql_git(id)
id |
integer required. The ID of the file. |
A list containing the following elements:
gitRef |
string, A git reference specifying an unambiguous version of the file. Can be a branch name, or the full or shortened SHA of a commit. |
gitBranch |
string, The git branch that the file is on. |
gitPath |
string, The path of the file in the repository. |
gitRepo |
list, A list containing the following elements:
|
pullFromGit |
boolean, Automatically pull latest commit from git. Only works for scripts. |
Get the git commits for an item
scripts_list_sql_git_commits(id)
scripts_list_sql_git_commits(id)
id |
integer required. The ID of the file. |
A list containing the following elements:
commitHash |
string, The SHA of the commit. |
authorName |
string, The name of the commit's author. |
date |
string, The commit's timestamp. |
message |
string, The commit message. |
List the projects a SQL script belongs to
scripts_list_sql_projects(id, hidden = NULL)
scripts_list_sql_projects(id, hidden = NULL)
id |
integer required. The ID of the SQL script. |
boolean optional. If specified to be true, returns hidden items. Defaults to false, returning non-hidden items. |
An array containing the following fields:
id |
integer, The ID for this project. |
author |
list, A list containing the following elements:
|
name |
string, The name of this project. |
description |
string, A description of the project. |
users |
array, An array containing the following fields:
|
autoShare |
boolean, |
createdAt |
string, |
updatedAt |
string, |
archived |
string, The archival status of the requested item(s). |
List runs for the given sql
scripts_list_sql_runs( id, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
scripts_list_sql_runs( id, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
id |
integer required. The ID of the sql. |
limit |
integer optional. Number of results to return. Defaults to 20. Maximum allowed is 100. |
page_num |
integer optional. Page number of the results to return. Defaults to the first page, 1. |
order |
string optional. The field on which to order the result set. Defaults to id. Must be one of: id. |
order_dir |
string optional. Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc. |
An array containing the following fields:
id |
integer, The ID of this run. |
sqlId |
integer, The ID of this sql. |
state |
string, The state of this run. |
isCancelRequested |
boolean, True if run cancel requested, else false. |
startedAt |
string, The time the last run started. |
finishedAt |
string, The time that this run finished. |
error |
string, The error message for this run, if present. |
output |
array, An array containing the following fields:
|
Get the logs for a run
scripts_list_sql_runs_logs(id, run_id, last_id = NULL, limit = NULL)
scripts_list_sql_runs_logs(id, run_id, last_id = NULL, limit = NULL)
id |
integer required. The ID of the sql. |
run_id |
integer required. The ID of the run. |
last_id |
integer optional. The ID of the last log message received. Log entries with this ID value or lower will be omitted.Logs are sorted by ID if this value is provided, and are otherwise sorted by createdAt. |
limit |
integer optional. The maximum number of log messages to return. Default of 10000. |
An array containing the following fields:
id |
integer, The ID of the log. |
createdAt |
string, The time the log was created. |
message |
string, The log message. |
level |
string, The level of the log. One of unknown,fatal,error,warn,info,debug. |
List the outputs for a run
scripts_list_sql_runs_outputs( id, run_id, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
scripts_list_sql_runs_outputs( id, run_id, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
id |
integer required. The ID of the sql script. |
run_id |
integer required. The ID of the run. |
limit |
integer optional. Number of results to return. Defaults to its maximum of 50. |
page_num |
integer optional. Page number of the results to return. Defaults to the first page, 1. |
order |
string optional. The field on which to order the result set. Defaults to created_at. Must be one of: created_at, id. |
order_dir |
string optional. Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc. |
An array containing the following fields:
objectType |
string, The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue |
objectId |
integer, The ID of the output. |
name |
string, The name of the output. |
link |
string, The hypermedia link to the output. |
value |
string, |
List available script types
scripts_list_types()
scripts_list_types()
An array containing the following fields:
name |
string, The name of the type. |
Update a script
scripts_patch( id, name = NULL, sql = NULL, params = NULL, arguments = NULL, template_script_id = NULL, schedule = NULL, notifications = NULL, parent_id = NULL )
scripts_patch( id, name = NULL, sql = NULL, params = NULL, arguments = NULL, template_script_id = NULL, schedule = NULL, notifications = NULL, parent_id = NULL )
id |
integer required. The ID for the script. |
name |
string optional. The name of the script. |
sql |
string optional. The raw SQL query for the script. |
params |
array optional. An array containing the following fields:
|
arguments |
list optional. Parameter-value pairs to use when running this script. Only settable if this script has defined parameters. |
template_script_id |
integer optional. The ID of the template script, if any. A script cannot both have a template script and be a template for other scripts. |
schedule |
list optional. A list containing the following elements:
|
notifications |
list optional. A list containing the following elements:
|
parent_id |
integer optional. The ID of the parent job that will trigger this script |
A list containing the following elements:
id |
integer, The ID for the script. |
name |
string, The name of the script. |
type |
string, The type of script. |
createdAt |
string, The time this script was created. |
updatedAt |
string, The time this script was last updated. |
author |
list, A list containing the following elements:
|
state |
string, The status of the script's last run. |
finishedAt |
string, The time that the script's last run finished. |
category |
string, The category of the script. |
projects |
array, An array containing the following fields:
|
parentId |
integer, The ID of the parent job that will trigger this script |
userContext |
string, "runner" or "author", who to execute the script as when run as a template. |
params |
array, An array containing the following fields:
|
arguments |
list, Parameter-value pairs to use when running this script. Only settable if this script has defined parameters. |
isTemplate |
boolean, Whether others scripts use this one as a template. |
publishedAsTemplateId |
integer, The ID of the template that this script is backing. |
fromTemplateId |
integer, The ID of the template this script uses, if any. |
templateDependentsCount |
integer, How many other scripts use this one as a template. |
templateScriptName |
string, The name of the template script. |
links |
list, A list containing the following elements:
|
schedule |
list, A list containing the following elements:
|
notifications |
list, A list containing the following elements:
|
runningAs |
list, A list containing the following elements:
|
nextRunAt |
string, The time of the next scheduled run. |
timeZone |
string, The time zone of this script. |
lastRun |
list, A list containing the following elements:
|
hidden |
boolean, The hidden status of the item. |
targetProjectId |
integer, Target project to which script outputs will be added. |
archived |
string, The archival status of the requested item(s). |
sql |
string, The raw SQL query for the script. |
expandedArguments |
list, Expanded arguments for use in injecting into different environments. |
templateScriptId |
integer, The ID of the template script, if any. |
Update a container
scripts_patch_containers( id, name = NULL, parent_id = NULL, user_context = NULL, params = NULL, arguments = NULL, schedule = NULL, notifications = NULL, required_resources = NULL, repo_http_uri = NULL, repo_ref = NULL, remote_host_credential_id = NULL, git_credential_id = NULL, docker_command = NULL, docker_image_name = NULL, docker_image_tag = NULL, instance_type = NULL, cancel_timeout = NULL, time_zone = NULL, target_project_id = NULL )
scripts_patch_containers( id, name = NULL, parent_id = NULL, user_context = NULL, params = NULL, arguments = NULL, schedule = NULL, notifications = NULL, required_resources = NULL, repo_http_uri = NULL, repo_ref = NULL, remote_host_credential_id = NULL, git_credential_id = NULL, docker_command = NULL, docker_image_name = NULL, docker_image_tag = NULL, instance_type = NULL, cancel_timeout = NULL, time_zone = NULL, target_project_id = NULL )
id |
integer required. The ID for the script. |
name |
string optional. The name of the container. |
parent_id |
integer optional. The ID of the parent job that will trigger this script |
user_context |
string optional. "runner" or "author", who to execute the script as when run as a template. |
params |
array optional. An array containing the following fields:
|
arguments |
list optional. Parameter-value pairs to use when running this script. Only settable if this script has defined parameters. |
schedule |
list optional. A list containing the following elements:
|
notifications |
list optional. A list containing the following elements:
|
required_resources |
list optional. A list containing the following elements:
|
repo_http_uri |
string optional. The location of a github repo to clone into the container, e.g. github.com/my-user/my-repo.git. |
repo_ref |
string optional. The tag or branch of the github repo to clone into the container. |
remote_host_credential_id |
integer optional. The id of the database credentials to pass into the environment of the container. |
git_credential_id |
integer optional. The id of the git credential to be used when checking out the specified git repo. If not supplied, the first git credential you've submitted will be used. Unnecessary if no git repo is specified or the git repo is public. |
docker_command |
string 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_name |
string optional. The name of the docker image to pull from DockerHub. |
docker_image_tag |
string optional. The tag of the docker image to pull from DockerHub. |
instance_type |
string optional. The EC2 instance type to deploy to. Only available for jobs running on kubernetes. |
cancel_timeout |
integer 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_zone |
string optional. The time zone of this script. |
target_project_id |
integer optional. Target project to which script outputs will be added. |
A list containing the following elements:
id |
integer, The ID for the script. |
name |
string, The name of the container. |
type |
string, The type of the script (e.g Container) |
createdAt |
string, The time this script was created. |
updatedAt |
string, The time the script was last updated. |
author |
list, A list containing the following elements:
|
state |
string, The status of the script's last run. |
finishedAt |
string, The time that the script's last run finished. |
category |
string, The category of the script. |
projects |
array, An array containing the following fields:
|
parentId |
integer, The ID of the parent job that will trigger this script |
userContext |
string, "runner" or "author", who to execute the script as when run as a template. |
params |
array, An array containing the following fields:
|
arguments |
list, Parameter-value pairs to use when running this script. Only settable if this script has defined parameters. |
isTemplate |
boolean, Whether others scripts use this one as a template. |
templateDependentsCount |
integer, How many other scripts use this one as a template. |
publishedAsTemplateId |
integer, The ID of the template that this script is backing. |
fromTemplateId |
integer, The ID of the template script. |
templateScriptName |
string, The name of the template script. |
links |
list, A list containing the following elements:
|
schedule |
list, A list containing the following elements:
|
notifications |
list, A list containing the following elements:
|
runningAs |
list, A list containing the following elements:
|
requiredResources |
list, A list containing the following elements:
|
repoHttpUri |
string, The location of a github repo to clone into the container, e.g. github.com/my-user/my-repo.git. |
repoRef |
string, The tag or branch of the github repo to clone into the container. |
remoteHostCredentialId |
integer, The id of the database credentials to pass into the environment of the container. |
gitCredentialId |
integer, The id of the git credential to be used when checking out the specified git repo. If not supplied, the first git credential you've submitted will be used. Unnecessary if no git repo is specified or the git repo is public. |
dockerCommand |
string, The command to run on the container. Will be run via sh as: ["sh", "-c", dockerCommand]. Defaults to the Docker image's ENTRYPOINT/CMD. |
dockerImageName |
string, The name of the docker image to pull from DockerHub. |
dockerImageTag |
string, The tag of the docker image to pull from DockerHub. |
instanceType |
string, The EC2 instance type to deploy to. Only available for jobs running on kubernetes. |
cancelTimeout |
integer, 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. |
lastRun |
list, A list containing the following elements:
|
timeZone |
string, The time zone of this script. |
hidden |
boolean, The hidden status of the item. |
archived |
string, The archival status of the requested item(s). |
targetProjectId |
integer, Target project to which script outputs will be added. |
Update some attributes of this Custom Script
scripts_patch_custom( id, name = NULL, parent_id = NULL, arguments = NULL, remote_host_id = NULL, credential_id = NULL, schedule = NULL, notifications = NULL, time_zone = NULL, target_project_id = NULL )
scripts_patch_custom( id, name = NULL, parent_id = NULL, arguments = NULL, remote_host_id = NULL, credential_id = NULL, schedule = NULL, notifications = NULL, time_zone = NULL, target_project_id = NULL )
id |
integer required. The ID for the script. |
name |
string optional. The name of the script. |
parent_id |
integer optional. The ID of the parent job that will trigger this script |
arguments |
list optional. Parameter-value pairs to use when running this script. Only settable if this script has defined parameters. |
remote_host_id |
integer optional. The remote host ID that this script will connect to. |
credential_id |
integer optional. The credential that this script will use. |
schedule |
list optional. A list containing the following elements:
|
notifications |
list optional. A list containing the following elements:
|
time_zone |
string optional. The time zone of this script. |
target_project_id |
integer optional. Target project to which script outputs will be added. |
A list containing the following elements:
id |
integer, The ID for the script. |
name |
string, The name of the script. |
type |
string, The type of the script (e.g Custom) |
createdAt |
string, The time this script was created. |
updatedAt |
string, The time the script was last updated. |
author |
list, A list containing the following elements:
|
state |
string, The status of the script's last run. |
finishedAt |
string, The time that the script's last run finished. |
category |
string, |
projects |
array, An array containing the following fields:
|
parentId |
integer, The ID of the parent job that will trigger this script |
params |
array, An array containing the following fields:
|
arguments |
list, Parameter-value pairs to use when running this script. Only settable if this script has defined parameters. |
isTemplate |
boolean, Whether others scripts use this one as a template. |
publishedAsTemplateId |
integer, The ID of the template that this script is backing. |
fromTemplateId |
integer, The ID of the template script. |
uiReportUrl |
integer, The url of the custom HTML. |
uiReportId |
integer, The id of the report with the custom HTML. |
uiReportProvideAPIKey |
boolean, Whether the ui report requests an API Key from the report viewer. |
templateScriptName |
string, The name of the template script. |
templateNote |
string, The template's note. |
remoteHostId |
integer, The remote host ID that this script will connect to. |
credentialId |
integer, The credential that this script will use. |
codePreview |
string, The code that this script will run with arguments inserted. |
schedule |
list, A list containing the following elements:
|
notifications |
list, A list containing the following elements:
|
runningAs |
list, A list containing the following elements:
|
timeZone |
string, The time zone of this script. |
lastRun |
list, A list containing the following elements:
|
hidden |
boolean, The hidden status of the item. |
archived |
string, The archival status of the requested item(s). |
targetProjectId |
integer, Target project to which script outputs will be added. |
lastSuccessfulRun |
list, A list containing the following elements:
|
Update some attributes of this JavaScript Script
scripts_patch_javascript( id, name = NULL, parent_id = NULL, user_context = NULL, params = NULL, arguments = NULL, schedule = NULL, notifications = NULL, next_run_at = NULL, time_zone = NULL, target_project_id = NULL, source = NULL, remote_host_id = NULL, credential_id = NULL )
scripts_patch_javascript( id, name = NULL, parent_id = NULL, user_context = NULL, params = NULL, arguments = NULL, schedule = NULL, notifications = NULL, next_run_at = NULL, time_zone = NULL, target_project_id = NULL, source = NULL, remote_host_id = NULL, credential_id = NULL )
id |
integer required. The ID for the script. |
name |
string optional. The name of the script. |
parent_id |
integer optional. The ID of the parent job that will trigger this script |
user_context |
string optional. "runner" or "author", who to execute the script as when run as a template. |
params |
array optional. An array containing the following fields:
|
arguments |
list optional. Parameter-value pairs to use when running this script. Only settable if this script has defined parameters. |
schedule |
list optional. A list containing the following elements:
|
notifications |
list optional. A list containing the following elements:
|
next_run_at |
string optional. The time of the next scheduled run. |
time_zone |
string optional. The time zone of this script. |
target_project_id |
integer optional. Target project to which script outputs will be added. |
source |
string optional. The body/text of the script. |
remote_host_id |
integer optional. The remote host ID that this script will connect to. |
credential_id |
integer optional. The credential that this script will use. |
A list containing the following elements:
id |
integer, The ID for the script. |
name |
string, The name of the script. |
type |
string, The type of the script (e.g SQL, Container, Python, R, JavaScript) |
createdAt |
string, The time this script was created. |
updatedAt |
string, The time the script was last updated. |
author |
list, A list containing the following elements:
|
state |
string, The status of the script's last run. |
finishedAt |
string, The time that the script's last run finished. |
category |
string, The category of the script. |
projects |
array, An array containing the following fields:
|
parentId |
integer, The ID of the parent job that will trigger this script |
userContext |
string, "runner" or "author", who to execute the script as when run as a template. |
params |
array, An array containing the following fields:
|
arguments |
list, Parameter-value pairs to use when running this script. Only settable if this script has defined parameters. |
isTemplate |
boolean, Whether others scripts use this one as a template. |
publishedAsTemplateId |
integer, The ID of the template that this script is backing. |
fromTemplateId |
integer, The ID of the template this script uses, if any. |
templateDependentsCount |
integer, How many other scripts use this one as a template. |
templateScriptName |
string, The name of the template script. |
links |
list, A list containing the following elements:
|
schedule |
list, A list containing the following elements:
|
notifications |
list, A list containing the following elements:
|
runningAs |
list, A list containing the following elements:
|
nextRunAt |
string, The time of the next scheduled run. |
timeZone |
string, The time zone of this script. |
lastRun |
list, A list containing the following elements:
|
hidden |
boolean, The hidden status of the item. |
targetProjectId |
integer, Target project to which script outputs will be added. |
archived |
string, The archival status of the requested item(s). |
source |
string, The body/text of the script. |
remoteHostId |
integer, The remote host ID that this script will connect to. |
credentialId |
integer, The credential that this script will use. |
Update some attributes of this Python Script
scripts_patch_python3( id, name = NULL, parent_id = NULL, user_context = NULL, params = NULL, arguments = NULL, schedule = NULL, notifications = NULL, next_run_at = NULL, time_zone = NULL, target_project_id = NULL, required_resources = NULL, instance_type = NULL, source = NULL, cancel_timeout = NULL, docker_image_tag = NULL )
scripts_patch_python3( id, name = NULL, parent_id = NULL, user_context = NULL, params = NULL, arguments = NULL, schedule = NULL, notifications = NULL, next_run_at = NULL, time_zone = NULL, target_project_id = NULL, required_resources = NULL, instance_type = NULL, source = NULL, cancel_timeout = NULL, docker_image_tag = NULL )
id |
integer required. The ID for the script. |
name |
string optional. The name of the script. |
parent_id |
integer optional. The ID of the parent job that will trigger this script |
user_context |
string optional. "runner" or "author", who to execute the script as when run as a template. |
params |
array optional. An array containing the following fields:
|
arguments |
list optional. Parameter-value pairs to use when running this script. Only settable if this script has defined parameters. |
schedule |
list optional. A list containing the following elements:
|
notifications |
list optional. A list containing the following elements:
|
next_run_at |
string optional. The time of the next scheduled run. |
time_zone |
string optional. The time zone of this script. |
target_project_id |
integer optional. Target project to which script outputs will be added. |
required_resources |
list optional. A list containing the following elements:
|
instance_type |
string optional. The EC2 instance type to deploy to. Only available for jobs running on kubernetes. |
source |
string optional. The body/text of the script. |
cancel_timeout |
integer 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_tag |
string optional. The tag of the docker image to pull from DockerHub. |
A list containing the following elements:
id |
integer, The ID for the script. |
name |
string, The name of the script. |
type |
string, The type of the script (e.g SQL, Container, Python, R, JavaScript) |
createdAt |
string, The time this script was created. |
updatedAt |
string, The time the script was last updated. |
author |
list, A list containing the following elements:
|
state |
string, The status of the script's last run. |
finishedAt |
string, The time that the script's last run finished. |
category |
string, The category of the script. |
projects |
array, An array containing the following fields:
|
parentId |
integer, The ID of the parent job that will trigger this script |
userContext |
string, "runner" or "author", who to execute the script as when run as a template. |
params |
array, An array containing the following fields:
|
arguments |
list, Parameter-value pairs to use when running this script. Only settable if this script has defined parameters. |
isTemplate |
boolean, Whether others scripts use this one as a template. |
publishedAsTemplateId |
integer, The ID of the template that this script is backing. |
fromTemplateId |
integer, The ID of the template this script uses, if any. |
templateDependentsCount |
integer, How many other scripts use this one as a template. |
templateScriptName |
string, The name of the template script. |
links |
list, A list containing the following elements:
|
schedule |
list, A list containing the following elements:
|
notifications |
list, A list containing the following elements:
|
runningAs |
list, A list containing the following elements:
|
nextRunAt |
string, The time of the next scheduled run. |
timeZone |
string, The time zone of this script. |
lastRun |
list, A list containing the following elements:
|
hidden |
boolean, The hidden status of the item. |
targetProjectId |
integer, Target project to which script outputs will be added. |
archived |
string, The archival status of the requested item(s). |
requiredResources |
list, A list containing the following elements:
|
instanceType |
string, The EC2 instance type to deploy to. Only available for jobs running on kubernetes. |
source |
string, The body/text of the script. |
cancelTimeout |
integer, 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. |
dockerImageTag |
string, The tag of the docker image to pull from DockerHub. |
Update some attributes of this R Script
scripts_patch_r( id, name = NULL, parent_id = NULL, user_context = NULL, params = NULL, arguments = NULL, schedule = NULL, notifications = NULL, next_run_at = NULL, time_zone = NULL, target_project_id = NULL, required_resources = NULL, instance_type = NULL, source = NULL, cancel_timeout = NULL, docker_image_tag = NULL )
scripts_patch_r( id, name = NULL, parent_id = NULL, user_context = NULL, params = NULL, arguments = NULL, schedule = NULL, notifications = NULL, next_run_at = NULL, time_zone = NULL, target_project_id = NULL, required_resources = NULL, instance_type = NULL, source = NULL, cancel_timeout = NULL, docker_image_tag = NULL )
id |
integer required. The ID for the script. |
name |
string optional. The name of the script. |
parent_id |
integer optional. The ID of the parent job that will trigger this script |
user_context |
string optional. "runner" or "author", who to execute the script as when run as a template. |
params |
array optional. An array containing the following fields:
|
arguments |
list optional. Parameter-value pairs to use when running this script. Only settable if this script has defined parameters. |
schedule |
list optional. A list containing the following elements:
|
notifications |
list optional. A list containing the following elements:
|
next_run_at |
string optional. The time of the next scheduled run. |
time_zone |
string optional. The time zone of this script. |
target_project_id |
integer optional. Target project to which script outputs will be added. |
required_resources |
list optional. A list containing the following elements:
|
instance_type |
string optional. The EC2 instance type to deploy to. Only available for jobs running on kubernetes. |
source |
string optional. The body/text of the script. |
cancel_timeout |
integer 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_tag |
string optional. The tag of the docker image to pull from DockerHub. |
A list containing the following elements:
id |
integer, The ID for the script. |
name |
string, The name of the script. |
type |
string, The type of the script (e.g SQL, Container, Python, R, JavaScript) |
createdAt |
string, The time this script was created. |
updatedAt |
string, The time the script was last updated. |
author |
list, A list containing the following elements:
|
state |
string, The status of the script's last run. |
finishedAt |
string, The time that the script's last run finished. |
category |
string, The category of the script. |
projects |
array, An array containing the following fields:
|
parentId |
integer, The ID of the parent job that will trigger this script |
userContext |
string, "runner" or "author", who to execute the script as when run as a template. |
params |
array, An array containing the following fields:
|
arguments |
list, Parameter-value pairs to use when running this script. Only settable if this script has defined parameters. |
isTemplate |
boolean, Whether others scripts use this one as a template. |
publishedAsTemplateId |
integer, The ID of the template that this script is backing. |
fromTemplateId |
integer, The ID of the template this script uses, if any. |
templateDependentsCount |
integer, How many other scripts use this one as a template. |
templateScriptName |
string, The name of the template script. |
links |
list, A list containing the following elements:
|
schedule |
list, A list containing the following elements:
|
notifications |
list, A list containing the following elements:
|
runningAs |
list, A list containing the following elements:
|
nextRunAt |
string, The time of the next scheduled run. |
timeZone |
string, The time zone of this script. |
lastRun |
list, A list containing the following elements:
|
hidden |
boolean, The hidden status of the item. |
targetProjectId |
integer, Target project to which script outputs will be added. |
archived |
string, The archival status of the requested item(s). |
requiredResources |
list, A list containing the following elements:
|
instanceType |
string, The EC2 instance type to deploy to. Only available for jobs running on kubernetes. |
source |
string, The body/text of the script. |
cancelTimeout |
integer, 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. |
dockerImageTag |
string, The tag of the docker image to pull from DockerHub. |
Update some attributes of this SQL script
scripts_patch_sql( id, name = NULL, parent_id = NULL, user_context = NULL, params = NULL, arguments = NULL, schedule = NULL, notifications = NULL, next_run_at = NULL, time_zone = NULL, target_project_id = NULL, sql = NULL, remote_host_id = NULL, credential_id = NULL, csv_settings = NULL )
scripts_patch_sql( id, name = NULL, parent_id = NULL, user_context = NULL, params = NULL, arguments = NULL, schedule = NULL, notifications = NULL, next_run_at = NULL, time_zone = NULL, target_project_id = NULL, sql = NULL, remote_host_id = NULL, credential_id = NULL, csv_settings = NULL )
id |
integer required. The ID for the script. |
name |
string optional. The name of the script. |
parent_id |
integer optional. The ID of the parent job that will trigger this script |
user_context |
string optional. "runner" or "author", who to execute the script as when run as a template. |
params |
array optional. An array containing the following fields:
|
arguments |
list optional. Parameter-value pairs to use when running this script. Only settable if this script has defined parameters. |
schedule |
list optional. A list containing the following elements:
|
notifications |
list optional. A list containing the following elements:
|
next_run_at |
string optional. The time of the next scheduled run. |
time_zone |
string optional. The time zone of this script. |
target_project_id |
integer optional. Target project to which script outputs will be added. |
sql |
string optional. The raw SQL query for the script. |
remote_host_id |
integer optional. The remote host ID that this script will connect to. |
credential_id |
integer optional. The credential that this script will use. |
csv_settings |
list optional. A list containing the following elements:
|
A list containing the following elements:
id |
integer, The ID for the script. |
name |
string, The name of the script. |
type |
string, The type of the script (e.g SQL, Container, Python, R, JavaScript) |
createdAt |
string, The time this script was created. |
updatedAt |
string, The time the script was last updated. |
author |
list, A list containing the following elements:
|
state |
string, The status of the script's last run. |
finishedAt |
string, The time that the script's last run finished. |
category |
string, The category of the script. |
projects |
array, An array containing the following fields:
|
parentId |
integer, The ID of the parent job that will trigger this script |
userContext |
string, "runner" or "author", who to execute the script as when run as a template. |
params |
array, An array containing the following fields:
|
arguments |
list, Parameter-value pairs to use when running this script. Only settable if this script has defined parameters. |
isTemplate |
boolean, Whether others scripts use this one as a template. |
publishedAsTemplateId |
integer, The ID of the template that this script is backing. |
fromTemplateId |
integer, The ID of the template this script uses, if any. |
templateDependentsCount |
integer, How many other scripts use this one as a template. |
templateScriptName |
string, The name of the template script. |
links |
list, A list containing the following elements:
|
schedule |
list, A list containing the following elements:
|
notifications |
list, A list containing the following elements:
|
runningAs |
list, A list containing the following elements:
|
nextRunAt |
string, The time of the next scheduled run. |
timeZone |
string, The time zone of this script. |
lastRun |
list, A list containing the following elements:
|
hidden |
boolean, The hidden status of the item. |
targetProjectId |
integer, Target project to which script outputs will be added. |
archived |
string, The archival status of the requested item(s). |
sql |
string, The raw SQL query for the script. |
expandedArguments |
list, Expanded arguments for use in injecting into different environments. |
remoteHostId |
integer, The remote host ID that this script will connect to. |
credentialId |
integer, The credential that this script will use. |
codePreview |
string, The code that this script will run with arguments inserted. |
csvSettings |
list, A list containing the following elements:
|
Create a script
scripts_post( name, remote_host_id, credential_id, sql, params = NULL, arguments = NULL, template_script_id = NULL, notifications = NULL, hidden = NULL )
scripts_post( name, remote_host_id, credential_id, sql, params = NULL, arguments = NULL, template_script_id = NULL, notifications = NULL, hidden = NULL )
name |
string required. The name of the script. |
remote_host_id |
integer required. The database ID. |
credential_id |
integer required. The credential ID. |
sql |
string required. The raw SQL query for the script. |
params |
array optional. An array containing the following fields:
|
arguments |
list optional. Parameter-value pairs to use when running this script. Only settable if this script has defined parameters. |
template_script_id |
integer optional. The ID of the template script, if any. A script cannot both have a template script and be a template for other scripts. |
notifications |
list optional. A list containing the following elements:
|
boolean optional. The hidden status of the item. |
A list containing the following elements:
id |
integer, The ID for the script. |
name |
string, The name of the script. |
type |
string, The type of the script (e.g SQL, Container, Python, R, JavaScript) |
createdAt |
string, The time this script was created. |
updatedAt |
string, The time the script was last updated. |
author |
list, A list containing the following elements:
|
state |
string, The status of the script's last run. |
finishedAt |
string, The time that the script's last run finished. |
category |
string, The category of the script. |
projects |
array, An array containing the following fields:
|
parentId |
integer, The ID of the parent job that will trigger this script |
userContext |
string, "runner" or "author", who to execute the script as when run as a template. |
params |
array, An array containing the following fields:
|
arguments |
list, Parameter-value pairs to use when running this script. Only settable if this script has defined parameters. |
isTemplate |
boolean, Whether others scripts use this one as a template. |
publishedAsTemplateId |
integer, The ID of the template that this script is backing. |
fromTemplateId |
integer, The ID of the template this script uses, if any. |
templateDependentsCount |
integer, How many other scripts use this one as a template. |
templateScriptName |
string, The name of the template script. |
links |
list, A list containing the following elements:
|
schedule |
list, A list containing the following elements:
|
notifications |
list, A list containing the following elements:
|
runningAs |
list, A list containing the following elements:
|
nextRunAt |
string, The time of the next scheduled run. |
timeZone |
string, The time zone of this script. |
lastRun |
list, A list containing the following elements:
|
hidden |
boolean, The hidden status of the item. |
targetProjectId |
integer, Target project to which script outputs will be added. |
archived |
string, The archival status of the requested item(s). |
templateScriptId |
integer, The ID of the template script, if any. |
Cancel a run
scripts_post_cancel(id)
scripts_post_cancel(id)
id |
integer required. The ID of the job. |
A list containing the following elements:
id |
integer, The ID of the run. |
state |
string, The state of the run, one of 'queued', 'running' or 'cancelled'. |
isCancelRequested |
boolean, True if run cancel requested, else false. |
Create a container
scripts_post_containers( required_resources, docker_image_name, name = NULL, parent_id = NULL, user_context = NULL, params = NULL, arguments = NULL, schedule = NULL, notifications = NULL, repo_http_uri = NULL, repo_ref = NULL, remote_host_credential_id = NULL, git_credential_id = NULL, docker_command = NULL, docker_image_tag = NULL, instance_type = NULL, cancel_timeout = NULL, time_zone = NULL, hidden = NULL, target_project_id = NULL )
scripts_post_containers( required_resources, docker_image_name, name = NULL, parent_id = NULL, user_context = NULL, params = NULL, arguments = NULL, schedule = NULL, notifications = NULL, repo_http_uri = NULL, repo_ref = NULL, remote_host_credential_id = NULL, git_credential_id = NULL, docker_command = NULL, docker_image_tag = NULL, instance_type = NULL, cancel_timeout = NULL, time_zone = NULL, hidden = NULL, target_project_id = NULL )
required_resources |
list required. A list containing the following elements:
|
docker_image_name |
string required. The name of the docker image to pull from DockerHub. |
name |
string optional. The name of the container. |
parent_id |
integer optional. The ID of the parent job that will trigger this script |
user_context |
string optional. "runner" or "author", who to execute the script as when run as a template. |
params |
array optional. An array containing the following fields:
|
arguments |
list optional. Parameter-value pairs to use when running this script. Only settable if this script has defined parameters. |
schedule |
list optional. A list containing the following elements:
|
notifications |
list optional. A list containing the following elements:
|
repo_http_uri |
string optional. The location of a github repo to clone into the container, e.g. github.com/my-user/my-repo.git. |
repo_ref |
string optional. The tag or branch of the github repo to clone into the container. |
remote_host_credential_id |
integer optional. The id of the database credentials to pass into the environment of the container. |
git_credential_id |
integer optional. The id of the git credential to be used when checking out the specified git repo. If not supplied, the first git credential you've submitted will be used. Unnecessary if no git repo is specified or the git repo is public. |
docker_command |
string 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_tag |
string optional. The tag of the docker image to pull from DockerHub. |
instance_type |
string optional. The EC2 instance type to deploy to. Only available for jobs running on kubernetes. |
cancel_timeout |
integer 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_zone |
string optional. The time zone of this script. |
boolean optional. The hidden status of the item. |
|
target_project_id |
integer optional. Target project to which script outputs will be added. |
A list containing the following elements:
id |
integer, The ID for the script. |
name |
string, The name of the container. |
type |
string, The type of the script (e.g Container) |
createdAt |
string, The time this script was created. |
updatedAt |
string, The time the script was last updated. |
author |
list, A list containing the following elements:
|
state |
string, The status of the script's last run. |
finishedAt |
string, The time that the script's last run finished. |
category |
string, The category of the script. |
projects |
array, An array containing the following fields:
|
parentId |
integer, The ID of the parent job that will trigger this script |
userContext |
string, "runner" or "author", who to execute the script as when run as a template. |
params |
array, An array containing the following fields:
|
arguments |
list, Parameter-value pairs to use when running this script. Only settable if this script has defined parameters. |
isTemplate |
boolean, Whether others scripts use this one as a template. |
templateDependentsCount |
integer, How many other scripts use this one as a template. |
publishedAsTemplateId |
integer, The ID of the template that this script is backing. |
fromTemplateId |
integer, The ID of the template script. |
templateScriptName |
string, The name of the template script. |
links |
list, A list containing the following elements:
|
schedule |
list, A list containing the following elements:
|
notifications |
list, A list containing the following elements:
|
runningAs |
list, A list containing the following elements:
|
requiredResources |
list, A list containing the following elements:
|
repoHttpUri |
string, The location of a github repo to clone into the container, e.g. github.com/my-user/my-repo.git. |
repoRef |
string, The tag or branch of the github repo to clone into the container. |
remoteHostCredentialId |
integer, The id of the database credentials to pass into the environment of the container. |
gitCredentialId |
integer, The id of the git credential to be used when checking out the specified git repo. If not supplied, the first git credential you've submitted will be used. Unnecessary if no git repo is specified or the git repo is public. |
dockerCommand |
string, The command to run on the container. Will be run via sh as: ["sh", "-c", dockerCommand]. Defaults to the Docker image's ENTRYPOINT/CMD. |
dockerImageName |
string, The name of the docker image to pull from DockerHub. |
dockerImageTag |
string, The tag of the docker image to pull from DockerHub. |
instanceType |
string, The EC2 instance type to deploy to. Only available for jobs running on kubernetes. |
cancelTimeout |
integer, 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. |
lastRun |
list, A list containing the following elements:
|
timeZone |
string, The time zone of this script. |
hidden |
boolean, The hidden status of the item. |
archived |
string, The archival status of the requested item(s). |
targetProjectId |
integer, Target project to which script outputs will be added. |
Clone this Container Script
scripts_post_containers_clone( id, clone_schedule = NULL, clone_triggers = NULL, clone_notifications = NULL )
scripts_post_containers_clone( id, clone_schedule = NULL, clone_triggers = NULL, clone_notifications = NULL )
id |
integer required. The ID for the script. |
clone_schedule |
boolean optional. If true, also copy the schedule to the new script. |
clone_triggers |
boolean optional. If true, also copy the triggers to the new script. |
clone_notifications |
boolean optional. If true, also copy the notifications to the new script. |
A list containing the following elements:
id |
integer, The ID for the script. |
name |
string, The name of the container. |
type |
string, The type of the script (e.g Container) |
createdAt |
string, The time this script was created. |
updatedAt |
string, The time the script was last updated. |
author |
list, A list containing the following elements:
|
state |
string, The status of the script's last run. |
finishedAt |
string, The time that the script's last run finished. |
category |
string, The category of the script. |
projects |
array, An array containing the following fields:
|
parentId |
integer, The ID of the parent job that will trigger this script |
userContext |
string, "runner" or "author", who to execute the script as when run as a template. |
params |
array, An array containing the following fields:
|
arguments |
list, Parameter-value pairs to use when running this script. Only settable if this script has defined parameters. |
isTemplate |
boolean, Whether others scripts use this one as a template. |
templateDependentsCount |
integer, How many other scripts use this one as a template. |
publishedAsTemplateId |
integer, The ID of the template that this script is backing. |
fromTemplateId |
integer, The ID of the template script. |
templateScriptName |
string, The name of the template script. |
links |
list, A list containing the following elements:
|
schedule |
list, A list containing the following elements:
|
notifications |
list, A list containing the following elements:
|
runningAs |
list, A list containing the following elements:
|
requiredResources |
list, A list containing the following elements:
|
repoHttpUri |
string, The location of a github repo to clone into the container, e.g. github.com/my-user/my-repo.git. |
repoRef |
string, The tag or branch of the github repo to clone into the container. |
remoteHostCredentialId |
integer, The id of the database credentials to pass into the environment of the container. |
gitCredentialId |
integer, The id of the git credential to be used when checking out the specified git repo. If not supplied, the first git credential you've submitted will be used. Unnecessary if no git repo is specified or the git repo is public. |
dockerCommand |
string, The command to run on the container. Will be run via sh as: ["sh", "-c", dockerCommand]. Defaults to the Docker image's ENTRYPOINT/CMD. |
dockerImageName |
string, The name of the docker image to pull from DockerHub. |
dockerImageTag |
string, The tag of the docker image to pull from DockerHub. |
instanceType |
string, The EC2 instance type to deploy to. Only available for jobs running on kubernetes. |
cancelTimeout |
integer, 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. |
lastRun |
list, A list containing the following elements:
|
timeZone |
string, The time zone of this script. |
hidden |
boolean, The hidden status of the item. |
archived |
string, The archival status of the requested item(s). |
targetProjectId |
integer, Target project to which script outputs will be added. |
Start a run
scripts_post_containers_runs(id)
scripts_post_containers_runs(id)
id |
integer required. The ID of the container. |
A list containing the following elements:
id |
integer, The ID of the run. |
containerId |
integer, The ID of the container. |
state |
string, The state of the run, one of 'queued' 'running' 'succeeded' 'failed' or 'cancelled'. |
isCancelRequested |
boolean, True if run cancel requested, else false. |
startedAt |
string, The time the last run started at. |
finishedAt |
string, The time the last run completed. |
error |
string, The error, if any, returned by the run. |
Add log messages
scripts_post_containers_runs_logs( id, run_id, message = NULL, level = NULL, messages = NULL, child_job_id = NULL )
scripts_post_containers_runs_logs( id, run_id, message = NULL, level = NULL, messages = NULL, child_job_id = NULL )
id |
integer required. The ID of the script. |
run_id |
integer required. The ID of the script run. |
message |
string optional. The log message to store. |
level |
string optional. The log level of this message [default: info] |
messages |
array optional. An array containing the following fields:
|
child_job_id |
integer optional. The ID of the child job the message came from. |
An empty HTTP response
Add an output for a run
scripts_post_containers_runs_outputs(id, run_id, object_type, object_id)
scripts_post_containers_runs_outputs(id, run_id, object_type, object_id)
id |
integer required. The ID of the container script. |
run_id |
integer required. The ID of the run. |
object_type |
string required. The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue |
object_id |
integer required. The ID of the output. |
A list containing the following elements:
objectType |
string, The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue |
objectId |
integer, The ID of the output. |
name |
string, The name of the output. |
link |
string, The hypermedia link to the output. |
value |
string, |
Create a Custom Script
scripts_post_custom( from_template_id, name = NULL, parent_id = NULL, arguments = NULL, remote_host_id = NULL, credential_id = NULL, schedule = NULL, notifications = NULL, time_zone = NULL, hidden = NULL, target_project_id = NULL )
scripts_post_custom( from_template_id, name = NULL, parent_id = NULL, arguments = NULL, remote_host_id = NULL, credential_id = NULL, schedule = NULL, notifications = NULL, time_zone = NULL, hidden = NULL, target_project_id = NULL )
from_template_id |
integer required. The ID of the template script. |
name |
string optional. The name of the script. |
parent_id |
integer optional. The ID of the parent job that will trigger this script |
arguments |
list optional. Parameter-value pairs to use when running this script. Only settable if this script has defined parameters. |
remote_host_id |
integer optional. The remote host ID that this script will connect to. |
credential_id |
integer optional. The credential that this script will use. |
schedule |
list optional. A list containing the following elements:
|
notifications |
list optional. A list containing the following elements:
|
time_zone |
string optional. The time zone of this script. |
boolean optional. The hidden status of the item. |
|
target_project_id |
integer optional. Target project to which script outputs will be added. |
A list containing the following elements:
id |
integer, The ID for the script. |
name |
string, The name of the script. |
type |
string, The type of the script (e.g Custom) |
createdAt |
string, The time this script was created. |
updatedAt |
string, The time the script was last updated. |
author |
list, A list containing the following elements:
|
state |
string, The status of the script's last run. |
finishedAt |
string, The time that the script's last run finished. |
category |
string, |
projects |
array, An array containing the following fields:
|
parentId |
integer, The ID of the parent job that will trigger this script |
params |
array, An array containing the following fields:
|
arguments |
list, Parameter-value pairs to use when running this script. Only settable if this script has defined parameters. |
isTemplate |
boolean, Whether others scripts use this one as a template. |
publishedAsTemplateId |
integer, The ID of the template that this script is backing. |
fromTemplateId |
integer, The ID of the template script. |
uiReportUrl |
integer, The url of the custom HTML. |
uiReportId |
integer, The id of the report with the custom HTML. |
uiReportProvideAPIKey |
boolean, Whether the ui report requests an API Key from the report viewer. |
templateScriptName |
string, The name of the template script. |
templateNote |
string, The template's note. |
remoteHostId |
integer, The remote host ID that this script will connect to. |
credentialId |
integer, The credential that this script will use. |
codePreview |
string, The code that this script will run with arguments inserted. |
schedule |
list, A list containing the following elements:
|
notifications |
list, A list containing the following elements:
|
runningAs |
list, A list containing the following elements:
|
timeZone |
string, The time zone of this script. |
lastRun |
list, A list containing the following elements:
|
hidden |
boolean, The hidden status of the item. |
archived |
string, The archival status of the requested item(s). |
targetProjectId |
integer, Target project to which script outputs will be added. |
lastSuccessfulRun |
list, A list containing the following elements:
|
Clone this Custom Script
scripts_post_custom_clone( id, clone_schedule = NULL, clone_triggers = NULL, clone_notifications = NULL )
scripts_post_custom_clone( id, clone_schedule = NULL, clone_triggers = NULL, clone_notifications = NULL )
id |
integer required. The ID for the script. |
clone_schedule |
boolean optional. If true, also copy the schedule to the new script. |
clone_triggers |
boolean optional. If true, also copy the triggers to the new script. |
clone_notifications |
boolean optional. If true, also copy the notifications to the new script. |
A list containing the following elements:
id |
integer, The ID for the script. |
name |
string, The name of the script. |
type |
string, The type of the script (e.g Custom) |
createdAt |
string, The time this script was created. |
updatedAt |
string, The time the script was last updated. |
author |
list, A list containing the following elements:
|
state |
string, The status of the script's last run. |
finishedAt |
string, The time that the script's last run finished. |
category |
string, |
projects |
array, An array containing the following fields:
|
parentId |
integer, The ID of the parent job that will trigger this script |
params |
array, An array containing the following fields:
|
arguments |
list, Parameter-value pairs to use when running this script. Only settable if this script has defined parameters. |
isTemplate |
boolean, Whether others scripts use this one as a template. |
publishedAsTemplateId |
integer, The ID of the template that this script is backing. |
fromTemplateId |
integer, The ID of the template script. |
uiReportUrl |
integer, The url of the custom HTML. |
uiReportId |
integer, The id of the report with the custom HTML. |
uiReportProvideAPIKey |
boolean, Whether the ui report requests an API Key from the report viewer. |
templateScriptName |
string, The name of the template script. |
templateNote |
string, The template's note. |
remoteHostId |
integer, The remote host ID that this script will connect to. |
credentialId |
integer, The credential that this script will use. |
codePreview |
string, The code that this script will run with arguments inserted. |
schedule |
list, A list containing the following elements:
|
notifications |
list, A list containing the following elements:
|
runningAs |
list, A list containing the following elements:
|
timeZone |
string, The time zone of this script. |
lastRun |
list, A list containing the following elements:
|
hidden |
boolean, The hidden status of the item. |
archived |
string, The archival status of the requested item(s). |
targetProjectId |
integer, Target project to which script outputs will be added. |
lastSuccessfulRun |
list, A list containing the following elements:
|
Start a run
scripts_post_custom_runs(id)
scripts_post_custom_runs(id)
id |
integer required. The ID of the custom. |
A list containing the following elements:
id |
integer, The ID of the run. |
customId |
integer, The ID of the custom. |
state |
string, The state of the run, one of 'queued' 'running' 'succeeded' 'failed' or 'cancelled'. |
isCancelRequested |
boolean, True if run cancel requested, else false. |
startedAt |
string, The time the last run started at. |
finishedAt |
string, The time the last run completed. |
error |
string, The error, if any, returned by the run. |
Add an output for a run
scripts_post_custom_runs_outputs(id, run_id, object_type, object_id)
scripts_post_custom_runs_outputs(id, run_id, object_type, object_id)
id |
integer required. The ID of the custom script. |
run_id |
integer required. The ID of the run. |
object_type |
string required. The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue |
object_id |
integer required. The ID of the output. |
A list containing the following elements:
objectType |
string, The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue |
objectId |
integer, The ID of the output. |
name |
string, The name of the output. |
link |
string, The hypermedia link to the output. |
value |
string, |
Create a JavaScript Script
scripts_post_javascript( name, source, remote_host_id, credential_id, parent_id = NULL, user_context = NULL, params = NULL, arguments = NULL, schedule = NULL, notifications = NULL, next_run_at = NULL, time_zone = NULL, hidden = NULL, target_project_id = NULL )
scripts_post_javascript( name, source, remote_host_id, credential_id, parent_id = NULL, user_context = NULL, params = NULL, arguments = NULL, schedule = NULL, notifications = NULL, next_run_at = NULL, time_zone = NULL, hidden = NULL, target_project_id = NULL )
name |
string required. The name of the script. |
source |
string required. The body/text of the script. |
remote_host_id |
integer required. The remote host ID that this script will connect to. |
credential_id |
integer required. The credential that this script will use. |
parent_id |
integer optional. The ID of the parent job that will trigger this script |
user_context |
string optional. "runner" or "author", who to execute the script as when run as a template. |
params |
array optional. An array containing the following fields:
|
arguments |
list optional. Parameter-value pairs to use when running this script. Only settable if this script has defined parameters. |
schedule |
list optional. A list containing the following elements:
|
notifications |
list optional. A list containing the following elements:
|
next_run_at |
string optional. The time of the next scheduled run. |
time_zone |
string optional. The time zone of this script. |
boolean optional. The hidden status of the item. |
|
target_project_id |
integer optional. Target project to which script outputs will be added. |
A list containing the following elements:
id |
integer, The ID for the script. |
name |
string, The name of the script. |
type |
string, The type of the script (e.g SQL, Container, Python, R, JavaScript) |
createdAt |
string, The time this script was created. |
updatedAt |
string, The time the script was last updated. |
author |
list, A list containing the following elements:
|
state |
string, The status of the script's last run. |
finishedAt |
string, The time that the script's last run finished. |
category |
string, The category of the script. |
projects |
array, An array containing the following fields:
|
parentId |
integer, The ID of the parent job that will trigger this script |
userContext |
string, "runner" or "author", who to execute the script as when run as a template. |
params |
array, An array containing the following fields:
|
arguments |
list, Parameter-value pairs to use when running this script. Only settable if this script has defined parameters. |
isTemplate |
boolean, Whether others scripts use this one as a template. |
publishedAsTemplateId |
integer, The ID of the template that this script is backing. |
fromTemplateId |
integer, The ID of the template this script uses, if any. |
templateDependentsCount |
integer, How many other scripts use this one as a template. |
templateScriptName |
string, The name of the template script. |
links |
list, A list containing the following elements:
|
schedule |
list, A list containing the following elements:
|
notifications |
list, A list containing the following elements:
|
runningAs |
list, A list containing the following elements:
|
nextRunAt |
string, The time of the next scheduled run. |
timeZone |
string, The time zone of this script. |
lastRun |
list, A list containing the following elements:
|
hidden |
boolean, The hidden status of the item. |
targetProjectId |
integer, Target project to which script outputs will be added. |
archived |
string, The archival status of the requested item(s). |
source |
string, The body/text of the script. |
remoteHostId |
integer, The remote host ID that this script will connect to. |
credentialId |
integer, The credential that this script will use. |
Clone this JavaScript Script
scripts_post_javascript_clone( id, clone_schedule = NULL, clone_triggers = NULL, clone_notifications = NULL )
scripts_post_javascript_clone( id, clone_schedule = NULL, clone_triggers = NULL, clone_notifications = NULL )
id |
integer required. The ID for the script. |
clone_schedule |
boolean optional. If true, also copy the schedule to the new script. |
clone_triggers |
boolean optional. If true, also copy the triggers to the new script. |
clone_notifications |
boolean optional. If true, also copy the notifications to the new script. |
A list containing the following elements:
id |
integer, The ID for the script. |
name |
string, The name of the script. |
type |
string, The type of the script (e.g SQL, Container, Python, R, JavaScript) |
createdAt |
string, The time this script was created. |
updatedAt |
string, The time the script was last updated. |
author |
list, A list containing the following elements:
|
state |
string, The status of the script's last run. |
finishedAt |
string, The time that the script's last run finished. |
category |
string, The category of the script. |
projects |
array, An array containing the following fields:
|
parentId |
integer, The ID of the parent job that will trigger this script |
userContext |
string, "runner" or "author", who to execute the script as when run as a template. |
params |
array, An array containing the following fields:
|
arguments |
list, Parameter-value pairs to use when running this script. Only settable if this script has defined parameters. |
isTemplate |
boolean, Whether others scripts use this one as a template. |
publishedAsTemplateId |
integer, The ID of the template that this script is backing. |
fromTemplateId |
integer, The ID of the template this script uses, if any. |
templateDependentsCount |
integer, How many other scripts use this one as a template. |
templateScriptName |
string, The name of the template script. |
links |
list, A list containing the following elements:
|
schedule |
list, A list containing the following elements:
|
notifications |
list, A list containing the following elements:
|
runningAs |
list, A list containing the following elements:
|
nextRunAt |
string, The time of the next scheduled run. |
timeZone |
string, The time zone of this script. |
lastRun |
list, A list containing the following elements:
|
hidden |
boolean, The hidden status of the item. |
targetProjectId |
integer, Target project to which script outputs will be added. |
archived |
string, The archival status of the requested item(s). |
source |
string, The body/text of the script. |
remoteHostId |
integer, The remote host ID that this script will connect to. |
credentialId |
integer, The credential that this script will use. |
Commit and push a new version of the file
scripts_post_javascript_git_commits(id, content, message, file_hash)
scripts_post_javascript_git_commits(id, content, message, file_hash)
id |
integer required. The ID of the file. |
content |
string required. The contents to commit to the file. |
message |
string required. A commit message describing the changes being made. |
file_hash |
string required. The full SHA of the file being replaced. |
A list containing the following elements:
content |
string, The file's contents. |
type |
string, The file's type. |
size |
integer, The file's size. |
fileHash |
string, The SHA of the file. |
Start a run
scripts_post_javascript_runs(id)
scripts_post_javascript_runs(id)
id |
integer required. The ID of the javascript. |
A list containing the following elements:
id |
integer, The ID of the run. |
javascriptId |
integer, The ID of the javascript. |
state |
string, The state of the run, one of 'queued' 'running' 'succeeded' 'failed' or 'cancelled'. |
isCancelRequested |
boolean, True if run cancel requested, else false. |
startedAt |
string, The time the last run started at. |
finishedAt |
string, The time the last run completed. |
error |
string, The error, if any, returned by the run. |
Add an output for a run
scripts_post_javascript_runs_outputs(id, run_id, object_type, object_id)
scripts_post_javascript_runs_outputs(id, run_id, object_type, object_id)
id |
integer required. The ID of the javascript script. |
run_id |
integer required. The ID of the run. |
object_type |
string required. The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue |
object_id |
integer required. The ID of the output. |
A list containing the following elements:
objectType |
string, The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue |
objectId |
integer, The ID of the output. |
name |
string, The name of the output. |
link |
string, The hypermedia link to the output. |
value |
string, |
Create a Python Script
scripts_post_python3( name, source, parent_id = NULL, user_context = NULL, params = NULL, arguments = NULL, schedule = NULL, notifications = NULL, next_run_at = NULL, time_zone = NULL, hidden = NULL, target_project_id = NULL, required_resources = NULL, instance_type = NULL, cancel_timeout = NULL, docker_image_tag = NULL )
scripts_post_python3( name, source, parent_id = NULL, user_context = NULL, params = NULL, arguments = NULL, schedule = NULL, notifications = NULL, next_run_at = NULL, time_zone = NULL, hidden = NULL, target_project_id = NULL, required_resources = NULL, instance_type = NULL, cancel_timeout = NULL, docker_image_tag = NULL )
name |
string required. The name of the script. |
source |
string required. The body/text of the script. |
parent_id |
integer optional. The ID of the parent job that will trigger this script |
user_context |
string optional. "runner" or "author", who to execute the script as when run as a template. |
params |
array optional. An array containing the following fields:
|
arguments |
list optional. Parameter-value pairs to use when running this script. Only settable if this script has defined parameters. |
schedule |
list optional. A list containing the following elements:
|
notifications |
list optional. A list containing the following elements:
|
next_run_at |
string optional. The time of the next scheduled run. |
time_zone |
string optional. The time zone of this script. |
boolean optional. The hidden status of the item. |
|
target_project_id |
integer optional. Target project to which script outputs will be added. |
required_resources |
list optional. A list containing the following elements:
|
instance_type |
string optional. The EC2 instance type to deploy to. Only available for jobs running on kubernetes. |
cancel_timeout |
integer 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_tag |
string optional. The tag of the docker image to pull from DockerHub. |
A list containing the following elements:
id |
integer, The ID for the script. |
name |
string, The name of the script. |
type |
string, The type of the script (e.g SQL, Container, Python, R, JavaScript) |
createdAt |
string, The time this script was created. |
updatedAt |
string, The time the script was last updated. |
author |
list, A list containing the following elements:
|
state |
string, The status of the script's last run. |
finishedAt |
string, The time that the script's last run finished. |
category |
string, The category of the script. |
projects |
array, An array containing the following fields:
|
parentId |
integer, The ID of the parent job that will trigger this script |
userContext |
string, "runner" or "author", who to execute the script as when run as a template. |
params |
array, An array containing the following fields:
|
arguments |
list, Parameter-value pairs to use when running this script. Only settable if this script has defined parameters. |
isTemplate |
boolean, Whether others scripts use this one as a template. |
publishedAsTemplateId |
integer, The ID of the template that this script is backing. |
fromTemplateId |
integer, The ID of the template this script uses, if any. |
templateDependentsCount |
integer, How many other scripts use this one as a template. |
templateScriptName |
string, The name of the template script. |
links |
list, A list containing the following elements:
|
schedule |
list, A list containing the following elements:
|
notifications |
list, A list containing the following elements:
|
runningAs |
list, A list containing the following elements:
|
nextRunAt |
string, The time of the next scheduled run. |
timeZone |
string, The time zone of this script. |
lastRun |
list, A list containing the following elements:
|
hidden |
boolean, The hidden status of the item. |
targetProjectId |
integer, Target project to which script outputs will be added. |
archived |
string, The archival status of the requested item(s). |
requiredResources |
list, A list containing the following elements:
|
instanceType |
string, The EC2 instance type to deploy to. Only available for jobs running on kubernetes. |
source |
string, The body/text of the script. |
cancelTimeout |
integer, 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. |
dockerImageTag |
string, The tag of the docker image to pull from DockerHub. |
Clone this Python Script
scripts_post_python3_clone( id, clone_schedule = NULL, clone_triggers = NULL, clone_notifications = NULL )
scripts_post_python3_clone( id, clone_schedule = NULL, clone_triggers = NULL, clone_notifications = NULL )
id |
integer required. The ID for the script. |
clone_schedule |
boolean optional. If true, also copy the schedule to the new script. |
clone_triggers |
boolean optional. If true, also copy the triggers to the new script. |
clone_notifications |
boolean optional. If true, also copy the notifications to the new script. |
A list containing the following elements:
id |
integer, The ID for the script. |
name |
string, The name of the script. |
type |
string, The type of the script (e.g SQL, Container, Python, R, JavaScript) |
createdAt |
string, The time this script was created. |
updatedAt |
string, The time the script was last updated. |
author |
list, A list containing the following elements:
|
state |
string, The status of the script's last run. |
finishedAt |
string, The time that the script's last run finished. |
category |
string, The category of the script. |
projects |
array, An array containing the following fields:
|
parentId |
integer, The ID of the parent job that will trigger this script |
userContext |
string, "runner" or "author", who to execute the script as when run as a template. |
params |
array, An array containing the following fields:
|
arguments |
list, Parameter-value pairs to use when running this script. Only settable if this script has defined parameters. |
isTemplate |
boolean, Whether others scripts use this one as a template. |
publishedAsTemplateId |
integer, The ID of the template that this script is backing. |
fromTemplateId |
integer, The ID of the template this script uses, if any. |
templateDependentsCount |
integer, How many other scripts use this one as a template. |
templateScriptName |
string, The name of the template script. |
links |
list, A list containing the following elements:
|
schedule |
list, A list containing the following elements:
|
notifications |
list, A list containing the following elements:
|
runningAs |
list, A list containing the following elements:
|
nextRunAt |
string, The time of the next scheduled run. |
timeZone |
string, The time zone of this script. |
lastRun |
list, A list containing the following elements:
|
hidden |
boolean, The hidden status of the item. |
targetProjectId |
integer, Target project to which script outputs will be added. |
archived |
string, The archival status of the requested item(s). |
requiredResources |
list, A list containing the following elements:
|
instanceType |
string, The EC2 instance type to deploy to. Only available for jobs running on kubernetes. |
source |
string, The body/text of the script. |
cancelTimeout |
integer, 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. |
dockerImageTag |
string, The tag of the docker image to pull from DockerHub. |
Commit and push a new version of the file
scripts_post_python3_git_commits(id, content, message, file_hash)
scripts_post_python3_git_commits(id, content, message, file_hash)
id |
integer required. The ID of the file. |
content |
string required. The contents to commit to the file. |
message |
string required. A commit message describing the changes being made. |
file_hash |
string required. The full SHA of the file being replaced. |
A list containing the following elements:
content |
string, The file's contents. |
type |
string, The file's type. |
size |
integer, The file's size. |
fileHash |
string, The SHA of the file. |
Start a run
scripts_post_python3_runs(id)
scripts_post_python3_runs(id)
id |
integer required. The ID of the python. |
A list containing the following elements:
id |
integer, The ID of the run. |
pythonId |
integer, The ID of the python. |
state |
string, The state of the run, one of 'queued' 'running' 'succeeded' 'failed' or 'cancelled'. |
isCancelRequested |
boolean, True if run cancel requested, else false. |
startedAt |
string, The time the last run started at. |
finishedAt |
string, The time the last run completed. |
error |
string, The error, if any, returned by the run. |
Add an output for a run
scripts_post_python3_runs_outputs(id, run_id, object_type, object_id)
scripts_post_python3_runs_outputs(id, run_id, object_type, object_id)
id |
integer required. The ID of the python script. |
run_id |
integer required. The ID of the run. |
object_type |
string required. The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue |
object_id |
integer required. The ID of the output. |
A list containing the following elements:
objectType |
string, The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue |
objectId |
integer, The ID of the output. |
name |
string, The name of the output. |
link |
string, The hypermedia link to the output. |
value |
string, |
Create an R Script
scripts_post_r( name, source, parent_id = NULL, user_context = NULL, params = NULL, arguments = NULL, schedule = NULL, notifications = NULL, next_run_at = NULL, time_zone = NULL, hidden = NULL, target_project_id = NULL, required_resources = NULL, instance_type = NULL, cancel_timeout = NULL, docker_image_tag = NULL )
scripts_post_r( name, source, parent_id = NULL, user_context = NULL, params = NULL, arguments = NULL, schedule = NULL, notifications = NULL, next_run_at = NULL, time_zone = NULL, hidden = NULL, target_project_id = NULL, required_resources = NULL, instance_type = NULL, cancel_timeout = NULL, docker_image_tag = NULL )
name |
string required. The name of the script. |
source |
string required. The body/text of the script. |
parent_id |
integer optional. The ID of the parent job that will trigger this script |
user_context |
string optional. "runner" or "author", who to execute the script as when run as a template. |
params |
array optional. An array containing the following fields:
|
arguments |
list optional. Parameter-value pairs to use when running this script. Only settable if this script has defined parameters. |
schedule |
list optional. A list containing the following elements:
|
notifications |
list optional. A list containing the following elements:
|
next_run_at |
string optional. The time of the next scheduled run. |
time_zone |
string optional. The time zone of this script. |
boolean optional. The hidden status of the item. |
|
target_project_id |
integer optional. Target project to which script outputs will be added. |
required_resources |
list optional. A list containing the following elements:
|
instance_type |
string optional. The EC2 instance type to deploy to. Only available for jobs running on kubernetes. |
cancel_timeout |
integer 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_tag |
string optional. The tag of the docker image to pull from DockerHub. |
A list containing the following elements:
id |
integer, The ID for the script. |
name |
string, The name of the script. |
type |
string, The type of the script (e.g SQL, Container, Python, R, JavaScript) |
createdAt |
string, The time this script was created. |
updatedAt |
string, The time the script was last updated. |
author |
list, A list containing the following elements:
|
state |
string, The status of the script's last run. |
finishedAt |
string, The time that the script's last run finished. |
category |
string, The category of the script. |
projects |
array, An array containing the following fields:
|
parentId |
integer, The ID of the parent job that will trigger this script |
userContext |
string, "runner" or "author", who to execute the script as when run as a template. |
params |
array, An array containing the following fields:
|
arguments |
list, Parameter-value pairs to use when running this script. Only settable if this script has defined parameters. |
isTemplate |
boolean, Whether others scripts use this one as a template. |
publishedAsTemplateId |
integer, The ID of the template that this script is backing. |
fromTemplateId |
integer, The ID of the template this script uses, if any. |
templateDependentsCount |
integer, How many other scripts use this one as a template. |
templateScriptName |
string, The name of the template script. |
links |
list, A list containing the following elements:
|
schedule |
list, A list containing the following elements:
|
notifications |
list, A list containing the following elements:
|
runningAs |
list, A list containing the following elements:
|
nextRunAt |
string, The time of the next scheduled run. |
timeZone |
string, The time zone of this script. |
lastRun |
list, A list containing the following elements:
|
hidden |
boolean, The hidden status of the item. |
targetProjectId |
integer, Target project to which script outputs will be added. |
archived |
string, The archival status of the requested item(s). |
requiredResources |
list, A list containing the following elements:
|
instanceType |
string, The EC2 instance type to deploy to. Only available for jobs running on kubernetes. |
source |
string, The body/text of the script. |
cancelTimeout |
integer, 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. |
dockerImageTag |
string, The tag of the docker image to pull from DockerHub. |
Clone this R Script
scripts_post_r_clone( id, clone_schedule = NULL, clone_triggers = NULL, clone_notifications = NULL )
scripts_post_r_clone( id, clone_schedule = NULL, clone_triggers = NULL, clone_notifications = NULL )
id |
integer required. The ID for the script. |
clone_schedule |
boolean optional. If true, also copy the schedule to the new script. |
clone_triggers |
boolean optional. If true, also copy the triggers to the new script. |
clone_notifications |
boolean optional. If true, also copy the notifications to the new script. |
A list containing the following elements:
id |
integer, The ID for the script. |
name |
string, The name of the script. |
type |
string, The type of the script (e.g SQL, Container, Python, R, JavaScript) |
createdAt |
string, The time this script was created. |
updatedAt |
string, The time the script was last updated. |
author |
list, A list containing the following elements:
|
state |
string, The status of the script's last run. |
finishedAt |
string, The time that the script's last run finished. |
category |
string, The category of the script. |
projects |
array, An array containing the following fields:
|
parentId |
integer, The ID of the parent job that will trigger this script |
userContext |
string, "runner" or "author", who to execute the script as when run as a template. |
params |
array, An array containing the following fields:
|
arguments |
list, Parameter-value pairs to use when running this script. Only settable if this script has defined parameters. |
isTemplate |
boolean, Whether others scripts use this one as a template. |
publishedAsTemplateId |
integer, The ID of the template that this script is backing. |
fromTemplateId |
integer, The ID of the template this script uses, if any. |
templateDependentsCount |
integer, How many other scripts use this one as a template. |
templateScriptName |
string, The name of the template script. |
links |
list, A list containing the following elements:
|
schedule |
list, A list containing the following elements:
|
notifications |
list, A list containing the following elements:
|
runningAs |
list, A list containing the following elements:
|
nextRunAt |
string, The time of the next scheduled run. |
timeZone |
string, The time zone of this script. |
lastRun |
list, A list containing the following elements:
|
hidden |
boolean, The hidden status of the item. |
targetProjectId |
integer, Target project to which script outputs will be added. |
archived |
string, The archival status of the requested item(s). |
requiredResources |
list, A list containing the following elements:
|
instanceType |
string, The EC2 instance type to deploy to. Only available for jobs running on kubernetes. |
source |
string, The body/text of the script. |
cancelTimeout |
integer, 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. |
dockerImageTag |
string, The tag of the docker image to pull from DockerHub. |
Commit and push a new version of the file
scripts_post_r_git_commits(id, content, message, file_hash)
scripts_post_r_git_commits(id, content, message, file_hash)
id |
integer required. The ID of the file. |
content |
string required. The contents to commit to the file. |
message |
string required. A commit message describing the changes being made. |
file_hash |
string required. The full SHA of the file being replaced. |
A list containing the following elements:
content |
string, The file's contents. |
type |
string, The file's type. |
size |
integer, The file's size. |
fileHash |
string, The SHA of the file. |
Start a run
scripts_post_r_runs(id)
scripts_post_r_runs(id)
id |
integer required. The ID of the r. |
A list containing the following elements:
id |
integer, The ID of the run. |
rId |
integer, The ID of the r. |
state |
string, The state of the run, one of 'queued' 'running' 'succeeded' 'failed' or 'cancelled'. |
isCancelRequested |
boolean, True if run cancel requested, else false. |
startedAt |
string, The time the last run started at. |
finishedAt |
string, The time the last run completed. |
error |
string, The error, if any, returned by the run. |
Add an output for a run
scripts_post_r_runs_outputs(id, run_id, object_type, object_id)
scripts_post_r_runs_outputs(id, run_id, object_type, object_id)
id |
integer required. The ID of the r script. |
run_id |
integer required. The ID of the run. |
object_type |
string required. The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue |
object_id |
integer required. The ID of the output. |
A list containing the following elements:
objectType |
string, The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue |
objectId |
integer, The ID of the output. |
name |
string, The name of the output. |
link |
string, The hypermedia link to the output. |
value |
string, |
Run a script
scripts_post_run(id)
scripts_post_run(id)
id |
integer required. The ID for the script. |
An empty HTTP response
Create a SQL script
scripts_post_sql( name, sql, remote_host_id, credential_id, parent_id = NULL, user_context = NULL, params = NULL, arguments = NULL, schedule = NULL, notifications = NULL, next_run_at = NULL, time_zone = NULL, hidden = NULL, target_project_id = NULL, csv_settings = NULL )
scripts_post_sql( name, sql, remote_host_id, credential_id, parent_id = NULL, user_context = NULL, params = NULL, arguments = NULL, schedule = NULL, notifications = NULL, next_run_at = NULL, time_zone = NULL, hidden = NULL, target_project_id = NULL, csv_settings = NULL )
name |
string required. The name of the script. |
sql |
string required. The raw SQL query for the script. |
remote_host_id |
integer required. The remote host ID that this script will connect to. |
credential_id |
integer required. The credential that this script will use. |
parent_id |
integer optional. The ID of the parent job that will trigger this script |
user_context |
string optional. "runner" or "author", who to execute the script as when run as a template. |
params |
array optional. An array containing the following fields:
|
arguments |
list optional. Parameter-value pairs to use when running this script. Only settable if this script has defined parameters. |
schedule |
list optional. A list containing the following elements:
|
notifications |
list optional. A list containing the following elements:
|
next_run_at |
string optional. The time of the next scheduled run. |
time_zone |
string optional. The time zone of this script. |
boolean optional. The hidden status of the item. |
|
target_project_id |
integer optional. Target project to which script outputs will be added. |
csv_settings |
list optional. A list containing the following elements:
|
A list containing the following elements:
id |
integer, The ID for the script. |
name |
string, The name of the script. |
type |
string, The type of the script (e.g SQL, Container, Python, R, JavaScript) |
createdAt |
string, The time this script was created. |
updatedAt |
string, The time the script was last updated. |
author |
list, A list containing the following elements:
|
state |
string, The status of the script's last run. |
finishedAt |
string, The time that the script's last run finished. |
category |
string, The category of the script. |
projects |
array, An array containing the following fields:
|
parentId |
integer, The ID of the parent job that will trigger this script |
userContext |
string, "runner" or "author", who to execute the script as when run as a template. |
params |
array, An array containing the following fields:
|
arguments |
list, Parameter-value pairs to use when running this script. Only settable if this script has defined parameters. |
isTemplate |
boolean, Whether others scripts use this one as a template. |
publishedAsTemplateId |
integer, The ID of the template that this script is backing. |
fromTemplateId |
integer, The ID of the template this script uses, if any. |
templateDependentsCount |
integer, How many other scripts use this one as a template. |
templateScriptName |
string, The name of the template script. |
links |
list, A list containing the following elements:
|
schedule |
list, A list containing the following elements:
|
notifications |
list, A list containing the following elements:
|
runningAs |
list, A list containing the following elements:
|
nextRunAt |
string, The time of the next scheduled run. |
timeZone |
string, The time zone of this script. |
lastRun |
list, A list containing the following elements:
|
hidden |
boolean, The hidden status of the item. |
targetProjectId |
integer, Target project to which script outputs will be added. |
archived |
string, The archival status of the requested item(s). |
sql |
string, The raw SQL query for the script. |
expandedArguments |
list, Expanded arguments for use in injecting into different environments. |
remoteHostId |
integer, The remote host ID that this script will connect to. |
credentialId |
integer, The credential that this script will use. |
codePreview |
string, The code that this script will run with arguments inserted. |
csvSettings |
list, A list containing the following elements:
|
Clone this SQL script
scripts_post_sql_clone( id, clone_schedule = NULL, clone_triggers = NULL, clone_notifications = NULL )
scripts_post_sql_clone( id, clone_schedule = NULL, clone_triggers = NULL, clone_notifications = NULL )
id |
integer required. The ID for the script. |
clone_schedule |
boolean optional. If true, also copy the schedule to the new script. |
clone_triggers |
boolean optional. If true, also copy the triggers to the new script. |
clone_notifications |
boolean optional. If true, also copy the notifications to the new script. |
A list containing the following elements:
id |
integer, The ID for the script. |
name |
string, The name of the script. |
type |
string, The type of the script (e.g SQL, Container, Python, R, JavaScript) |
createdAt |
string, The time this script was created. |
updatedAt |
string, The time the script was last updated. |
author |
list, A list containing the following elements:
|
state |
string, The status of the script's last run. |
finishedAt |
string, The time that the script's last run finished. |
category |
string, The category of the script. |
projects |
array, An array containing the following fields:
|
parentId |
integer, The ID of the parent job that will trigger this script |
userContext |
string, "runner" or "author", who to execute the script as when run as a template. |
params |
array, An array containing the following fields:
|
arguments |
list, Parameter-value pairs to use when running this script. Only settable if this script has defined parameters. |
isTemplate |
boolean, Whether others scripts use this one as a template. |
publishedAsTemplateId |
integer, The ID of the template that this script is backing. |
fromTemplateId |
integer, The ID of the template this script uses, if any. |
templateDependentsCount |
integer, How many other scripts use this one as a template. |
templateScriptName |
string, The name of the template script. |
links |
list, A list containing the following elements:
|
schedule |
list, A list containing the following elements:
|
notifications |
list, A list containing the following elements:
|
runningAs |
list, A list containing the following elements:
|
nextRunAt |
string, The time of the next scheduled run. |
timeZone |
string, The time zone of this script. |
lastRun |
list, A list containing the following elements:
|
hidden |
boolean, The hidden status of the item. |
targetProjectId |
integer, Target project to which script outputs will be added. |
archived |
string, The archival status of the requested item(s). |
sql |
string, The raw SQL query for the script. |
expandedArguments |
list, Expanded arguments for use in injecting into different environments. |
remoteHostId |
integer, The remote host ID that this script will connect to. |
credentialId |
integer, The credential that this script will use. |
codePreview |
string, The code that this script will run with arguments inserted. |
csvSettings |
list, A list containing the following elements:
|
Commit and push a new version of the file
scripts_post_sql_git_commits(id, content, message, file_hash)
scripts_post_sql_git_commits(id, content, message, file_hash)
id |
integer required. The ID of the file. |
content |
string required. The contents to commit to the file. |
message |
string required. A commit message describing the changes being made. |
file_hash |
string required. The full SHA of the file being replaced. |
A list containing the following elements:
content |
string, The file's contents. |
type |
string, The file's type. |
size |
integer, The file's size. |
fileHash |
string, The SHA of the file. |
Start a run
scripts_post_sql_runs(id)
scripts_post_sql_runs(id)
id |
integer required. The ID of the sql. |
A list containing the following elements:
id |
integer, The ID of this run. |
sqlId |
integer, The ID of this sql. |
state |
string, The state of this run. |
isCancelRequested |
boolean, True if run cancel requested, else false. |
startedAt |
string, The time the last run started. |
finishedAt |
string, The time that this run finished. |
error |
string, The error message for this run, if present. |
output |
array, An array containing the following fields:
|
Edit a container
scripts_put_containers( id, required_resources, docker_image_name, name = NULL, parent_id = NULL, user_context = NULL, params = NULL, arguments = NULL, schedule = NULL, notifications = NULL, repo_http_uri = NULL, repo_ref = NULL, remote_host_credential_id = NULL, git_credential_id = NULL, docker_command = NULL, docker_image_tag = NULL, instance_type = NULL, cancel_timeout = NULL, time_zone = NULL, target_project_id = NULL )
scripts_put_containers( id, required_resources, docker_image_name, name = NULL, parent_id = NULL, user_context = NULL, params = NULL, arguments = NULL, schedule = NULL, notifications = NULL, repo_http_uri = NULL, repo_ref = NULL, remote_host_credential_id = NULL, git_credential_id = NULL, docker_command = NULL, docker_image_tag = NULL, instance_type = NULL, cancel_timeout = NULL, time_zone = NULL, target_project_id = NULL )
id |
integer required. The ID for the script. |
required_resources |
list required. A list containing the following elements:
|
docker_image_name |
string required. The name of the docker image to pull from DockerHub. |
name |
string optional. The name of the container. |
parent_id |
integer optional. The ID of the parent job that will trigger this script |
user_context |
string optional. "runner" or "author", who to execute the script as when run as a template. |
params |
array optional. An array containing the following fields:
|
arguments |
list optional. Parameter-value pairs to use when running this script. Only settable if this script has defined parameters. |
schedule |
list optional. A list containing the following elements:
|
notifications |
list optional. A list containing the following elements:
|
repo_http_uri |
string optional. The location of a github repo to clone into the container, e.g. github.com/my-user/my-repo.git. |
repo_ref |
string optional. The tag or branch of the github repo to clone into the container. |
remote_host_credential_id |
integer optional. The id of the database credentials to pass into the environment of the container. |
git_credential_id |
integer optional. The id of the git credential to be used when checking out the specified git repo. If not supplied, the first git credential you've submitted will be used. Unnecessary if no git repo is specified or the git repo is public. |
docker_command |
string 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_tag |
string optional. The tag of the docker image to pull from DockerHub. |
instance_type |
string optional. The EC2 instance type to deploy to. Only available for jobs running on kubernetes. |
cancel_timeout |
integer 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_zone |
string optional. The time zone of this script. |
target_project_id |
integer optional. Target project to which script outputs will be added. |
A list containing the following elements:
id |
integer, The ID for the script. |
name |
string, The name of the container. |
type |
string, The type of the script (e.g Container) |
createdAt |
string, The time this script was created. |
updatedAt |
string, The time the script was last updated. |
author |
list, A list containing the following elements:
|
state |
string, The status of the script's last run. |
finishedAt |
string, The time that the script's last run finished. |
category |
string, The category of the script. |
projects |
array, An array containing the following fields:
|
parentId |
integer, The ID of the parent job that will trigger this script |
userContext |
string, "runner" or "author", who to execute the script as when run as a template. |
params |
array, An array containing the following fields:
|
arguments |
list, Parameter-value pairs to use when running this script. Only settable if this script has defined parameters. |
isTemplate |
boolean, Whether others scripts use this one as a template. |
templateDependentsCount |
integer, How many other scripts use this one as a template. |
publishedAsTemplateId |
integer, The ID of the template that this script is backing. |
fromTemplateId |
integer, The ID of the template script. |
templateScriptName |
string, The name of the template script. |
links |
list, A list containing the following elements:
|
schedule |
list, A list containing the following elements:
|
notifications |
list, A list containing the following elements:
|
runningAs |
list, A list containing the following elements:
|
requiredResources |
list, A list containing the following elements:
|
repoHttpUri |
string, The location of a github repo to clone into the container, e.g. github.com/my-user/my-repo.git. |
repoRef |
string, The tag or branch of the github repo to clone into the container. |
remoteHostCredentialId |
integer, The id of the database credentials to pass into the environment of the container. |
gitCredentialId |
integer, The id of the git credential to be used when checking out the specified git repo. If not supplied, the first git credential you've submitted will be used. Unnecessary if no git repo is specified or the git repo is public. |
dockerCommand |
string, The command to run on the container. Will be run via sh as: ["sh", "-c", dockerCommand]. Defaults to the Docker image's ENTRYPOINT/CMD. |
dockerImageName |
string, The name of the docker image to pull from DockerHub. |
dockerImageTag |
string, The tag of the docker image to pull from DockerHub. |
instanceType |
string, The EC2 instance type to deploy to. Only available for jobs running on kubernetes. |
cancelTimeout |
integer, 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. |
lastRun |
list, A list containing the following elements:
|
timeZone |
string, The time zone of this script. |
hidden |
boolean, The hidden status of the item. |
archived |
string, The archival status of the requested item(s). |
targetProjectId |
integer, Target project to which script outputs will be added. |
Update the archive status of this object
scripts_put_containers_archive(id, status)
scripts_put_containers_archive(id, status)
id |
integer required. The ID of the object. |
status |
boolean required. The desired archived status of the object. |
A list containing the following elements:
id |
integer, The ID for the script. |
name |
string, The name of the container. |
type |
string, The type of the script (e.g Container) |
createdAt |
string, The time this script was created. |
updatedAt |
string, The time the script was last updated. |
author |
list, A list containing the following elements:
|
state |
string, The status of the script's last run. |
finishedAt |
string, The time that the script's last run finished. |
category |
string, The category of the script. |
projects |
array, An array containing the following fields:
|
parentId |
integer, The ID of the parent job that will trigger this script |
userContext |
string, "runner" or "author", who to execute the script as when run as a template. |
params |
array, An array containing the following fields:
|
arguments |
list, Parameter-value pairs to use when running this script. Only settable if this script has defined parameters. |
isTemplate |
boolean, Whether others scripts use this one as a template. |
templateDependentsCount |
integer, How many other scripts use this one as a template. |
publishedAsTemplateId |
integer, The ID of the template that this script is backing. |
fromTemplateId |
integer, The ID of the template script. |
templateScriptName |
string, The name of the template script. |
links |
list, A list containing the following elements:
|
schedule |
list, A list containing the following elements:
|
notifications |
list, A list containing the following elements:
|
runningAs |
list, A list containing the following elements:
|
requiredResources |
list, A list containing the following elements:
|
repoHttpUri |
string, The location of a github repo to clone into the container, e.g. github.com/my-user/my-repo.git. |
repoRef |
string, The tag or branch of the github repo to clone into the container. |
remoteHostCredentialId |
integer, The id of the database credentials to pass into the environment of the container. |
gitCredentialId |
integer, The id of the git credential to be used when checking out the specified git repo. If not supplied, the first git credential you've submitted will be used. Unnecessary if no git repo is specified or the git repo is public. |
dockerCommand |
string, The command to run on the container. Will be run via sh as: ["sh", "-c", dockerCommand]. Defaults to the Docker image's ENTRYPOINT/CMD. |
dockerImageName |
string, The name of the docker image to pull from DockerHub. |
dockerImageTag |
string, The tag of the docker image to pull from DockerHub. |
instanceType |
string, The EC2 instance type to deploy to. Only available for jobs running on kubernetes. |
cancelTimeout |
integer, 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. |
lastRun |
list, A list containing the following elements:
|
timeZone |
string, The time zone of this script. |
hidden |
boolean, The hidden status of the item. |
archived |
string, The archival status of the requested item(s). |
targetProjectId |
integer, Target project to which script outputs will be added. |
Add a Container Script to a project
scripts_put_containers_projects(id, project_id)
scripts_put_containers_projects(id, project_id)
id |
integer required. The ID of the Container Script. |
project_id |
integer required. The ID of the project. |
An empty HTTP response
Replace all attributes of this Custom Script
scripts_put_custom( id, name = NULL, parent_id = NULL, arguments = NULL, remote_host_id = NULL, credential_id = NULL, schedule = NULL, notifications = NULL, time_zone = NULL, target_project_id = NULL )
scripts_put_custom( id, name = NULL, parent_id = NULL, arguments = NULL, remote_host_id = NULL, credential_id = NULL, schedule = NULL, notifications = NULL, time_zone = NULL, target_project_id = NULL )
id |
integer required. The ID for the script. |
name |
string optional. The name of the script. |
parent_id |
integer optional. The ID of the parent job that will trigger this script |
arguments |
list optional. Parameter-value pairs to use when running this script. Only settable if this script has defined parameters. |
remote_host_id |
integer optional. The remote host ID that this script will connect to. |
credential_id |
integer optional. The credential that this script will use. |
schedule |
list optional. A list containing the following elements:
|
notifications |
list optional. A list containing the following elements:
|
time_zone |
string optional. The time zone of this script. |
target_project_id |
integer optional. Target project to which script outputs will be added. |
A list containing the following elements:
id |
integer, The ID for the script. |
name |
string, The name of the script. |
type |
string, The type of the script (e.g Custom) |
createdAt |
string, The time this script was created. |
updatedAt |
string, The time the script was last updated. |
author |
list, A list containing the following elements:
|
state |
string, The status of the script's last run. |
finishedAt |
string, The time that the script's last run finished. |
category |
string, |
projects |
array, An array containing the following fields:
|
parentId |
integer, The ID of the parent job that will trigger this script |
params |
array, An array containing the following fields:
|
arguments |
list, Parameter-value pairs to use when running this script. Only settable if this script has defined parameters. |
isTemplate |
boolean, Whether others scripts use this one as a template. |
publishedAsTemplateId |
integer, The ID of the template that this script is backing. |
fromTemplateId |
integer, The ID of the template script. |
uiReportUrl |
integer, The url of the custom HTML. |
uiReportId |
integer, The id of the report with the custom HTML. |
uiReportProvideAPIKey |
boolean, Whether the ui report requests an API Key from the report viewer. |
templateScriptName |
string, The name of the template script. |
templateNote |
string, The template's note. |
remoteHostId |
integer, The remote host ID that this script will connect to. |
credentialId |
integer, The credential that this script will use. |
codePreview |
string, The code that this script will run with arguments inserted. |
schedule |
list, A list containing the following elements:
|
notifications |
list, A list containing the following elements:
|
runningAs |
list, A list containing the following elements:
|
timeZone |
string, The time zone of this script. |
lastRun |
list, A list containing the following elements:
|
hidden |
boolean, The hidden status of the item. |
archived |
string, The archival status of the requested item(s). |
targetProjectId |
integer, Target project to which script outputs will be added. |
lastSuccessfulRun |
list, A list containing the following elements:
|
Update the archive status of this object
scripts_put_custom_archive(id, status)
scripts_put_custom_archive(id, status)
id |
integer required. The ID of the object. |
status |
boolean required. The desired archived status of the object. |
A list containing the following elements:
id |
integer, The ID for the script. |
name |
string, The name of the script. |
type |
string, The type of the script (e.g Custom) |
createdAt |
string, The time this script was created. |
updatedAt |
string, The time the script was last updated. |
author |
list, A list containing the following elements:
|
state |
string, The status of the script's last run. |
finishedAt |
string, The time that the script's last run finished. |
category |
string, |
projects |
array, An array containing the following fields:
|
parentId |
integer, The ID of the parent job that will trigger this script |
params |
array, An array containing the following fields:
|
arguments |
list, Parameter-value pairs to use when running this script. Only settable if this script has defined parameters. |
isTemplate |
boolean, Whether others scripts use this one as a template. |
publishedAsTemplateId |
integer, The ID of the template that this script is backing. |
fromTemplateId |
integer, The ID of the template script. |
uiReportUrl |
integer, The url of the custom HTML. |
uiReportId |
integer, The id of the report with the custom HTML. |
uiReportProvideAPIKey |
boolean, Whether the ui report requests an API Key from the report viewer. |
templateScriptName |
string, The name of the template script. |
templateNote |
string, The template's note. |
remoteHostId |
integer, The remote host ID that this script will connect to. |
credentialId |
integer, The credential that this script will use. |
codePreview |
string, The code that this script will run with arguments inserted. |
schedule |
list, A list containing the following elements:
|
notifications |
list, A list containing the following elements:
|
runningAs |
list, A list containing the following elements:
|
timeZone |
string, The time zone of this script. |
lastRun |
list, A list containing the following elements:
|
hidden |
boolean, The hidden status of the item. |
archived |
string, The archival status of the requested item(s). |
targetProjectId |
integer, Target project to which script outputs will be added. |
lastSuccessfulRun |
list, A list containing the following elements:
|
Add a Custom Script to a project
scripts_put_custom_projects(id, project_id)
scripts_put_custom_projects(id, project_id)
id |
integer required. The ID of the Custom Script. |
project_id |
integer required. The ID of the project. |
An empty HTTP response
Replace all attributes of this JavaScript Script
scripts_put_javascript( id, name, source, remote_host_id, credential_id, parent_id = NULL, user_context = NULL, params = NULL, arguments = NULL, schedule = NULL, notifications = NULL, next_run_at = NULL, time_zone = NULL, target_project_id = NULL )
scripts_put_javascript( id, name, source, remote_host_id, credential_id, parent_id = NULL, user_context = NULL, params = NULL, arguments = NULL, schedule = NULL, notifications = NULL, next_run_at = NULL, time_zone = NULL, target_project_id = NULL )
id |
integer required. The ID for the script. |
name |
string required. The name of the script. |
source |
string required. The body/text of the script. |
remote_host_id |
integer required. The remote host ID that this script will connect to. |
credential_id |
integer required. The credential that this script will use. |
parent_id |
integer optional. The ID of the parent job that will trigger this script |
user_context |
string optional. "runner" or "author", who to execute the script as when run as a template. |
params |
array optional. An array containing the following fields:
|
arguments |
list optional. Parameter-value pairs to use when running this script. Only settable if this script has defined parameters. |
schedule |
list optional. A list containing the following elements:
|
notifications |
list optional. A list containing the following elements:
|
next_run_at |
string optional. The time of the next scheduled run. |
time_zone |
string optional. The time zone of this script. |
target_project_id |
integer optional. Target project to which script outputs will be added. |
A list containing the following elements:
id |
integer, The ID for the script. |
name |
string, The name of the script. |
type |
string, The type of the script (e.g SQL, Container, Python, R, JavaScript) |
createdAt |
string, The time this script was created. |
updatedAt |
string, The time the script was last updated. |
author |
list, A list containing the following elements:
|
state |
string, The status of the script's last run. |
finishedAt |
string, The time that the script's last run finished. |
category |
string, The category of the script. |
projects |
array, An array containing the following fields:
|
parentId |
integer, The ID of the parent job that will trigger this script |
userContext |
string, "runner" or "author", who to execute the script as when run as a template. |
params |
array, An array containing the following fields:
|
arguments |
list, Parameter-value pairs to use when running this script. Only settable if this script has defined parameters. |
isTemplate |
boolean, Whether others scripts use this one as a template. |
publishedAsTemplateId |
integer, The ID of the template that this script is backing. |
fromTemplateId |
integer, The ID of the template this script uses, if any. |
templateDependentsCount |
integer, How many other scripts use this one as a template. |
templateScriptName |
string, The name of the template script. |
links |
list, A list containing the following elements:
|
schedule |
list, A list containing the following elements:
|
notifications |
list, A list containing the following elements:
|
runningAs |
list, A list containing the following elements:
|
nextRunAt |
string, The time of the next scheduled run. |
timeZone |
string, The time zone of this script. |
lastRun |
list, A list containing the following elements:
|
hidden |
boolean, The hidden status of the item. |
targetProjectId |
integer, Target project to which script outputs will be added. |
archived |
string, The archival status of the requested item(s). |
source |
string, The body/text of the script. |
remoteHostId |
integer, The remote host ID that this script will connect to. |
credentialId |
integer, The credential that this script will use. |
Update the archive status of this object
scripts_put_javascript_archive(id, status)
scripts_put_javascript_archive(id, status)
id |
integer required. The ID of the object. |
status |
boolean required. The desired archived status of the object. |
A list containing the following elements:
id |
integer, The ID for the script. |
name |
string, The name of the script. |
type |
string, The type of the script (e.g SQL, Container, Python, R, JavaScript) |
createdAt |
string, The time this script was created. |
updatedAt |
string, The time the script was last updated. |
author |
list, A list containing the following elements:
|
state |
string, The status of the script's last run. |
finishedAt |
string, The time that the script's last run finished. |
category |
string, The category of the script. |
projects |
array, An array containing the following fields:
|
parentId |
integer, The ID of the parent job that will trigger this script |
userContext |
string, "runner" or "author", who to execute the script as when run as a template. |
params |
array, An array containing the following fields:
|
arguments |
list, Parameter-value pairs to use when running this script. Only settable if this script has defined parameters. |
isTemplate |
boolean, Whether others scripts use this one as a template. |
publishedAsTemplateId |
integer, The ID of the template that this script is backing. |
fromTemplateId |
integer, The ID of the template this script uses, if any. |
templateDependentsCount |
integer, How many other scripts use this one as a template. |
templateScriptName |
string, The name of the template script. |
links |
list, A list containing the following elements:
|
schedule |
list, A list containing the following elements:
|
notifications |
list, A list containing the following elements:
|
runningAs |
list, A list containing the following elements:
|
nextRunAt |
string, The time of the next scheduled run. |
timeZone |
string, The time zone of this script. |
lastRun |
list, A list containing the following elements:
|
hidden |
boolean, The hidden status of the item. |
targetProjectId |
integer, Target project to which script outputs will be added. |
archived |
string, The archival status of the requested item(s). |
source |
string, The body/text of the script. |
remoteHostId |
integer, The remote host ID that this script will connect to. |
credentialId |
integer, The credential that this script will use. |
Attach an item to a file in a git repo
scripts_put_javascript_git( id, git_ref = NULL, git_branch = NULL, git_path = NULL, git_repo_url = NULL, pull_from_git = NULL )
scripts_put_javascript_git( id, git_ref = NULL, git_branch = NULL, git_path = NULL, git_repo_url = NULL, pull_from_git = NULL )
id |
integer required. The ID of the file. |
git_ref |
string 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_branch |
string optional. The git branch that the file is on. |
git_path |
string optional. The path of the file in the repository. |
git_repo_url |
string optional. The URL of the git repository. |
pull_from_git |
boolean optional. Automatically pull latest commit from git. Only works for scripts. |
A list containing the following elements:
gitRef |
string, A git reference specifying an unambiguous version of the file. Can be a branch name, or the full or shortened SHA of a commit. |
gitBranch |
string, The git branch that the file is on. |
gitPath |
string, The path of the file in the repository. |
gitRepo |
list, A list containing the following elements:
|
pullFromGit |
boolean, Automatically pull latest commit from git. Only works for scripts. |
Add a JavaScript Script to a project
scripts_put_javascript_projects(id, project_id)
scripts_put_javascript_projects(id, project_id)
id |
integer required. The ID of the JavaScript Script. |
project_id |
integer required. The ID of the project. |
An empty HTTP response
Replace all attributes of this Python Script
scripts_put_python3( id, name, source, parent_id = NULL, user_context = NULL, params = NULL, arguments = NULL, schedule = NULL, notifications = NULL, next_run_at = NULL, time_zone = NULL, target_project_id = NULL, required_resources = NULL, instance_type = NULL, cancel_timeout = NULL, docker_image_tag = NULL )
scripts_put_python3( id, name, source, parent_id = NULL, user_context = NULL, params = NULL, arguments = NULL, schedule = NULL, notifications = NULL, next_run_at = NULL, time_zone = NULL, target_project_id = NULL, required_resources = NULL, instance_type = NULL, cancel_timeout = NULL, docker_image_tag = NULL )
id |
integer required. The ID for the script. |
name |
string required. The name of the script. |
source |
string required. The body/text of the script. |
parent_id |
integer optional. The ID of the parent job that will trigger this script |
user_context |
string optional. "runner" or "author", who to execute the script as when run as a template. |
params |
array optional. An array containing the following fields:
|
arguments |
list optional. Parameter-value pairs to use when running this script. Only settable if this script has defined parameters. |
schedule |
list optional. A list containing the following elements:
|
notifications |
list optional. A list containing the following elements:
|
next_run_at |
string optional. The time of the next scheduled run. |
time_zone |
string optional. The time zone of this script. |
target_project_id |
integer optional. Target project to which script outputs will be added. |
required_resources |
list optional. A list containing the following elements:
|
instance_type |
string optional. The EC2 instance type to deploy to. Only available for jobs running on kubernetes. |
cancel_timeout |
integer 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_tag |
string optional. The tag of the docker image to pull from DockerHub. |
A list containing the following elements:
id |
integer, The ID for the script. |
name |
string, The name of the script. |
type |
string, The type of the script (e.g SQL, Container, Python, R, JavaScript) |
createdAt |
string, The time this script was created. |
updatedAt |
string, The time the script was last updated. |
author |
list, A list containing the following elements:
|
state |
string, The status of the script's last run. |
finishedAt |
string, The time that the script's last run finished. |
category |
string, The category of the script. |
projects |
array, An array containing the following fields:
|
parentId |
integer, The ID of the parent job that will trigger this script |
userContext |
string, "runner" or "author", who to execute the script as when run as a template. |
params |
array, An array containing the following fields:
|
arguments |
list, Parameter-value pairs to use when running this script. Only settable if this script has defined parameters. |
isTemplate |
boolean, Whether others scripts use this one as a template. |
publishedAsTemplateId |
integer, The ID of the template that this script is backing. |
fromTemplateId |
integer, The ID of the template this script uses, if any. |
templateDependentsCount |
integer, How many other scripts use this one as a template. |
templateScriptName |
string, The name of the template script. |
links |
list, A list containing the following elements:
|
schedule |
list, A list containing the following elements:
|
notifications |
list, A list containing the following elements:
|
runningAs |
list, A list containing the following elements:
|
nextRunAt |
string, The time of the next scheduled run. |
timeZone |
string, The time zone of this script. |
lastRun |
list, A list containing the following elements:
|
hidden |
boolean, The hidden status of the item. |
targetProjectId |
integer, Target project to which script outputs will be added. |
archived |
string, The archival status of the requested item(s). |
requiredResources |
list, A list containing the following elements:
|
instanceType |
string, The EC2 instance type to deploy to. Only available for jobs running on kubernetes. |
source |
string, The body/text of the script. |
cancelTimeout |
integer, 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. |
dockerImageTag |
string, The tag of the docker image to pull from DockerHub. |
Update the archive status of this object
scripts_put_python3_archive(id, status)
scripts_put_python3_archive(id, status)
id |
integer required. The ID of the object. |
status |
boolean required. The desired archived status of the object. |
A list containing the following elements:
id |
integer, The ID for the script. |
name |
string, The name of the script. |
type |
string, The type of the script (e.g SQL, Container, Python, R, JavaScript) |
createdAt |
string, The time this script was created. |
updatedAt |
string, The time the script was last updated. |
author |
list, A list containing the following elements:
|
state |
string, The status of the script's last run. |
finishedAt |
string, The time that the script's last run finished. |
category |
string, The category of the script. |
projects |
array, An array containing the following fields:
|
parentId |
integer, The ID of the parent job that will trigger this script |
userContext |
string, "runner" or "author", who to execute the script as when run as a template. |
params |
array, An array containing the following fields:
|
arguments |
list, Parameter-value pairs to use when running this script. Only settable if this script has defined parameters. |
isTemplate |
boolean, Whether others scripts use this one as a template. |
publishedAsTemplateId |
integer, The ID of the template that this script is backing. |
fromTemplateId |
integer, The ID of the template this script uses, if any. |
templateDependentsCount |
integer, How many other scripts use this one as a template. |
templateScriptName |
string, The name of the template script. |
links |
list, A list containing the following elements:
|
schedule |
list, A list containing the following elements:
|
notifications |
list, A list containing the following elements:
|
runningAs |
list, A list containing the following elements:
|
nextRunAt |
string, The time of the next scheduled run. |
timeZone |
string, The time zone of this script. |
lastRun |
list, A list containing the following elements:
|
hidden |
boolean, The hidden status of the item. |
targetProjectId |
integer, Target project to which script outputs will be added. |
archived |
string, The archival status of the requested item(s). |
requiredResources |
list, A list containing the following elements:
|
instanceType |
string, The EC2 instance type to deploy to. Only available for jobs running on kubernetes. |
source |
string, The body/text of the script. |
cancelTimeout |
integer, 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. |
dockerImageTag |
string, The tag of the docker image to pull from DockerHub. |
Attach an item to a file in a git repo
scripts_put_python3_git( id, git_ref = NULL, git_branch = NULL, git_path = NULL, git_repo_url = NULL, pull_from_git = NULL )
scripts_put_python3_git( id, git_ref = NULL, git_branch = NULL, git_path = NULL, git_repo_url = NULL, pull_from_git = NULL )
id |
integer required. The ID of the file. |
git_ref |
string 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_branch |
string optional. The git branch that the file is on. |
git_path |
string optional. The path of the file in the repository. |
git_repo_url |
string optional. The URL of the git repository. |
pull_from_git |
boolean optional. Automatically pull latest commit from git. Only works for scripts. |
A list containing the following elements:
gitRef |
string, A git reference specifying an unambiguous version of the file. Can be a branch name, or the full or shortened SHA of a commit. |
gitBranch |
string, The git branch that the file is on. |
gitPath |
string, The path of the file in the repository. |
gitRepo |
list, A list containing the following elements:
|
pullFromGit |
boolean, Automatically pull latest commit from git. Only works for scripts. |
Add a Python Script to a project
scripts_put_python3_projects(id, project_id)
scripts_put_python3_projects(id, project_id)
id |
integer required. The ID of the Python Script. |
project_id |
integer required. The ID of the project. |
An empty HTTP response
Replace all attributes of this R Script
scripts_put_r( id, name, source, parent_id = NULL, user_context = NULL, params = NULL, arguments = NULL, schedule = NULL, notifications = NULL, next_run_at = NULL, time_zone = NULL, target_project_id = NULL, required_resources = NULL, instance_type = NULL, cancel_timeout = NULL, docker_image_tag = NULL )
scripts_put_r( id, name, source, parent_id = NULL, user_context = NULL, params = NULL, arguments = NULL, schedule = NULL, notifications = NULL, next_run_at = NULL, time_zone = NULL, target_project_id = NULL, required_resources = NULL, instance_type = NULL, cancel_timeout = NULL, docker_image_tag = NULL )
id |
integer required. The ID for the script. |
name |
string required. The name of the script. |
source |
string required. The body/text of the script. |
parent_id |
integer optional. The ID of the parent job that will trigger this script |
user_context |
string optional. "runner" or "author", who to execute the script as when run as a template. |
params |
array optional. An array containing the following fields:
|
arguments |
list optional. Parameter-value pairs to use when running this script. Only settable if this script has defined parameters. |
schedule |
list optional. A list containing the following elements:
|
notifications |
list optional. A list containing the following elements:
|
next_run_at |
string optional. The time of the next scheduled run. |
time_zone |
string optional. The time zone of this script. |
target_project_id |
integer optional. Target project to which script outputs will be added. |
required_resources |
list optional. A list containing the following elements:
|
instance_type |
string optional. The EC2 instance type to deploy to. Only available for jobs running on kubernetes. |
cancel_timeout |
integer 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_tag |
string optional. The tag of the docker image to pull from DockerHub. |
A list containing the following elements:
id |
integer, The ID for the script. |
name |
string, The name of the script. |
type |
string, The type of the script (e.g SQL, Container, Python, R, JavaScript) |
createdAt |
string, The time this script was created. |
updatedAt |
string, The time the script was last updated. |
author |
list, A list containing the following elements:
|
state |
string, The status of the script's last run. |
finishedAt |
string, The time that the script's last run finished. |
category |
string, The category of the script. |
projects |
array, An array containing the following fields:
|
parentId |
integer, The ID of the parent job that will trigger this script |
userContext |
string, "runner" or "author", who to execute the script as when run as a template. |
params |
array, An array containing the following fields:
|
arguments |
list, Parameter-value pairs to use when running this script. Only settable if this script has defined parameters. |
isTemplate |
boolean, Whether others scripts use this one as a template. |
publishedAsTemplateId |
integer, The ID of the template that this script is backing. |
fromTemplateId |
integer, The ID of the template this script uses, if any. |
templateDependentsCount |
integer, How many other scripts use this one as a template. |
templateScriptName |
string, The name of the template script. |
links |
list, A list containing the following elements:
|
schedule |
list, A list containing the following elements:
|
notifications |
list, A list containing the following elements:
|
runningAs |
list, A list containing the following elements:
|
nextRunAt |
string, The time of the next scheduled run. |
timeZone |
string, The time zone of this script. |
lastRun |
list, A list containing the following elements:
|
hidden |
boolean, The hidden status of the item. |
targetProjectId |
integer, Target project to which script outputs will be added. |
archived |
string, The archival status of the requested item(s). |
requiredResources |
list, A list containing the following elements:
|
instanceType |
string, The EC2 instance type to deploy to. Only available for jobs running on kubernetes. |
source |
string, The body/text of the script. |
cancelTimeout |
integer, 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. |
dockerImageTag |
string, The tag of the docker image to pull from DockerHub. |
Update the archive status of this object
scripts_put_r_archive(id, status)
scripts_put_r_archive(id, status)
id |
integer required. The ID of the object. |
status |
boolean required. The desired archived status of the object. |
A list containing the following elements:
id |
integer, The ID for the script. |
name |
string, The name of the script. |
type |
string, The type of the script (e.g SQL, Container, Python, R, JavaScript) |
createdAt |
string, The time this script was created. |
updatedAt |
string, The time the script was last updated. |
author |
list, A list containing the following elements:
|
state |
string, The status of the script's last run. |
finishedAt |
string, The time that the script's last run finished. |
category |
string, The category of the script. |
projects |
array, An array containing the following fields:
|
parentId |
integer, The ID of the parent job that will trigger this script |
userContext |
string, "runner" or "author", who to execute the script as when run as a template. |
params |
array, An array containing the following fields:
|
arguments |
list, Parameter-value pairs to use when running this script. Only settable if this script has defined parameters. |
isTemplate |
boolean, Whether others scripts use this one as a template. |
publishedAsTemplateId |
integer, The ID of the template that this script is backing. |
fromTemplateId |
integer, The ID of the template this script uses, if any. |
templateDependentsCount |
integer, How many other scripts use this one as a template. |
templateScriptName |
string, The name of the template script. |
links |
list, A list containing the following elements:
|
schedule |
list, A list containing the following elements:
|
notifications |
list, A list containing the following elements:
|
runningAs |
list, A list containing the following elements:
|
nextRunAt |
string, The time of the next scheduled run. |
timeZone |
string, The time zone of this script. |
lastRun |
list, A list containing the following elements:
|
hidden |
boolean, The hidden status of the item. |
targetProjectId |
integer, Target project to which script outputs will be added. |
archived |
string, The archival status of the requested item(s). |
requiredResources |
list, A list containing the following elements:
|
instanceType |
string, The EC2 instance type to deploy to. Only available for jobs running on kubernetes. |
source |
string, The body/text of the script. |
cancelTimeout |
integer, 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. |
dockerImageTag |
string, The tag of the docker image to pull from DockerHub. |
Attach an item to a file in a git repo
scripts_put_r_git( id, git_ref = NULL, git_branch = NULL, git_path = NULL, git_repo_url = NULL, pull_from_git = NULL )
scripts_put_r_git( id, git_ref = NULL, git_branch = NULL, git_path = NULL, git_repo_url = NULL, pull_from_git = NULL )
id |
integer required. The ID of the file. |
git_ref |
string 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_branch |
string optional. The git branch that the file is on. |
git_path |
string optional. The path of the file in the repository. |
git_repo_url |
string optional. The URL of the git repository. |
pull_from_git |
boolean optional. Automatically pull latest commit from git. Only works for scripts. |
A list containing the following elements:
gitRef |
string, A git reference specifying an unambiguous version of the file. Can be a branch name, or the full or shortened SHA of a commit. |
gitBranch |
string, The git branch that the file is on. |
gitPath |
string, The path of the file in the repository. |
gitRepo |
list, A list containing the following elements:
|
pullFromGit |
boolean, Automatically pull latest commit from git. Only works for scripts. |
Add an R Script to a project
scripts_put_r_projects(id, project_id)
scripts_put_r_projects(id, project_id)
id |
integer required. The ID of the R Script. |
project_id |
integer required. The ID of the project. |
An empty HTTP response
Replace all attributes of this SQL script
scripts_put_sql( id, name, sql, remote_host_id, credential_id, parent_id = NULL, user_context = NULL, params = NULL, arguments = NULL, schedule = NULL, notifications = NULL, next_run_at = NULL, time_zone = NULL, target_project_id = NULL, csv_settings = NULL )
scripts_put_sql( id, name, sql, remote_host_id, credential_id, parent_id = NULL, user_context = NULL, params = NULL, arguments = NULL, schedule = NULL, notifications = NULL, next_run_at = NULL, time_zone = NULL, target_project_id = NULL, csv_settings = NULL )
id |
integer required. The ID for the script. |
name |
string required. The name of the script. |
sql |
string required. The raw SQL query for the script. |
remote_host_id |
integer required. The remote host ID that this script will connect to. |
credential_id |
integer required. The credential that this script will use. |
parent_id |
integer optional. The ID of the parent job that will trigger this script |
user_context |
string optional. "runner" or "author", who to execute the script as when run as a template. |
params |
array optional. An array containing the following fields:
|
arguments |
list optional. Parameter-value pairs to use when running this script. Only settable if this script has defined parameters. |
schedule |
list optional. A list containing the following elements:
|
notifications |
list optional. A list containing the following elements:
|
next_run_at |
string optional. The time of the next scheduled run. |
time_zone |
string optional. The time zone of this script. |
target_project_id |
integer optional. Target project to which script outputs will be added. |
csv_settings |
list optional. A list containing the following elements:
|
A list containing the following elements:
id |
integer, The ID for the script. |
name |
string, The name of the script. |
type |
string, The type of the script (e.g SQL, Container, Python, R, JavaScript) |
createdAt |
string, The time this script was created. |
updatedAt |
string, The time the script was last updated. |
author |
list, A list containing the following elements:
|
state |
string, The status of the script's last run. |
finishedAt |
string, The time that the script's last run finished. |
category |
string, The category of the script. |
projects |
array, An array containing the following fields:
|
parentId |
integer, The ID of the parent job that will trigger this script |
userContext |
string, "runner" or "author", who to execute the script as when run as a template. |
params |
array, An array containing the following fields:
|
arguments |
list, Parameter-value pairs to use when running this script. Only settable if this script has defined parameters. |
isTemplate |
boolean, Whether others scripts use this one as a template. |
publishedAsTemplateId |
integer, The ID of the template that this script is backing. |
fromTemplateId |
integer, The ID of the template this script uses, if any. |
templateDependentsCount |
integer, How many other scripts use this one as a template. |
templateScriptName |
string, The name of the template script. |
links |
list, A list containing the following elements:
|
schedule |
list, A list containing the following elements:
|
notifications |
list, A list containing the following elements:
|
runningAs |
list, A list containing the following elements:
|
nextRunAt |
string, The time of the next scheduled run. |
timeZone |
string, The time zone of this script. |
lastRun |
list, A list containing the following elements:
|
hidden |
boolean, The hidden status of the item. |
targetProjectId |
integer, Target project to which script outputs will be added. |
archived |
string, The archival status of the requested item(s). |
sql |
string, The raw SQL query for the script. |
expandedArguments |
list, Expanded arguments for use in injecting into different environments. |
remoteHostId |
integer, The remote host ID that this script will connect to. |
credentialId |
integer, The credential that this script will use. |
codePreview |
string, The code that this script will run with arguments inserted. |
csvSettings |
list, A list containing the following elements:
|
Update the archive status of this object
scripts_put_sql_archive(id, status)
scripts_put_sql_archive(id, status)
id |
integer required. The ID of the object. |
status |
boolean required. The desired archived status of the object. |
A list containing the following elements:
id |
integer, The ID for the script. |
name |
string, The name of the script. |
type |
string, The type of the script (e.g SQL, Container, Python, R, JavaScript) |
createdAt |
string, The time this script was created. |
updatedAt |
string, The time the script was last updated. |
author |
list, A list containing the following elements:
|
state |
string, The status of the script's last run. |
finishedAt |
string, The time that the script's last run finished. |
category |
string, The category of the script. |
projects |
array, An array containing the following fields:
|
parentId |
integer, The ID of the parent job that will trigger this script |
userContext |
string, "runner" or "author", who to execute the script as when run as a template. |
params |
array, An array containing the following fields:
|
arguments |
list, Parameter-value pairs to use when running this script. Only settable if this script has defined parameters. |
isTemplate |
boolean, Whether others scripts use this one as a template. |
publishedAsTemplateId |
integer, The ID of the template that this script is backing. |
fromTemplateId |
integer, The ID of the template this script uses, if any. |
templateDependentsCount |
integer, How many other scripts use this one as a template. |
templateScriptName |
string, The name of the template script. |
links |
list, A list containing the following elements:
|
schedule |
list, A list containing the following elements:
|
notifications |
list, A list containing the following elements:
|
runningAs |
list, A list containing the following elements:
|
nextRunAt |
string, The time of the next scheduled run. |
timeZone |
string, The time zone of this script. |
lastRun |
list, A list containing the following elements:
|
hidden |
boolean, The hidden status of the item. |
targetProjectId |
integer, Target project to which script outputs will be added. |
archived |
string, The archival status of the requested item(s). |
sql |
string, The raw SQL query for the script. |
expandedArguments |
list, Expanded arguments for use in injecting into different environments. |
remoteHostId |
integer, The remote host ID that this script will connect to. |
credentialId |
integer, The credential that this script will use. |
codePreview |
string, The code that this script will run with arguments inserted. |
csvSettings |
list, A list containing the following elements:
|
Attach an item to a file in a git repo
scripts_put_sql_git( id, git_ref = NULL, git_branch = NULL, git_path = NULL, git_repo_url = NULL, pull_from_git = NULL )
scripts_put_sql_git( id, git_ref = NULL, git_branch = NULL, git_path = NULL, git_repo_url = NULL, pull_from_git = NULL )
id |
integer required. The ID of the file. |
git_ref |
string 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_branch |
string optional. The git branch that the file is on. |
git_path |
string optional. The path of the file in the repository. |
git_repo_url |
string optional. The URL of the git repository. |
pull_from_git |
boolean optional. Automatically pull latest commit from git. Only works for scripts. |
A list containing the following elements:
gitRef |
string, A git reference specifying an unambiguous version of the file. Can be a branch name, or the full or shortened SHA of a commit. |
gitBranch |
string, The git branch that the file is on. |
gitPath |
string, The path of the file in the repository. |
gitRepo |
list, A list containing the following elements:
|
pullFromGit |
boolean, Automatically pull latest commit from git. Only works for scripts. |
Add a SQL script to a project
scripts_put_sql_projects(id, project_id)
scripts_put_sql_projects(id, project_id)
id |
integer required. The ID of the SQL script. |
project_id |
integer required. The ID of the project. |
An empty HTTP response
Perform a search
search_list( query = NULL, type = NULL, offset = NULL, order = NULL, owner = NULL, limit = NULL, archived = NULL, last_run_state = NULL )
search_list( query = NULL, type = NULL, offset = NULL, order = NULL, owner = NULL, limit = NULL, archived = NULL, last_run_state = NULL )
query |
string optional. The search query. |
type |
string optional. The type for the search. It accepts a comma-separated list. Valid arguments are listed on the "GET /search/types" endpoint. |
offset |
integer optional. The offset for the search results. |
order |
string optional. The field on which to order the result set. |
owner |
string optional. The owner for the search. |
limit |
integer optional. Defaults to 10. Maximum allowed is 1000. |
archived |
string optional. If specified, return only results with the chosen archived status; either 'true', 'false', or 'all'. Defaults to 'false'. |
last_run_state |
string optional. The last run state of the job being searched for; either: 'queued', 'running', 'succeeded', 'failed', or 'cancelled'. |
An array containing the following fields:
totalResults |
integer, The number of items matching the search query. |
aggregations |
list, Aggregations by owner and type for the search results. |
results |
array, An array containing the following fields:
|
List available search types
search_list_types()
search_list_types()
An array containing the following fields:
type |
string, The name of the item type. |
Archive a Service (deprecated, use archiving endpoints instead)
services_delete(id)
services_delete(id)
id |
integer required. |
An empty HTTP response
Delete a Service deployment
services_delete_deployments(service_id, deployment_id)
services_delete_deployments(service_id, deployment_id)
service_id |
integer required. The ID of the owning Service |
deployment_id |
integer required. The ID for this deployment |
An empty HTTP response
Remove a Service from a project
services_delete_projects(id, project_id)
services_delete_projects(id, project_id)
id |
integer required. The ID of the Service. |
project_id |
integer required. The ID of the project. |
An empty HTTP response
Revoke a token by id
services_delete_tokens(id, token_id)
services_delete_tokens(id, token_id)
id |
integer required. The ID of the service. |
token_id |
integer required. The ID of the token. |
An empty HTTP response
Get a Service
services_get(id)
services_get(id)
id |
integer required. |
A list containing the following elements:
id |
integer, The ID for this Service. |
name |
string, The name of this Service. |
description |
string, The description of this Service. |
user |
list, A list containing the following elements:
|
type |
string, The type of this Service |
dockerImageName |
string, The name of the docker image to pull from DockerHub. |
dockerImageTag |
string, The tag of the docker image to pull from DockerHub (default: latest). |
schedule |
list, A list containing the following elements:
|
timeZone |
string, |
replicas |
integer, The number of Service replicas to deploy. When maxReplicas is set, this field defines the minimum number of replicas to deploy. |
maxReplicas |
integer, The maximum number of Service replicas to deploy. Defining this field enables autoscaling. |
instanceType |
string, The EC2 instance type to deploy to. |
memory |
integer, The amount of memory allocated to each replica of the Service. |
cpu |
integer, The amount of cpu allocated to each replica of the the Service. |
createdAt |
string, |
updatedAt |
string, |
credentials |
array, A list of credential IDs to pass to the Service. |
apiKeyId |
integer, API key id of user |
permissionSetId |
integer, The ID of the associated permission set, if any. |
gitRepoUrl |
string, The url for the git repo where the Service code lives. |
gitRepoRef |
string, The git reference to use when pulling code from the repo. |
gitPathDir |
string, The path to the Service code within the git repo. If unspecified, the root directory will be used. |
reportId |
integer, The ID of the associated report. |
currentDeployment |
list, A list containing the following elements:
|
previewDeployment |
list, A list containing the following elements:
|
currentUrl |
string, The URL that the service is hosted at. |
previewUrl |
string, The URL that previews of the service are hosted at. |
environmentVariables |
list, Environment Variables to be passed into the Service. |
notifications |
list, A list containing the following elements:
|
archived |
string, The archival status of the requested item(s). |
hidden |
boolean, The hidden status of the item. |
Get details about a Service deployment
services_get_deployments(service_id, deployment_id)
services_get_deployments(service_id, deployment_id)
service_id |
integer required. The ID of the owning Service |
deployment_id |
integer required. The ID for this deployment |
A list containing the following elements:
deploymentId |
integer, The ID for this deployment. |
userId |
integer, The ID of the owner. |
host |
string, Domain of the deployment. |
name |
string, Name of the deployment. |
dockerImageName |
string, The name of the docker image to pull from DockerHub. |
dockerImageTag |
string, The tag of the docker image to pull from DockerHub (default: latest). |
displayUrl |
string, A signed URL for viewing the deployed item. |
instanceType |
string, The EC2 instance type requested for the deployment. |
memory |
integer, The memory allocated to the deployment. |
cpu |
integer, The cpu allocated to the deployment. |
state |
string, The state of the deployment. |
stateMessage |
string, A detailed description of the state. |
createdAt |
string, |
updatedAt |
string, |
published |
boolean, |
serviceId |
integer, The ID of owning Service |
List Services
services_list( hidden = NULL, archived = NULL, author = NULL, status = NULL, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
services_list( hidden = NULL, archived = NULL, author = NULL, status = NULL, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
boolean optional. If specified to be true, returns hidden items. Defaults to false, returning non-hidden items. |
|
archived |
string optional. The archival status of the requested item(s). |
author |
string optional. If specified, return imports from this author. It accepts a comma-separated list of author IDs. |
status |
string optional. If specified, returns Services with one of these statuses. It accepts a comma-separated list, possible values are 'running', 'idle'. |
limit |
integer optional. Number of results to return. Defaults to 20. Maximum allowed is 50. |
page_num |
integer optional. Page number of the results to return. Defaults to the first page, 1. |
order |
string optional. The field on which to order the result set. Defaults to updated_at. Must be one of: updated_at, name, created_at. |
order_dir |
string optional. Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc. |
An array containing the following fields:
id |
integer, The ID for this Service. |
name |
string, The name of this Service. |
description |
string, The description of this Service. |
user |
list, A list containing the following elements:
|
type |
string, The type of this Service |
createdAt |
string, |
updatedAt |
string, |
gitRepoUrl |
string, The url for the git repo where the Service code lives. |
gitRepoRef |
string, The git reference to use when pulling code from the repo. |
gitPathDir |
string, The path to the Service code within the git repo. If unspecified, the root directory will be used. |
currentDeployment |
list, A list containing the following elements:
|
previewDeployment |
list, A list containing the following elements:
|
archived |
string, The archival status of the requested item(s). |
List deployments for a Service
services_list_deployments( service_id, deployment_id = NULL, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
services_list_deployments( service_id, deployment_id = NULL, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
service_id |
integer required. The ID of the owning Service |
deployment_id |
integer optional. The ID for this deployment |
limit |
integer optional. Number of results to return. Defaults to 20. Maximum allowed is 50. |
page_num |
integer optional. Page number of the results to return. Defaults to the first page, 1. |
order |
string optional. The field on which to order the result set. Defaults to created_at. Must be one of: created_at. |
order_dir |
string optional. Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc. |
An array containing the following fields:
deploymentId |
integer, The ID for this deployment. |
userId |
integer, The ID of the owner. |
host |
string, Domain of the deployment. |
name |
string, Name of the deployment. |
dockerImageName |
string, The name of the docker image to pull from DockerHub. |
dockerImageTag |
string, The tag of the docker image to pull from DockerHub (default: latest). |
instanceType |
string, The EC2 instance type requested for the deployment. |
memory |
integer, The memory allocated to the deployment. |
cpu |
integer, The cpu allocated to the deployment. |
state |
string, The state of the deployment. |
stateMessage |
string, A detailed description of the state. |
createdAt |
string, |
updatedAt |
string, |
published |
boolean, |
serviceId |
integer, The ID of owning Service |
Get the logs for a Service deployment
services_list_deployments_logs( id, deployment_id, start_at = NULL, end_at = NULL, limit = NULL )
services_list_deployments_logs( id, deployment_id, start_at = NULL, end_at = NULL, limit = NULL )
id |
integer required. The ID of the owning Service. |
deployment_id |
integer required. The ID for this deployment. |
start_at |
string optional. Log entries with a lower timestamp will be omitted. |
end_at |
string optional. Log entries with a higher timestamp will be omitted. |
limit |
integer optional. The maximum number of log messages to return. Default of 10000. |
An array containing the following fields:
message |
string, The log message. |
stream |
string, The stream of the log. One of "stdout", "stderr". |
createdAt |
string, The time the log was created. |
source |
string, The source of the log. One of "system", "user". |
List the projects a Service belongs to
services_list_projects(id, hidden = NULL)
services_list_projects(id, hidden = NULL)
id |
integer required. The ID of the Service. |
boolean optional. If specified to be true, returns hidden items. Defaults to false, returning non-hidden items. |
An array containing the following fields:
id |
integer, The ID for this project. |
author |
list, A list containing the following elements:
|
name |
string, The name of this project. |
description |
string, A description of the project. |
users |
array, An array containing the following fields:
|
autoShare |
boolean, |
createdAt |
string, |
updatedAt |
string, |
archived |
string, The archival status of the requested item(s). |
List tokens
services_list_tokens(id)
services_list_tokens(id)
id |
integer required. The ID of the service. |
An array containing the following fields:
id |
integer, The ID of the token. |
name |
string, The name of the token. |
user |
list, A list containing the following elements:
|
machineToken |
boolean, If true, this token is not tied to a particular user. |
createdAt |
string, The date and time when the token was created. |
Update some attributes of this Service
services_patch( id, name = NULL, description = NULL, docker_image_name = NULL, docker_image_tag = NULL, schedule = NULL, replicas = NULL, max_replicas = NULL, instance_type = NULL, memory = NULL, cpu = NULL, credentials = NULL, api_key_id = NULL, permission_set_id = NULL, git_repo_url = NULL, git_repo_ref = NULL, git_path_dir = NULL, environment_variables = NULL, notifications = NULL )
services_patch( id, name = NULL, description = NULL, docker_image_name = NULL, docker_image_tag = NULL, schedule = NULL, replicas = NULL, max_replicas = NULL, instance_type = NULL, memory = NULL, cpu = NULL, credentials = NULL, api_key_id = NULL, permission_set_id = NULL, git_repo_url = NULL, git_repo_ref = NULL, git_path_dir = NULL, environment_variables = NULL, notifications = NULL )
id |
integer required. The ID for this Service. |
name |
string optional. The name of this Service. |
description |
string optional. The description of this Service. |
docker_image_name |
string optional. The name of the docker image to pull from DockerHub. |
docker_image_tag |
string optional. The tag of the docker image to pull from DockerHub (default: latest). |
schedule |
list optional. A list containing the following elements:
|
replicas |
integer optional. The number of Service replicas to deploy. When maxReplicas is set, this field defines the minimum number of replicas to deploy. |
max_replicas |
integer optional. The maximum number of Service replicas to deploy. Defining this field enables autoscaling. |
instance_type |
string optional. The EC2 instance type to deploy to. |
memory |
integer optional. The amount of memory allocated to each replica of the Service. |
cpu |
integer optional. The amount of cpu allocated to each replica of the the Service. |
credentials |
array optional. A list of credential IDs to pass to the Service. |
api_key_id |
integer optional. API key id of user |
permission_set_id |
integer optional. The ID of the associated permission set, if any. |
git_repo_url |
string optional. The url for the git repo where the Service code lives. |
git_repo_ref |
string optional. The git reference to use when pulling code from the repo. |
git_path_dir |
string optional. The path to the Service code within the git repo. If unspecified, the root directory will be used. |
environment_variables |
list optional. Environment Variables to be passed into the Service. |
notifications |
list optional. A list containing the following elements:
|
A list containing the following elements:
id |
integer, The ID for this Service. |
name |
string, The name of this Service. |
description |
string, The description of this Service. |
user |
list, A list containing the following elements:
|
type |
string, The type of this Service |
dockerImageName |
string, The name of the docker image to pull from DockerHub. |
dockerImageTag |
string, The tag of the docker image to pull from DockerHub (default: latest). |
schedule |
list, A list containing the following elements:
|
timeZone |
string, |
replicas |
integer, The number of Service replicas to deploy. When maxReplicas is set, this field defines the minimum number of replicas to deploy. |
maxReplicas |
integer, The maximum number of Service replicas to deploy. Defining this field enables autoscaling. |
instanceType |
string, The EC2 instance type to deploy to. |
memory |
integer, The amount of memory allocated to each replica of the Service. |
cpu |
integer, The amount of cpu allocated to each replica of the the Service. |
createdAt |
string, |
updatedAt |
string, |
credentials |
array, A list of credential IDs to pass to the Service. |
apiKeyId |
integer, API key id of user |
permissionSetId |
integer, The ID of the associated permission set, if any. |
gitRepoUrl |
string, The url for the git repo where the Service code lives. |
gitRepoRef |
string, The git reference to use when pulling code from the repo. |
gitPathDir |
string, The path to the Service code within the git repo. If unspecified, the root directory will be used. |
reportId |
integer, The ID of the associated report. |
currentDeployment |
list, A list containing the following elements:
|
previewDeployment |
list, A list containing the following elements:
|
currentUrl |
string, The URL that the service is hosted at. |
previewUrl |
string, The URL that previews of the service are hosted at. |
environmentVariables |
list, Environment Variables to be passed into the Service. |
notifications |
list, A list containing the following elements:
|
archived |
string, The archival status of the requested item(s). |
hidden |
boolean, The hidden status of the item. |
Create a Service
services_post( name = NULL, description = NULL, type = NULL, docker_image_name = NULL, docker_image_tag = NULL, schedule = NULL, replicas = NULL, max_replicas = NULL, instance_type = NULL, memory = NULL, cpu = NULL, credentials = NULL, api_key_id = NULL, permission_set_id = NULL, git_repo_url = NULL, git_repo_ref = NULL, git_path_dir = NULL, environment_variables = NULL, notifications = NULL, hidden = NULL )
services_post( name = NULL, description = NULL, type = NULL, docker_image_name = NULL, docker_image_tag = NULL, schedule = NULL, replicas = NULL, max_replicas = NULL, instance_type = NULL, memory = NULL, cpu = NULL, credentials = NULL, api_key_id = NULL, permission_set_id = NULL, git_repo_url = NULL, git_repo_ref = NULL, git_path_dir = NULL, environment_variables = NULL, notifications = NULL, hidden = NULL )
name |
string optional. The name of this Service. |
description |
string optional. The description of this Service. |
type |
string optional. The type of this Service |
docker_image_name |
string optional. The name of the docker image to pull from DockerHub. |
docker_image_tag |
string optional. The tag of the docker image to pull from DockerHub (default: latest). |
schedule |
list optional. A list containing the following elements:
|
replicas |
integer optional. The number of Service replicas to deploy. When maxReplicas is set, this field defines the minimum number of replicas to deploy. |
max_replicas |
integer optional. The maximum number of Service replicas to deploy. Defining this field enables autoscaling. |
instance_type |
string optional. The EC2 instance type to deploy to. |
memory |
integer optional. The amount of memory allocated to each replica of the Service. |
cpu |
integer optional. The amount of cpu allocated to each replica of the the Service. |
credentials |
array optional. A list of credential IDs to pass to the Service. |
api_key_id |
integer optional. API key id of user |
permission_set_id |
integer optional. The ID of the associated permission set, if any. |
git_repo_url |
string optional. The url for the git repo where the Service code lives. |
git_repo_ref |
string optional. The git reference to use when pulling code from the repo. |
git_path_dir |
string optional. The path to the Service code within the git repo. If unspecified, the root directory will be used. |
environment_variables |
list optional. Environment Variables to be passed into the Service. |
notifications |
list optional. A list containing the following elements:
|
boolean optional. The hidden status of the item. |
A list containing the following elements:
id |
integer, The ID for this Service. |
name |
string, The name of this Service. |
description |
string, The description of this Service. |
user |
list, A list containing the following elements:
|
type |
string, The type of this Service |
dockerImageName |
string, The name of the docker image to pull from DockerHub. |
dockerImageTag |
string, The tag of the docker image to pull from DockerHub (default: latest). |
schedule |
list, A list containing the following elements:
|
timeZone |
string, |
replicas |
integer, The number of Service replicas to deploy. When maxReplicas is set, this field defines the minimum number of replicas to deploy. |
maxReplicas |
integer, The maximum number of Service replicas to deploy. Defining this field enables autoscaling. |
instanceType |
string, The EC2 instance type to deploy to. |
memory |
integer, The amount of memory allocated to each replica of the Service. |
cpu |
integer, The amount of cpu allocated to each replica of the the Service. |
createdAt |
string, |
updatedAt |
string, |
credentials |
array, A list of credential IDs to pass to the Service. |
apiKeyId |
integer, API key id of user |
permissionSetId |
integer, The ID of the associated permission set, if any. |
gitRepoUrl |
string, The url for the git repo where the Service code lives. |
gitRepoRef |
string, The git reference to use when pulling code from the repo. |
gitPathDir |
string, The path to the Service code within the git repo. If unspecified, the root directory will be used. |
reportId |
integer, The ID of the associated report. |
currentDeployment |
list, A list containing the following elements:
|
previewDeployment |
list, A list containing the following elements:
|
currentUrl |
string, The URL that the service is hosted at. |
previewUrl |
string, The URL that previews of the service are hosted at. |
environmentVariables |
list, Environment Variables to be passed into the Service. |
notifications |
list, A list containing the following elements:
|
archived |
string, The archival status of the requested item(s). |
hidden |
boolean, The hidden status of the item. |
Clone this Service
services_post_clone(id)
services_post_clone(id)
id |
integer required. |
A list containing the following elements:
id |
integer, The ID for this Service. |
name |
string, The name of this Service. |
description |
string, The description of this Service. |
user |
list, A list containing the following elements:
|
type |
string, The type of this Service |
dockerImageName |
string, The name of the docker image to pull from DockerHub. |
dockerImageTag |
string, The tag of the docker image to pull from DockerHub (default: latest). |
schedule |
list, A list containing the following elements:
|
timeZone |
string, |
replicas |
integer, The number of Service replicas to deploy. When maxReplicas is set, this field defines the minimum number of replicas to deploy. |
maxReplicas |
integer, The maximum number of Service replicas to deploy. Defining this field enables autoscaling. |
instanceType |
string, The EC2 instance type to deploy to. |
memory |
integer, The amount of memory allocated to each replica of the Service. |
cpu |
integer, The amount of cpu allocated to each replica of the the Service. |
createdAt |
string, |
updatedAt |
string, |
credentials |
array, A list of credential IDs to pass to the Service. |
apiKeyId |
integer, API key id of user |
permissionSetId |
integer, The ID of the associated permission set, if any. |
gitRepoUrl |
string, The url for the git repo where the Service code lives. |
gitRepoRef |
string, The git reference to use when pulling code from the repo. |
gitPathDir |
string, The path to the Service code within the git repo. If unspecified, the root directory will be used. |
reportId |
integer, The ID of the associated report. |
currentDeployment |
list, A list containing the following elements:
|
previewDeployment |
list, A list containing the following elements:
|
currentUrl |
string, The URL that the service is hosted at. |
previewUrl |
string, The URL that previews of the service are hosted at. |
environmentVariables |
list, Environment Variables to be passed into the Service. |
notifications |
list, A list containing the following elements:
|
archived |
string, The archival status of the requested item(s). |
hidden |
boolean, The hidden status of the item. |
Deploy a Service
services_post_deployments(service_id, deployment_id = NULL, published = NULL)
services_post_deployments(service_id, deployment_id = NULL, published = NULL)
service_id |
integer required. The ID of the owning Service |
deployment_id |
integer optional. The ID for this deployment |
published |
boolean optional. |
A list containing the following elements:
deploymentId |
integer, The ID for this deployment. |
userId |
integer, The ID of the owner. |
host |
string, Domain of the deployment. |
name |
string, Name of the deployment. |
dockerImageName |
string, The name of the docker image to pull from DockerHub. |
dockerImageTag |
string, The tag of the docker image to pull from DockerHub (default: latest). |
displayUrl |
string, A signed URL for viewing the deployed item. |
instanceType |
string, The EC2 instance type requested for the deployment. |
memory |
integer, The memory allocated to the deployment. |
cpu |
integer, The cpu allocated to the deployment. |
state |
string, The state of the deployment. |
stateMessage |
string, A detailed description of the state. |
createdAt |
string, |
updatedAt |
string, |
published |
boolean, |
serviceId |
integer, The ID of owning Service |
Redeploy a Service
services_post_redeploy(service_id, deployment_id = NULL, published = NULL)
services_post_redeploy(service_id, deployment_id = NULL, published = NULL)
service_id |
integer required. The ID of the owning Service |
deployment_id |
integer optional. The ID for this deployment |
published |
boolean optional. |
A list containing the following elements:
deploymentId |
integer, The ID for this deployment. |
userId |
integer, The ID of the owner. |
host |
string, Domain of the deployment. |
name |
string, Name of the deployment. |
dockerImageName |
string, The name of the docker image to pull from DockerHub. |
dockerImageTag |
string, The tag of the docker image to pull from DockerHub (default: latest). |
displayUrl |
string, A signed URL for viewing the deployed item. |
instanceType |
string, The EC2 instance type requested for the deployment. |
memory |
integer, The memory allocated to the deployment. |
cpu |
integer, The cpu allocated to the deployment. |
state |
string, The state of the deployment. |
stateMessage |
string, A detailed description of the state. |
createdAt |
string, |
updatedAt |
string, |
published |
boolean, |
serviceId |
integer, The ID of owning Service |
Create a new long-lived service token
services_post_tokens(id, name, machine_token = NULL)
services_post_tokens(id, name, machine_token = NULL)
id |
integer required. The ID of the service. |
name |
string required. The name of the token. |
machine_token |
boolean optional. If true, create a compact token with no user information. |
A list containing the following elements:
id |
integer, The ID of the token. |
name |
string, The name of the token. |
user |
list, A list containing the following elements:
|
machineToken |
boolean, If true, this token is not tied to a particular user. |
createdAt |
string, The date and time when the token was created. |
token |
string, The value of the token. Only returned when the token is first created. |
Replace all attributes of this Service
services_put( id, name = NULL, description = NULL, docker_image_name = NULL, docker_image_tag = NULL, schedule = NULL, replicas = NULL, max_replicas = NULL, instance_type = NULL, memory = NULL, cpu = NULL, credentials = NULL, api_key_id = NULL, permission_set_id = NULL, git_repo_url = NULL, git_repo_ref = NULL, git_path_dir = NULL, environment_variables = NULL, notifications = NULL )
services_put( id, name = NULL, description = NULL, docker_image_name = NULL, docker_image_tag = NULL, schedule = NULL, replicas = NULL, max_replicas = NULL, instance_type = NULL, memory = NULL, cpu = NULL, credentials = NULL, api_key_id = NULL, permission_set_id = NULL, git_repo_url = NULL, git_repo_ref = NULL, git_path_dir = NULL, environment_variables = NULL, notifications = NULL )
id |
integer required. The ID for this Service. |
name |
string optional. The name of this Service. |
description |
string optional. The description of this Service. |
docker_image_name |
string optional. The name of the docker image to pull from DockerHub. |
docker_image_tag |
string optional. The tag of the docker image to pull from DockerHub (default: latest). |
schedule |
list optional. A list containing the following elements:
|
replicas |
integer optional. The number of Service replicas to deploy. When maxReplicas is set, this field defines the minimum number of replicas to deploy. |
max_replicas |
integer optional. The maximum number of Service replicas to deploy. Defining this field enables autoscaling. |
instance_type |
string optional. The EC2 instance type to deploy to. |
memory |
integer optional. The amount of memory allocated to each replica of the Service. |
cpu |
integer optional. The amount of cpu allocated to each replica of the the Service. |
credentials |
array optional. A list of credential IDs to pass to the Service. |
api_key_id |
integer optional. API key id of user |
permission_set_id |
integer optional. The ID of the associated permission set, if any. |
git_repo_url |
string optional. The url for the git repo where the Service code lives. |
git_repo_ref |
string optional. The git reference to use when pulling code from the repo. |
git_path_dir |
string optional. The path to the Service code within the git repo. If unspecified, the root directory will be used. |
environment_variables |
list optional. Environment Variables to be passed into the Service. |
notifications |
list optional. A list containing the following elements:
|
A list containing the following elements:
id |
integer, The ID for this Service. |
name |
string, The name of this Service. |
description |
string, The description of this Service. |
user |
list, A list containing the following elements:
|
type |
string, The type of this Service |
dockerImageName |
string, The name of the docker image to pull from DockerHub. |
dockerImageTag |
string, The tag of the docker image to pull from DockerHub (default: latest). |
schedule |
list, A list containing the following elements:
|
timeZone |
string, |
replicas |
integer, The number of Service replicas to deploy. When maxReplicas is set, this field defines the minimum number of replicas to deploy. |
maxReplicas |
integer, The maximum number of Service replicas to deploy. Defining this field enables autoscaling. |
instanceType |
string, The EC2 instance type to deploy to. |
memory |
integer, The amount of memory allocated to each replica of the Service. |
cpu |
integer, The amount of cpu allocated to each replica of the the Service. |
createdAt |
string, |
updatedAt |
string, |
credentials |
array, A list of credential IDs to pass to the Service. |
apiKeyId |
integer, API key id of user |
permissionSetId |
integer, The ID of the associated permission set, if any. |
gitRepoUrl |
string, The url for the git repo where the Service code lives. |
gitRepoRef |
string, The git reference to use when pulling code from the repo. |
gitPathDir |
string, The path to the Service code within the git repo. If unspecified, the root directory will be used. |
reportId |
integer, The ID of the associated report. |
currentDeployment |
list, A list containing the following elements:
|
previewDeployment |
list, A list containing the following elements:
|
currentUrl |
string, The URL that the service is hosted at. |
previewUrl |
string, The URL that previews of the service are hosted at. |
environmentVariables |
list, Environment Variables to be passed into the Service. |
notifications |
list, A list containing the following elements:
|
archived |
string, The archival status of the requested item(s). |
hidden |
boolean, The hidden status of the item. |
Update the archive status of this object
services_put_archive(id, status)
services_put_archive(id, status)
id |
integer required. The ID of the object. |
status |
boolean required. The desired archived status of the object. |
A list containing the following elements:
id |
integer, The ID for this Service. |
name |
string, The name of this Service. |
description |
string, The description of this Service. |
user |
list, A list containing the following elements:
|
type |
string, The type of this Service |
dockerImageName |
string, The name of the docker image to pull from DockerHub. |
dockerImageTag |
string, The tag of the docker image to pull from DockerHub (default: latest). |
schedule |
list, A list containing the following elements:
|
timeZone |
string, |
replicas |
integer, The number of Service replicas to deploy. When maxReplicas is set, this field defines the minimum number of replicas to deploy. |
maxReplicas |
integer, The maximum number of Service replicas to deploy. Defining this field enables autoscaling. |
instanceType |
string, The EC2 instance type to deploy to. |
memory |
integer, The amount of memory allocated to each replica of the Service. |
cpu |
integer, The amount of cpu allocated to each replica of the the Service. |
createdAt |
string, |
updatedAt |
string, |
credentials |
array, A list of credential IDs to pass to the Service. |
apiKeyId |
integer, API key id of user |
permissionSetId |
integer, The ID of the associated permission set, if any. |
gitRepoUrl |
string, The url for the git repo where the Service code lives. |
gitRepoRef |
string, The git reference to use when pulling code from the repo. |
gitPathDir |
string, The path to the Service code within the git repo. If unspecified, the root directory will be used. |
reportId |
integer, The ID of the associated report. |
currentDeployment |
list, A list containing the following elements:
|
previewDeployment |
list, A list containing the following elements:
|
currentUrl |
string, The URL that the service is hosted at. |
previewUrl |
string, The URL that previews of the service are hosted at. |
environmentVariables |
list, Environment Variables to be passed into the Service. |
notifications |
list, A list containing the following elements:
|
archived |
string, The archival status of the requested item(s). |
hidden |
boolean, The hidden status of the item. |
Add a Service to a project
services_put_projects(id, project_id)
services_put_projects(id, project_id)
id |
integer required. The ID of the Service. |
project_id |
integer required. The ID of the project. |
An empty HTTP response
SQL escaping
sql(...)
sql(...)
... |
Character vectors that will be combined into a single SQL expression. |
Stash a data frame in feather or csv format, depending on CivisML version.
stash_local_dataframe(x, tmpl_id)
stash_local_dataframe(x, tmpl_id)
x |
data.frame to stash |
tmpl_id |
CivisML training template id |
file id where dataframe is stored
Delete a storage host (deprecated)
storage_hosts_delete(id)
storage_hosts_delete(id)
id |
integer required. The ID of the storage host. |
An empty HTTP response
Get a storage host
storage_hosts_get(id)
storage_hosts_get(id)
id |
integer required. The ID of the storage host. |
A list containing the following elements:
id |
integer, The ID of the storage host. |
owner |
list, A list containing the following elements:
|
name |
string, The human readable name for the storage host. |
provider |
string, The storage provider.One of: s3. |
bucket |
string, The bucket for this storage host. |
s3Options |
list, A list containing the following elements:
|
List the storage hosts
storage_hosts_list()
storage_hosts_list()
An array containing the following fields:
id |
integer, The ID of the storage host. |
owner |
list, A list containing the following elements:
|
name |
string, The human readable name for the storage host. |
provider |
string, The storage provider.One of: s3. |
bucket |
string, The bucket for this storage host. |
s3Options |
list, A list containing the following elements:
|
Update some attributes of this storage host
storage_hosts_patch( id, name = NULL, provider = NULL, bucket = NULL, s3_options = NULL )
storage_hosts_patch( id, name = NULL, provider = NULL, bucket = NULL, s3_options = NULL )
id |
integer required. The ID of the storage host. |
name |
string optional. The human readable name for the storage host. |
provider |
string optional. The storage provider.One of: s3. |
bucket |
string optional. The bucket for this storage host. |
s3_options |
list optional. A list containing the following elements:
|
A list containing the following elements:
id |
integer, The ID of the storage host. |
owner |
list, A list containing the following elements:
|
name |
string, The human readable name for the storage host. |
provider |
string, The storage provider.One of: s3. |
bucket |
string, The bucket for this storage host. |
s3Options |
list, A list containing the following elements:
|
Create a new storage host
storage_hosts_post(provider, bucket, name, s3_options = NULL)
storage_hosts_post(provider, bucket, name, s3_options = NULL)
provider |
string required. The storage provider.One of: s3. |
bucket |
string required. The bucket for this storage host. |
name |
string required. The human readable name for the storage host. |
s3_options |
list optional. A list containing the following elements:
|
A list containing the following elements:
id |
integer, The ID of the storage host. |
owner |
list, A list containing the following elements:
|
name |
string, The human readable name for the storage host. |
provider |
string, The storage provider.One of: s3. |
bucket |
string, The bucket for this storage host. |
s3Options |
list, A list containing the following elements:
|
Replace all attributes of this storage host
storage_hosts_put(id, name, provider, bucket, s3_options = NULL)
storage_hosts_put(id, name, provider, bucket, s3_options = NULL)
id |
integer required. The ID of the storage host. |
name |
string required. The human readable name for the storage host. |
provider |
string required. The storage provider.One of: s3. |
bucket |
string required. The bucket for this storage host. |
s3_options |
list optional. A list containing the following elements:
|
A list containing the following elements:
id |
integer, The ID of the storage host. |
owner |
list, A list containing the following elements:
|
name |
string, The human readable name for the storage host. |
provider |
string, The storage provider.One of: s3. |
bucket |
string, The bucket for this storage host. |
s3Options |
list, A list containing the following elements:
|
Remove a Table from a project
tables_delete_projects(id, project_id)
tables_delete_projects(id, project_id)
id |
integer required. The ID of the Table. |
project_id |
integer required. The ID of the project. |
An empty HTTP response
Show basic table info
tables_get(id)
tables_get(id)
id |
integer required. |
A list containing the following elements:
id |
integer, The ID of the table. |
databaseId |
integer, The ID of the database. |
schema |
string, The name of the schema containing the table. |
name |
string, Name of the table. |
description |
string, The description of the table, as specified by the table owner |
isView |
boolean, True if this table represents a view. False if it represents a regular table. |
rowCount |
integer, The number of rows in the table. |
columnCount |
integer, The number of columns in the table. |
sizeMb |
number, The size of the table in megabytes. |
owner |
string, The database username of the table's owner. |
distkey |
string, The column used as the Amazon Redshift distkey. |
sortkeys |
string, The column used as the Amazon Redshift sortkey. |
refreshStatus |
string, How up-to-date the table's statistics on row counts, null counts, distinct counts, and values distributions are. One of: refreshing, stale, or current. |
lastRefresh |
string, The time of the last statistics refresh. |
dataUpdatedAt |
string, The last time that Civis Platform captured a change in this table.Only applicable for Redshift tables; please see the Civis help desk for more info. |
schemaUpdatedAt |
string, The last time that Civis Platform captured a change to the table attributes/structure.Only applicable for Redshift tables; please see the Civis help desk for more info. |
refreshId |
string, The ID of the most recent statistics refresh. |
lastRun |
list, A list containing the following elements:
|
primaryKeys |
array, The primary keys for this table. |
lastModifiedKeys |
array, The columns indicating an entry's modification status for this table. |
ontologyMapping |
list, The ontology-key to column-name mapping. See /ontology for the list of valid ontology keys. |
columns |
array, An array containing the following fields:
|
joins |
array, An array containing the following fields:
|
multipartKey |
array, |
enhancements |
array, An array containing the following fields:
|
viewDef |
string, |
tableDef |
string, |
outgoingTableMatches |
array, An array containing the following fields:
|
View the status of a CASS / NCOA table enhancement
tables_get_enhancements_cass_ncoa(id, source_table_id)
tables_get_enhancements_cass_ncoa(id, source_table_id)
id |
integer required. The ID of the enhancement. |
source_table_id |
integer required. The ID of the table that was enhanced. |
A list containing the following elements:
id |
integer, The ID of the enhancement. |
sourceTableId |
integer, The ID of the table that was enhanced. |
state |
string, The state of the enhancement, one of 'queued' 'running' 'succeeded' 'failed' or 'cancelled'. |
enhancedTableSchema |
string, The schema name of the table created by the enhancement. |
enhancedTableName |
string, The name of the table created by the enhancement. |
performNcoa |
boolean, Whether to update addresses for records matching the National Change of Address (NCOA) database. |
ncoaCredentialId |
integer, Credential to use when performing NCOA updates. Required if 'performNcoa' is true. |
outputLevel |
string, The set of fields persisted by a CASS or NCOA enhancement.For CASS enhancements, one of 'cass' or 'all.'For NCOA enhancements, one of 'cass', 'ncoa' , 'coalesced' or 'all'.By default, all fields will be returned. |
View the status of a geocoding table enhancement
tables_get_enhancements_geocodings(id, source_table_id)
tables_get_enhancements_geocodings(id, source_table_id)
id |
integer required. The ID of the enhancement. |
source_table_id |
integer required. The ID of the table that was enhanced. |
A list containing the following elements:
id |
integer, The ID of the enhancement. |
sourceTableId |
integer, The ID of the table that was enhanced. |
state |
string, The state of the enhancement, one of 'queued' 'running' 'succeeded' 'failed' or 'cancelled'. |
enhancedTableSchema |
string, The schema name of the table created by the enhancement. |
enhancedTableName |
string, The name of the table created by the enhancement. |
List tables
tables_list( database_id = NULL, schema = NULL, name = NULL, search = NULL, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
tables_list( database_id = NULL, schema = NULL, name = NULL, search = NULL, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
database_id |
integer optional. The ID of the database. |
schema |
string optional. If specified, will be used to filter the tables returned. Substring matching is supported with "%" and "*" wildcards (e.g., "schema=%census%" will return both "client_census.table" and "census_2010.table"). |
name |
string optional. If specified, will be used to filter the tables returned. Substring matching is supported with "%" and "*" wildcards (e.g., "name=%table%" will return both "table1" and "my table"). |
search |
string optional. If specified, will be used to filter the tables returned. Will search across schema and name (in the full form schema.name) and will return any full name containing the search string. |
limit |
integer optional. Number of results to return. Defaults to 50. Maximum allowed is 1000. |
page_num |
integer optional. Page number of the results to return. Defaults to the first page, 1. |
order |
string optional. The field on which to order the result set. Defaults to schema. Must be one of: schema, name, search. |
order_dir |
string optional. Direction in which to sort, either asc (ascending) or desc (descending) defaulting to asc. |
An array containing the following fields:
id |
integer, The ID of the table. |
databaseId |
integer, The ID of the database. |
schema |
string, The name of the schema containing the table. |
name |
string, Name of the table. |
description |
string, The description of the table, as specified by the table owner |
isView |
boolean, True if this table represents a view. False if it represents a regular table. |
rowCount |
integer, The number of rows in the table. |
columnCount |
integer, The number of columns in the table. |
sizeMb |
number, The size of the table in megabytes. |
owner |
string, The database username of the table's owner. |
distkey |
string, The column used as the Amazon Redshift distkey. |
sortkeys |
string, The column used as the Amazon Redshift sortkey. |
refreshStatus |
string, How up-to-date the table's statistics on row counts, null counts, distinct counts, and values distributions are. One of: refreshing, stale, or current. |
lastRefresh |
string, The time of the last statistics refresh. |
refreshId |
string, The ID of the most recent statistics refresh. |
lastRun |
list, A list containing the following elements:
|
List columns in the specified table
tables_list_columns( id, name = NULL, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
tables_list_columns( id, name = NULL, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
id |
integer required. |
name |
string optional. Search for columns with the given name, within the specified table. |
limit |
integer optional. Number of results to return. Defaults to its maximum of 50. |
page_num |
integer optional. Page number of the results to return. Defaults to the first page, 1. |
order |
string optional. The field on which to order the result set. Defaults to name. Must be one of: name, order. |
order_dir |
string optional. Direction in which to sort, either asc (ascending) or desc (descending) defaulting to asc. |
An array containing the following fields:
name |
string, Name of the column. |
civisDataType |
string, The generic data type of the column (ex. "string"). Since this is database-agnostic, it may be helpful when loading data to R/Python. |
sqlType |
string, The database-specific SQL type of the column (ex. "varchar(30)"). |
sampleValues |
array, A sample of values from the column. |
encoding |
string, The compression encoding for this columnSee: http://docs.aws.amazon.com/redshift/latest/dg/c_Compression_encodings.html |
description |
string, The description of the column, as specified by the table owner |
order |
integer, Relative position of the column in the table. |
minValue |
string, Smallest value in the column. |
maxValue |
string, Largest value in the column. |
avgValue |
number, Average value of the column, where applicable. |
stddev |
number, Stddev of the column, where applicable. |
valueDistributionPercent |
list, A mapping between each value in the column and the percentage of rows with that value.Only present for tables with fewer than approximately 25,000,000 rows and for columns with fewer than twenty distinct values. |
coverageCount |
integer, Number of non-null values in the column. |
nullCount |
integer, Number of null values in the column. |
possibleDependentVariableTypes |
array, Possible dependent variable types the column may be used to model. Null if it may not be used as a dependent variable. |
useableAsIndependentVariable |
boolean, Whether the column may be used as an independent variable to train a model. |
useableAsPrimaryKey |
boolean, Whether the column may be used as an primary key to identify table rows. |
valueDistribution |
list, An object mapping distinct values in the column to the number of times they appear in the column |
distinctCount |
integer, Number of distinct values in the column. |
List the projects a Table belongs to
tables_list_projects(id, hidden = NULL)
tables_list_projects(id, hidden = NULL)
id |
integer required. The ID of the Table. |
boolean optional. If specified to be true, returns hidden items. Defaults to false, returning non-hidden items. |
An array containing the following fields:
id |
integer, The ID for this project. |
author |
list, A list containing the following elements:
|
name |
string, The name of this project. |
description |
string, A description of the project. |
users |
array, An array containing the following fields:
|
autoShare |
boolean, |
createdAt |
string, |
updatedAt |
string, |
archived |
string, The archival status of the requested item(s). |
Update a table
tables_patch( id, ontology_mapping = NULL, description = NULL, primary_keys = NULL, last_modified_keys = NULL )
tables_patch( id, ontology_mapping = NULL, description = NULL, primary_keys = NULL, last_modified_keys = NULL )
id |
integer required. The ID of the table. |
ontology_mapping |
list optional. The ontology-key to column-name mapping. See /ontology for the list of valid ontology keys. |
description |
string optional. The user-defined description of the table. |
primary_keys |
array optional. A list of column(s) which together uniquely identify a row in the data.These columns must not contain NULL values. |
last_modified_keys |
array optional. The columns indicating when a row was last modified. |
A list containing the following elements:
id |
integer, The ID of the table. |
databaseId |
integer, The ID of the database. |
schema |
string, The name of the schema containing the table. |
name |
string, Name of the table. |
description |
string, The description of the table, as specified by the table owner |
isView |
boolean, True if this table represents a view. False if it represents a regular table. |
rowCount |
integer, The number of rows in the table. |
columnCount |
integer, The number of columns in the table. |
sizeMb |
number, The size of the table in megabytes. |
owner |
string, The database username of the table's owner. |
distkey |
string, The column used as the Amazon Redshift distkey. |
sortkeys |
string, The column used as the Amazon Redshift sortkey. |
refreshStatus |
string, How up-to-date the table's statistics on row counts, null counts, distinct counts, and values distributions are. One of: refreshing, stale, or current. |
lastRefresh |
string, The time of the last statistics refresh. |
dataUpdatedAt |
string, The last time that Civis Platform captured a change in this table.Only applicable for Redshift tables; please see the Civis help desk for more info. |
schemaUpdatedAt |
string, The last time that Civis Platform captured a change to the table attributes/structure.Only applicable for Redshift tables; please see the Civis help desk for more info. |
refreshId |
string, The ID of the most recent statistics refresh. |
lastRun |
list, A list containing the following elements:
|
primaryKeys |
array, The primary keys for this table. |
lastModifiedKeys |
array, The columns indicating an entry's modification status for this table. |
ontologyMapping |
list, The ontology-key to column-name mapping. See /ontology for the list of valid ontology keys. |
Standardize addresses in a table
tables_post_enhancements_cass_ncoa( source_table_id, perform_ncoa = NULL, ncoa_credential_id = NULL, output_level = NULL )
tables_post_enhancements_cass_ncoa( source_table_id, perform_ncoa = NULL, ncoa_credential_id = NULL, output_level = NULL )
source_table_id |
integer required. The ID of the table to be enhanced. |
perform_ncoa |
boolean optional. Whether to update addresses for records matching the National Change of Address (NCOA) database. |
ncoa_credential_id |
integer optional. Credential to use when performing NCOA updates. Required if 'performNcoa' is true. |
output_level |
string optional. The set of fields persisted by a CASS or NCOA enhancement.For CASS enhancements, one of 'cass' or 'all.'For NCOA enhancements, one of 'cass', 'ncoa' , 'coalesced' or 'all'.By default, all fields will be returned. |
A list containing the following elements:
id |
integer, The ID of the enhancement. |
sourceTableId |
integer, The ID of the table that was enhanced. |
state |
string, The state of the enhancement, one of 'queued' 'running' 'succeeded' 'failed' or 'cancelled'. |
enhancedTableSchema |
string, The schema name of the table created by the enhancement. |
enhancedTableName |
string, The name of the table created by the enhancement. |
performNcoa |
boolean, Whether to update addresses for records matching the National Change of Address (NCOA) database. |
ncoaCredentialId |
integer, Credential to use when performing NCOA updates. Required if 'performNcoa' is true. |
outputLevel |
string, The set of fields persisted by a CASS or NCOA enhancement.For CASS enhancements, one of 'cass' or 'all.'For NCOA enhancements, one of 'cass', 'ncoa' , 'coalesced' or 'all'.By default, all fields will be returned. |
Geocode a table
tables_post_enhancements_geocodings(source_table_id)
tables_post_enhancements_geocodings(source_table_id)
source_table_id |
integer required. The ID of the table to be enhanced. |
A list containing the following elements:
id |
integer, The ID of the enhancement. |
sourceTableId |
integer, The ID of the table that was enhanced. |
state |
string, The state of the enhancement, one of 'queued' 'running' 'succeeded' 'failed' or 'cancelled'. |
enhancedTableSchema |
string, The schema name of the table created by the enhancement. |
enhancedTableName |
string, The name of the table created by the enhancement. |
Request a refresh for column and table statistics
tables_post_refresh(id)
tables_post_refresh(id)
id |
integer required. |
A list containing the following elements:
id |
integer, The ID of the table. |
databaseId |
integer, The ID of the database. |
schema |
string, The name of the schema containing the table. |
name |
string, Name of the table. |
description |
string, The description of the table, as specified by the table owner |
isView |
boolean, True if this table represents a view. False if it represents a regular table. |
rowCount |
integer, The number of rows in the table. |
columnCount |
integer, The number of columns in the table. |
sizeMb |
number, The size of the table in megabytes. |
owner |
string, The database username of the table's owner. |
distkey |
string, The column used as the Amazon Redshift distkey. |
sortkeys |
string, The column used as the Amazon Redshift sortkey. |
refreshStatus |
string, How up-to-date the table's statistics on row counts, null counts, distinct counts, and values distributions are. One of: refreshing, stale, or current. |
lastRefresh |
string, The time of the last statistics refresh. |
dataUpdatedAt |
string, The last time that Civis Platform captured a change in this table.Only applicable for Redshift tables; please see the Civis help desk for more info. |
schemaUpdatedAt |
string, The last time that Civis Platform captured a change to the table attributes/structure.Only applicable for Redshift tables; please see the Civis help desk for more info. |
refreshId |
string, The ID of the most recent statistics refresh. |
lastRun |
list, A list containing the following elements:
|
primaryKeys |
array, The primary keys for this table. |
lastModifiedKeys |
array, The columns indicating an entry's modification status for this table. |
ontologyMapping |
list, The ontology-key to column-name mapping. See /ontology for the list of valid ontology keys. |
columns |
array, An array containing the following fields:
|
joins |
array, An array containing the following fields:
|
multipartKey |
array, |
enhancements |
array, An array containing the following fields:
|
viewDef |
string, |
tableDef |
string, |
outgoingTableMatches |
array, An array containing the following fields:
|
Creates and enqueues a single table scanner job on a new table
tables_post_scan(database_id, schema, table_name, stats_priority = NULL)
tables_post_scan(database_id, schema, table_name, stats_priority = NULL)
database_id |
integer required. The ID of the database. |
schema |
string required. The name of the schema containing the table. |
table_name |
string required. The name of the table. |
stats_priority |
string optional. When to sync table statistics. Valid Options are the following. Option: 'flag' means to flag stats for the next scheduled run of a full table scan on the database. Option: 'block' means to block this job on stats syncing. Option: 'queue' means to queue a separate job for syncing stats and do not block this job on the queued job. Defaults to 'flag' |
A list containing the following elements:
jobId |
integer, The ID of the job created. |
runId |
integer, The ID of the run created. |
Add a Table to a project
tables_put_projects(id, project_id)
tables_put_projects(id, project_id)
id |
integer required. The ID of the Table. |
project_id |
integer required. The ID of the project. |
An empty HTTP response
Archive a Report Template (deprecated, use archiving endpoints instead)
templates_delete_reports(id)
templates_delete_reports(id)
id |
integer required. |
An empty HTTP response
Archive a Script Template (deprecated, use archiving endpoints instead)
templates_delete_scripts(id)
templates_delete_scripts(id)
id |
integer required. |
An empty HTTP response
Remove a Script Template from a project
templates_delete_scripts_projects(id, project_id)
templates_delete_scripts_projects(id, project_id)
id |
integer required. The ID of the Script Template. |
project_id |
integer required. The ID of the project. |
An empty HTTP response
Get a Report Template
templates_get_reports(id)
templates_get_reports(id)
id |
integer required. |
A list containing the following elements:
id |
integer, |
name |
string, The name of the template. |
category |
string, The category of this report template. Can be left blank. Acceptable values are: dataset-viz |
createdAt |
string, |
updatedAt |
string, |
useCount |
integer, The number of uses of this template. |
archived |
boolean, Whether the template has been archived. |
author |
list, A list containing the following elements:
|
techReviewed |
boolean, Whether this template has been audited by Civis for security vulnerability and correctness. |
authCodeUrl |
string, A URL to the template's stored code body. |
provideAPIKey |
boolean, Whether reports based on this template request an API Key from the report viewer. |
hidden |
boolean, The hidden status of the item. |
Get a Script Template
templates_get_scripts(id)
templates_get_scripts(id)
id |
integer required. |
A list containing the following elements:
id |
integer, |
public |
boolean, If the template is public or not. |
scriptId |
integer, The id of the script that this template uses. |
scriptType |
string, The type of the template's backing script (e.g SQL, Container, Python, R, JavaScript) |
userContext |
string, The user context of the script that this template uses. |
name |
string, The name of the template. |
category |
string, The category of this template. |
note |
string, A note describing what this template is used for; custom scripts created off this template will display this description. |
createdAt |
string, |
updatedAt |
string, |
useCount |
integer, The number of uses of this template. |
uiReportId |
integer, The id of the report that this template uses. |
techReviewed |
boolean, Whether this template has been audited by Civis for security vulnerability and correctness. |
archived |
boolean, Whether the template has been archived. |
hidden |
boolean, The hidden status of the item. |
List Report Templates
templates_list_reports( hidden = NULL, category = NULL, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
templates_list_reports( hidden = NULL, category = NULL, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
boolean optional. If specified to be true, returns hidden items. Defaults to false, returning non-hidden items. |
|
category |
string optional. A category to filter results by, one of: dataset-viz |
limit |
integer optional. Number of results to return. Defaults to 50. Maximum allowed is 1000. |
page_num |
integer optional. Page number of the results to return. Defaults to the first page, 1. |
order |
string optional. The field on which to order the result set. Defaults to name. Must be one of: name, updated_at, created_at. |
order_dir |
string optional. Direction in which to sort, either asc (ascending) or desc (descending) defaulting to asc. |
An array containing the following fields:
id |
integer, |
name |
string, The name of the template. |
category |
string, The category of this report template. Can be left blank. Acceptable values are: dataset-viz |
createdAt |
string, |
updatedAt |
string, |
useCount |
integer, The number of uses of this template. |
archived |
boolean, Whether the template has been archived. |
author |
list, A list containing the following elements:
|
techReviewed |
boolean, Whether this template has been audited by Civis for security vulnerability and correctness. |
List Script Templates
templates_list_scripts( hidden = NULL, category = NULL, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
templates_list_scripts( hidden = NULL, category = NULL, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
boolean optional. If specified to be true, returns hidden items. Defaults to false, returning non-hidden items. |
|
category |
string optional. A category to filter results by, one of: import, export, enhancement, model, and script |
limit |
integer optional. Number of results to return. Defaults to 50. Maximum allowed is 1000. |
page_num |
integer optional. Page number of the results to return. Defaults to the first page, 1. |
order |
string optional. The field on which to order the result set. Defaults to name. Must be one of: name, updated_at, created_at. |
order_dir |
string optional. Direction in which to sort, either asc (ascending) or desc (descending) defaulting to asc. |
An array containing the following fields:
id |
integer, |
public |
boolean, If the template is public or not. |
scriptId |
integer, The id of the script that this template uses. |
userContext |
string, The user context of the script that this template uses. |
name |
string, The name of the template. |
category |
string, The category of this template. |
createdAt |
string, |
updatedAt |
string, |
useCount |
integer, The number of uses of this template. |
uiReportId |
integer, The id of the report that this template uses. |
techReviewed |
boolean, Whether this template has been audited by Civis for security vulnerability and correctness. |
archived |
boolean, Whether the template has been archived. |
List the projects a Script Template belongs to
templates_list_scripts_projects(id, hidden = NULL)
templates_list_scripts_projects(id, hidden = NULL)
id |
integer required. The ID of the Script Template. |
boolean optional. If specified to be true, returns hidden items. Defaults to false, returning non-hidden items. |
An array containing the following fields:
id |
integer, The ID for this project. |
author |
list, A list containing the following elements:
|
name |
string, The name of this project. |
description |
string, A description of the project. |
users |
array, An array containing the following fields:
|
autoShare |
boolean, |
createdAt |
string, |
updatedAt |
string, |
archived |
string, The archival status of the requested item(s). |
Update some attributes of this Report Template
templates_patch_reports( id, name = NULL, category = NULL, archived = NULL, code_body = NULL, provide_api_key = NULL )
templates_patch_reports( id, name = NULL, category = NULL, archived = NULL, code_body = NULL, provide_api_key = NULL )
id |
integer required. |
name |
string optional. The name of the template. |
category |
string optional. The category of this report template. Can be left blank. Acceptable values are: dataset-viz |
archived |
boolean optional. Whether the template has been archived. |
code_body |
string optional. The code for the Template body. |
provide_api_key |
boolean optional. Whether reports based on this template request an API Key from the report viewer. |
A list containing the following elements:
id |
integer, |
name |
string, The name of the template. |
category |
string, The category of this report template. Can be left blank. Acceptable values are: dataset-viz |
createdAt |
string, |
updatedAt |
string, |
useCount |
integer, The number of uses of this template. |
archived |
boolean, Whether the template has been archived. |
author |
list, A list containing the following elements:
|
techReviewed |
boolean, Whether this template has been audited by Civis for security vulnerability and correctness. |
authCodeUrl |
string, A URL to the template's stored code body. |
provideAPIKey |
boolean, Whether reports based on this template request an API Key from the report viewer. |
hidden |
boolean, The hidden status of the item. |
Update some attributes of this Script Template
templates_patch_scripts( id, name = NULL, note = NULL, ui_report_id = NULL, archived = NULL )
templates_patch_scripts( id, name = NULL, note = NULL, ui_report_id = NULL, archived = NULL )
id |
integer required. |
name |
string optional. The name of the template. |
note |
string optional. A note describing what this template is used for; custom scripts created off this template will display this description. |
ui_report_id |
integer optional. The id of the report that this template uses. |
archived |
boolean optional. Whether the template has been archived. |
A list containing the following elements:
id |
integer, |
public |
boolean, If the template is public or not. |
scriptId |
integer, The id of the script that this template uses. |
scriptType |
string, The type of the template's backing script (e.g SQL, Container, Python, R, JavaScript) |
userContext |
string, The user context of the script that this template uses. |
name |
string, The name of the template. |
category |
string, The category of this template. |
note |
string, A note describing what this template is used for; custom scripts created off this template will display this description. |
createdAt |
string, |
updatedAt |
string, |
useCount |
integer, The number of uses of this template. |
uiReportId |
integer, The id of the report that this template uses. |
techReviewed |
boolean, Whether this template has been audited by Civis for security vulnerability and correctness. |
archived |
boolean, Whether the template has been archived. |
hidden |
boolean, The hidden status of the item. |
Create a Report Template
templates_post_reports( name, code_body, category = NULL, archived = NULL, provide_api_key = NULL, hidden = NULL )
templates_post_reports( name, code_body, category = NULL, archived = NULL, provide_api_key = NULL, hidden = NULL )
name |
string required. The name of the template. |
code_body |
string required. The code for the Template body. |
category |
string optional. The category of this report template. Can be left blank. Acceptable values are: dataset-viz |
archived |
boolean optional. Whether the template has been archived. |
provide_api_key |
boolean optional. Whether reports based on this template request an API Key from the report viewer. |
boolean optional. The hidden status of the item. |
A list containing the following elements:
id |
integer, |
name |
string, The name of the template. |
category |
string, The category of this report template. Can be left blank. Acceptable values are: dataset-viz |
createdAt |
string, |
updatedAt |
string, |
useCount |
integer, The number of uses of this template. |
archived |
boolean, Whether the template has been archived. |
author |
list, A list containing the following elements:
|
techReviewed |
boolean, Whether this template has been audited by Civis for security vulnerability and correctness. |
authCodeUrl |
string, A URL to the template's stored code body. |
provideAPIKey |
boolean, Whether reports based on this template request an API Key from the report viewer. |
hidden |
boolean, The hidden status of the item. |
Review a template for security vulnerability and correctness (admin-only)
templates_post_reports_review(id, status)
templates_post_reports_review(id, status)
id |
integer required. The ID of the item. |
status |
boolean required. Whether this item has been reviewed. |
A list containing the following elements:
id |
integer, |
name |
string, The name of the template. |
category |
string, The category of this report template. Can be left blank. Acceptable values are: dataset-viz |
createdAt |
string, |
updatedAt |
string, |
useCount |
integer, The number of uses of this template. |
archived |
boolean, Whether the template has been archived. |
author |
list, A list containing the following elements:
|
techReviewed |
boolean, Whether this template has been audited by Civis for security vulnerability and correctness. |
authCodeUrl |
string, A URL to the template's stored code body. |
provideAPIKey |
boolean, Whether reports based on this template request an API Key from the report viewer. |
hidden |
boolean, The hidden status of the item. |
Create a Script Template
templates_post_scripts( script_id, name, note = NULL, ui_report_id = NULL, archived = NULL, hidden = NULL )
templates_post_scripts( script_id, name, note = NULL, ui_report_id = NULL, archived = NULL, hidden = NULL )
script_id |
integer required. The id of the script that this template uses. |
name |
string required. The name of the template. |
note |
string optional. A note describing what this template is used for; custom scripts created off this template will display this description. |
ui_report_id |
integer optional. The id of the report that this template uses. |
archived |
boolean optional. Whether the template has been archived. |
boolean optional. The hidden status of the item. |
A list containing the following elements:
id |
integer, |
public |
boolean, If the template is public or not. |
scriptId |
integer, The id of the script that this template uses. |
scriptType |
string, The type of the template's backing script (e.g SQL, Container, Python, R, JavaScript) |
userContext |
string, The user context of the script that this template uses. |
name |
string, The name of the template. |
category |
string, The category of this template. |
note |
string, A note describing what this template is used for; custom scripts created off this template will display this description. |
createdAt |
string, |
updatedAt |
string, |
useCount |
integer, The number of uses of this template. |
uiReportId |
integer, The id of the report that this template uses. |
techReviewed |
boolean, Whether this template has been audited by Civis for security vulnerability and correctness. |
archived |
boolean, Whether the template has been archived. |
hidden |
boolean, The hidden status of the item. |
Review a template for security vulnerability and correctness (admin-only)
templates_post_scripts_review(id, status)
templates_post_scripts_review(id, status)
id |
integer required. The ID of the item. |
status |
boolean required. Whether this item has been reviewed. |
A list containing the following elements:
id |
integer, |
public |
boolean, If the template is public or not. |
scriptId |
integer, The id of the script that this template uses. |
scriptType |
string, The type of the template's backing script (e.g SQL, Container, Python, R, JavaScript) |
userContext |
string, The user context of the script that this template uses. |
name |
string, The name of the template. |
category |
string, The category of this template. |
note |
string, A note describing what this template is used for; custom scripts created off this template will display this description. |
createdAt |
string, |
updatedAt |
string, |
useCount |
integer, The number of uses of this template. |
uiReportId |
integer, The id of the report that this template uses. |
techReviewed |
boolean, Whether this template has been audited by Civis for security vulnerability and correctness. |
archived |
boolean, Whether the template has been archived. |
hidden |
boolean, The hidden status of the item. |
Replace all attributes of this Report Template
templates_put_reports( id, name, code_body, category = NULL, archived = NULL, provide_api_key = NULL )
templates_put_reports( id, name, code_body, category = NULL, archived = NULL, provide_api_key = NULL )
id |
integer required. |
name |
string required. The name of the template. |
code_body |
string required. The code for the Template body. |
category |
string optional. The category of this report template. Can be left blank. Acceptable values are: dataset-viz |
archived |
boolean optional. Whether the template has been archived. |
provide_api_key |
boolean optional. Whether reports based on this template request an API Key from the report viewer. |
A list containing the following elements:
id |
integer, |
name |
string, The name of the template. |
category |
string, The category of this report template. Can be left blank. Acceptable values are: dataset-viz |
createdAt |
string, |
updatedAt |
string, |
useCount |
integer, The number of uses of this template. |
archived |
boolean, Whether the template has been archived. |
author |
list, A list containing the following elements:
|
techReviewed |
boolean, Whether this template has been audited by Civis for security vulnerability and correctness. |
authCodeUrl |
string, A URL to the template's stored code body. |
provideAPIKey |
boolean, Whether reports based on this template request an API Key from the report viewer. |
hidden |
boolean, The hidden status of the item. |
Replace all attributes of this Script Template
templates_put_scripts( id, name, note = NULL, ui_report_id = NULL, archived = NULL )
templates_put_scripts( id, name, note = NULL, ui_report_id = NULL, archived = NULL )
id |
integer required. |
name |
string required. The name of the template. |
note |
string optional. A note describing what this template is used for; custom scripts created off this template will display this description. |
ui_report_id |
integer optional. The id of the report that this template uses. |
archived |
boolean optional. Whether the template has been archived. |
A list containing the following elements:
id |
integer, |
public |
boolean, If the template is public or not. |
scriptId |
integer, The id of the script that this template uses. |
scriptType |
string, The type of the template's backing script (e.g SQL, Container, Python, R, JavaScript) |
userContext |
string, The user context of the script that this template uses. |
name |
string, The name of the template. |
category |
string, The category of this template. |
note |
string, A note describing what this template is used for; custom scripts created off this template will display this description. |
createdAt |
string, |
updatedAt |
string, |
useCount |
integer, The number of uses of this template. |
uiReportId |
integer, The id of the report that this template uses. |
techReviewed |
boolean, Whether this template has been audited by Civis for security vulnerability and correctness. |
archived |
boolean, Whether the template has been archived. |
hidden |
boolean, The hidden status of the item. |
Add a Script Template to a project
templates_put_scripts_projects(id, project_id)
templates_put_scripts_projects(id, project_id)
id |
integer required. The ID of the Script Template. |
project_id |
integer required. The ID of the project. |
An empty HTTP response
Transfer a table from one location to another.
transfer_table( source_db, dest_db, source_table, dest_table, job_name = NULL, source_credential_id = NULL, dest_credential_id = NULL, interval = NULL, verbose = FALSE, advanced_options = NULL )
transfer_table( source_db, dest_db, source_table, dest_table, job_name = NULL, source_credential_id = NULL, dest_credential_id = NULL, interval = NULL, verbose = FALSE, advanced_options = NULL )
source_db |
string or int, The name of the database where the source table is located. Optionally, could be the database ID. |
dest_db |
string or int, The name of the database where the table will be transferred. Optionally, could be the database ID. |
source_table |
string, Full name of the table to transfer,
e.g., |
dest_table |
string, Full name of the table in the destination database,
e.g., |
job_name |
string, optional, A name to give the job. If omitted, a random job name will be used. |
source_credential_id |
string or int, Optional credential ID
for the source database. If |
dest_credential_id |
string or int, Optional credential ID
for the source database. If |
interval |
Number of seconds to wait between checks for job completion.
If |
verbose |
bool, Set to TRUE to print intermediate progress indicators. |
advanced_options |
A list of advanced options for the sync. See |
A civis_api
object.
Other tables:
get_table_id()
,
refresh_table()
## Not run: transfer_table(source_db='Cluster A', dest_db='Cluster B', source_table='schma.tbl', dest_table='schma.tbl') ## End(Not run)
## Not run: transfer_table(source_db='Cluster A', dest_db='Cluster B', source_table='schma.tbl', dest_table='schma.tbl') ## End(Not run)
Revoke the specified API key
users_delete_api_keys(id, key_id)
users_delete_api_keys(id, key_id)
id |
string required. The ID of the user or 'me'. |
key_id |
integer required. The ID of the API key. |
A list containing the following elements:
id |
integer, The ID of the API key. |
name |
string, The name of the API key. |
expiresAt |
string, The date and time when the key expired. |
createdAt |
string, The date and time when the key was created. |
revokedAt |
string, The date and time when the key was revoked. |
lastUsedAt |
string, The date and time when the key was last used. |
scopes |
array, The scopes which the key is permissioned on. |
useCount |
integer, The number of times the key has been used. |
expired |
boolean, True if the key has expired. |
active |
boolean, True if the key has neither expired nor been revoked. |
constraints |
array, An array containing the following fields:
|
Unfavorite an item
users_delete_me_favorites(id)
users_delete_me_favorites(id)
id |
integer required. The id of the favorite. |
An empty HTTP response
Show info about a user
users_get(id)
users_get(id)
id |
integer required. The ID of this user. |
A list containing the following elements:
id |
integer, The ID of this user. |
user |
string, The username of this user. |
name |
string, The name of this user. |
email |
string, The email of this user. |
active |
boolean, The account status of this user. |
primaryGroupId |
integer, The ID of the primary group of this user. |
groups |
array, An array containing the following fields:
|
city |
string, The city of this user. |
state |
string, The state of this user. |
timeZone |
string, The time zone of this user. |
initials |
string, The initials of this user. |
department |
string, The department of this user. |
title |
string, The title of this user. |
githubUsername |
string, The GitHub username of this user. |
prefersSmsOtp |
boolean, The preference for phone authorization of this user |
vpnEnabled |
boolean, The availability of vpn for this user. |
ssoDisabled |
boolean, The availability of SSO for this user. |
otpRequiredForLogin |
boolean, The two factor authentication requirement for this user. |
exemptFromOrgSmsOtpDisabled |
boolean, Whether the user has SMS OTP enabled on an individual level. This field does not matter if the org does not have SMS OTP disabled. |
smsOtpAllowed |
boolean, Whether the user is allowed to receive two factor authentication codes via SMS. |
robot |
boolean, Whether the user is a robot. |
phone |
string, The phone number of this user. |
organizationSlug |
string, The slug of the organization the user belongs to. |
organizationSSODisableCapable |
boolean, The user's organization's ability to disable sso for their users. |
organizationLoginType |
string, The user's organization's login type. |
organizationSmsOtpDisabled |
boolean, Whether the user's organization has SMS OTP disabled. |
Show the specified API key
users_get_api_keys(id, key_id)
users_get_api_keys(id, key_id)
id |
string required. The ID of the user or 'me'. |
key_id |
integer required. The ID of the API key. |
A list containing the following elements:
id |
integer, The ID of the API key. |
name |
string, The name of the API key. |
expiresAt |
string, The date and time when the key expired. |
createdAt |
string, The date and time when the key was created. |
revokedAt |
string, The date and time when the key was revoked. |
lastUsedAt |
string, The date and time when the key was last used. |
scopes |
array, The scopes which the key is permissioned on. |
useCount |
integer, The number of times the key has been used. |
expired |
boolean, True if the key has expired. |
active |
boolean, True if the key has neither expired nor been revoked. |
constraints |
array, An array containing the following fields:
|
List users
users_list( feature_flag = NULL, account_status = NULL, query = NULL, group_id = NULL, organization_id = NULL, exclude_groups = NULL, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
users_list( feature_flag = NULL, account_status = NULL, query = NULL, group_id = NULL, organization_id = NULL, exclude_groups = NULL, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
feature_flag |
string optional. Return users that have a feature flag enabled. |
account_status |
string optional. The account status by which to filter users. May be one of "active", "inactive", or "all". |
query |
string optional. Return users who match the given query, based on name, user, and email. |
group_id |
integer optional. The ID of the group by which to filter users. Cannot be present if organization_id is. |
organization_id |
integer optional. The ID of the organization by which to filter users. Cannot be present if group_id is. |
exclude_groups |
boolean optional. Whether or to exclude users' groups. Default: false. |
limit |
integer optional. Number of results to return. Defaults to 20. Maximum allowed is 10000. |
page_num |
integer optional. Page number of the results to return. Defaults to the first page, 1. |
order |
string optional. The field on which to order the result set. Defaults to name. Must be one of: name, user. |
order_dir |
string optional. Direction in which to sort, either asc (ascending) or desc (descending) defaulting to asc. |
An array containing the following fields:
id |
integer, The ID of this user. |
user |
string, The username of this user. |
name |
string, The name of this user. |
email |
string, The email of this user. |
active |
boolean, The account status of this user. |
primaryGroupId |
integer, The ID of the primary group of this user. |
groups |
array, An array containing the following fields:
|
createdAt |
string, The date and time when the user was created. |
currentSignInAt |
string, The date and time when the user's current session began. |
Show API keys belonging to the specified user
users_list_api_keys( id, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
users_list_api_keys( id, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
id |
string required. The ID of the user or 'me'. |
limit |
integer optional. Number of results to return. Defaults to its maximum of 50. |
page_num |
integer optional. Page number of the results to return. Defaults to the first page, 1. |
order |
string optional. The field on which to order the result set. Defaults to id. Must be one of: id. |
order_dir |
string optional. Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc. |
An array containing the following fields:
id |
integer, The ID of the API key. |
name |
string, The name of the API key. |
expiresAt |
string, The date and time when the key expired. |
createdAt |
string, The date and time when the key was created. |
revokedAt |
string, The date and time when the key was revoked. |
lastUsedAt |
string, The date and time when the key was last used. |
scopes |
array, The scopes which the key is permissioned on. |
useCount |
integer, The number of times the key has been used. |
expired |
boolean, True if the key has expired. |
active |
boolean, True if the key has neither expired nor been revoked. |
constraintCount |
integer, The number of constraints on the created key |
Show info about the logged-in user
users_list_me()
users_list_me()
A list containing the following elements:
id |
integer, The ID of this user. |
name |
string, This user's name. |
email |
string, This user's email address. |
username |
string, This user's username. |
initials |
string, This user's initials. |
lastCheckedAnnouncements |
string, The date and time at which the user last checked their announcements. |
featureFlags |
list, The feature flag settings for this user. |
roles |
array, The roles this user has, listed by slug. |
preferences |
list, This user's preferences. |
customBranding |
string, The branding of Platform for this user. |
primaryGroupId |
integer, The ID of the primary group of this user. |
groups |
array, An array containing the following fields:
|
organizationName |
string, The name of the organization the user belongs to. |
organizationSlug |
string, The slug of the organization the user belongs to. |
organizationDefaultThemeId |
integer, The ID of the organizations's default theme. |
createdAt |
string, The date and time when the user was created. |
signInCount |
integer, The number of times the user has signed in. |
assumingRole |
boolean, Whether the user is assuming a role or not. |
assumingAdmin |
boolean, Whether the user is assuming admin. |
assumingAdminExpiration |
string, When the user's admin role is set to expire. |
List Favorites
users_list_me_favorites( object_id = NULL, object_type = NULL, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
users_list_me_favorites( object_id = NULL, object_type = NULL, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
object_id |
integer optional. The id of the object. If specified as a query parameter, must also specify object_type parameter. |
object_type |
string optional. The type of the object that is favorited. Valid options: Project |
limit |
integer optional. Number of results to return. Defaults to 50. Maximum allowed is 1000. |
page_num |
integer optional. Page number of the results to return. Defaults to the first page, 1. |
order |
string optional. The field on which to order the result set. Defaults to created_at. Must be one of: created_at, object_type, object_id. |
order_dir |
string optional. Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc. |
An array containing the following fields:
id |
integer, The id of the favorite. |
objectId |
integer, The id of the object. If specified as a query parameter, must also specify object_type parameter. |
objectType |
string, The type of the object that is favorited. Valid options: Project |
objectName |
string, The name of the object that is favorited. |
createdAt |
string, The time this favorite was created. |
UI configuration for logged-in user
users_list_me_ui()
users_list_me_ui()
A list containing the following elements:
id |
integer, The ID of this user. |
navigationMenus |
list, Navigation menus visible to this user. |
userMenus |
list, User profile menu items available to this user. |
userType |
list, A list containing the following elements:
|
zendeskToken |
string, JSON web token for this user's Zendesk widget. |
Update info about a user (must be an admin or client user admin)
users_patch( id, name = NULL, email = NULL, active = NULL, primary_group_id = NULL, city = NULL, state = NULL, time_zone = NULL, initials = NULL, department = NULL, title = NULL, prefers_sms_otp = NULL, group_ids = NULL, vpn_enabled = NULL, sso_disabled = NULL, otp_required_for_login = NULL, exempt_from_org_sms_otp_disabled = NULL, robot = NULL, phone = NULL, password = NULL )
users_patch( id, name = NULL, email = NULL, active = NULL, primary_group_id = NULL, city = NULL, state = NULL, time_zone = NULL, initials = NULL, department = NULL, title = NULL, prefers_sms_otp = NULL, group_ids = NULL, vpn_enabled = NULL, sso_disabled = NULL, otp_required_for_login = NULL, exempt_from_org_sms_otp_disabled = NULL, robot = NULL, phone = NULL, password = NULL )
id |
integer required. The ID of this user. |
name |
string optional. The name of this user. |
email |
string optional. The email of this user. |
active |
boolean optional. The account status of this user. |
primary_group_id |
integer optional. The ID of the primary group of this user. |
city |
string optional. The city of this user. |
state |
string optional. The state of this user. |
time_zone |
string optional. The time zone of this user. |
initials |
string optional. The initials of this user. |
department |
string optional. The department of this user. |
title |
string optional. The title of this user. |
prefers_sms_otp |
boolean optional. The preference for phone authorization of this user |
group_ids |
array optional. An array of ids of all the groups this user is in. |
vpn_enabled |
boolean optional. The availability of vpn for this user. |
sso_disabled |
boolean optional. The availability of SSO for this user. |
otp_required_for_login |
boolean optional. The two factor authentication requirement for this user. |
exempt_from_org_sms_otp_disabled |
boolean optional. Whether the user has SMS OTP enabled on an individual level. This field does not matter if the org does not have SMS OTP disabled. |
robot |
boolean optional. Whether the user is a robot. |
phone |
string optional. The phone number of this user. |
password |
string optional. The password of this user. |
A list containing the following elements:
id |
integer, The ID of this user. |
user |
string, The username of this user. |
name |
string, The name of this user. |
email |
string, The email of this user. |
active |
boolean, The account status of this user. |
primaryGroupId |
integer, The ID of the primary group of this user. |
groups |
array, An array containing the following fields:
|
city |
string, The city of this user. |
state |
string, The state of this user. |
timeZone |
string, The time zone of this user. |
initials |
string, The initials of this user. |
department |
string, The department of this user. |
title |
string, The title of this user. |
githubUsername |
string, The GitHub username of this user. |
prefersSmsOtp |
boolean, The preference for phone authorization of this user |
vpnEnabled |
boolean, The availability of vpn for this user. |
ssoDisabled |
boolean, The availability of SSO for this user. |
otpRequiredForLogin |
boolean, The two factor authentication requirement for this user. |
exemptFromOrgSmsOtpDisabled |
boolean, Whether the user has SMS OTP enabled on an individual level. This field does not matter if the org does not have SMS OTP disabled. |
smsOtpAllowed |
boolean, Whether the user is allowed to receive two factor authentication codes via SMS. |
robot |
boolean, Whether the user is a robot. |
phone |
string, The phone number of this user. |
organizationSlug |
string, The slug of the organization the user belongs to. |
organizationSSODisableCapable |
boolean, The user's organization's ability to disable sso for their users. |
organizationLoginType |
string, The user's organization's login type. |
organizationSmsOtpDisabled |
boolean, Whether the user's organization has SMS OTP disabled. |
Update info about the logged-in user
users_patch_me(preferences = NULL, last_checked_announcements = NULL)
users_patch_me(preferences = NULL, last_checked_announcements = NULL)
preferences |
list optional. A list containing the following elements:
|
last_checked_announcements |
string optional. The date and time at which the user last checked their announcements. |
A list containing the following elements:
id |
integer, The ID of this user. |
name |
string, This user's name. |
email |
string, This user's email address. |
username |
string, This user's username. |
initials |
string, This user's initials. |
lastCheckedAnnouncements |
string, The date and time at which the user last checked their announcements. |
featureFlags |
list, The feature flag settings for this user. |
roles |
array, The roles this user has, listed by slug. |
preferences |
list, This user's preferences. |
customBranding |
string, The branding of Platform for this user. |
primaryGroupId |
integer, The ID of the primary group of this user. |
groups |
array, An array containing the following fields:
|
organizationName |
string, The name of the organization the user belongs to. |
organizationSlug |
string, The slug of the organization the user belongs to. |
organizationDefaultThemeId |
integer, The ID of the organizations's default theme. |
createdAt |
string, The date and time when the user was created. |
signInCount |
integer, The number of times the user has signed in. |
assumingRole |
boolean, Whether the user is assuming a role or not. |
assumingAdmin |
boolean, Whether the user is assuming admin. |
assumingAdminExpiration |
string, When the user's admin role is set to expire. |
Create a new user (must be an admin or client user admin)
users_post( name, email, primary_group_id, user, active = NULL, city = NULL, state = NULL, time_zone = NULL, initials = NULL, department = NULL, title = NULL, prefers_sms_otp = NULL, group_ids = NULL, vpn_enabled = NULL, sso_disabled = NULL, otp_required_for_login = NULL, exempt_from_org_sms_otp_disabled = NULL, robot = NULL, send_email = NULL )
users_post( name, email, primary_group_id, user, active = NULL, city = NULL, state = NULL, time_zone = NULL, initials = NULL, department = NULL, title = NULL, prefers_sms_otp = NULL, group_ids = NULL, vpn_enabled = NULL, sso_disabled = NULL, otp_required_for_login = NULL, exempt_from_org_sms_otp_disabled = NULL, robot = NULL, send_email = NULL )
name |
string required. The name of this user. |
email |
string required. The email of this user. |
primary_group_id |
integer required. The ID of the primary group of this user. |
user |
string required. The username of this user. |
active |
boolean optional. The account status of this user. |
city |
string optional. The city of this user. |
state |
string optional. The state of this user. |
time_zone |
string optional. The time zone of this user. |
initials |
string optional. The initials of this user. |
department |
string optional. The department of this user. |
title |
string optional. The title of this user. |
prefers_sms_otp |
boolean optional. The preference for phone authorization of this user |
group_ids |
array optional. An array of ids of all the groups this user is in. |
vpn_enabled |
boolean optional. The availability of vpn for this user. |
sso_disabled |
boolean optional. The availability of SSO for this user. |
otp_required_for_login |
boolean optional. The two factor authentication requirement for this user. |
exempt_from_org_sms_otp_disabled |
boolean optional. Whether the user has SMS OTP enabled on an individual level. This field does not matter if the org does not have SMS OTP disabled. |
robot |
boolean optional. Whether the user is a robot. |
send_email |
boolean optional. Whether the user will receive a welcome email. |
A list containing the following elements:
id |
integer, The ID of this user. |
user |
string, The username of this user. |
name |
string, The name of this user. |
email |
string, The email of this user. |
active |
boolean, The account status of this user. |
primaryGroupId |
integer, The ID of the primary group of this user. |
groups |
array, An array containing the following fields:
|
city |
string, The city of this user. |
state |
string, The state of this user. |
timeZone |
string, The time zone of this user. |
initials |
string, The initials of this user. |
department |
string, The department of this user. |
title |
string, The title of this user. |
githubUsername |
string, The GitHub username of this user. |
prefersSmsOtp |
boolean, The preference for phone authorization of this user |
vpnEnabled |
boolean, The availability of vpn for this user. |
ssoDisabled |
boolean, The availability of SSO for this user. |
otpRequiredForLogin |
boolean, The two factor authentication requirement for this user. |
exemptFromOrgSmsOtpDisabled |
boolean, Whether the user has SMS OTP enabled on an individual level. This field does not matter if the org does not have SMS OTP disabled. |
smsOtpAllowed |
boolean, Whether the user is allowed to receive two factor authentication codes via SMS. |
robot |
boolean, Whether the user is a robot. |
phone |
string, The phone number of this user. |
organizationSlug |
string, The slug of the organization the user belongs to. |
organizationSSODisableCapable |
boolean, The user's organization's ability to disable sso for their users. |
organizationLoginType |
string, The user's organization's login type. |
organizationSmsOtpDisabled |
boolean, Whether the user's organization has SMS OTP disabled. |
Create a new API key belonging to the logged-in user
users_post_api_keys(id, expires_in, name, constraints = NULL)
users_post_api_keys(id, expires_in, name, constraints = NULL)
id |
string required. The ID of the user or 'me'. |
expires_in |
integer required. The number of seconds the key should last for. |
name |
string required. The name of the API key. |
constraints |
array optional. An array containing the following fields:
|
A list containing the following elements:
id |
integer, The ID of the API key. |
name |
string, The name of the API key. |
expiresAt |
string, The date and time when the key expired. |
createdAt |
string, The date and time when the key was created. |
revokedAt |
string, The date and time when the key was revoked. |
lastUsedAt |
string, The date and time when the key was last used. |
scopes |
array, The scopes which the key is permissioned on. |
useCount |
integer, The number of times the key has been used. |
expired |
boolean, True if the key has expired. |
active |
boolean, True if the key has neither expired nor been revoked. |
constraints |
array, An array containing the following fields:
|
token |
string, The API key. |
Favorite an item
users_post_me_favorites(object_id, object_type)
users_post_me_favorites(object_id, object_type)
object_id |
integer required. The id of the object. If specified as a query parameter, must also specify object_type parameter. |
object_type |
string required. The type of the object that is favorited. Valid options: Project |
A list containing the following elements:
id |
integer, The id of the favorite. |
objectId |
integer, The id of the object. If specified as a query parameter, must also specify object_type parameter. |
objectType |
string, The type of the object that is favorited. Valid options: Project |
objectName |
string, The name of the object that is favorited. |
createdAt |
string, The time this favorite was created. |
Remove a Workflow from a project
workflows_delete_projects(id, project_id)
workflows_delete_projects(id, project_id)
id |
integer required. The ID of the Workflow. |
project_id |
integer required. The ID of the project. |
An empty HTTP response
Get a Workflow
workflows_get(id)
workflows_get(id)
id |
integer required. |
A list containing the following elements:
id |
integer, The ID for this workflow. |
name |
string, The name of this workflow. |
description |
string, A description of the workflow. |
definition |
string, The definition of the workflow in YAML format. Must not be specified if 'fromJobChain' is specified. |
valid |
boolean, The validity of the workflow definition. |
validationErrors |
string, The errors encountered when validating the workflow definition. |
fileId |
string, The file id for the s3 file containing the workflow configuration. |
user |
list, A list containing the following elements:
|
state |
string, The state of the workflow. State is "running" if any execution is running, otherwise reflects most recent execution state. |
schedule |
list, A list containing the following elements:
|
allowConcurrentExecutions |
boolean, Whether the workflow can execute when already running. |
timeZone |
string, The time zone of this workflow. |
nextExecutionAt |
string, The time of the next scheduled execution. |
notifications |
list, A list containing the following elements:
|
archived |
string, The archival status of the requested item(s). |
hidden |
boolean, The hidden status of the item. |
createdAt |
string, |
updatedAt |
string, |
Get a workflow execution
workflows_get_executions(id, execution_id)
workflows_get_executions(id, execution_id)
id |
integer required. The ID for the workflow. |
execution_id |
integer required. The ID for the workflow execution. |
A list containing the following elements:
id |
integer, The ID for this workflow execution. |
state |
string, The state of this workflow execution. |
mistralState |
string, The state of this workflow as reported by mistral. One of running, paused, success, error, or cancelled |
mistralStateInfo |
string, The state info of this workflow as reported by mistral. |
user |
list, A list containing the following elements:
|
definition |
string, The definition of the workflow for this execution. |
input |
list, Key-value pairs defined for this execution. |
includedTasks |
array, The subset of workflow tasks selected to execute. |
tasks |
array, An array containing the following fields:
|
startedAt |
string, The time this execution started. |
finishedAt |
string, The time this execution finished. |
createdAt |
string, The time this execution was created. |
updatedAt |
string, The time this execution was last updated. |
Get a task of a workflow execution
workflows_get_executions_tasks(id, execution_id, task_name)
workflows_get_executions_tasks(id, execution_id, task_name)
id |
integer required. The ID for the workflow. |
execution_id |
integer required. The ID for the workflow execution. |
task_name |
string required. The URL-encoded name of the task. |
A list containing the following elements:
name |
string, The name of the task. |
mistralState |
string, The state of this task. One of idle, waiting, running, delayed, success, error, or cancelled |
mistralStateInfo |
string, Extra info associated with the state of the task. |
runs |
array, An array containing the following fields:
|
executions |
array, An array containing the following fields:
|
Get file contents at commit_hash
workflows_get_git_commits(id, commit_hash)
workflows_get_git_commits(id, commit_hash)
id |
integer required. The ID of the file. |
commit_hash |
string required. The SHA (full or shortened) of the desired git commit. |
A list containing the following elements:
content |
string, The file's contents. |
type |
string, The file's type. |
size |
integer, The file's size. |
fileHash |
string, The SHA of the file. |
List Workflows
workflows_list( hidden = NULL, archived = NULL, author = NULL, state = NULL, scheduled = NULL, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
workflows_list( hidden = NULL, archived = NULL, author = NULL, state = NULL, scheduled = NULL, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
boolean optional. If specified to be true, returns hidden items. Defaults to false, returning non-hidden items. |
|
archived |
string optional. The archival status of the requested item(s). |
author |
string optional. Author of the workflow. It accepts a comma-separated list of author ids. |
state |
array optional. State of the most recent execution.One or more of queued, running, succeeded, failed, cancelled, idle, and scheduled. |
scheduled |
boolean optional. If the workflow is scheduled. |
limit |
integer optional. Number of results to return. Defaults to 20. Maximum allowed is 50. |
page_num |
integer optional. Page number of the results to return. Defaults to the first page, 1. |
order |
string optional. The field on which to order the result set. Defaults to updated_at. Must be one of: updated_at, name, created_at. |
order_dir |
string optional. Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc. |
An array containing the following fields:
id |
integer, The ID for this workflow. |
name |
string, The name of this workflow. |
description |
string, A description of the workflow. |
valid |
boolean, The validity of the workflow definition. |
fileId |
string, The file id for the s3 file containing the workflow configuration. |
user |
list, A list containing the following elements:
|
state |
string, The state of the workflow. State is "running" if any execution is running, otherwise reflects most recent execution state. |
schedule |
list, A list containing the following elements:
|
allowConcurrentExecutions |
boolean, Whether the workflow can execute when already running. |
timeZone |
string, The time zone of this workflow. |
nextExecutionAt |
string, The time of the next scheduled execution. |
archived |
string, The archival status of the requested item(s). |
createdAt |
string, |
updatedAt |
string, |
List workflow executions
workflows_list_executions( id, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
workflows_list_executions( id, limit = NULL, page_num = NULL, order = NULL, order_dir = NULL )
id |
integer required. The ID for this workflow. |
limit |
integer optional. Number of results to return. Defaults to 20. Maximum allowed is 50. |
page_num |
integer optional. Page number of the results to return. Defaults to the first page, 1. |
order |
string optional. The field on which to order the result set. Defaults to id. Must be one of: id, updated_at, created_at. |
order_dir |
string optional. Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc. |
An array containing the following fields:
id |
integer, The ID for this workflow execution. |
state |
string, The state of this workflow execution. |
mistralState |
string, The state of this workflow as reported by mistral. One of running, paused, success, error, or cancelled |
mistralStateInfo |
string, The state info of this workflow as reported by mistral. |
user |
list, A list containing the following elements:
|
startedAt |
string, The time this execution started. |
finishedAt |
string, The time this execution finished. |
createdAt |
string, The time this execution was created. |
updatedAt |
string, The time this execution was last updated. |
Get the git metadata attached to an item
workflows_list_git(id)
workflows_list_git(id)
id |
integer required. The ID of the file. |
A list containing the following elements:
gitRef |
string, A git reference specifying an unambiguous version of the file. Can be a branch name, or the full or shortened SHA of a commit. |
gitBranch |
string, The git branch that the file is on. |
gitPath |
string, The path of the file in the repository. |
gitRepo |
list, A list containing the following elements:
|
pullFromGit |
boolean, Automatically pull latest commit from git. Only works for scripts. |
Get the git commits for an item
workflows_list_git_commits(id)
workflows_list_git_commits(id)
id |
integer required. The ID of the file. |
A list containing the following elements:
commitHash |
string, The SHA of the commit. |
authorName |
string, The name of the commit's author. |
date |
string, The commit's timestamp. |
message |
string, The commit message. |
List the projects a Workflow belongs to
workflows_list_projects(id, hidden = NULL)
workflows_list_projects(id, hidden = NULL)
id |
integer required. The ID of the Workflow. |
boolean optional. If specified to be true, returns hidden items. Defaults to false, returning non-hidden items. |
An array containing the following fields:
id |
integer, The ID for this project. |
author |
list, A list containing the following elements:
|
name |
string, The name of this project. |
description |
string, A description of the project. |
users |
array, An array containing the following fields:
|
autoShare |
boolean, |
createdAt |
string, |
updatedAt |
string, |
archived |
string, The archival status of the requested item(s). |
Update some attributes of this Workflow
workflows_patch( id, name = NULL, description = NULL, definition = NULL, schedule = NULL, allow_concurrent_executions = NULL, time_zone = NULL, notifications = NULL )
workflows_patch( id, name = NULL, description = NULL, definition = NULL, schedule = NULL, allow_concurrent_executions = NULL, time_zone = NULL, notifications = NULL )
id |
integer required. The ID for this workflow. |
name |
string optional. The name of this workflow. |
description |
string optional. A description of the workflow. |
definition |
string optional. The definition of the workflow in YAML format. Must not be specified if 'fromJobChain' is specified. |
schedule |
list optional. A list containing the following elements:
|
allow_concurrent_executions |
boolean optional. Whether the workflow can execute when already running. |
time_zone |
string optional. The time zone of this workflow. |
notifications |
list optional. A list containing the following elements:
|
A list containing the following elements:
id |
integer, The ID for this workflow. |
name |
string, The name of this workflow. |
description |
string, A description of the workflow. |
definition |
string, The definition of the workflow in YAML format. Must not be specified if 'fromJobChain' is specified. |
valid |
boolean, The validity of the workflow definition. |
validationErrors |
string, The errors encountered when validating the workflow definition. |
fileId |
string, The file id for the s3 file containing the workflow configuration. |
user |
list, A list containing the following elements:
|
state |
string, The state of the workflow. State is "running" if any execution is running, otherwise reflects most recent execution state. |
schedule |
list, A list containing the following elements:
|
allowConcurrentExecutions |
boolean, Whether the workflow can execute when already running. |
timeZone |
string, The time zone of this workflow. |
nextExecutionAt |
string, The time of the next scheduled execution. |
notifications |
list, A list containing the following elements:
|
archived |
string, The archival status of the requested item(s). |
hidden |
boolean, The hidden status of the item. |
createdAt |
string, |
updatedAt |
string, |
Create a Workflow
workflows_post( name, description = NULL, from_job_chain = NULL, definition = NULL, schedule = NULL, allow_concurrent_executions = NULL, time_zone = NULL, notifications = NULL, hidden = NULL )
workflows_post( name, description = NULL, from_job_chain = NULL, definition = NULL, schedule = NULL, allow_concurrent_executions = NULL, time_zone = NULL, notifications = NULL, hidden = NULL )
name |
string required. The name of this workflow. |
description |
string optional. A description of the workflow. |
from_job_chain |
integer optional. If specified, create a workflow from the job chain this job is in, and inherit the schedule from the root of the chain. |
definition |
string optional. The definition of the workflow in YAML format. Must not be specified if 'fromJobChain' is specified. |
schedule |
list optional. A list containing the following elements:
|
allow_concurrent_executions |
boolean optional. Whether the workflow can execute when already running. |
time_zone |
string optional. The time zone of this workflow. |
notifications |
list optional. A list containing the following elements:
|
boolean optional. The hidden status of the item. |
A list containing the following elements:
id |
integer, The ID for this workflow. |
name |
string, The name of this workflow. |
description |
string, A description of the workflow. |
definition |
string, The definition of the workflow in YAML format. Must not be specified if 'fromJobChain' is specified. |
valid |
boolean, The validity of the workflow definition. |
validationErrors |
string, The errors encountered when validating the workflow definition. |
fileId |
string, The file id for the s3 file containing the workflow configuration. |
user |
list, A list containing the following elements:
|
state |
string, The state of the workflow. State is "running" if any execution is running, otherwise reflects most recent execution state. |
schedule |
list, A list containing the following elements:
|
allowConcurrentExecutions |
boolean, Whether the workflow can execute when already running. |
timeZone |
string, The time zone of this workflow. |
nextExecutionAt |
string, The time of the next scheduled execution. |
notifications |
list, A list containing the following elements:
|
archived |
string, The archival status of the requested item(s). |
hidden |
boolean, The hidden status of the item. |
createdAt |
string, |
updatedAt |
string, |
Clone this Workflow
workflows_post_clone(id, clone_schedule = NULL, clone_notifications = NULL)
workflows_post_clone(id, clone_schedule = NULL, clone_notifications = NULL)
id |
integer required. The ID for the workflow. |
clone_schedule |
boolean optional. If true, also copy the schedule to the new workflow. |
clone_notifications |
boolean optional. If true, also copy the notifications to the new workflow. |
A list containing the following elements:
id |
integer, The ID for this workflow. |
name |
string, The name of this workflow. |
description |
string, A description of the workflow. |
definition |
string, The definition of the workflow in YAML format. Must not be specified if 'fromJobChain' is specified. |
valid |
boolean, The validity of the workflow definition. |
validationErrors |
string, The errors encountered when validating the workflow definition. |
fileId |
string, The file id for the s3 file containing the workflow configuration. |
user |
list, A list containing the following elements:
|
state |
string, The state of the workflow. State is "running" if any execution is running, otherwise reflects most recent execution state. |
schedule |
list, A list containing the following elements:
|
allowConcurrentExecutions |
boolean, Whether the workflow can execute when already running. |
timeZone |
string, The time zone of this workflow. |
nextExecutionAt |
string, The time of the next scheduled execution. |
notifications |
list, A list containing the following elements:
|
archived |
string, The archival status of the requested item(s). |
hidden |
boolean, The hidden status of the item. |
createdAt |
string, |
updatedAt |
string, |
Execute a workflow
workflows_post_executions( id, target_task = NULL, input = NULL, included_tasks = NULL )
workflows_post_executions( id, target_task = NULL, input = NULL, included_tasks = NULL )
id |
integer required. The ID for the workflow. |
target_task |
string optional. For a reverse workflow, the name of the task to target. |
input |
list optional. Key-value pairs to send to this execution as inputs. |
included_tasks |
array optional. If specified, executes only the subset of workflow tasks included. |
A list containing the following elements:
id |
integer, The ID for this workflow execution. |
state |
string, The state of this workflow execution. |
mistralState |
string, The state of this workflow as reported by mistral. One of running, paused, success, error, or cancelled |
mistralStateInfo |
string, The state info of this workflow as reported by mistral. |
user |
list, A list containing the following elements:
|
definition |
string, The definition of the workflow for this execution. |
input |
list, Key-value pairs defined for this execution. |
includedTasks |
array, The subset of workflow tasks selected to execute. |
tasks |
array, An array containing the following fields:
|
startedAt |
string, The time this execution started. |
finishedAt |
string, The time this execution finished. |
createdAt |
string, The time this execution was created. |
updatedAt |
string, The time this execution was last updated. |
Cancel a workflow execution
workflows_post_executions_cancel(id, execution_id)
workflows_post_executions_cancel(id, execution_id)
id |
integer required. The ID for the workflow. |
execution_id |
integer required. The ID for the workflow execution. |
A list containing the following elements:
id |
integer, The ID for this workflow execution. |
state |
string, The state of this workflow execution. |
mistralState |
string, The state of this workflow as reported by mistral. One of running, paused, success, error, or cancelled |
mistralStateInfo |
string, The state info of this workflow as reported by mistral. |
user |
list, A list containing the following elements:
|
definition |
string, The definition of the workflow for this execution. |
input |
list, Key-value pairs defined for this execution. |
includedTasks |
array, The subset of workflow tasks selected to execute. |
tasks |
array, An array containing the following fields:
|
startedAt |
string, The time this execution started. |
finishedAt |
string, The time this execution finished. |
createdAt |
string, The time this execution was created. |
updatedAt |
string, The time this execution was last updated. |
Resume a paused workflow execution
workflows_post_executions_resume(id, execution_id)
workflows_post_executions_resume(id, execution_id)
id |
integer required. The ID for the workflow. |
execution_id |
integer required. The ID for the workflow execution. |
A list containing the following elements:
id |
integer, The ID for this workflow execution. |
state |
string, The state of this workflow execution. |
mistralState |
string, The state of this workflow as reported by mistral. One of running, paused, success, error, or cancelled |
mistralStateInfo |
string, The state info of this workflow as reported by mistral. |
user |
list, A list containing the following elements:
|
definition |
string, The definition of the workflow for this execution. |
input |
list, Key-value pairs defined for this execution. |
includedTasks |
array, The subset of workflow tasks selected to execute. |
tasks |
array, An array containing the following fields:
|
startedAt |
string, The time this execution started. |
finishedAt |
string, The time this execution finished. |
createdAt |
string, The time this execution was created. |
updatedAt |
string, The time this execution was last updated. |
Retry a failed task, or all failed tasks in an execution
workflows_post_executions_retry(id, execution_id, task_name = NULL)
workflows_post_executions_retry(id, execution_id, task_name = NULL)
id |
integer required. The ID for the workflow. |
execution_id |
integer required. The ID for the workflow execution. |
task_name |
string optional. If specified, the name of the task to be retried. If not specified, all failed tasks in the execution will be retried. |
A list containing the following elements:
id |
integer, The ID for this workflow execution. |
state |
string, The state of this workflow execution. |
mistralState |
string, The state of this workflow as reported by mistral. One of running, paused, success, error, or cancelled |
mistralStateInfo |
string, The state info of this workflow as reported by mistral. |
user |
list, A list containing the following elements:
|
definition |
string, The definition of the workflow for this execution. |
input |
list, Key-value pairs defined for this execution. |
includedTasks |
array, The subset of workflow tasks selected to execute. |
tasks |
array, An array containing the following fields:
|
startedAt |
string, The time this execution started. |
finishedAt |
string, The time this execution finished. |
createdAt |
string, The time this execution was created. |
updatedAt |
string, The time this execution was last updated. |
Commit and push a new version of the file
workflows_post_git_commits(id, content, message, file_hash)
workflows_post_git_commits(id, content, message, file_hash)
id |
integer required. The ID of the file. |
content |
string required. The contents to commit to the file. |
message |
string required. A commit message describing the changes being made. |
file_hash |
string required. The full SHA of the file being replaced. |
A list containing the following elements:
content |
string, The file's contents. |
type |
string, The file's type. |
size |
integer, The file's size. |
fileHash |
string, The SHA of the file. |
Replace all attributes of this Workflow
workflows_put( id, name, description = NULL, definition = NULL, schedule = NULL, allow_concurrent_executions = NULL, time_zone = NULL, notifications = NULL )
workflows_put( id, name, description = NULL, definition = NULL, schedule = NULL, allow_concurrent_executions = NULL, time_zone = NULL, notifications = NULL )
id |
integer required. The ID for this workflow. |
name |
string required. The name of this workflow. |
description |
string optional. A description of the workflow. |
definition |
string optional. The definition of the workflow in YAML format. Must not be specified if 'fromJobChain' is specified. |
schedule |
list optional. A list containing the following elements:
|
allow_concurrent_executions |
boolean optional. Whether the workflow can execute when already running. |
time_zone |
string optional. The time zone of this workflow. |
notifications |
list optional. A list containing the following elements:
|
A list containing the following elements:
id |
integer, The ID for this workflow. |
name |
string, The name of this workflow. |
description |
string, A description of the workflow. |
definition |
string, The definition of the workflow in YAML format. Must not be specified if 'fromJobChain' is specified. |
valid |
boolean, The validity of the workflow definition. |
validationErrors |
string, The errors encountered when validating the workflow definition. |
fileId |
string, The file id for the s3 file containing the workflow configuration. |
user |
list, A list containing the following elements:
|
state |
string, The state of the workflow. State is "running" if any execution is running, otherwise reflects most recent execution state. |
schedule |
list, A list containing the following elements:
|
allowConcurrentExecutions |
boolean, Whether the workflow can execute when already running. |
timeZone |
string, The time zone of this workflow. |
nextExecutionAt |
string, The time of the next scheduled execution. |
notifications |
list, A list containing the following elements:
|
archived |
string, The archival status of the requested item(s). |
hidden |
boolean, The hidden status of the item. |
createdAt |
string, |
updatedAt |
string, |
Update the archive status of this object
workflows_put_archive(id, status)
workflows_put_archive(id, status)
id |
integer required. The ID of the object. |
status |
boolean required. The desired archived status of the object. |
A list containing the following elements:
id |
integer, The ID for this workflow. |
name |
string, The name of this workflow. |
description |
string, A description of the workflow. |
definition |
string, The definition of the workflow in YAML format. Must not be specified if 'fromJobChain' is specified. |
valid |
boolean, The validity of the workflow definition. |
validationErrors |
string, The errors encountered when validating the workflow definition. |
fileId |
string, The file id for the s3 file containing the workflow configuration. |
user |
list, A list containing the following elements:
|
state |
string, The state of the workflow. State is "running" if any execution is running, otherwise reflects most recent execution state. |
schedule |
list, A list containing the following elements:
|
allowConcurrentExecutions |
boolean, Whether the workflow can execute when already running. |
timeZone |
string, The time zone of this workflow. |
nextExecutionAt |
string, The time of the next scheduled execution. |
notifications |
list, A list containing the following elements:
|
archived |
string, The archival status of the requested item(s). |
hidden |
boolean, The hidden status of the item. |
createdAt |
string, |
updatedAt |
string, |
Attach an item to a file in a git repo
workflows_put_git( id, git_ref = NULL, git_branch = NULL, git_path = NULL, git_repo_url = NULL, pull_from_git = NULL )
workflows_put_git( id, git_ref = NULL, git_branch = NULL, git_path = NULL, git_repo_url = NULL, pull_from_git = NULL )
id |
integer required. The ID of the file. |
git_ref |
string 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_branch |
string optional. The git branch that the file is on. |
git_path |
string optional. The path of the file in the repository. |
git_repo_url |
string optional. The URL of the git repository. |
pull_from_git |
boolean optional. Automatically pull latest commit from git. Only works for scripts. |
A list containing the following elements:
gitRef |
string, A git reference specifying an unambiguous version of the file. Can be a branch name, or the full or shortened SHA of a commit. |
gitBranch |
string, The git branch that the file is on. |
gitPath |
string, The path of the file in the repository. |
gitRepo |
list, A list containing the following elements:
|
pullFromGit |
boolean, Automatically pull latest commit from git. Only works for scripts. |
Add a Workflow to a project
workflows_put_projects(id, project_id)
workflows_put_projects(id, project_id)
id |
integer required. The ID of the Workflow. |
project_id |
integer required. The ID of the project. |
An empty HTTP response
Split a file into chunks of a given chunk size, returning a list of file names.
write_chunks(file, chunk_size)
write_chunks(file, chunk_size)
file |
name of the file |
chunk_size |
size of the chunk in bytes. |
Uploads a data frame, a csv file, or file on S3 to Redshift based on the first argument.
A default database can be set using options(civis.default_db = "my_database")
.
If there is only one database available,
this database will automatically be used as the default.
write_civis(x, ...) ## S3 method for class 'data.frame' write_civis( x, tablename, database = NULL, if_exists = "fail", distkey = NULL, sortkey1 = NULL, sortkey2 = NULL, max_errors = NULL, verbose = FALSE, hidden = TRUE, diststyle = NULL, header = TRUE, credential_id = NULL, import_args = NULL, ... ) ## S3 method for class 'character' write_civis( x, tablename, database = NULL, if_exists = "fail", distkey = NULL, sortkey1 = NULL, sortkey2 = NULL, max_errors = NULL, verbose = FALSE, hidden = TRUE, diststyle = NULL, header = TRUE, credential_id = NULL, import_args = NULL, ... ) ## S3 method for class 'numeric' write_civis( x, tablename, database = NULL, if_exists = "fail", distkey = NULL, sortkey1 = NULL, sortkey2 = NULL, max_errors = NULL, verbose = FALSE, delimiter = ",", hidden = TRUE, diststyle = NULL, header = TRUE, credential_id = NULL, import_args = NULL, ... )
write_civis(x, ...) ## S3 method for class 'data.frame' write_civis( x, tablename, database = NULL, if_exists = "fail", distkey = NULL, sortkey1 = NULL, sortkey2 = NULL, max_errors = NULL, verbose = FALSE, hidden = TRUE, diststyle = NULL, header = TRUE, credential_id = NULL, import_args = NULL, ... ) ## S3 method for class 'character' write_civis( x, tablename, database = NULL, if_exists = "fail", distkey = NULL, sortkey1 = NULL, sortkey2 = NULL, max_errors = NULL, verbose = FALSE, hidden = TRUE, diststyle = NULL, header = TRUE, credential_id = NULL, import_args = NULL, ... ) ## S3 method for class 'numeric' write_civis( x, tablename, database = NULL, if_exists = "fail", distkey = NULL, sortkey1 = NULL, sortkey2 = NULL, max_errors = NULL, verbose = FALSE, delimiter = ",", hidden = TRUE, diststyle = NULL, header = TRUE, credential_id = NULL, import_args = NULL, ... )
x |
data frame, file path of a csv, or the id of a csv file on S3 to upload to platform. |
... |
arguments passed to |
tablename |
string, Name of table and schema |
database |
string, Name of database where data frame is to be uploaded. If no database is specified,
uses |
if_exists |
string, optional, String indicating action to take if table already exists. Must be either "fail", "drop", "truncate" or "append". Defaults to "fail". |
distkey |
string, optional, Column name designating the distkey. |
sortkey1 |
string, optional, Column name designating the first sortkey. |
sortkey2 |
string, optional, Column name designating the second (compound) sortkey. |
max_errors |
int, optional, Maximum number of rows with errors to remove before failing. |
verbose |
bool, Set to TRUE to print intermediate progress indicators. |
bool, if |
|
diststyle |
string optional. The diststyle to use for the table. One of "even", "all", or "key". |
header |
bool, if |
credential_id |
integer, the id of the credential to be used when performing
the database import. If |
import_args |
list of additional arguments for |
delimiter |
string, optional. Which delimiter to use. One of
|
data.frame
: Upload a data frame to Civis Platform (Redshift).
character
: Upload a csv to Civis Platform (Redshift).
numeric
: Upload a csv file from the files endpoint to Civis Platform (Redshift)
refresh_table
to update table meta-data.
Other io:
download_civis()
,
query_civis_file()
,
query_civis()
,
read_civis()
,
write_civis_file()
## Not run: df <- read.csv(local_file) # Create new table, fail if already exists write_civis(df, "schema.my_table", "my_database") # Create new table, append if already exists write_civis(df, "schema.my_table", "my_database", if_exists="append") # Create new table with additional options write_civis(df, "schema.my_table", "my_database", distkey="id", sortkey1="added_date", credential_id = 1, header = FALSE) # Create new table directly from a saved csv write_civis("my/file/path.csv", "schema.my_table", "my_database") # Create new table from a file_id id <- write_civis_file("my/file/path.csv", name = "path.csv") write_civis(id, "schema.my_table", "my_database") ## End(Not run)
## Not run: df <- read.csv(local_file) # Create new table, fail if already exists write_civis(df, "schema.my_table", "my_database") # Create new table, append if already exists write_civis(df, "schema.my_table", "my_database", if_exists="append") # Create new table with additional options write_civis(df, "schema.my_table", "my_database", distkey="id", sortkey1="added_date", credential_id = 1, header = FALSE) # Create new table directly from a saved csv write_civis("my/file/path.csv", "schema.my_table", "my_database") # Create new table from a file_id id <- write_civis_file("my/file/path.csv", name = "path.csv") write_civis(id, "schema.my_table", "my_database") ## End(Not run)
Uploads a data frame, R object or file to the files endpoint on Civis
Platform (Amazon S3). It returns the id of the file for use with read_civis
or download_civis
.
Data frames are uploaded as CSVs with write.csv
.
R objects are serialized with saveRDS
. Files are uploaded as-is.
Objects or files larger than 50mb are chunked and can be uploaded in parallel
if a plan
has been set. Files larger than 5TB cannot be uploaded.
write_civis_file(x, ...) ## Default S3 method: write_civis_file(x, name = "r-object.rds", expires_at = NULL, ...) ## S3 method for class 'data.frame' write_civis_file( x, name = "data.csv", expires_at = NULL, row.names = FALSE, ... ) ## S3 method for class 'character' write_civis_file(x, name = x, expires_at = NULL, ...)
write_civis_file(x, ...) ## Default S3 method: write_civis_file(x, name = "r-object.rds", expires_at = NULL, ...) ## S3 method for class 'data.frame' write_civis_file( x, name = "data.csv", expires_at = NULL, row.names = FALSE, ... ) ## S3 method for class 'character' write_civis_file(x, name = x, expires_at = NULL, ...)
x |
R object or path of file to upload. |
... |
|
name |
string, Name of the file or object. |
expires_at |
string, The date and time the object will expire on in the
format |
row.names |
default FALSE. Either a logical value indicating whether the row names of x are to be written along with x, or a character vector of row names to be written. |
Data frames are uploaded as CSVs using write.csv
, with row.names = FALSE
by default. Additional arguments to write.csv
can be passed through ...
.
By default, R objects are serialized using saveRDS
before uploading the object
to the files endpoint. If given a filepath, the file is uploaded as-is.
The file id which can be used to later retrieve the file using
read_civis
.
default
: Serialize R object
data.frame
: Upload a data frame as a csv
character
: Upload any file
Other io:
download_civis()
,
query_civis_file()
,
query_civis()
,
read_civis()
,
write_civis()
## Not run: data(iris) file_id <- write_civis_file(iris) read_civis(file_id) file_id <- write_civis_file("path/to/my.csv") read_civis(file_id) read_civis(file_id, using = readr::read_csv) file_id <- write_civis_file(list(a = 1)) read_civis(file_id, using = readRDS) # Does not expire file_id <- write_civis_file(iris, expires_at = NULL) # Expires on a given date and time file_id <- write_civis_file(iris, expires_at = "2030-01-01") file_id <- write_civis_file(iris, expires_at = "12:00:00") file_id <- write_civis_file(iris, expires_at = "2030-01-01 12:00:00") # Upload a large file in parallel. library(future) plan(multisession) file_id <- write_civis_file("my_large_file") ## End(Not run)
## Not run: data(iris) file_id <- write_civis_file(iris) read_civis(file_id) file_id <- write_civis_file("path/to/my.csv") read_civis(file_id) read_civis(file_id, using = readr::read_csv) file_id <- write_civis_file(list(a = 1)) read_civis(file_id, using = readRDS) # Does not expire file_id <- write_civis_file(iris, expires_at = NULL) # Expires on a given date and time file_id <- write_civis_file(iris, expires_at = "2030-01-01") file_id <- write_civis_file(iris, expires_at = "12:00:00") file_id <- write_civis_file(iris, expires_at = "2030-01-01 12:00:00") # Upload a large file in parallel. library(future) plan(multisession) file_id <- write_civis_file("my_large_file") ## End(Not run)
Add a file as a run output if called from a container job
write_job_output(filename)
write_job_output(filename)
filename |
string, name of the file to add as a run output
|
Only posts if running on Civis Platform.
Returns the filename if not running on platform.