API Resources¶
Announcements¶
-
class
Announcements
(session_kwargs, return_type='civis')¶ Methods
-
list
(*, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶ List announcements
Parameters: - 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.
- iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: - id : integer
The ID of this announcement
- subject : string
The subject of this announcement.
- body : string
The body of this announcement.
- released_at : string/date-time
The date and time this announcement was released.
- created_at : string/date-time
- updated_at : string/date-time
-
Apps¶
-
class
Apps
(session_kwargs, return_type='civis')¶ Methods
-
delete_instances_projects
(id, project_id, slug)¶ Remove a AppInstance from a project
Parameters: - id : integer
ID of the resource
- project_id : integer
The ID of the project
- slug : string
The slug for the application.
Returns: - None
Response code 204: success
Revoke the permissions a group has on this object
Parameters: - id : integer
ID of the resource to be revoked
- group_id : integer
ID of the group
- slug : string
The slug for the application.
Returns: - None
Response code 204: success
Revoke the permissions a user has on this object
Parameters: - id : integer
ID of the resource to be revoked
- user_id : integer
ID of the user
- slug : string
The slug for the application.
Returns: - None
Response code 204: success
-
get
(slug)¶ List details of a Decision Application
Parameters: - slug : string
The slug for the application.
Returns: - slug : string
The slug for the application.
- id : integer
The unique id of the application.
- instance_name : string
A word that describes an instance of this app.
- name : string
The name of the application.
- current_release : dict::
- id : integer
- The unique id of the release.
- app_id : integer
- The id of the app the release belongs to.
- report_template_id : integer
- ID of the report template for this release.
- resources : dict
- A hash of resources associated with this release.
- features : dict
App features.
-
get_instances
(id, slug)¶ Return a given app instance
Parameters: - id : integer
The unique id of the instance.
- slug : string
The slug for the application.
Returns: - id : integer
The unique id of the instance.
- name : string
The name of the instance.
- app_release_id : integer
The id of the app release the instance belongs to.
- report_id : integer
The id of the report the instance belongs to.
- created_at : string/time
The time the instance was created at.
- user : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- project_id : integer
The id of the project collecting all the objects that belong to this app instance.
- auth_code_url : string
- api_key : string
A Civis API key that can be used by this app instance.
-
list
()¶ List apps
Returns: - slug : string
The slug for the application.
- id : integer
The unique id of the application.
- instance_name : string
A word that describes an instance of this app.
- name : string
The name of the application.
-
list_instances
(slug, *, archived='DEFAULT', app_release_id='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶ List the instances of a Decision Application
Parameters: - slug : string
The slug for the application.
- archived : string, optional
The archival status of the requested object(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.
- iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: - id : integer
The unique id of the instance.
- name : string
The name of the instance.
- app_release_id : integer
The id of the app release the instance belongs to.
- report_id : integer
The id of the report the instance belongs to.
- created_at : string/time
The time the instance was created at.
- user : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- project_id : integer
The id of the project collecting all the objects that belong to this app instance.
-
list_instances_projects
(id, slug, *, hidden='DEFAULT')¶ List the projects a AppInstance belongs to
Parameters: - id : integer
The ID of the resource.
- slug : string
The slug for the application.
- hidden : boolean, optional
If specified to be true, returns hidden objects. Defaults to false, returning non-hidden objects.
Returns: - id : integer
The ID for this project.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- name : string
The name of this project.
- description : string
A description of the project
- users : list::
Users who can see the project - id : integer
The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- auto_share : boolean
- created_at : string/time
- updated_at : string/time
- archived : string
The archival status of the requested object(s).
List users and groups permissioned on this object
Parameters: - id : integer
The ID of the object.
- slug : string
The slug for the application.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
-
patch_instances
(id, slug, *, name='DEFAULT')¶ Update a given app instance
Parameters: - id : integer
The unique id of the instance.
- slug : string
The slug for the application.
- name : string, optional
The name of the instance.
Returns: - id : integer
The unique id of the instance.
- name : string
The name of the instance.
- app_release_id : integer
The id of the app release the instance belongs to.
- report_id : integer
The id of the report the instance belongs to.
- created_at : string/time
The time the instance was created at.
- user : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- project_id : integer
The id of the project collecting all the objects that belong to this app instance.
- auth_code_url : string
- api_key : string
A Civis API key that can be used by this app instance.
-
post_instances
(slug, *, name='DEFAULT')¶ Create a new instance of an application of the given slug
Parameters: - slug : string
The slug for the application.
- name : string, optional
The name of the instance.
Returns: - id : integer
The unique id of the instance.
- name : string
The name of the instance.
- app_release_id : integer
The id of the app release the instance belongs to.
- report_id : integer
The id of the report the instance belongs to.
- created_at : string/time
The time the instance was created at.
- user : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- project_id : integer
The id of the project collecting all the objects that belong to this app instance.
- auth_code_url : string
- api_key : string
A Civis API key that can be used by this app instance.
-
put_instances_archive
(id, slug, status)¶ Update the archive status of this object
Parameters: - id : integer
The ID of the object.
- slug : string
The slug for the application.
- status : boolean
The desired archived status of the object.
Returns: - id : integer
The unique id of the instance.
- name : string
The name of the instance.
- app_release_id : integer
The id of the app release the instance belongs to.
- report_id : integer
The id of the report the instance belongs to.
- created_at : string/time
The time the instance was created at.
- user : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- project_id : integer
The id of the project collecting all the objects that belong to this app instance.
- auth_code_url : string
- api_key : string
A Civis API key that can be used by this app instance.
-
put_instances_projects
(id, project_id, slug)¶ Add a AppInstance to a project
Parameters: - id : integer
ID of the resource
- project_id : integer
The ID of the project
- slug : string
The slug for the application.
Returns: - None
Response code 204: success
Set the permissions groups has on this object
Parameters: - id : integer
ID of the resource to be shared
- slug : string
The slug for the application.
- group_ids : list
An array of one or more group IDs
- permission_level : string
Options are: “read”, “write”, or “manage”
- share_email_body : string, optional
Custom body text for e-mail sent on a share.
- send_shared_email : boolean, optional
Send email to the recipients of a share.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
Set the permissions users have on this object
Parameters: - id : integer
ID of the resource to be shared
- slug : string
The slug for the application.
- user_ids : list
An array of one or more user IDs
- permission_level : string
Options are: “read”, “write”, or “manage”
- share_email_body : string, optional
Custom body text for e-mail sent on a share.
- send_shared_email : boolean, optional
Send email to the recipients of a share.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
-
Clusters¶
-
class
Clusters
(session_kwargs, return_type='civis')¶ Methods
-
get_kubernetes
(id)¶ Describe a Kubernetes Cluster
Parameters: - id : integer
The ID of this cluster.
Returns: - id : integer
The ID of this cluster.
- instance_type : string
The EC2 instance types in this cluster.
- min_instances : integer
The minimum number of instances in this cluster.
- max_instances : integer
The maximum number of instances in this cluster.
- instance_max_memory : integer
The amount of memory available to a single instance.
- instance_max_cpu : integer
The number of processor shares available to a single instance.
- organization_id : string
The id of this cluster’s organization.
- organization_slug : string
The slug of this cluster’s organization.
- security_group_id : string
The security group to be added to the nodes of this cluster
-
get_workers
(id)¶ Describe a Worker Cluster
Parameters: - id : integer
The ID of this cluster.
Returns: - id : integer
The ID of this cluster.
- instance_type : string
The EC2 instance types in this cluster.
- min_instances : integer
The minimum number of instances in this cluster.
- max_instances : integer
The maximum number of instances in this cluster.
- instances : integer
The number of instances currently in this cluster.
- instance_max_memory : integer
The amount of memory available to a single instance.
- instance_max_cpu : integer
The number of processor shares available to a single instance.
- instance_max_disk_space : number/float
The amount of memory available to a single instance.
- region : string
The AWS region that this cluster is in.
- active_jobs_count : integer
The number of jobs currently being run in the cluster.
- queued_jobs_count : integer
The number of jobs currently waiting to be run on the cluster.
-
list_kubernetes
(*, organization_slug='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶ List Kubernetes Clusters
Parameters: - 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.
- iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: - id : integer
The ID of this cluster.
- instance_type : string
The EC2 instance types in this cluster.
- min_instances : integer
The minimum number of instances in this cluster.
- max_instances : integer
The maximum number of instances in this cluster.
- instance_max_memory : integer
The amount of memory available to a single instance.
- instance_max_cpu : integer
The number of processor shares available to a single instance.
- organization_id : string
The id of this cluster’s organization.
- organization_slug : string
The slug of this cluster’s organization.
- security_group_id : string
The security group to be added to the nodes of this cluster
-
list_workers
(*, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶ List Worker Clusters
Parameters: - limit : integer, optional
Number of results to return. Defaults to its maximum of 50.
- page_num : integer, optional
Page number of the results to return. Defaults to the first page, 1.
- order : string, optional
The field on which to order the result set. Defaults to id. Must be one of: id, created_at.
- order_dir : string, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to asc.
- iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: - id : integer
The ID of this cluster.
- instance_type : string
The EC2 instance types in this cluster.
- min_instances : integer
The minimum number of instances in this cluster.
- max_instances : integer
The maximum number of instances in this cluster.
- region : string
The AWS region that this cluster is in.
- active_jobs_count : integer
The number of jobs currently being run in the cluster.
- queued_jobs_count : integer
The number of jobs currently waiting to be run on the cluster.
-
list_workers_active_jobs
(id)¶ List Active Jobs for a Worker Cluster
Parameters: - id : integer
The ID of this cluster.
Returns: - id : integer
- name : string
- type : string
- state : string
Whether the job is idle, queued, running, cancelled, or failed.
- created_at : string/date-time
- updated_at : string/date-time
- runs : list::
Information about the most recent runs of the job. - id : integer - state : string - created_at : string/time
The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- hidden : boolean
The hidden status of the object.
- required_cpu : integer
The CPU shares required by the script.
- required_disk_space : integer
The disk space in GB required by the script.
- required_memory : integer
The memory in MB required by the script.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- running_as : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
-
list_workers_queued_jobs
(id)¶ List Queued Jobs for a Worker Cluster
Parameters: - id : integer
The ID of this cluster.
Returns: - id : integer
- name : string
- type : string
- state : string
Whether the job is idle, queued, running, cancelled, or failed.
- created_at : string/date-time
- updated_at : string/date-time
- runs : list::
Information about the most recent runs of the job. - id : integer - state : string - created_at : string/time
The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- hidden : boolean
The hidden status of the object.
- required_cpu : integer
The CPU shares required by the script.
- required_disk_space : integer
The disk space in GB required by the script.
- required_memory : integer
The memory in MB required by the script.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- running_as : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
-
Codes¶
-
class
Codes
(session_kwargs, return_type='civis')¶ Methods
-
delete
(id)¶ Delete a code
Parameters: - id : integer
The ID for this code.
Returns: - None
Response code 204: success
-
get
(id)¶ Show basic code info
Parameters: - id : integer
The ID for this code.
Returns: - id : integer
The ID for this code.
- name : string
Name of code.
- type : string
The code’s type; e.g., Code::FrontEnd.
- body : string
Actual code contents; e.g., HTML, SQL, etc.
- readme : string
User specified information about this code. Markdown format accepted.
- score : integer
Internal Civis Use Only.
- auth_s3_url : string
Authorized_s3_link to file.
- created_at : string/time
The creation time for this code.
- updated_at : string/time
The last modification time for this code.
-
list
(*, limit='DEFAULT', type='DEFAULT', featured='DEFAULT')¶ List codes
Parameters: - limit : integer, optional
The maximum number of codes to return.
- type : string, optional
The code’s type; e.g., Code::FrontEnd.
- featured : boolean, optional
If true, return featured codes.
Returns: - id : integer
The ID for this code.
- name : string
Name of code.
- type : string
The code’s type; e.g., Code::FrontEnd.
- created_at : string/time
The creation time for this code.
- updated_at : string/time
The last modification time for this code.
-
patch
(id, *, name='DEFAULT', type='DEFAULT', body='DEFAULT', readme='DEFAULT', score='DEFAULT', auth_s3_url='DEFAULT')¶ Update a code
Parameters: - id : integer
The ID for this code.
- name : string, optional
Name of code.
- type : string, optional
The code’s type; e.g., Code::FrontEnd.
- body : string, optional
Actual code contents; e.g., HTML, SQL, etc.
- readme : string, optional
User specified information about this code. Markdown format accepted.
- score : integer, optional
Internal Civis Use Only.
- auth_s3_url : string, optional
Authorized_s3_link to file.
Returns: - None
Response code 204: success
-
post
(name, type, body, readme, *, score='DEFAULT', auth_s3_url='DEFAULT')¶ Create a new code
Parameters: - name : string
Name of code.
- type : string
The code’s type; e.g., Code::FrontEnd.
- body : string
Actual code contents; e.g., HTML, SQL, etc.
- readme : string
User specified information about this code. Markdown format accepted.
- score : integer, optional
Internal Civis Use Only.
- auth_s3_url : string, optional
Authorized_s3_link to file.
Returns: - None
Response code 204: success
-
put
(id, name, type, body, readme, *, score='DEFAULT', auth_s3_url='DEFAULT')¶ Update a code
Parameters: - id : integer
The ID for this code.
- name : string
Name of code.
- type : string
The code’s type; e.g., Code::FrontEnd.
- body : string
Actual code contents; e.g., HTML, SQL, etc.
- readme : string
User specified information about this code. Markdown format accepted.
- score : integer, optional
Internal Civis Use Only.
- auth_s3_url : string, optional
Authorized_s3_link to file.
Returns: - id : integer
The ID for this code.
- name : string
Name of code.
- type : string
The code’s type; e.g., Code::FrontEnd.
- body : string
Actual code contents; e.g., HTML, SQL, etc.
- readme : string
User specified information about this code. Markdown format accepted.
- score : integer
Internal Civis Use Only.
- auth_s3_url : string
Authorized_s3_link to file.
- created_at : string/time
The creation time for this code.
- updated_at : string/time
The last modification time for this code.
-
Credentials¶
-
class
Credentials
(session_kwargs, return_type='civis')¶ Methods
Revoke the permissions a group has on this object
Parameters: - id : integer
ID of the resource to be revoked
- group_id : integer
ID of the group
Returns: - None
Response code 204: success
Revoke the permissions a user has on this object
Parameters: - id : integer
ID of the resource to be revoked
- user_id : integer
ID of the user
Returns: - None
Response code 204: success
-
get
(id)¶ Get a credential
Parameters: - id : integer
The ID of the credential.
Returns: - 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.
- remote_host_id : integer
The ID of the remote host associated with this credential.
- remote_host_name : string
The name of the remote host associated with this credential.
- created_at : string/time
The creation time for this credential.
- updated_at : string/time
The last modification time for this credential.
-
list
(*, type='DEFAULT', default='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶ List credentials
Parameters: - type : string, optional
The type (or types) of credentials to return. One or more of: Amazon Web Services S3, BSD::API, CASS/NCOA PAF, Catalist::API, Catalist::SFTP, Certificate, Civis Platform, Custom, Database, Google, Github, JobTraits::Ftp, Salesforce User, Salesforce Client, Silverpop Application, Silverpop Refresh Token, Silverpop User, TableauUser, VAN::MyVoterFile, VAN::MyCampaign, and VAN::BothModes. Specify multiple values as a comma- separated list (e.g., “A,B”).
- 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.
- iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: - 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.
- remote_host_id : integer
The ID of the remote host associated with this credential.
- remote_host_name : string
The name of the remote host associated with this credential.
- created_at : string/time
The creation time for this credential.
- updated_at : string/time
The last modification time for this credential.
List users and groups permissioned on this object
Parameters: - id : integer
The ID of the object.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
-
post
(type, username, password, *, name='DEFAULT', description='DEFAULT', remote_host_id='DEFAULT', system_credential='DEFAULT')¶ Create a credential
Parameters: - type : string
- username : string
The username for the credential.
- password : string
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.
- system_credential : boolean, optional
Returns: - 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.
- remote_host_id : integer
The ID of the remote host associated with this credential.
- remote_host_name : string
The name of the remote host associated with this credential.
- created_at : string/time
The creation time for this credential.
- updated_at : string/time
The last modification time for this credential.
-
post_authenticate
(url, remote_host_type, username, password)¶ Authenticate against a remote host
Parameters: - url : string
The URL to your host.
- remote_host_type : string
The type of remote host. One of: RemoteHostTypes::BSD, RemoteHostTypes::Ftp, RemoteHostTypes::Github, RemoteHostTypes::GoogleDoc, RemoteHostTypes::JDBC, RemoteHostTypes::Redshift, RemoteHostTypes::Salesforce, and RemoteHostTypes::Van
- username : string
The username for the credential.
- password : string
The password for the credential.
Returns: - 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.
- remote_host_id : integer
The ID of the remote host associated with this credential.
- remote_host_name : string
The name of the remote host associated with this credential.
- created_at : string/time
The creation time for this credential.
- updated_at : string/time
The last modification time for this credential.
-
post_temporary
(id, *, duration='DEFAULT')¶ Generate a temporary credential for accessing S3
Parameters: - id : integer
The ID of the credential.
- duration : integer, optional
The number of seconds the temporary credential should be valid. Defaults to 15 minutes. Must not be less than 15 minutes or greater than 36 hours.
Returns: - access_key : string
The identifier of the credential.
- secret_access_key : string
The secret part of the credential.
- session_token : string
The session token identifier.
-
put
(id, type, username, password, *, name='DEFAULT', description='DEFAULT', remote_host_id='DEFAULT', system_credential='DEFAULT')¶ Update an existing credential
Parameters: - id : integer
The ID of the credential.
- type : string
- username : string
The username for the credential.
- password : string
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.
- system_credential : boolean, optional
Returns: - 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.
- remote_host_id : integer
The ID of the remote host associated with this credential.
- remote_host_name : string
The name of the remote host associated with this credential.
- created_at : string/time
The creation time for this credential.
- updated_at : string/time
The last modification time for this credential.
Set the permissions groups has on this object
Parameters: - id : integer
ID of the resource to be shared
- group_ids : list
An array of one or more group IDs
- permission_level : string
Options are: “read”, “write”, or “manage”
- share_email_body : string, optional
Custom body text for e-mail sent on a share.
- send_shared_email : boolean, optional
Send email to the recipients of a share.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
Set the permissions users have on this object
Parameters: - id : integer
ID of the resource to be shared
- user_ids : list
An array of one or more user IDs
- permission_level : string
Options are: “read”, “write”, or “manage”
- share_email_body : string, optional
Custom body text for e-mail sent on a share.
- send_shared_email : boolean, optional
Send email to the recipients of a share.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
Databases¶
-
class
Databases
(session_kwargs, return_type='civis')¶ Methods
-
delete_whitelist_ips
(id, whitelisted_ip_id)¶ Remove a whitelisted IP address
Parameters: - id : integer
The ID of the database this rule is applied to.
- whitelisted_ip_id : integer
The ID of this whitelisted IP address.
Returns: - None
Response code 204: success
-
get_whitelist_ips
(id, whitelisted_ip_id)¶ View details about a whitelisted IP
Parameters: - id : integer
The ID of the database this rule is applied to.
- whitelisted_ip_id : integer
The ID of this whitelisted IP address.
Returns: - id : integer
The ID of this whitelisted IP address.
- remote_host_id : integer
The ID of the database this rule is applied to.
- security_group_id : string
The ID of the security group this rule is applied to.
- subnet_mask : string
The subnet mask that is allowed by this rule.
- authorized_by : string
The user who authorized this rule.
- is_active : boolean
True if the rule is applied, false if it has been revoked.
- created_at : string/time
The time this rule was created.
- updated_at : string/time
The time this rule was last updated.
-
list
()¶ List databases
Returns: - id : integer
The ID for the database.
- name : string
The name of the database.
-
list_schemas
(id)¶ List schemas in this database
Parameters: - id : integer
The ID of the database.
Returns: - schema : string
The name of a schema.
-
list_whitelist_ips
(id)¶ List whitelisted IPs for the specified database
Parameters: - id : integer
The ID for the database.
Returns: - id : integer
The ID of this whitelisted IP address.
- remote_host_id : integer
The ID of the database this rule is applied to.
- security_group_id : string
The ID of the security group this rule is applied to.
- subnet_mask : string
The subnet mask that is allowed by this rule.
- created_at : string/time
The time this rule was created.
- updated_at : string/time
The time this rule was last updated.
-
post_whitelist_ips
(id, subnet_mask)¶ Whitelist an IP address
Parameters: - id : integer
The ID of the database this rule is applied to.
- subnet_mask : string
The subnet mask that is allowed by this rule.
Returns: - id : integer
The ID of this whitelisted IP address.
- remote_host_id : integer
The ID of the database this rule is applied to.
- security_group_id : string
The ID of the security group this rule is applied to.
- subnet_mask : string
The subnet mask that is allowed by this rule.
- authorized_by : string
The user who authorized this rule.
- is_active : boolean
True if the rule is applied, false if it has been revoked.
- created_at : string/time
The time this rule was created.
- updated_at : string/time
The time this rule was last updated.
-
Endpoints¶
Enhancements¶
-
class
Enhancements
(session_kwargs, return_type='civis')¶ Methods
-
delete_cass_ncoa_projects
(id, project_id)¶ Remove a JobTypes::CassNcoa from a project
Parameters: - id : integer
ID of the resource
- project_id : integer
The ID of the project
Returns: - None
Response code 204: success
-
delete_cass_ncoa_runs
(id, run_id)¶ Cancel a run
Parameters: - id : integer
The ID of the cass_ncoa.
- run_id : integer
The ID of the run.
Returns: - None
Response code 202: success
Revoke the permissions a group has on this object
Parameters: - id : integer
ID of the resource to be revoked
- group_id : integer
ID of the group
Returns: - None
Response code 204: success
Revoke the permissions a user has on this object
Parameters: - id : integer
ID of the resource to be revoked
- user_id : integer
ID of the user
Returns: - None
Response code 204: success
-
get_cass_ncoa
(id)¶ Get a CASS/NCOA Enhancement
Parameters: - id : integer
Returns: - id : integer
The ID for the enhancement.
- name : string
The name of the enhancement.
- type : string
The type of the enhancement (e.g CASS-NCOA)
- created_at : string/time
The time this enhancement was created.
- updated_at : string/time
The time the enhancement was last updated.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- state : string
The status of the enhancement’s last run
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- parent_id : integer
Parent ID that triggers this enhancement.
- notifications : dict::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- running_as : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- source : dict::
- database_table : dict::
- schema : string
- The schema name of the source table.
- table : string
- The name of the source table.
- remote_host_id : integer
- The ID of the database host for the table.
- credential_id : integer
- The id of the credentials to be used when performing the enhancement.
- multipart_key : list
- The source table primary key.
- destination : dict::
- database_table : dict::
- schema : string
- The schema name for the output data.
- table : string
- The table name for the output data.
- column_mapping : dict::
- address1 : string
- The first address line.
- address2 : string
- The second address line.
- city : string
- The city of an address.
- state : string
- The state of an address.
- zip : string
- The zip code of an address.
- name : string
- The full name of the resident at this address. If needed, separate multiple columns with +, e.g. first_name+last_name
- company : string
- The name of the company located at this address.
- use_default_column_mapping : 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.
- perform_ncoa : boolean
Whether to update addresses for records matching the National Change of Address (NCOA) database.
- ncoa_credential_id : integer
Credential to use when performing NCOA updates. Required if ‘performNcoa’ is true.
- output_level : string
The set of fields persisted by a CASS or NCOA enhancement.For CASS enhancements, one of ‘cass’ or ‘all.’For NCOA enhancements, one of ‘cass’, ‘ncoa’ , ‘coalesced’ or ‘all’.By default, all fields will be returned.
- limiting_sql : string
The limiting sql.
- archived : string
The archival status of the requested object(s).
-
get_cass_ncoa_runs
(id, run_id)¶ Check status of a run
Parameters: - id : integer
The ID of the cass_ncoa.
- run_id : integer
The ID of the run.
Returns: - id : integer
The ID of the run.
- cass_ncoa_id : integer
The ID of the cass_ncoa.
- state : string
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- is_cancel_requested : boolean
True if run cancel requested, else false.
- started_at : string/time
The time the last run started at.
- finished_at : string/time
The time the last run completed.
- error : string
The error, if any, returned by the run.
-
list
(*, type='DEFAULT', author='DEFAULT', status='DEFAULT', archived='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶ List Enhancements
Parameters: - type : string, optional
If specified, return objects of these types.
- author : string, optional
If specified, return objects from this author. Must use user IDs. A comma separated list of IDs is also accepted to return objects from multiple authors.
- status : string, optional
If specified, returns objects with one of these statuses. It accepts a comma-separated list, possible values are ‘running’, ‘failed’, ‘succeeded’, ‘idle’, ‘scheduled’.
- archived : string, optional
The archival status of the requested object(s).
- limit : integer, optional
Number of results to return. Defaults to 20. Maximum allowed is 50.
- page_num : integer, optional
Page number of the results to return. Defaults to the first page, 1.
- order : string, optional
The field on which to order the result set. Defaults to updated_at. Must be one of: updated_at, name, created_at, last_run.updated_at.
- order_dir : string, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: - id : integer
The ID for the enhancement.
- name : string
The name of the enhancement.
- type : string
The type of the enhancement (e.g CASS-NCOA)
- created_at : string/time
The time this enhancement was created.
- updated_at : string/time
The time the enhancement was last updated.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- state : string
The status of the enhancement’s last run
- archived : string
The archival status of the requested object(s).
-
list_cass_ncoa_projects
(id, *, hidden='DEFAULT')¶ List the projects a JobTypes::CassNcoa belongs to
Parameters: - id : integer
The ID of the resource.
- hidden : boolean, optional
If specified to be true, returns hidden objects. Defaults to false, returning non-hidden objects.
Returns: - id : integer
The ID for this project.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- name : string
The name of this project.
- description : string
A description of the project
- users : list::
Users who can see the project - id : integer
The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- auto_share : boolean
- created_at : string/time
- updated_at : string/time
- archived : string
The archival status of the requested object(s).
-
list_cass_ncoa_runs
(id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶ List runs for the given cass_ncoa
Parameters: - id : integer
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.
- iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: - id : integer
The ID of the run.
- cass_ncoa_id : integer
The ID of the cass_ncoa.
- state : string
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- is_cancel_requested : boolean
True if run cancel requested, else false.
- started_at : string/time
The time the last run started at.
- finished_at : string/time
The time the last run completed.
- error : string
The error, if any, returned by the run.
-
list_cass_ncoa_runs_logs
(id, run_id, *, last_id='DEFAULT', limit='DEFAULT')¶ Get the logs for a run
Parameters: - id : integer
The ID of the cass_ncoa.
- run_id : integer
The ID of the run.
- last_id : integer, optional
The ID of the last log message received. Log entries with this ID value or lower will be omitted.Logs are sorted by ID if this value is provided, and are otherwise sorted by createdAt.
- limit : integer, optional
The maximum number of log messages to return. Default of 10000.
Returns: - id : integer
The ID of the log.
- created_at : string/date-time
The time the log was created.
- message : string
The log message.
- level : string
The level of the log. One of unknown,fatal,error,warn,info,debug.
-
list_cass_ncoa_runs_outputs
(id, run_id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶ List the outputs for a run
Parameters: - id : integer
The ID of the job.
- run_id : integer
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.
- iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: - object_type : string
The type of the output. Valid values are File, Table, Report, Project, or Credential
- object_id : integer
The ID of the output object.
- name : string
The name of the output object.
- link : string
The link to retrieve the output object.
List users and groups permissioned on this object
Parameters: - id : integer
The ID of the object.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
-
list_types
()¶ List available enhancement types
Returns: - name : string
The name of the type.
-
patch_cass_ncoa
(id, *, name='DEFAULT', schedule='DEFAULT', parent_id='DEFAULT', notifications='DEFAULT', source='DEFAULT', destination='DEFAULT', column_mapping='DEFAULT', use_default_column_mapping='DEFAULT', perform_ncoa='DEFAULT', ncoa_credential_id='DEFAULT', output_level='DEFAULT', limiting_sql='DEFAULT')¶ Update some attributes of this CASS/NCOA Enhancement
Parameters: - id : integer
The ID for the enhancement.
- name : string, optional
The name of the enhancement.
- schedule : dict, optional::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- parent_id : integer, optional
Parent ID that triggers this enhancement.
- notifications : dict, optional::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- source : dict, optional::
- database_table : dict::
- schema : string
- The schema name of the source table.
- table : string
- The name of the source table.
- remote_host_id : integer
- The ID of the database host for the table.
- credential_id : integer
- The id of the credentials to be used when performing the enhancement.
- multipart_key : list
- The source table primary key.
- destination : dict, optional::
- database_table : dict::
- schema : string
- The schema name for the output data.
- table : string
- The table name for the output data.
- column_mapping : dict, optional::
- address1 : string
- The first address line.
- address2 : string
- The second address line.
- city : string
- The city of an address.
- state : string
- The state of an address.
- zip : string
- The zip code of an address.
- name : string
- The full name of the resident at this address. If needed, separate multiple columns with +, e.g. first_name+last_name
- company : string
- The name of the company located at this address.
- 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.
Returns: - id : integer
The ID for the enhancement.
- name : string
The name of the enhancement.
- type : string
The type of the enhancement (e.g CASS-NCOA)
- created_at : string/time
The time this enhancement was created.
- updated_at : string/time
The time the enhancement was last updated.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- state : string
The status of the enhancement’s last run
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- parent_id : integer
Parent ID that triggers this enhancement.
- notifications : dict::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- running_as : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- source : dict::
- database_table : dict::
- schema : string
- The schema name of the source table.
- table : string
- The name of the source table.
- remote_host_id : integer
- The ID of the database host for the table.
- credential_id : integer
- The id of the credentials to be used when performing the enhancement.
- multipart_key : list
- The source table primary key.
- destination : dict::
- database_table : dict::
- schema : string
- The schema name for the output data.
- table : string
- The table name for the output data.
- column_mapping : dict::
- address1 : string
- The first address line.
- address2 : string
- The second address line.
- city : string
- The city of an address.
- state : string
- The state of an address.
- zip : string
- The zip code of an address.
- name : string
- The full name of the resident at this address. If needed, separate multiple columns with +, e.g. first_name+last_name
- company : string
- The name of the company located at this address.
- use_default_column_mapping : 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.
- perform_ncoa : boolean
Whether to update addresses for records matching the National Change of Address (NCOA) database.
- ncoa_credential_id : integer
Credential to use when performing NCOA updates. Required if ‘performNcoa’ is true.
- output_level : string
The set of fields persisted by a CASS or NCOA enhancement.For CASS enhancements, one of ‘cass’ or ‘all.’For NCOA enhancements, one of ‘cass’, ‘ncoa’ , ‘coalesced’ or ‘all’.By default, all fields will be returned.
- limiting_sql : string
The limiting sql.
- archived : string
The archival status of the requested object(s).
-
post_cass_ncoa
(name, source, *, schedule='DEFAULT', parent_id='DEFAULT', notifications='DEFAULT', destination='DEFAULT', column_mapping='DEFAULT', use_default_column_mapping='DEFAULT', perform_ncoa='DEFAULT', ncoa_credential_id='DEFAULT', output_level='DEFAULT', limiting_sql='DEFAULT')¶ Create a CASS/NCOA Enhancement
Parameters: - name : string
The name of the enhancement.
- source : dict::
- database_table : dict::
- schema : string
- The schema name of the source table.
- table : string
- The name of the source table.
- remote_host_id : integer
- The ID of the database host for the table.
- credential_id : integer
- The id of the credentials to be used when performing the enhancement.
- multipart_key : list
- The source table primary key.
- schedule : dict, optional::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- parent_id : integer, optional
Parent ID that triggers this enhancement.
- notifications : dict, optional::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- destination : dict, optional::
- database_table : dict::
- schema : string
- The schema name for the output data.
- table : string
- The table name for the output data.
- column_mapping : dict, optional::
- address1 : string
- The first address line.
- address2 : string
- The second address line.
- city : string
- The city of an address.
- state : string
- The state of an address.
- zip : string
- The zip code of an address.
- name : string
- The full name of the resident at this address. If needed, separate multiple columns with +, e.g. first_name+last_name
- company : string
- The name of the company located at this address.
- 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.
Returns: - id : integer
The ID for the enhancement.
- name : string
The name of the enhancement.
- type : string
The type of the enhancement (e.g CASS-NCOA)
- created_at : string/time
The time this enhancement was created.
- updated_at : string/time
The time the enhancement was last updated.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- state : string
The status of the enhancement’s last run
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- parent_id : integer
Parent ID that triggers this enhancement.
- notifications : dict::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- running_as : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- source : dict::
- database_table : dict::
- schema : string
- The schema name of the source table.
- table : string
- The name of the source table.
- remote_host_id : integer
- The ID of the database host for the table.
- credential_id : integer
- The id of the credentials to be used when performing the enhancement.
- multipart_key : list
- The source table primary key.
- destination : dict::
- database_table : dict::
- schema : string
- The schema name for the output data.
- table : string
- The table name for the output data.
- column_mapping : dict::
- address1 : string
- The first address line.
- address2 : string
- The second address line.
- city : string
- The city of an address.
- state : string
- The state of an address.
- zip : string
- The zip code of an address.
- name : string
- The full name of the resident at this address. If needed, separate multiple columns with +, e.g. first_name+last_name
- company : string
- The name of the company located at this address.
- use_default_column_mapping : 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.
- perform_ncoa : boolean
Whether to update addresses for records matching the National Change of Address (NCOA) database.
- ncoa_credential_id : integer
Credential to use when performing NCOA updates. Required if ‘performNcoa’ is true.
- output_level : string
The set of fields persisted by a CASS or NCOA enhancement.For CASS enhancements, one of ‘cass’ or ‘all.’For NCOA enhancements, one of ‘cass’, ‘ncoa’ , ‘coalesced’ or ‘all’.By default, all fields will be returned.
- limiting_sql : string
The limiting sql.
- archived : string
The archival status of the requested object(s).
-
post_cass_ncoa_cancel
(id)¶ Cancel a run
Parameters: - id : integer
The ID of the job.
Returns: - id : integer
The ID of the run.
- state : string
The state of the run, one of ‘queued’, ‘running’ or ‘cancelled’.
- is_cancel_requested : boolean
True if run cancel requested, else false.
-
post_cass_ncoa_runs
(id)¶ Start a run
Parameters: - id : integer
The ID of the cass_ncoa.
Returns: - id : integer
The ID of the run.
- cass_ncoa_id : integer
The ID of the cass_ncoa.
- state : string
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- is_cancel_requested : boolean
True if run cancel requested, else false.
- started_at : string/time
The time the last run started at.
- finished_at : string/time
The time the last run completed.
- error : string
The error, if any, returned by the run.
-
put_cass_ncoa
(id, name, source, *, schedule='DEFAULT', parent_id='DEFAULT', notifications='DEFAULT', destination='DEFAULT', column_mapping='DEFAULT', use_default_column_mapping='DEFAULT', perform_ncoa='DEFAULT', ncoa_credential_id='DEFAULT', output_level='DEFAULT', limiting_sql='DEFAULT')¶ Replace all attributes of this CASS/NCOA Enhancement
Parameters: - id : integer
The ID for the enhancement.
- name : string
The name of the enhancement.
- source : dict::
- database_table : dict::
- schema : string
- The schema name of the source table.
- table : string
- The name of the source table.
- remote_host_id : integer
- The ID of the database host for the table.
- credential_id : integer
- The id of the credentials to be used when performing the enhancement.
- multipart_key : list
- The source table primary key.
- schedule : dict, optional::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- parent_id : integer, optional
Parent ID that triggers this enhancement.
- notifications : dict, optional::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- destination : dict, optional::
- database_table : dict::
- schema : string
- The schema name for the output data.
- table : string
- The table name for the output data.
- column_mapping : dict, optional::
- address1 : string
- The first address line.
- address2 : string
- The second address line.
- city : string
- The city of an address.
- state : string
- The state of an address.
- zip : string
- The zip code of an address.
- name : string
- The full name of the resident at this address. If needed, separate multiple columns with +, e.g. first_name+last_name
- company : string
- The name of the company located at this address.
- 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.
Returns: - id : integer
The ID for the enhancement.
- name : string
The name of the enhancement.
- type : string
The type of the enhancement (e.g CASS-NCOA)
- created_at : string/time
The time this enhancement was created.
- updated_at : string/time
The time the enhancement was last updated.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- state : string
The status of the enhancement’s last run
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- parent_id : integer
Parent ID that triggers this enhancement.
- notifications : dict::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- running_as : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- source : dict::
- database_table : dict::
- schema : string
- The schema name of the source table.
- table : string
- The name of the source table.
- remote_host_id : integer
- The ID of the database host for the table.
- credential_id : integer
- The id of the credentials to be used when performing the enhancement.
- multipart_key : list
- The source table primary key.
- destination : dict::
- database_table : dict::
- schema : string
- The schema name for the output data.
- table : string
- The table name for the output data.
- column_mapping : dict::
- address1 : string
- The first address line.
- address2 : string
- The second address line.
- city : string
- The city of an address.
- state : string
- The state of an address.
- zip : string
- The zip code of an address.
- name : string
- The full name of the resident at this address. If needed, separate multiple columns with +, e.g. first_name+last_name
- company : string
- The name of the company located at this address.
- use_default_column_mapping : 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.
- perform_ncoa : boolean
Whether to update addresses for records matching the National Change of Address (NCOA) database.
- ncoa_credential_id : integer
Credential to use when performing NCOA updates. Required if ‘performNcoa’ is true.
- output_level : string
The set of fields persisted by a CASS or NCOA enhancement.For CASS enhancements, one of ‘cass’ or ‘all.’For NCOA enhancements, one of ‘cass’, ‘ncoa’ , ‘coalesced’ or ‘all’.By default, all fields will be returned.
- limiting_sql : string
The limiting sql.
- archived : string
The archival status of the requested object(s).
-
put_cass_ncoa_archive
(id, status)¶ Update the archive status of this object
Parameters: - id : integer
The ID of the object.
- status : boolean
The desired archived status of the object.
Returns: - id : integer
The ID for the enhancement.
- name : string
The name of the enhancement.
- type : string
The type of the enhancement (e.g CASS-NCOA)
- created_at : string/time
The time this enhancement was created.
- updated_at : string/time
The time the enhancement was last updated.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- state : string
The status of the enhancement’s last run
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- parent_id : integer
Parent ID that triggers this enhancement.
- notifications : dict::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- running_as : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- source : dict::
- database_table : dict::
- schema : string
- The schema name of the source table.
- table : string
- The name of the source table.
- remote_host_id : integer
- The ID of the database host for the table.
- credential_id : integer
- The id of the credentials to be used when performing the enhancement.
- multipart_key : list
- The source table primary key.
- destination : dict::
- database_table : dict::
- schema : string
- The schema name for the output data.
- table : string
- The table name for the output data.
- column_mapping : dict::
- address1 : string
- The first address line.
- address2 : string
- The second address line.
- city : string
- The city of an address.
- state : string
- The state of an address.
- zip : string
- The zip code of an address.
- name : string
- The full name of the resident at this address. If needed, separate multiple columns with +, e.g. first_name+last_name
- company : string
- The name of the company located at this address.
- use_default_column_mapping : 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.
- perform_ncoa : boolean
Whether to update addresses for records matching the National Change of Address (NCOA) database.
- ncoa_credential_id : integer
Credential to use when performing NCOA updates. Required if ‘performNcoa’ is true.
- output_level : string
The set of fields persisted by a CASS or NCOA enhancement.For CASS enhancements, one of ‘cass’ or ‘all.’For NCOA enhancements, one of ‘cass’, ‘ncoa’ , ‘coalesced’ or ‘all’.By default, all fields will be returned.
- limiting_sql : string
The limiting sql.
- archived : string
The archival status of the requested object(s).
-
put_cass_ncoa_projects
(id, project_id)¶ Add a JobTypes::CassNcoa to a project
Parameters: - id : integer
ID of the resource
- project_id : integer
The ID of the project
Returns: - None
Response code 204: success
Set the permissions groups has on this object
Parameters: - id : integer
ID of the resource to be shared
- group_ids : list
An array of one or more group IDs
- permission_level : string
Options are: “read”, “write”, or “manage”
- share_email_body : string, optional
Custom body text for e-mail sent on a share.
- send_shared_email : boolean, optional
Send email to the recipients of a share.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
Set the permissions users have on this object
Parameters: - id : integer
ID of the resource to be shared
- user_ids : list
An array of one or more user IDs
- permission_level : string
Options are: “read”, “write”, or “manage”
- share_email_body : string, optional
Custom body text for e-mail sent on a share.
- send_shared_email : boolean, optional
Send email to the recipients of a share.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
-
Exports¶
-
class
Exports
(session_kwargs, return_type='civis')¶ Methods
-
list
(*, type='DEFAULT', author='DEFAULT', status='DEFAULT', hidden='DEFAULT', archived='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶ List
Parameters: - 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’.
- hidden : boolean, optional
If specified to be true, returns hidden objects. Defaults to false, returning non-hidden objects.
- archived : string, optional
The archival status of the requested object(s).
- limit : integer, optional
Number of results to return. Defaults to 20. Maximum allowed is 50.
- page_num : integer, optional
Page number of the results to return. Defaults to the first page, 1.
- order : string, optional
The field on which to order the result set. Defaults to updated_at. Must be one of: updated_at, name, created_at, last_run.updated_at.
- order_dir : string, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: - id : integer
The ID for this export.
- name : string
The name of this export.
- type : string
The type of export.
- created_at : string/time
The creation time for this export.
- updated_at : string/time
The last modification time for this export.
- state : string
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
-
Files¶
-
class
Files
(session_kwargs, return_type='civis')¶ Methods
-
delete_projects
(id, project_id)¶ Remove a Data::S3File from a project
Parameters: - id : integer
ID of the resource
- project_id : integer
The ID of the project
Returns: - None
Response code 204: success
Revoke the permissions a group has on this object
Parameters: - id : integer
ID of the resource to be revoked
- group_id : integer
ID of the group
Returns: - None
Response code 204: success
Revoke the permissions a user has on this object
Parameters: - id : integer
ID of the resource to be revoked
- user_id : integer
ID of the user
Returns: - None
Response code 204: success
-
get
(id, *, link_expires_at='DEFAULT')¶ Get details about a file
Parameters: - id : integer
The ID of the file object.
- 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.
Returns: - id : integer
The ID of the file object.
- name : string
The file name.
- created_at : string/date-time
The date and time the file was created.
- file_size : integer
The file size.
- expires_at : string/date-time
The date and time the file will expire. If not specified, the file will expire in 30 days. To keep a file indefinitely, specify null.
- download_url : string
A JSON string containing information about the URL of the file.
- file_url : string
The URL that may be used to download the file.
-
list_projects
(id, *, hidden='DEFAULT')¶ List the projects a Data::S3File belongs to
Parameters: - id : integer
The ID of the resource.
- hidden : boolean, optional
If specified to be true, returns hidden objects. Defaults to false, returning non-hidden objects.
Returns: - id : integer
The ID for this project.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- name : string
The name of this project.
- description : string
A description of the project
- users : list::
Users who can see the project - id : integer
The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- auto_share : boolean
- created_at : string/time
- updated_at : string/time
- archived : string
The archival status of the requested object(s).
List users and groups permissioned on this object
Parameters: - id : integer
The ID of the object.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
-
post
(name, *, expires_at='DEFAULT')¶ Initiate an upload of a file into the platform
Parameters: - name : string
The file name.
- expires_at : string/date-time, optional
The date and time the file will expire. If not specified, the file will expire in 30 days. To keep a file indefinitely, specify null.
Returns: - id : integer
The ID of the file object.
- name : string
The file name.
- created_at : string/date-time
The date and time the file was created.
- file_size : integer
The file size.
- expires_at : string/date-time
The date and time the file will expire. If not specified, the file will expire in 30 days. To keep a file indefinitely, specify null.
- upload_url : string
The URL that may be used to upload a file. To use the upload URL, initiate a POST request to the given URL with the file you wish to import as the “file” form field.
- upload_fields : dict
A hash containing the form fields to be included with the POST request.
-
post_multipart
(name, num_parts, *, expires_at='DEFAULT')¶ Initiate a multipart upload
Parameters: - name : string
The file name.
- num_parts : integer
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/date-time, optional
The date and time the file will expire. If not specified, the file will expire in 30 days. To keep a file indefinitely, specify null.
Returns: - id : integer
The ID of the file object.
- name : string
The file name.
- created_at : string/date-time
The date and time the file was created.
- file_size : integer
The file size.
- expires_at : string/date-time
The date and time the file will expire. If not specified, the file will expire in 30 days. To keep a file indefinitely, specify null.
- upload_urls : list
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.
-
post_multipart_complete
(id)¶ Complete a multipart upload
Parameters: - id : integer
The ID of the file object.
Returns: - None
Response code 204: success
-
put_projects
(id, project_id)¶ Add a Data::S3File to a project
Parameters: - id : integer
ID of the resource
- project_id : integer
The ID of the project
Returns: - None
Response code 204: success
Set the permissions groups has on this object
Parameters: - id : integer
ID of the resource to be shared
- group_ids : list
An array of one or more group IDs
- permission_level : string
Options are: “read”, “write”, or “manage”
- share_email_body : string, optional
Custom body text for e-mail sent on a share.
- send_shared_email : boolean, optional
Send email to the recipients of a share.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
Set the permissions users have on this object
Parameters: - id : integer
ID of the resource to be shared
- user_ids : list
An array of one or more user IDs
- permission_level : string
Options are: “read”, “write”, or “manage”
- share_email_body : string, optional
Custom body text for e-mail sent on a share.
- send_shared_email : boolean, optional
Send email to the recipients of a share.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
-
Groups¶
-
class
Groups
(session_kwargs, return_type='civis')¶ Methods
-
list
(*, query='DEFAULT', permission='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶ List Groups
Parameters: - query : string, optional
If specified, it will filter the groups returned. Prefix matching is supported (e.g., “query=group” will return “group” and “group of people”, but not “my group”.
- permission : string, optional
A permissions string, one of “read”, “write”, or “manage”. Lists only groups for which the current user has that permission.
- 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.
- iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: - id : integer
The ID of this group.
- name : string
This group’s name.
- created_at : string/time
The date and time when this group was created.
- slug : string
The slug for this group.
- organization_id : integer
The organization associated with this group.
-
Imports¶
-
class
Imports
(session_kwargs, return_type='civis')¶ Methods
-
delete_files_runs
(id, run_id)¶ Cancel a run
Parameters: - id : integer
The ID of the import.
- run_id : integer
The ID of the run.
Returns: - None
Response code 202: success
-
delete_projects
(id, project_id)¶ Remove a JobTypes::Import from a project
Parameters: - id : integer
ID of the resource
- project_id : integer
The ID of the project
Returns: - None
Response code 204: success
Revoke the permissions a group has on this object
Parameters: - id : integer
ID of the resource to be revoked
- group_id : integer
ID of the group
Returns: - None
Response code 204: success
Revoke the permissions a user has on this object
Parameters: - id : integer
ID of the resource to be revoked
- user_id : integer
ID of the user
Returns: - None
Response code 204: success
-
get
(id)¶ Get details about an import
Parameters: - id : integer
The ID for the import.
Returns: - name : string
The name of the import.
- sync_type : string
The type of sync to perform; one of Dbsync, AutoImport, SilverpopDataImport, SilverpopContactImport, GdocImport, GdocExport, and Salesforce.
- source : dict::
- remote_host_id : integer
- credential_id : integer
- additional_credentials : list
- Array that holds additional credentials used for specific imports. For salesforce imports, the first and only element is the client credential id.
- name : string
- destination : dict::
- remote_host_id : integer
- credential_id : integer
- additional_credentials : list
- Array that holds additional credentials used for specific imports. For salesforce imports, the first and only element is the client credential id.
- name : string
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- notifications : dict::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- parent_id : integer
Parent id to trigger this import from
- id : integer
The ID for the import.
- is_outbound : boolean
- job_type : string
The job type of this import.
- syncs : list::
List of syncs. - id : integer - source : dict:
- id : integer The ID of the table or file, if available. - path : string The path of the dataset to sync from; for a database source, schema.tablename. If you are doing a Google Sheet export, this can be blank. This is a legacy parameter, it is recommended you use one of the following: databaseTable, file, googleWorksheet, salesforce, silverpop - database_table : dict:: - schema : string The database schema name. - table : string The database table name. - file : dict:: - id : integer The file id. - google_worksheet : dict:: - spreadsheet : string The spreadsheet document name. - worksheet : string The worksheet tab name. - salesforce : dict:: - object_name : string The Salesforce object name. - silverpop : dict:: - list_id : integer The Silverpop list id.
- destination : dict::
- path : string
- The schema.tablename to sync to. If you are doing a Google Sheet export, this is the spreadsheet and sheet name separated by a period. i.e. if you have a spreadsheet named “MySpreadsheet” and a sheet called “Sheet1” this field would be “MySpreadsheet.Sheet1”. This is a legacy parameter, it is recommended you use one of the following: databaseTable, googleWorksheet
- database_table : dict::
- schema : string
- The database schema name.
- table : string
- The database table name.
- google_worksheet : dict::
- spreadsheet : string
- The spreadsheet document name.
- worksheet : string
- The worksheet tab name.
- advanced_options : dict::
- max_errors : integer
- existing_table_rows : string
- distkey : string
- sortkey1 : string
- sortkey2 : string
- column_delimiter : string
- column_overrides : dict
- Hash used for overriding auto-detected names and types, with keys being the current name of the column being overridden.
- identity_column : string
- row_chunk_size : integer
- wipe_destination_table : boolean
- truncate_long_lines : boolean
- invalid_char_replacement : string
- verify_table_row_counts : boolean
- partition_column_name : string
- partition_schema_name : string
- partition_table_name : string
- partition_table_partition_column_min_name : string
- partition_table_partition_column_max_name : string
- last_modified_column : string
- mysql_catalog_matches_schema : boolean
- chunking_method : string
- The method used to break the data into smaller chunks for transfer. The value can be set to sorted_by_identity_columns or if not set the chunking method will be choosen automatically.
- first_row_is_header : boolean
- export_action : string
- The kind of export action you want to have the export execute. Set to “newsprsht” if you want a new worksheet inside a new spreadsheet. Set to “newwksht” if you want a new worksheet inside an existing spreadsheet. Set to “updatewksht” if you want to overwrite an existing worksheet inside an existing spreadsheet. Set to “appendwksht” if you want to append to the end of an existing worksheet inside an existing spreadsheet.
- sql_query : string
- If you are doing a Google Sheet export, this is your SQL query.
- contact_lists : string
- soql_query : string
- state : string
- created_at : string/date-time
- updated_at : string/date-time
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- user : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- running_as : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- next_run_at : string/time
The time of the next scheduled run.
- time_zone : string
The time zone of this import.
- hidden : boolean
The hidden status of the object.
- archived : string
The archival status of the requested object(s).
-
get_batches
(id)¶ Get details about a batch import
Parameters: - id : integer
The ID for the import.
Returns: - 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.
- remote_host_id : integer
The ID of the destination database host.
- state : string
The state of the run; one of “queued”, “running”, “succeeded”, “failed”, or “cancelled”.
- started_at : string/time
The time the last run started at.
- finished_at : string/time
The time the last run completed.
- error : string
The error returned by the run, if any.
- hidden : boolean
The hidden status of the object.
-
get_files_runs
(id, run_id)¶ Check status of a run
Parameters: - id : integer
The ID of the import.
- run_id : integer
The ID of the run.
Returns: - id : integer
The ID of the run.
- import_id : integer
The ID of the import.
- state : string
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- is_cancel_requested : boolean
True if run cancel requested, else false.
- started_at : string/time
The time the last run started at.
- finished_at : string/time
The time the last run completed.
- error : string
The error, if any, returned by the run.
-
list
(*, type='DEFAULT', author='DEFAULT', destination='DEFAULT', status='DEFAULT', hidden='DEFAULT', archived='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶ List
Parameters: - type : string, optional
If specified, return imports of these types. It accepts a comma-separated list, possible values are ‘AutoImport’, ‘DbSync’, ‘Salesforce’, ‘GdocImport’.
- author : string, optional
If specified, return imports from this author. It accepts a comma-separated list of author ids.
- destination : string, optional
If specified, returns imports with one of these destinations. It accepts a comma-separated list of remote host ids.
- status : string, optional
If specified, returns imports with one of these statuses. It accepts a comma-separated list, possible values are ‘running’, ‘failed’, ‘succeeded’, ‘idle’, ‘scheduled’.
- hidden : boolean, optional
If specified to be true, returns hidden objects. Defaults to false, returning non-hidden objects.
- archived : string, optional
The archival status of the requested object(s).
- limit : integer, optional
Number of results to return. Defaults to 20. Maximum allowed is 50.
- page_num : integer, optional
Page number of the results to return. Defaults to the first page, 1.
- order : string, optional
The field on which to order the result set. Defaults to updated_at. Must be one of: updated_at, name, created_at, last_run.updated_at.
- order_dir : string, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: - name : string
The name of the import.
- sync_type : string
The type of sync to perform; one of Dbsync, AutoImport, SilverpopDataImport, SilverpopContactImport, GdocImport, GdocExport, and Salesforce.
- source : dict::
- remote_host_id : integer
- credential_id : integer
- additional_credentials : list
- Array that holds additional credentials used for specific imports. For salesforce imports, the first and only element is the client credential id.
- name : string
- destination : dict::
- remote_host_id : integer
- credential_id : integer
- additional_credentials : list
- Array that holds additional credentials used for specific imports. For salesforce imports, the first and only element is the client credential id.
- name : string
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- id : integer
The ID for the import.
- is_outbound : boolean
- job_type : string
The job type of this import.
- state : string
- created_at : string/date-time
- updated_at : string/date-time
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- user : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- time_zone : string
The time zone of this import.
- archived : string
The archival status of the requested object(s).
-
list_batches
(*, hidden='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶ List batch imports
Parameters: - hidden : boolean, optional
If specified to be true, returns hidden objects. Defaults to false, returning non-hidden objects.
- 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.
- iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: - 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.
- remote_host_id : integer
The ID of the destination database host.
- state : string
The state of the run; one of “queued”, “running”, “succeeded”, “failed”, or “cancelled”.
- started_at : string/time
The time the last run started at.
- finished_at : string/time
The time the last run completed.
- error : string
The error returned by the run, if any.
-
list_files_runs
(id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶ List runs for the given import
Parameters: - id : integer
The ID of the import.
- limit : integer, optional
Number of results to return. Defaults to 20. Maximum allowed is 100.
- page_num : integer, optional
Page number of the results to return. Defaults to the first page, 1.
- order : string, optional
The field on which to order the result set. Defaults to id. Must be one of: id.
- order_dir : string, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: - id : integer
The ID of the run.
- import_id : integer
The ID of the import.
- state : string
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- is_cancel_requested : boolean
True if run cancel requested, else false.
- started_at : string/time
The time the last run started at.
- finished_at : string/time
The time the last run completed.
- error : string
The error, if any, returned by the run.
-
list_files_runs_logs
(id, run_id, *, last_id='DEFAULT', limit='DEFAULT')¶ Get the logs for a run
Parameters: - id : integer
The ID of the import.
- run_id : integer
The ID of the run.
- last_id : integer, optional
The ID of the last log message received. Log entries with this ID value or lower will be omitted.Logs are sorted by ID if this value is provided, and are otherwise sorted by createdAt.
- limit : integer, optional
The maximum number of log messages to return. Default of 10000.
Returns: - id : integer
The ID of the log.
- created_at : string/date-time
The time the log was created.
- message : string
The log message.
- level : string
The level of the log. One of unknown,fatal,error,warn,info,debug.
-
list_projects
(id, *, hidden='DEFAULT')¶ List the projects a JobTypes::Import belongs to
Parameters: - id : integer
The ID of the resource.
- hidden : boolean, optional
If specified to be true, returns hidden objects. Defaults to false, returning non-hidden objects.
Returns: - id : integer
The ID for this project.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- name : string
The name of this project.
- description : string
A description of the project
- users : list::
Users who can see the project - id : integer
The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- auto_share : boolean
- created_at : string/time
- updated_at : string/time
- archived : string
The archival status of the requested object(s).
-
list_runs
(id)¶ Get the run history of this import
Parameters: - id : integer
Returns: - id : integer
- state : string
- created_at : string/time
The time that the run was queued.
- started_at : string/time
The time that the run started.
- finished_at : string/time
The time that the run completed.
- error : string
The error message for this run, if present.
-
list_runs_logs
(id, run_id, *, last_id='DEFAULT', limit='DEFAULT')¶ Get the logs for a run
Parameters: - id : integer
The ID of the import.
- run_id : integer
The ID of the run.
- last_id : integer, optional
The ID of the last log message received. Log entries with this ID value or lower will be omitted.Logs are sorted by ID if this value is provided, and are otherwise sorted by createdAt.
- limit : integer, optional
The maximum number of log messages to return. Default of 10000.
Returns: - id : integer
The ID of the log.
- created_at : string/date-time
The time the log was created.
- message : string
The log message.
- level : string
The level of the log. One of unknown,fatal,error,warn,info,debug.
List users and groups permissioned on this object
Parameters: - id : integer
The ID of the object.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
-
post
(name, sync_type, is_outbound, *, source='DEFAULT', destination='DEFAULT', schedule='DEFAULT', notifications='DEFAULT', parent_id='DEFAULT', next_run_at='DEFAULT', time_zone='DEFAULT', hidden='DEFAULT')¶ Create a new import configuration
Parameters: - name : string
The name of the import.
- sync_type : string
The type of sync to perform; one of Dbsync, AutoImport, SilverpopDataImport, SilverpopContactImport, GdocImport, GdocExport, and Salesforce.
- is_outbound : boolean
- source : dict, optional::
- remote_host_id : integer
- credential_id : integer
- additional_credentials : list
- Array that holds additional credentials used for specific imports. For salesforce imports, the first and only element is the client credential id.
- destination : dict, optional::
- remote_host_id : integer
- credential_id : integer
- additional_credentials : list
- Array that holds additional credentials used for specific imports. For salesforce imports, the first and only element is the client credential id.
- schedule : dict, optional::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- notifications : dict, optional::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- parent_id : integer, optional
Parent id to trigger this import from
- next_run_at : string/time, optional
The time of the next scheduled run.
- time_zone : string, optional
The time zone of this import.
- hidden : boolean, optional
The hidden status of the object.
Returns: - name : string
The name of the import.
- sync_type : string
The type of sync to perform; one of Dbsync, AutoImport, SilverpopDataImport, SilverpopContactImport, GdocImport, GdocExport, and Salesforce.
- source : dict::
- remote_host_id : integer
- credential_id : integer
- additional_credentials : list
- Array that holds additional credentials used for specific imports. For salesforce imports, the first and only element is the client credential id.
- name : string
- destination : dict::
- remote_host_id : integer
- credential_id : integer
- additional_credentials : list
- Array that holds additional credentials used for specific imports. For salesforce imports, the first and only element is the client credential id.
- name : string
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- notifications : dict::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- parent_id : integer
Parent id to trigger this import from
- id : integer
The ID for the import.
- is_outbound : boolean
- job_type : string
The job type of this import.
- syncs : list::
List of syncs. - id : integer - source : dict:
- id : integer The ID of the table or file, if available. - path : string The path of the dataset to sync from; for a database source, schema.tablename. If you are doing a Google Sheet export, this can be blank. This is a legacy parameter, it is recommended you use one of the following: databaseTable, file, googleWorksheet, salesforce, silverpop - database_table : dict:: - schema : string The database schema name. - table : string The database table name. - file : dict:: - id : integer The file id. - google_worksheet : dict:: - spreadsheet : string The spreadsheet document name. - worksheet : string The worksheet tab name. - salesforce : dict:: - object_name : string The Salesforce object name. - silverpop : dict:: - list_id : integer The Silverpop list id.
- destination : dict::
- path : string
- The schema.tablename to sync to. If you are doing a Google Sheet export, this is the spreadsheet and sheet name separated by a period. i.e. if you have a spreadsheet named “MySpreadsheet” and a sheet called “Sheet1” this field would be “MySpreadsheet.Sheet1”. This is a legacy parameter, it is recommended you use one of the following: databaseTable, googleWorksheet
- database_table : dict::
- schema : string
- The database schema name.
- table : string
- The database table name.
- google_worksheet : dict::
- spreadsheet : string
- The spreadsheet document name.
- worksheet : string
- The worksheet tab name.
- advanced_options : dict::
- max_errors : integer
- existing_table_rows : string
- distkey : string
- sortkey1 : string
- sortkey2 : string
- column_delimiter : string
- column_overrides : dict
- Hash used for overriding auto-detected names and types, with keys being the current name of the column being overridden.
- identity_column : string
- row_chunk_size : integer
- wipe_destination_table : boolean
- truncate_long_lines : boolean
- invalid_char_replacement : string
- verify_table_row_counts : boolean
- partition_column_name : string
- partition_schema_name : string
- partition_table_name : string
- partition_table_partition_column_min_name : string
- partition_table_partition_column_max_name : string
- last_modified_column : string
- mysql_catalog_matches_schema : boolean
- chunking_method : string
- The method used to break the data into smaller chunks for transfer. The value can be set to sorted_by_identity_columns or if not set the chunking method will be choosen automatically.
- first_row_is_header : boolean
- export_action : string
- The kind of export action you want to have the export execute. Set to “newsprsht” if you want a new worksheet inside a new spreadsheet. Set to “newwksht” if you want a new worksheet inside an existing spreadsheet. Set to “updatewksht” if you want to overwrite an existing worksheet inside an existing spreadsheet. Set to “appendwksht” if you want to append to the end of an existing worksheet inside an existing spreadsheet.
- sql_query : string
- If you are doing a Google Sheet export, this is your SQL query.
- contact_lists : string
- soql_query : string
- state : string
- created_at : string/date-time
- updated_at : string/date-time
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- user : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- running_as : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- next_run_at : string/time
The time of the next scheduled run.
- time_zone : string
The time zone of this import.
- hidden : boolean
The hidden status of the object.
- archived : string
The archival status of the requested object(s).
-
post_batches
(file_ids, schema, table, remote_host_id, credential_id, *, column_delimiter='DEFAULT', first_row_is_header='DEFAULT', compression='DEFAULT', hidden='DEFAULT')¶ Upload multiple files to Redshift
Parameters: - file_ids : list
The file IDs 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.
- remote_host_id : integer
The ID of the destination database host.
- credential_id : integer
The ID of the credentials to be used when performing the database import.
- 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”.
- hidden : boolean, optional
The hidden status of the object.
Returns: - 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.
- remote_host_id : integer
The ID of the destination database host.
- state : string
The state of the run; one of “queued”, “running”, “succeeded”, “failed”, or “cancelled”.
- started_at : string/time
The time the last run started at.
- finished_at : string/time
The time the last run completed.
- error : string
The error returned by the run, if any.
- hidden : boolean
The hidden status of the object.
-
post_cancel
(id)¶ Cancel a run
Parameters: - id : integer
The ID of the job.
Returns: - id : integer
The ID of the run.
- state : string
The state of the run, one of ‘queued’, ‘running’ or ‘cancelled’.
- is_cancel_requested : boolean
True if run cancel requested, else false.
-
post_files
(schema, name, remote_host_id, credential_id, *, max_errors='DEFAULT', existing_table_rows='DEFAULT', distkey='DEFAULT', sortkey1='DEFAULT', sortkey2='DEFAULT', column_delimiter='DEFAULT', first_row_is_header='DEFAULT', multipart='DEFAULT', hidden='DEFAULT')¶ Initate an import of a tabular file into the platform
Parameters: - schema : string
The schema of the destination table.
- name : string
The name of the destination table.
- remote_host_id : integer
The id of the destination database host.
- credential_id : integer
The id of the credentials to be used when performing the database import.
- 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”.
- 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.
- hidden : boolean, optional
The hidden status of the object.
Returns: - id : integer
The id of the import.
- upload_uri : string
The URI which may be used to upload a tabular file for import. You must use this URI to upload the file you wish imported and then inform the Civis API when your upload is complete using the URI given by the runUri field of this reponse.
- run_uri : string
The URI to POST to once the file upload is complete. After uploading the file using the URI given in the uploadUri attribute of the reponse, POST to this URI to initiate the import of your uploaded file into the platform.
- upload_fields : dict
If multipart was set to true, these fields should be included in the multipart upload.
-
post_files_runs
(id)¶ Start a run
Parameters: - id : integer
The ID of the import.
Returns: - id : integer
The ID of the run.
- import_id : integer
The ID of the import.
- state : string
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- is_cancel_requested : boolean
True if run cancel requested, else false.
- started_at : string/time
The time the last run started at.
- finished_at : string/time
The time the last run completed.
- error : string
The error, if any, returned by the run.
-
post_runs
(id)¶ Run an import
Parameters: - id : integer
The ID of the import to run.
Returns: - run_id : integer
The ID of the new run triggered.
-
post_syncs
(id, source, destination, *, advanced_options='DEFAULT')¶ Create a sync
Parameters: - id : integer
- source : dict::
- path : string
- The path of the dataset to sync from; for a database source, schema.tablename. If you are doing a Google Sheet export, this can be blank. This is a legacy parameter, it is recommended you use one of the following: databaseTable, file, googleWorksheet, salesforce, silverpop
- database_table : dict::
- schema : string
- The database schema name.
- table : string
- The database table name.
- file : dict
- google_worksheet : dict::
- spreadsheet : string
- The spreadsheet document name.
- worksheet : string
- The worksheet tab name.
- salesforce : dict::
- object_name : string
- The Salesforce object name.
- silverpop : dict::
- list_id : integer
- The Silverpop list id.
- destination : dict::
- path : string
- The schema.tablename to sync to. If you are doing a Google Sheet export, this is the spreadsheet and sheet name separated by a period. i.e. if you have a spreadsheet named “MySpreadsheet” and a sheet called “Sheet1” this field would be “MySpreadsheet.Sheet1”. This is a legacy parameter, it is recommended you use one of the following: databaseTable, googleWorksheet
- database_table : dict::
- schema : string
- The database schema name.
- table : string
- The database table name.
- google_worksheet : dict::
- spreadsheet : string
- The spreadsheet document name.
- worksheet : string
- The worksheet tab name.
- advanced_options : dict, optional::
- max_errors : integer
- existing_table_rows : string
- distkey : string
- sortkey1 : string
- sortkey2 : string
- column_delimiter : string
- column_overrides : dict
- Hash used for overriding auto-detected names and types, with keys being the current name of the column being overridden.
- identity_column : string
- row_chunk_size : integer
- wipe_destination_table : boolean
- truncate_long_lines : boolean
- invalid_char_replacement : string
- verify_table_row_counts : boolean
- partition_column_name : string
- partition_schema_name : string
- partition_table_name : string
- partition_table_partition_column_min_name : string
- partition_table_partition_column_max_name : string
- last_modified_column : string
- mysql_catalog_matches_schema : boolean
- chunking_method : string
- The method used to break the data into smaller chunks for transfer. The value can be set to sorted_by_identity_columns or if not set the chunking method will be choosen automatically.
- first_row_is_header : boolean
- export_action : string
- The kind of export action you want to have the export execute. Set to “newsprsht” if you want a new worksheet inside a new spreadsheet. Set to “newwksht” if you want a new worksheet inside an existing spreadsheet. Set to “updatewksht” if you want to overwrite an existing worksheet inside an existing spreadsheet. Set to “appendwksht” if you want to append to the end of an existing worksheet inside an existing spreadsheet.
- sql_query : string
- If you are doing a Google Sheet export, this is your SQL query.
- contact_lists : string
- soql_query : string
Returns: - id : integer
- source : dict::
- id : integer
- The ID of the table or file, if available.
- path : string
- The path of the dataset to sync from; for a database source, schema.tablename. If you are doing a Google Sheet export, this can be blank. This is a legacy parameter, it is recommended you use one of the following: databaseTable, file, googleWorksheet, salesforce, silverpop
- database_table : dict::
- schema : string
- The database schema name.
- table : string
- The database table name.
- file : dict::
- id : integer
- The file id.
- google_worksheet : dict::
- spreadsheet : string
- The spreadsheet document name.
- worksheet : string
- The worksheet tab name.
- salesforce : dict::
- object_name : string
- The Salesforce object name.
- silverpop : dict::
- list_id : integer
- The Silverpop list id.
- destination : dict::
- path : string
- The schema.tablename to sync to. If you are doing a Google Sheet export, this is the spreadsheet and sheet name separated by a period. i.e. if you have a spreadsheet named “MySpreadsheet” and a sheet called “Sheet1” this field would be “MySpreadsheet.Sheet1”. This is a legacy parameter, it is recommended you use one of the following: databaseTable, googleWorksheet
- database_table : dict::
- schema : string
- The database schema name.
- table : string
- The database table name.
- google_worksheet : dict::
- spreadsheet : string
- The spreadsheet document name.
- worksheet : string
- The worksheet tab name.
- advanced_options : dict::
- max_errors : integer
- existing_table_rows : string
- distkey : string
- sortkey1 : string
- sortkey2 : string
- column_delimiter : string
- column_overrides : dict
- Hash used for overriding auto-detected names and types, with keys being the current name of the column being overridden.
- identity_column : string
- row_chunk_size : integer
- wipe_destination_table : boolean
- truncate_long_lines : boolean
- invalid_char_replacement : string
- verify_table_row_counts : boolean
- partition_column_name : string
- partition_schema_name : string
- partition_table_name : string
- partition_table_partition_column_min_name : string
- partition_table_partition_column_max_name : string
- last_modified_column : string
- mysql_catalog_matches_schema : boolean
- chunking_method : string
- The method used to break the data into smaller chunks for transfer. The value can be set to sorted_by_identity_columns or if not set the chunking method will be choosen automatically.
- first_row_is_header : boolean
- export_action : string
- The kind of export action you want to have the export execute. Set to “newsprsht” if you want a new worksheet inside a new spreadsheet. Set to “newwksht” if you want a new worksheet inside an existing spreadsheet. Set to “updatewksht” if you want to overwrite an existing worksheet inside an existing spreadsheet. Set to “appendwksht” if you want to append to the end of an existing worksheet inside an existing spreadsheet.
- sql_query : string
- If you are doing a Google Sheet export, this is your SQL query.
- contact_lists : string
- soql_query : string
-
put
(id, name, sync_type, is_outbound, *, source='DEFAULT', destination='DEFAULT', schedule='DEFAULT', notifications='DEFAULT', parent_id='DEFAULT', next_run_at='DEFAULT', time_zone='DEFAULT')¶ Update an import
Parameters: - id : integer
The ID for the import.
- name : string
The name of the import.
- sync_type : string
The type of sync to perform; one of Dbsync, AutoImport, SilverpopDataImport, SilverpopContactImport, GdocImport, GdocExport, and Salesforce.
- is_outbound : boolean
- source : dict, optional::
- remote_host_id : integer
- credential_id : integer
- additional_credentials : list
- Array that holds additional credentials used for specific imports. For salesforce imports, the first and only element is the client credential id.
- destination : dict, optional::
- remote_host_id : integer
- credential_id : integer
- additional_credentials : list
- Array that holds additional credentials used for specific imports. For salesforce imports, the first and only element is the client credential id.
- schedule : dict, optional::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- notifications : dict, optional::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- parent_id : integer, optional
Parent id to trigger this import from
- next_run_at : string/time, optional
The time of the next scheduled run.
- time_zone : string, optional
The time zone of this import.
Returns: - name : string
The name of the import.
- sync_type : string
The type of sync to perform; one of Dbsync, AutoImport, SilverpopDataImport, SilverpopContactImport, GdocImport, GdocExport, and Salesforce.
- source : dict::
- remote_host_id : integer
- credential_id : integer
- additional_credentials : list
- Array that holds additional credentials used for specific imports. For salesforce imports, the first and only element is the client credential id.
- name : string
- destination : dict::
- remote_host_id : integer
- credential_id : integer
- additional_credentials : list
- Array that holds additional credentials used for specific imports. For salesforce imports, the first and only element is the client credential id.
- name : string
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- notifications : dict::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- parent_id : integer
Parent id to trigger this import from
- id : integer
The ID for the import.
- is_outbound : boolean
- job_type : string
The job type of this import.
- syncs : list::
List of syncs. - id : integer - source : dict:
- id : integer The ID of the table or file, if available. - path : string The path of the dataset to sync from; for a database source, schema.tablename. If you are doing a Google Sheet export, this can be blank. This is a legacy parameter, it is recommended you use one of the following: databaseTable, file, googleWorksheet, salesforce, silverpop - database_table : dict:: - schema : string The database schema name. - table : string The database table name. - file : dict:: - id : integer The file id. - google_worksheet : dict:: - spreadsheet : string The spreadsheet document name. - worksheet : string The worksheet tab name. - salesforce : dict:: - object_name : string The Salesforce object name. - silverpop : dict:: - list_id : integer The Silverpop list id.
- destination : dict::
- path : string
- The schema.tablename to sync to. If you are doing a Google Sheet export, this is the spreadsheet and sheet name separated by a period. i.e. if you have a spreadsheet named “MySpreadsheet” and a sheet called “Sheet1” this field would be “MySpreadsheet.Sheet1”. This is a legacy parameter, it is recommended you use one of the following: databaseTable, googleWorksheet
- database_table : dict::
- schema : string
- The database schema name.
- table : string
- The database table name.
- google_worksheet : dict::
- spreadsheet : string
- The spreadsheet document name.
- worksheet : string
- The worksheet tab name.
- advanced_options : dict::
- max_errors : integer
- existing_table_rows : string
- distkey : string
- sortkey1 : string
- sortkey2 : string
- column_delimiter : string
- column_overrides : dict
- Hash used for overriding auto-detected names and types, with keys being the current name of the column being overridden.
- identity_column : string
- row_chunk_size : integer
- wipe_destination_table : boolean
- truncate_long_lines : boolean
- invalid_char_replacement : string
- verify_table_row_counts : boolean
- partition_column_name : string
- partition_schema_name : string
- partition_table_name : string
- partition_table_partition_column_min_name : string
- partition_table_partition_column_max_name : string
- last_modified_column : string
- mysql_catalog_matches_schema : boolean
- chunking_method : string
- The method used to break the data into smaller chunks for transfer. The value can be set to sorted_by_identity_columns or if not set the chunking method will be choosen automatically.
- first_row_is_header : boolean
- export_action : string
- The kind of export action you want to have the export execute. Set to “newsprsht” if you want a new worksheet inside a new spreadsheet. Set to “newwksht” if you want a new worksheet inside an existing spreadsheet. Set to “updatewksht” if you want to overwrite an existing worksheet inside an existing spreadsheet. Set to “appendwksht” if you want to append to the end of an existing worksheet inside an existing spreadsheet.
- sql_query : string
- If you are doing a Google Sheet export, this is your SQL query.
- contact_lists : string
- soql_query : string
- state : string
- created_at : string/date-time
- updated_at : string/date-time
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- user : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- running_as : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- next_run_at : string/time
The time of the next scheduled run.
- time_zone : string
The time zone of this import.
- hidden : boolean
The hidden status of the object.
- archived : string
The archival status of the requested object(s).
-
put_archive
(id, status)¶ Update the archive status of this object
Parameters: - id : integer
The ID of the object.
- status : boolean
The desired archived status of the object.
Returns: - name : string
The name of the import.
- sync_type : string
The type of sync to perform; one of Dbsync, AutoImport, SilverpopDataImport, SilverpopContactImport, GdocImport, GdocExport, and Salesforce.
- source : dict::
- remote_host_id : integer
- credential_id : integer
- additional_credentials : list
- Array that holds additional credentials used for specific imports. For salesforce imports, the first and only element is the client credential id.
- name : string
- destination : dict::
- remote_host_id : integer
- credential_id : integer
- additional_credentials : list
- Array that holds additional credentials used for specific imports. For salesforce imports, the first and only element is the client credential id.
- name : string
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- notifications : dict::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- parent_id : integer
Parent id to trigger this import from
- id : integer
The ID for the import.
- is_outbound : boolean
- job_type : string
The job type of this import.
- syncs : list::
List of syncs. - id : integer - source : dict:
- id : integer The ID of the table or file, if available. - path : string The path of the dataset to sync from; for a database source, schema.tablename. If you are doing a Google Sheet export, this can be blank. This is a legacy parameter, it is recommended you use one of the following: databaseTable, file, googleWorksheet, salesforce, silverpop - database_table : dict:: - schema : string The database schema name. - table : string The database table name. - file : dict:: - id : integer The file id. - google_worksheet : dict:: - spreadsheet : string The spreadsheet document name. - worksheet : string The worksheet tab name. - salesforce : dict:: - object_name : string The Salesforce object name. - silverpop : dict:: - list_id : integer The Silverpop list id.
- destination : dict::
- path : string
- The schema.tablename to sync to. If you are doing a Google Sheet export, this is the spreadsheet and sheet name separated by a period. i.e. if you have a spreadsheet named “MySpreadsheet” and a sheet called “Sheet1” this field would be “MySpreadsheet.Sheet1”. This is a legacy parameter, it is recommended you use one of the following: databaseTable, googleWorksheet
- database_table : dict::
- schema : string
- The database schema name.
- table : string
- The database table name.
- google_worksheet : dict::
- spreadsheet : string
- The spreadsheet document name.
- worksheet : string
- The worksheet tab name.
- advanced_options : dict::
- max_errors : integer
- existing_table_rows : string
- distkey : string
- sortkey1 : string
- sortkey2 : string
- column_delimiter : string
- column_overrides : dict
- Hash used for overriding auto-detected names and types, with keys being the current name of the column being overridden.
- identity_column : string
- row_chunk_size : integer
- wipe_destination_table : boolean
- truncate_long_lines : boolean
- invalid_char_replacement : string
- verify_table_row_counts : boolean
- partition_column_name : string
- partition_schema_name : string
- partition_table_name : string
- partition_table_partition_column_min_name : string
- partition_table_partition_column_max_name : string
- last_modified_column : string
- mysql_catalog_matches_schema : boolean
- chunking_method : string
- The method used to break the data into smaller chunks for transfer. The value can be set to sorted_by_identity_columns or if not set the chunking method will be choosen automatically.
- first_row_is_header : boolean
- export_action : string
- The kind of export action you want to have the export execute. Set to “newsprsht” if you want a new worksheet inside a new spreadsheet. Set to “newwksht” if you want a new worksheet inside an existing spreadsheet. Set to “updatewksht” if you want to overwrite an existing worksheet inside an existing spreadsheet. Set to “appendwksht” if you want to append to the end of an existing worksheet inside an existing spreadsheet.
- sql_query : string
- If you are doing a Google Sheet export, this is your SQL query.
- contact_lists : string
- soql_query : string
- state : string
- created_at : string/date-time
- updated_at : string/date-time
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- user : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- running_as : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- next_run_at : string/time
The time of the next scheduled run.
- time_zone : string
The time zone of this import.
- hidden : boolean
The hidden status of the object.
- archived : string
The archival status of the requested object(s).
-
put_projects
(id, project_id)¶ Add a JobTypes::Import to a project
Parameters: - id : integer
ID of the resource
- project_id : integer
The ID of the project
Returns: - None
Response code 204: success
Set the permissions groups has on this object
Parameters: - id : integer
ID of the resource to be shared
- group_ids : list
An array of one or more group IDs
- permission_level : string
Options are: “read”, “write”, or “manage”
- share_email_body : string, optional
Custom body text for e-mail sent on a share.
- send_shared_email : boolean, optional
Send email to the recipients of a share.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
Set the permissions users have on this object
Parameters: - id : integer
ID of the resource to be shared
- user_ids : list
An array of one or more user IDs
- permission_level : string
Options are: “read”, “write”, or “manage”
- share_email_body : string, optional
Custom body text for e-mail sent on a share.
- send_shared_email : boolean, optional
Send email to the recipients of a share.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
-
put_syncs
(id, sync_id, source, destination, *, advanced_options='DEFAULT')¶ Update a sync
Parameters: - id : integer
The ID of the import to fetch.
- sync_id : integer
The ID of the sync to fetch.
- source : dict::
- path : string
- The path of the dataset to sync from; for a database source, schema.tablename. If you are doing a Google Sheet export, this can be blank. This is a legacy parameter, it is recommended you use one of the following: databaseTable, file, googleWorksheet, salesforce, silverpop
- database_table : dict::
- schema : string
- The database schema name.
- table : string
- The database table name.
- file : dict
- google_worksheet : dict::
- spreadsheet : string
- The spreadsheet document name.
- worksheet : string
- The worksheet tab name.
- salesforce : dict::
- object_name : string
- The Salesforce object name.
- silverpop : dict::
- list_id : integer
- The Silverpop list id.
- destination : dict::
- path : string
- The schema.tablename to sync to. If you are doing a Google Sheet export, this is the spreadsheet and sheet name separated by a period. i.e. if you have a spreadsheet named “MySpreadsheet” and a sheet called “Sheet1” this field would be “MySpreadsheet.Sheet1”. This is a legacy parameter, it is recommended you use one of the following: databaseTable, googleWorksheet
- database_table : dict::
- schema : string
- The database schema name.
- table : string
- The database table name.
- google_worksheet : dict::
- spreadsheet : string
- The spreadsheet document name.
- worksheet : string
- The worksheet tab name.
- advanced_options : dict, optional::
- max_errors : integer
- existing_table_rows : string
- distkey : string
- sortkey1 : string
- sortkey2 : string
- column_delimiter : string
- column_overrides : dict
- Hash used for overriding auto-detected names and types, with keys being the current name of the column being overridden.
- identity_column : string
- row_chunk_size : integer
- wipe_destination_table : boolean
- truncate_long_lines : boolean
- invalid_char_replacement : string
- verify_table_row_counts : boolean
- partition_column_name : string
- partition_schema_name : string
- partition_table_name : string
- partition_table_partition_column_min_name : string
- partition_table_partition_column_max_name : string
- last_modified_column : string
- mysql_catalog_matches_schema : boolean
- chunking_method : string
- The method used to break the data into smaller chunks for transfer. The value can be set to sorted_by_identity_columns or if not set the chunking method will be choosen automatically.
- first_row_is_header : boolean
- export_action : string
- The kind of export action you want to have the export execute. Set to “newsprsht” if you want a new worksheet inside a new spreadsheet. Set to “newwksht” if you want a new worksheet inside an existing spreadsheet. Set to “updatewksht” if you want to overwrite an existing worksheet inside an existing spreadsheet. Set to “appendwksht” if you want to append to the end of an existing worksheet inside an existing spreadsheet.
- sql_query : string
- If you are doing a Google Sheet export, this is your SQL query.
- contact_lists : string
- soql_query : string
Returns: - id : integer
- source : dict::
- id : integer
- The ID of the table or file, if available.
- path : string
- The path of the dataset to sync from; for a database source, schema.tablename. If you are doing a Google Sheet export, this can be blank. This is a legacy parameter, it is recommended you use one of the following: databaseTable, file, googleWorksheet, salesforce, silverpop
- database_table : dict::
- schema : string
- The database schema name.
- table : string
- The database table name.
- file : dict::
- id : integer
- The file id.
- google_worksheet : dict::
- spreadsheet : string
- The spreadsheet document name.
- worksheet : string
- The worksheet tab name.
- salesforce : dict::
- object_name : string
- The Salesforce object name.
- silverpop : dict::
- list_id : integer
- The Silverpop list id.
- destination : dict::
- path : string
- The schema.tablename to sync to. If you are doing a Google Sheet export, this is the spreadsheet and sheet name separated by a period. i.e. if you have a spreadsheet named “MySpreadsheet” and a sheet called “Sheet1” this field would be “MySpreadsheet.Sheet1”. This is a legacy parameter, it is recommended you use one of the following: databaseTable, googleWorksheet
- database_table : dict::
- schema : string
- The database schema name.
- table : string
- The database table name.
- google_worksheet : dict::
- spreadsheet : string
- The spreadsheet document name.
- worksheet : string
- The worksheet tab name.
- advanced_options : dict::
- max_errors : integer
- existing_table_rows : string
- distkey : string
- sortkey1 : string
- sortkey2 : string
- column_delimiter : string
- column_overrides : dict
- Hash used for overriding auto-detected names and types, with keys being the current name of the column being overridden.
- identity_column : string
- row_chunk_size : integer
- wipe_destination_table : boolean
- truncate_long_lines : boolean
- invalid_char_replacement : string
- verify_table_row_counts : boolean
- partition_column_name : string
- partition_schema_name : string
- partition_table_name : string
- partition_table_partition_column_min_name : string
- partition_table_partition_column_max_name : string
- last_modified_column : string
- mysql_catalog_matches_schema : boolean
- chunking_method : string
- The method used to break the data into smaller chunks for transfer. The value can be set to sorted_by_identity_columns or if not set the chunking method will be choosen automatically.
- first_row_is_header : boolean
- export_action : string
- The kind of export action you want to have the export execute. Set to “newsprsht” if you want a new worksheet inside a new spreadsheet. Set to “newwksht” if you want a new worksheet inside an existing spreadsheet. Set to “updatewksht” if you want to overwrite an existing worksheet inside an existing spreadsheet. Set to “appendwksht” if you want to append to the end of an existing worksheet inside an existing spreadsheet.
- sql_query : string
- If you are doing a Google Sheet export, this is your SQL query.
- contact_lists : string
- soql_query : string
-
put_syncs_archive
(id, sync_id, *, status='DEFAULT')¶ Update the archive status of this sync
Parameters: - id : integer
The ID of the import to fetch.
- sync_id : integer
The ID of the sync to fetch.
- status : boolean, optional
The desired archived status of the sync.
Returns: - id : integer
- source : dict::
- id : integer
- The ID of the table or file, if available.
- path : string
- The path of the dataset to sync from; for a database source, schema.tablename. If you are doing a Google Sheet export, this can be blank. This is a legacy parameter, it is recommended you use one of the following: databaseTable, file, googleWorksheet, salesforce, silverpop
- database_table : dict::
- schema : string
- The database schema name.
- table : string
- The database table name.
- file : dict::
- id : integer
- The file id.
- google_worksheet : dict::
- spreadsheet : string
- The spreadsheet document name.
- worksheet : string
- The worksheet tab name.
- salesforce : dict::
- object_name : string
- The Salesforce object name.
- silverpop : dict::
- list_id : integer
- The Silverpop list id.
- destination : dict::
- path : string
- The schema.tablename to sync to. If you are doing a Google Sheet export, this is the spreadsheet and sheet name separated by a period. i.e. if you have a spreadsheet named “MySpreadsheet” and a sheet called “Sheet1” this field would be “MySpreadsheet.Sheet1”. This is a legacy parameter, it is recommended you use one of the following: databaseTable, googleWorksheet
- database_table : dict::
- schema : string
- The database schema name.
- table : string
- The database table name.
- google_worksheet : dict::
- spreadsheet : string
- The spreadsheet document name.
- worksheet : string
- The worksheet tab name.
- advanced_options : dict::
- max_errors : integer
- existing_table_rows : string
- distkey : string
- sortkey1 : string
- sortkey2 : string
- column_delimiter : string
- column_overrides : dict
- Hash used for overriding auto-detected names and types, with keys being the current name of the column being overridden.
- identity_column : string
- row_chunk_size : integer
- wipe_destination_table : boolean
- truncate_long_lines : boolean
- invalid_char_replacement : string
- verify_table_row_counts : boolean
- partition_column_name : string
- partition_schema_name : string
- partition_table_name : string
- partition_table_partition_column_min_name : string
- partition_table_partition_column_max_name : string
- last_modified_column : string
- mysql_catalog_matches_schema : boolean
- chunking_method : string
- The method used to break the data into smaller chunks for transfer. The value can be set to sorted_by_identity_columns or if not set the chunking method will be choosen automatically.
- first_row_is_header : boolean
- export_action : string
- The kind of export action you want to have the export execute. Set to “newsprsht” if you want a new worksheet inside a new spreadsheet. Set to “newwksht” if you want a new worksheet inside an existing spreadsheet. Set to “updatewksht” if you want to overwrite an existing worksheet inside an existing spreadsheet. Set to “appendwksht” if you want to append to the end of an existing worksheet inside an existing spreadsheet.
- sql_query : string
- If you are doing a Google Sheet export, this is your SQL query.
- contact_lists : string
- soql_query : string
-
Jobs¶
-
class
Jobs
(session_kwargs, return_type='civis')¶ Methods
-
delete_projects
(id, project_id)¶ Remove a Job from a project
Parameters: - id : integer
ID of the resource
- project_id : integer
The ID of the project
Returns: - None
Response code 204: success
Revoke the permissions a group has on this object
Parameters: - id : integer
ID of the resource to be revoked
- group_id : integer
ID of the group
Returns: - None
Response code 204: success
Revoke the permissions a user has on this object
Parameters: - id : integer
ID of the resource to be revoked
- user_id : integer
ID of the user
Returns: - None
Response code 204: success
-
get
(id)¶ Show basic job info
Parameters: - id : integer
The ID for this job.
Returns: - id : integer
- name : string
- type : string
- state : string
Whether the job is idle, queued, running, cancelled, or failed.
- created_at : string/date-time
- updated_at : string/date-time
- runs : list::
Information about the most recent runs of the job. - id : integer - state : string - created_at : string/time
The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- hidden : boolean
The hidden status of the object.
- archived : string
The archival status of the requested object(s).
-
get_runs
(id, run_id)¶ Check status of a job
Parameters: - id : integer
The ID of the Job.
- run_id : integer
The ID of the Run.
Returns: - id : integer
- state : string
- created_at : string/time
The time that the run was queued.
- started_at : string/time
The time that the run started.
- finished_at : string/time
The time that the run completed.
- error : string
The error message for this run, if present.
-
list
(*, state='DEFAULT', type='DEFAULT', q='DEFAULT', permission='DEFAULT', hidden='DEFAULT', archived='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶ List
Parameters: - 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.
- hidden : boolean, optional
If specified to be true, returns hidden objects. Defaults to false, returning non-hidden objects.
- archived : string, optional
The archival status of the requested object(s).
- limit : integer, optional
Number of results to return. Defaults to its maximum of 50.
- page_num : integer, optional
Page number of the results to return. Defaults to the first page, 1.
- order : string, optional
The field on which to order the result set. Defaults to updated_at. Must be one of: updated_at.
- order_dir : string, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: - id : integer
- name : string
- type : string
- state : string
Whether the job is idle, queued, running, cancelled, or failed.
- created_at : string/date-time
- updated_at : string/date-time
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- archived : string
The archival status of the requested object(s).
-
list_children
(id)¶ Show nested tree of children that this job triggers
Parameters: - id : integer
The ID for this job.
Returns: - id : integer
- name : string
- type : string
- state : string
- created_at : string/date-time
- updated_at : string/date-time
- runs : list::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- children : list
-
list_parents
(id)¶ Show chain of parents as a list that this job triggers from
Parameters: - id : integer
The ID for this job.
Returns: - id : integer
- name : string
- type : string
- state : string
Whether the job is idle, queued, running, cancelled, or failed.
- created_at : string/date-time
- updated_at : string/date-time
- runs : list::
Information about the most recent runs of the job. - id : integer - state : string - created_at : string/time
The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- hidden : boolean
The hidden status of the object.
- archived : string
The archival status of the requested object(s).
-
list_projects
(id, *, hidden='DEFAULT')¶ List the projects a Job belongs to
Parameters: - id : integer
The ID of the resource.
- hidden : boolean, optional
If specified to be true, returns hidden objects. Defaults to false, returning non-hidden objects.
Returns: - id : integer
The ID for this project.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- name : string
The name of this project.
- description : string
A description of the project
- users : list::
Users who can see the project - id : integer
The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- auto_share : boolean
- created_at : string/time
- updated_at : string/time
- archived : string
The archival status of the requested object(s).
List users and groups permissioned on this object
Parameters: - id : integer
The ID of the object.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
-
post_runs
(id)¶ Run a job
Parameters: - id : integer
The ID for this job.
Returns: - id : integer
- state : string
- created_at : string/time
The time that the run was queued.
- started_at : string/time
The time that the run started.
- finished_at : string/time
The time that the run completed.
- error : string
The error message for this run, if present.
-
post_trigger_email
(id)¶ Generate and retrieve trigger email address
Parameters: - id : integer
The ID for this job.
Returns: - trigger_email : string
Email address which may be used to trigger this job to run.
-
put_projects
(id, project_id)¶ Add a Job to a project
Parameters: - id : integer
ID of the resource
- project_id : integer
The ID of the project
Returns: - None
Response code 204: success
Set the permissions groups has on this object
Parameters: - id : integer
ID of the resource to be shared
- group_ids : list
An array of one or more group IDs
- permission_level : string
Options are: “read”, “write”, or “manage”
- share_email_body : string, optional
Custom body text for e-mail sent on a share.
- send_shared_email : boolean, optional
Send email to the recipients of a share.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
Set the permissions users have on this object
Parameters: - id : integer
ID of the resource to be shared
- user_ids : list
An array of one or more user IDs
- permission_level : string
Options are: “read”, “write”, or “manage”
- share_email_body : string, optional
Custom body text for e-mail sent on a share.
- send_shared_email : boolean, optional
Send email to the recipients of a share.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
-
Match_Targets¶
-
civis.resources._resources.
Match_Targets
¶ alias of
civis.resources._resources.MatchTargets
Media¶
-
class
Media
(session_kwargs, return_type='civis')¶ Methods
-
delete_optimizations_runs
(id, run_id)¶ Cancel a run
Parameters: - id : integer
The ID of the optimization.
- run_id : integer
The ID of the run.
Returns: - None
Response code 202: success
Revoke the permissions a group has on this object
Parameters: - id : integer
ID of the resource to be revoked
- group_id : integer
ID of the group
Returns: - None
Response code 204: success
Revoke the permissions a user has on this object
Parameters: - id : integer
ID of the resource to be revoked
- user_id : integer
ID of the user
Returns: - None
Response code 204: success
Revoke the permissions a group has on this object
Parameters: - id : integer
ID of the resource to be revoked
- group_id : integer
ID of the group
Returns: - None
Response code 204: success
Revoke the permissions a user has on this object
Parameters: - id : integer
ID of the resource to be revoked
- user_id : integer
ID of the user
Returns: - None
Response code 204: success
-
get_optimizations
(id)¶ Show a single optimization
Parameters: - id : integer
The optimization ID.
Returns: - id : integer
The optimization ID.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- name : string
The name of the optimization.
- created_at : string/time
- updated_at : string/time
- finished_at : string/date-time
The end time of the last run.
- state : string
The state of the last run.
- last_run_id : integer
The ID of the last run.
- spot_order_id : integer
The ID for the spot order produced by the optimization.
- archived : string
The archival status of the requested object(s).
- report_link : string
A link to the visual report for the optimization.
- spot_order_link : string
A link to the json version of the spot order.
- file_links : list
Links to the csv and xml versions of the spot order.
- runs : list::
The runs of the optimization. - market_id : integer
The market ID.
- start_date : string/date
The start date for the media run.
- end_date : string/date
The end date for the media run.
- syscodes : list
The syscodes for the media run.
- rate_cards : list
The ratecards for the media run.
- constraints : list::
The constraints for the media run. - targets : list
The targets to constrain.
- budget : number/float
- The maximum budget for these targets.
- frequency : integer
- The maximum frequency for these targets.
-
get_optimizations_runs
(id, run_id)¶ Check status of a run
Parameters: - id : integer
The ID of the optimization.
- run_id : integer
The ID of the run.
Returns: - id : integer
The ID of the run.
- optimization_id : integer
The ID of the optimization.
- state : string
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- is_cancel_requested : boolean
True if run cancel requested, else false.
- started_at : string/time
The time the last run started at.
- finished_at : string/time
The time the last run completed.
- error : string
The error, if any, returned by the run.
-
get_spot_orders
(id)¶ Show a single spot order
Parameters: - id : integer
The ID for the spot order.
Returns: - id : integer
The ID for the spot order.
- archived : string
The archival status of the requested object(s).
- csv_s3_uri : string
S3 URI for the spot order CSV file.
- json_s3_uri : string
S3 URI for the spot order JSON file.
- xml_archive_s3_uri : string
S3 URI for the spot order XML archive.
- last_transform_job_id : integer
ID of the spot order transformation job.
-
list_dmas
(*, name='DEFAULT', number='DEFAULT')¶ List all Designated Market Areas
Parameters: - 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.
Returns: - name : string
Name for the DMA region.
- number : integer
Identifier number for a DMA.
-
list_optimizations
(*, archived='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶ List all optimizations
Parameters: - archived : string, optional
The archival status of the requested object(s).
- limit : integer, optional
Number of results to return. Defaults to 20. Maximum allowed is 50.
- page_num : integer, optional
Page number of the results to return. Defaults to the first page, 1.
- order : string, optional
The field on which to order the result set. Defaults to 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.
- iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: - id : integer
The optimization ID.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- name : string
The name of the optimization.
- created_at : string/time
- updated_at : string/time
- finished_at : string/date-time
The end time of the last run.
- state : string
The state of the last run.
- last_run_id : integer
The ID of the last run.
- spot_order_id : integer
The ID for the spot order produced by the optimization.
- archived : string
The archival status of the requested object(s).
-
list_optimizations_runs
(id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶ List runs for the given optimization
Parameters: - id : integer
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.
- iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: - id : integer
The ID of the run.
- optimization_id : integer
The ID of the optimization.
- state : string
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- is_cancel_requested : boolean
True if run cancel requested, else false.
- started_at : string/time
The time the last run started at.
- finished_at : string/time
The time the last run completed.
- error : string
The error, if any, returned by the run.
-
list_optimizations_runs_logs
(id, run_id, *, last_id='DEFAULT', limit='DEFAULT')¶ Get the logs for a run
Parameters: - id : integer
The ID of the optimization.
- run_id : integer
The ID of the run.
- last_id : integer, optional
The ID of the last log message received. Log entries with this ID value or lower will be omitted.Logs are sorted by ID if this value is provided, and are otherwise sorted by createdAt.
- limit : integer, optional
The maximum number of log messages to return. Default of 10000.
Returns: - id : integer
The ID of the log.
- created_at : string/date-time
The time the log was created.
- message : string
The log message.
- level : string
The level of the log. One of unknown,fatal,error,warn,info,debug.
List users and groups permissioned on this object
Parameters: - id : integer
The ID of the object.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
-
list_ratecards
(*, filename='DEFAULT', dma_number='DEFAULT')¶ List all ratecards
Parameters: - 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.
Returns: - id : integer
The ratecard ID.
- filename : string
Name of the ratecard file.
- start_on : string/date
First day to which the ratecard applies.
- end_on : string/date
Last day to which the ratecard applies.
- dma_number : integer
Number of the DMA associated with the ratecard.
-
list_spot_orders
(*, id='DEFAULT', archived='DEFAULT')¶ List all spot orders
Parameters: - id : integer, optional
The ID for the spot order.
- archived : string, optional
The archival status of the requested object(s).
Returns: - id : integer
The ID for the spot order.
- archived : string
The archival status of the requested object(s).
List users and groups permissioned on this object
Parameters: - id : integer
The ID of the object.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
-
list_targets
(*, name='DEFAULT', identifier='DEFAULT', data_source='DEFAULT')¶ List all Media Targets
Parameters: - 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.
Returns: - name : string
The name of the target.
- identifier : string
A unique identifier for this target.
- data_source : string
The source of viewership data for this target.
-
patch_optimizations
(id, *, name='DEFAULT', runs='DEFAULT')¶ Edit an existing optimization
Parameters: - id : integer
The optimization ID.
- name : string, optional
The name of the optimization.
- runs : list, optional::
The runs of the optimization. - market_id : integer
The market ID.
- start_date : string/date
The start date for the media run.
- end_date : string/date
The end date for the media run.
- syscodes : list
The syscodes for the media run.
- rate_cards : list
The ratecards for the media run.
- constraints : list::
The constraints for the media run. - targets : list
The targets to constrain.
- budget : number/float
- The maximum budget for these targets.
- frequency : integer
- The maximum frequency for these targets.
Returns: - id : integer
The optimization ID.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- name : string
The name of the optimization.
- created_at : string/time
- updated_at : string/time
- finished_at : string/date-time
The end time of the last run.
- state : string
The state of the last run.
- last_run_id : integer
The ID of the last run.
- spot_order_id : integer
The ID for the spot order produced by the optimization.
- archived : string
The archival status of the requested object(s).
- report_link : string
A link to the visual report for the optimization.
- spot_order_link : string
A link to the json version of the spot order.
- file_links : list
Links to the csv and xml versions of the spot order.
- runs : list::
The runs of the optimization. - market_id : integer
The market ID.
- start_date : string/date
The start date for the media run.
- end_date : string/date
The end date for the media run.
- syscodes : list
The syscodes for the media run.
- rate_cards : list
The ratecards for the media run.
- constraints : list::
The constraints for the media run. - targets : list
The targets to constrain.
- budget : number/float
- The maximum budget for these targets.
- frequency : integer
- The maximum frequency for these targets.
-
post_optimizations
(runs, *, name='DEFAULT')¶ Create a new optimization
Parameters: - runs : list::
The runs of the optimization. - market_id : integer
The market ID.
- start_date : string/date
The start date for the media run.
- end_date : string/date
The end date for the media run.
- syscodes : list
The syscodes for the media run.
- rate_cards : list
The ratecards for the media run.
- constraints : list::
The constraints for the media run. - targets : list
The targets to constrain.
- budget : number/float
- The maximum budget for these targets.
- frequency : integer
- The maximum frequency for these targets.
- name : string, optional
The name of the optimization.
Returns: - id : integer
The optimization ID.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- name : string
The name of the optimization.
- created_at : string/time
- updated_at : string/time
- finished_at : string/date-time
The end time of the last run.
- state : string
The state of the last run.
- last_run_id : integer
The ID of the last run.
- spot_order_id : integer
The ID for the spot order produced by the optimization.
- archived : string
The archival status of the requested object(s).
- report_link : string
A link to the visual report for the optimization.
- spot_order_link : string
A link to the json version of the spot order.
- file_links : list
Links to the csv and xml versions of the spot order.
- runs : list::
The runs of the optimization. - market_id : integer
The market ID.
- start_date : string/date
The start date for the media run.
- end_date : string/date
The end date for the media run.
- syscodes : list
The syscodes for the media run.
- rate_cards : list
The ratecards for the media run.
- constraints : list::
The constraints for the media run. - targets : list
The targets to constrain.
- budget : number/float
- The maximum budget for these targets.
- frequency : integer
- The maximum frequency for these targets.
-
post_optimizations_clone
(id)¶ Clone an existing optimization
Parameters: - id : integer
The optimization ID.
Returns: - id : integer
The optimization ID.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- name : string
The name of the optimization.
- created_at : string/time
- updated_at : string/time
- finished_at : string/date-time
The end time of the last run.
- state : string
The state of the last run.
- last_run_id : integer
The ID of the last run.
- spot_order_id : integer
The ID for the spot order produced by the optimization.
- archived : string
The archival status of the requested object(s).
- report_link : string
A link to the visual report for the optimization.
- spot_order_link : string
A link to the json version of the spot order.
- file_links : list
Links to the csv and xml versions of the spot order.
- runs : list::
The runs of the optimization. - market_id : integer
The market ID.
- start_date : string/date
The start date for the media run.
- end_date : string/date
The end date for the media run.
- syscodes : list
The syscodes for the media run.
- rate_cards : list
The ratecards for the media run.
- constraints : list::
The constraints for the media run. - targets : list
The targets to constrain.
- budget : number/float
- The maximum budget for these targets.
- frequency : integer
- The maximum frequency for these targets.
-
post_optimizations_runs
(id)¶ Start a run
Parameters: - id : integer
The ID of the optimization.
Returns: - id : integer
The ID of the run.
- optimization_id : integer
The ID of the optimization.
- state : string
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- is_cancel_requested : boolean
True if run cancel requested, else false.
- started_at : string/time
The time the last run started at.
- finished_at : string/time
The time the last run completed.
- error : string
The error, if any, returned by the run.
-
post_spot_orders
(*, body='DEFAULT')¶ Create a spot order
Parameters: - body : string, optional
CSV body of a spot order.
Returns: - id : integer
The ID for the spot order.
- archived : string
The archival status of the requested object(s).
- csv_s3_uri : string
S3 URI for the spot order CSV file.
- json_s3_uri : string
S3 URI for the spot order JSON file.
- xml_archive_s3_uri : string
S3 URI for the spot order XML archive.
- last_transform_job_id : integer
ID of the spot order transformation job.
-
put_optimizations_archive
(id, status)¶ Update the archive status of this object
Parameters: - id : integer
The ID of the object.
- status : boolean
The desired archived status of the object.
Returns: - id : integer
The optimization ID.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- name : string
The name of the optimization.
- created_at : string/time
- updated_at : string/time
- finished_at : string/date-time
The end time of the last run.
- state : string
The state of the last run.
- last_run_id : integer
The ID of the last run.
- spot_order_id : integer
The ID for the spot order produced by the optimization.
- archived : string
The archival status of the requested object(s).
- report_link : string
A link to the visual report for the optimization.
- spot_order_link : string
A link to the json version of the spot order.
- file_links : list
Links to the csv and xml versions of the spot order.
- runs : list::
The runs of the optimization. - market_id : integer
The market ID.
- start_date : string/date
The start date for the media run.
- end_date : string/date
The end date for the media run.
- syscodes : list
The syscodes for the media run.
- rate_cards : list
The ratecards for the media run.
- constraints : list::
The constraints for the media run. - targets : list
The targets to constrain.
- budget : number/float
- The maximum budget for these targets.
- frequency : integer
- The maximum frequency for these targets.
Set the permissions groups has on this object
Parameters: - id : integer
ID of the resource to be shared
- group_ids : list
An array of one or more group IDs
- permission_level : string
Options are: “read”, “write”, or “manage”
- share_email_body : string, optional
Custom body text for e-mail sent on a share.
- send_shared_email : boolean, optional
Send email to the recipients of a share.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
Set the permissions users have on this object
Parameters: - id : integer
ID of the resource to be shared
- user_ids : list
An array of one or more user IDs
- permission_level : string
Options are: “read”, “write”, or “manage”
- share_email_body : string, optional
Custom body text for e-mail sent on a share.
- send_shared_email : boolean, optional
Send email to the recipients of a share.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
-
put_spot_orders
(id, *, body='DEFAULT')¶ Edit the specified spot order
Parameters: - id : integer
The ID for the spot order.
- body : string, optional
CSV body of a spot order.
Returns: - id : integer
The ID for the spot order.
- archived : string
The archival status of the requested object(s).
- csv_s3_uri : string
S3 URI for the spot order CSV file.
- json_s3_uri : string
S3 URI for the spot order JSON file.
- xml_archive_s3_uri : string
S3 URI for the spot order XML archive.
- last_transform_job_id : integer
ID of the spot order transformation job.
-
put_spot_orders_archive
(id, status)¶ Update the archive status of this object
Parameters: - id : integer
The ID of the object.
- status : boolean
The desired archived status of the object.
Returns: - id : integer
The ID for the spot order.
- archived : string
The archival status of the requested object(s).
- csv_s3_uri : string
S3 URI for the spot order CSV file.
- json_s3_uri : string
S3 URI for the spot order JSON file.
- xml_archive_s3_uri : string
S3 URI for the spot order XML archive.
- last_transform_job_id : integer
ID of the spot order transformation job.
Set the permissions groups has on this object
Parameters: - id : integer
ID of the resource to be shared
- group_ids : list
An array of one or more group IDs
- permission_level : string
Options are: “read”, “write”, or “manage”
- share_email_body : string, optional
Custom body text for e-mail sent on a share.
- send_shared_email : boolean, optional
Send email to the recipients of a share.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
Set the permissions users have on this object
Parameters: - id : integer
ID of the resource to be shared
- user_ids : list
An array of one or more user IDs
- permission_level : string
Options are: “read”, “write”, or “manage”
- share_email_body : string, optional
Custom body text for e-mail sent on a share.
- send_shared_email : boolean, optional
Send email to the recipients of a share.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
-
Models¶
-
class
Models
(session_kwargs, return_type='civis')¶ Methods
-
delete_builds
(id, build_id)¶ Cancel a build
Parameters: - id : integer
The ID of the model.
- build_id : integer
The ID of the build.
Returns: - None
Response code 202: success
-
delete_projects
(id, project_id)¶ Remove a models from a project
Parameters: - id : integer
ID of the resource
- project_id : integer
The ID of the project
Returns: - None
Response code 204: success
Revoke the permissions a group has on this object
Parameters: - id : integer
ID of the resource to be revoked
- group_id : integer
ID of the group
Returns: - None
Response code 204: success
Revoke the permissions a user has on this object
Parameters: - id : integer
ID of the resource to be revoked
- user_id : integer
ID of the user
Returns: - None
Response code 204: success
-
get
(id)¶ Retrieve model configuration
Parameters: - id : integer
The ID of the model.
Returns: - id : integer
The ID of the model.
- table_name : string
The qualified name of the table containing the training set from which to build the model.
- database_id : integer
The ID of the database holding the training set table used to build the model.
- credential_id : integer
The ID of the credential used to read the target table. Defaults to the user’s default credential.
- model_name : string
The name of the model.
- description : string
A description of the model.
- interaction_terms : boolean
Whether to search for interaction terms.
- box_cox_transformation : boolean
Whether to transform data so that it assumes a normal distribution. Valid only with continuous models.
- model_type_id : integer
The ID of the model’s type.
- primary_key : string
The unique ID (primary key) of the training dataset.
- dependent_variable : string
The dependent variable of the training dataset.
- dependent_variable_order : list
The order of dependent variables, especially useful for Ordinal Modeling.
- excluded_columns : list
A list of columns which will be considered ineligible to be independent variables.
- limiting_sql : string
A custom SQL WHERE clause used to filter the rows used to build the model. (e.g., “id > 105”).
- active_build_id : integer
The ID of the current active build, the build used to score predictions.
- cross_validation_parameters : dict
Cross validation parameter grid for tree methods, e.g. {“n_estimators”: [100, 200, 500], “learning_rate”: [0.01, 0.1], “max_depth”: [2, 3]}.
- number_of_folds : integer
Number of folds for cross validation. Default value is 5.
- notifications : dict::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- parent_id : integer
The ID of the parent job that will trigger this model.
- running_as : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- time_zone : string
The time zone of this model.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- hidden : boolean
The hidden status of the object.
- user : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- created_at : string/date-time
The time the model was created.
- updated_at : string/date-time
The time the model was updated.
- current_build_state : string
The status of the current model build. One of “succeeded”, “failed”, “queued”, or “running,”or “idle”, if no build has been attempted.
- current_build_exception : string
Exception message, if applicable, of the current model build.
- builds : list::
A list of trained models available for making predictions. - id : integer
The ID of the model build.
- name : string
- The name of the model build.
- created_at : string
- The time the model build was created.
- description : string
- A description of the model build.
- root_mean_squared_error : number/float
- A key metric for continuous models. Nil for other model types.
- r_squared_error : number/float
- A key metric for continuous models. Nil for other model types.
- roc_auc : number/float
- A key metric for binary, multinomial, and ordinal models. Nil for other model types.
- predictions : list::
The tables upon which the model will be applied. - id : integer
The ID of the model to which to apply the prediction.
- table_name : string
- The qualified name of the table on which to apply the predictive model.
- primary_key : list
- The primary key or composite keys of the table being predicted.
- limiting_sql : string
- A SQL WHERE clause used to scope the rows to be predicted.
- output_table : string
- The qualified name of the table to be created which will contain the model’s predictions.
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- state : string
- The status of the prediction. One of: “succeeded”, “failed”, “queued”, or “running,”or “idle”, if no build has been attempted.
- last_output_location : string
The output JSON for the last build.
- archived : string
The archival status of the requested object(s).
-
get_builds
(id, build_id)¶ Check status of a build
Parameters: - id : integer
The ID of the model.
- build_id : integer
The ID of the build.
Returns: - 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.
- created_at : string
The time the model build was created.
- description : string
A description of the model build.
- root_mean_squared_error : number/float
A key metric for continuous models. Nil for other model types.
- r_squared_error : number/float
A key metric for continuous models. Nil for other model types.
- roc_auc : number/float
A key metric for binary, multinomial, and ordinal models. Nil for other model types.
- transformation_metadata : string
A string representing the full JSON output of the metadata for transformation of column names
- output : string
A string representing the JSON output for the specified build. Only present when smaller than 10KB in size.
- output_location : string
A URL representing the location of the full JSON output for the specified build.The URL link will be valid for 5 minutes.
-
list
(*, model_name='DEFAULT', training_table_name='DEFAULT', dependent_variable='DEFAULT', author='DEFAULT', status='DEFAULT', hidden='DEFAULT', archived='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶ List
Parameters: - model_name : string, optional
If specified, will be used to filter the models returned. Substring matching is supported. (e.g., “modelName=model” will return both “model1” and “my model”).
- training_table_name : string, optional
If specified, will be used to filter the models returned by the training dataset table name. Substring matching is supported. (e.g., “trainingTableName=table” will return both “table1” and “my_table”).
- dependent_variable : string, optional
If specified, will be used to filter the models returned by the dependent variable column name. Substring matching is supported. (e.g., “dependentVariable=predictor” will return both “predictor” and “my predictor”).
- author : string, optional
If specified, return models from this author. It accepts a comma-separated list of author ids.
- status : string, optional
If specified, returns models with one of these statuses. It accepts a comma-separated list, possible values are ‘running’, ‘failed’, ‘succeeded’, ‘idle’, ‘scheduled’.
- hidden : boolean, optional
If specified to be true, returns hidden objects. Defaults to false, returning non-hidden objects.
- archived : string, optional
The archival status of the requested object(s).
- limit : integer, optional
Number of results to return. Defaults to its maximum of 50.
- page_num : integer, optional
Page number of the results to return. Defaults to the first page, 1.
- order : string, optional
The field on which to order the result set. Defaults to updated_at. Must be one of: updated_at, name, created_at, last_run.updated_at.
- order_dir : string, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: - id : integer
The ID of the model.
- table_name : string
The qualified name of the table containing the training set from which to build the model.
- database_id : integer
The ID of the database holding the training set table used to build the model.
- credential_id : integer
The ID of the credential used to read the target table. Defaults to the user’s default credential.
- model_name : string
The name of the model.
- description : string
A description of the model.
- interaction_terms : boolean
Whether to search for interaction terms.
- box_cox_transformation : boolean
Whether to transform data so that it assumes a normal distribution. Valid only with continuous models.
- model_type_id : integer
The ID of the model’s type.
- primary_key : string
The unique ID (primary key) of the training dataset.
- dependent_variable : string
The dependent variable of the training dataset.
- dependent_variable_order : list
The order of dependent variables, especially useful for Ordinal Modeling.
- excluded_columns : list
A list of columns which will be considered ineligible to be independent variables.
- limiting_sql : string
A custom SQL WHERE clause used to filter the rows used to build the model. (e.g., “id > 105”).
- cross_validation_parameters : dict
Cross validation parameter grid for tree methods, e.g. {“n_estimators”: [100, 200, 500], “learning_rate”: [0.01, 0.1], “max_depth”: [2, 3]}.
- number_of_folds : integer
Number of folds for cross validation. Default value is 5.
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- parent_id : integer
The ID of the parent job that will trigger this model.
- time_zone : string
The time zone of this model.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- user : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- created_at : string/date-time
The time the model was created.
- updated_at : string/date-time
The time the model was updated.
- current_build_state : string
The status of the current model build. One of “succeeded”, “failed”, “queued”, or “running,”or “idle”, if no build has been attempted.
- current_build_exception : string
Exception message, if applicable, of the current model build.
- builds : list::
A list of trained models available for making predictions. - id : integer
The ID of the model build.
- name : string
- The name of the model build.
- created_at : string
- The time the model build was created.
- description : string
- A description of the model build.
- root_mean_squared_error : number/float
- A key metric for continuous models. Nil for other model types.
- r_squared_error : number/float
- A key metric for continuous models. Nil for other model types.
- roc_auc : number/float
- A key metric for binary, multinomial, and ordinal models. Nil for other model types.
- predictions : list::
The tables upon which the model will be applied. - id : integer
The ID of the model to which to apply the prediction.
- table_name : string
- The qualified name of the table on which to apply the predictive model.
- primary_key : list
- The primary key or composite keys of the table being predicted.
- limiting_sql : string
- A SQL WHERE clause used to scope the rows to be predicted.
- output_table : string
- The qualified name of the table to be created which will contain the model’s predictions.
- state : string
- The status of the prediction. One of: “succeeded”, “failed”, “queued”, or “running,”or “idle”, if no build has been attempted.
- last_output_location : string
The output JSON for the last build.
- archived : string
The archival status of the requested object(s).
-
list_builds
(id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶ List builds for the given model
Parameters: - id : integer
The ID of the model.
- limit : integer, optional
Number of results to return. Defaults to 20. Maximum allowed is 100.
- page_num : integer, optional
Page number of the results to return. Defaults to the first page, 1.
- order : string, optional
The field on which to order the result set. Defaults to id. Must be one of: id.
- order_dir : string, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: - 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.
- created_at : string
The time the model build was created.
- description : string
A description of the model build.
- root_mean_squared_error : number/float
A key metric for continuous models. Nil for other model types.
- r_squared_error : number/float
A key metric for continuous models. Nil for other model types.
- roc_auc : number/float
A key metric for binary, multinomial, and ordinal models. Nil for other model types.
- transformation_metadata : string
A string representing the full JSON output of the metadata for transformation of column names
- output : string
A string representing the JSON output for the specified build. Only present when smaller than 10KB in size.
- output_location : string
A URL representing the location of the full JSON output for the specified build.The URL link will be valid for 5 minutes.
-
list_builds_logs
(id, build_id, *, last_id='DEFAULT', limit='DEFAULT')¶ Get the logs for a build
Parameters: - id : integer
The ID of the model.
- build_id : integer
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.
Returns: - id : integer
The ID of the log.
- created_at : string/date-time
The time the log was created.
- message : string
The log message.
- level : string
The level of the log. One of unknown,fatal,error,warn,info,debug.
-
list_projects
(id, *, hidden='DEFAULT')¶ List the projects a models belongs to
Parameters: - id : integer
The ID of the resource.
- hidden : boolean, optional
If specified to be true, returns hidden objects. Defaults to false, returning non-hidden objects.
Returns: - id : integer
The ID for this project.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- name : string
The name of this project.
- description : string
A description of the project
- users : list::
Users who can see the project - id : integer
The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- auto_share : boolean
- created_at : string/time
- updated_at : string/time
- archived : string
The archival status of the requested object(s).
-
list_schedules
(id)¶ Show the model build schedule
Parameters: - id : integer
The ID of the model associated with this schedule.
Returns: - id : integer
The ID of the model associated with this schedule.
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
List users and groups permissioned on this object
Parameters: - id : integer
The ID of the object.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
-
list_types
()¶ List all available model types
Returns: - id : integer
The ID of the model type.
- algorithm : string
The name of the algorithm used to train the model.
- dv_type : string
The type of dependent variable predicted by the model.
- fint_allowed : boolean
Whether this model type supports searching for interaction terms.
-
patch
(id, *, table_name='DEFAULT', database_id='DEFAULT', credential_id='DEFAULT', model_name='DEFAULT', description='DEFAULT', interaction_terms='DEFAULT', box_cox_transformation='DEFAULT', model_type_id='DEFAULT', primary_key='DEFAULT', dependent_variable='DEFAULT', dependent_variable_order='DEFAULT', excluded_columns='DEFAULT', limiting_sql='DEFAULT', active_build_id='DEFAULT', cross_validation_parameters='DEFAULT', number_of_folds='DEFAULT', notifications='DEFAULT', schedule='DEFAULT', parent_id='DEFAULT', time_zone='DEFAULT')¶ Update model configuration
Parameters: - id : integer
The ID of the model.
- table_name : string, optional
The qualified name of the table containing the training set from which to build the model.
- database_id : integer, optional
The ID of the database holding the training set table used to build the model.
- credential_id : integer, optional
The ID of the credential used to read the target table. Defaults to the user’s default credential.
- model_name : string, optional
The name of the model.
- description : string, optional
A description of the model.
- interaction_terms : boolean, optional
Whether to search for interaction terms.
- box_cox_transformation : boolean, optional
Whether to transform data so that it assumes a normal distribution. Valid only with continuous models.
- model_type_id : integer, optional
The ID of the model’s type.
- primary_key : string, optional
The unique ID (primary key) of the training dataset.
- dependent_variable : string, optional
The dependent variable of the training dataset.
- dependent_variable_order : list, optional
The order of dependent variables, especially useful for Ordinal Modeling.
- excluded_columns : list, optional
A list of columns which will be considered ineligible to be independent variables.
- limiting_sql : string, optional
A custom SQL WHERE clause used to filter the rows used to build the model. (e.g., “id > 105”).
- active_build_id : integer, optional
The ID of the current active build, the build used to score predictions.
- cross_validation_parameters : dict, optional
Cross validation parameter grid for tree methods, e.g. {“n_estimators”: [100, 200, 500], “learning_rate”: [0.01, 0.1], “max_depth”: [2, 3]}.
- number_of_folds : integer, optional
Number of folds for cross validation. Default value is 5.
- notifications : dict, optional::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- schedule : dict, optional::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- parent_id : integer, optional
The ID of the parent job that will trigger this model.
- time_zone : string, optional
The time zone of this model.
Returns: - None
Response code 204: success
-
post
(*, table_name='DEFAULT', database_id='DEFAULT', credential_id='DEFAULT', model_name='DEFAULT', description='DEFAULT', interaction_terms='DEFAULT', box_cox_transformation='DEFAULT', model_type_id='DEFAULT', primary_key='DEFAULT', dependent_variable='DEFAULT', dependent_variable_order='DEFAULT', excluded_columns='DEFAULT', limiting_sql='DEFAULT', active_build_id='DEFAULT', cross_validation_parameters='DEFAULT', number_of_folds='DEFAULT', notifications='DEFAULT', schedule='DEFAULT', parent_id='DEFAULT', time_zone='DEFAULT', hidden='DEFAULT')¶ Create new configuration for a model
Parameters: - table_name : string, optional
The qualified name of the table containing the training set from which to build the model.
- database_id : integer, optional
The ID of the database holding the training set table used to build the model.
- credential_id : integer, optional
The ID of the credential used to read the target table. Defaults to the user’s default credential.
- model_name : string, optional
The name of the model.
- description : string, optional
A description of the model.
- interaction_terms : boolean, optional
Whether to search for interaction terms.
- box_cox_transformation : boolean, optional
Whether to transform data so that it assumes a normal distribution. Valid only with continuous models.
- model_type_id : integer, optional
The ID of the model’s type.
- primary_key : string, optional
The unique ID (primary key) of the training dataset.
- dependent_variable : string, optional
The dependent variable of the training dataset.
- dependent_variable_order : list, optional
The order of dependent variables, especially useful for Ordinal Modeling.
- excluded_columns : list, optional
A list of columns which will be considered ineligible to be independent variables.
- limiting_sql : string, optional
A custom SQL WHERE clause used to filter the rows used to build the model. (e.g., “id > 105”).
- active_build_id : integer, optional
The ID of the current active build, the build used to score predictions.
- cross_validation_parameters : dict, optional
Cross validation parameter grid for tree methods, e.g. {“n_estimators”: [100, 200, 500], “learning_rate”: [0.01, 0.1], “max_depth”: [2, 3]}.
- number_of_folds : integer, optional
Number of folds for cross validation. Default value is 5.
- notifications : dict, optional::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- schedule : dict, optional::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- parent_id : integer, optional
The ID of the parent job that will trigger this model.
- time_zone : string, optional
The time zone of this model.
- hidden : boolean, optional
The hidden status of the object.
Returns: - id : integer
The ID of the model.
- table_name : string
The qualified name of the table containing the training set from which to build the model.
- database_id : integer
The ID of the database holding the training set table used to build the model.
- credential_id : integer
The ID of the credential used to read the target table. Defaults to the user’s default credential.
- model_name : string
The name of the model.
- description : string
A description of the model.
- interaction_terms : boolean
Whether to search for interaction terms.
- box_cox_transformation : boolean
Whether to transform data so that it assumes a normal distribution. Valid only with continuous models.
- model_type_id : integer
The ID of the model’s type.
- primary_key : string
The unique ID (primary key) of the training dataset.
- dependent_variable : string
The dependent variable of the training dataset.
- dependent_variable_order : list
The order of dependent variables, especially useful for Ordinal Modeling.
- excluded_columns : list
A list of columns which will be considered ineligible to be independent variables.
- limiting_sql : string
A custom SQL WHERE clause used to filter the rows used to build the model. (e.g., “id > 105”).
- active_build_id : integer
The ID of the current active build, the build used to score predictions.
- cross_validation_parameters : dict
Cross validation parameter grid for tree methods, e.g. {“n_estimators”: [100, 200, 500], “learning_rate”: [0.01, 0.1], “max_depth”: [2, 3]}.
- number_of_folds : integer
Number of folds for cross validation. Default value is 5.
- notifications : dict::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- parent_id : integer
The ID of the parent job that will trigger this model.
- running_as : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- time_zone : string
The time zone of this model.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- hidden : boolean
The hidden status of the object.
- user : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- created_at : string/date-time
The time the model was created.
- updated_at : string/date-time
The time the model was updated.
- current_build_state : string
The status of the current model build. One of “succeeded”, “failed”, “queued”, or “running,”or “idle”, if no build has been attempted.
- current_build_exception : string
Exception message, if applicable, of the current model build.
- builds : list::
A list of trained models available for making predictions. - id : integer
The ID of the model build.
- name : string
- The name of the model build.
- created_at : string
- The time the model build was created.
- description : string
- A description of the model build.
- root_mean_squared_error : number/float
- A key metric for continuous models. Nil for other model types.
- r_squared_error : number/float
- A key metric for continuous models. Nil for other model types.
- roc_auc : number/float
- A key metric for binary, multinomial, and ordinal models. Nil for other model types.
- predictions : list::
The tables upon which the model will be applied. - id : integer
The ID of the model to which to apply the prediction.
- table_name : string
- The qualified name of the table on which to apply the predictive model.
- primary_key : list
- The primary key or composite keys of the table being predicted.
- limiting_sql : string
- A SQL WHERE clause used to scope the rows to be predicted.
- output_table : string
- The qualified name of the table to be created which will contain the model’s predictions.
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- state : string
- The status of the prediction. One of: “succeeded”, “failed”, “queued”, or “running,”or “idle”, if no build has been attempted.
- last_output_location : string
The output JSON for the last build.
- archived : string
The archival status of the requested object(s).
-
post_builds
(id)¶ Start a build
Parameters: - id : integer
The ID of the model.
Returns: - 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.
- created_at : string
The time the model build was created.
- description : string
A description of the model build.
- root_mean_squared_error : number/float
A key metric for continuous models. Nil for other model types.
- r_squared_error : number/float
A key metric for continuous models. Nil for other model types.
- roc_auc : number/float
A key metric for binary, multinomial, and ordinal models. Nil for other model types.
- transformation_metadata : string
A string representing the full JSON output of the metadata for transformation of column names
- output : string
A string representing the JSON output for the specified build. Only present when smaller than 10KB in size.
- output_location : string
A URL representing the location of the full JSON output for the specified build.The URL link will be valid for 5 minutes.
-
put_archive
(id, status)¶ Update the archive status of this object
Parameters: - id : integer
The ID of the object.
- status : boolean
The desired archived status of the object.
Returns: - id : integer
The ID of the model.
- table_name : string
The qualified name of the table containing the training set from which to build the model.
- database_id : integer
The ID of the database holding the training set table used to build the model.
- credential_id : integer
The ID of the credential used to read the target table. Defaults to the user’s default credential.
- model_name : string
The name of the model.
- description : string
A description of the model.
- interaction_terms : boolean
Whether to search for interaction terms.
- box_cox_transformation : boolean
Whether to transform data so that it assumes a normal distribution. Valid only with continuous models.
- model_type_id : integer
The ID of the model’s type.
- primary_key : string
The unique ID (primary key) of the training dataset.
- dependent_variable : string
The dependent variable of the training dataset.
- dependent_variable_order : list
The order of dependent variables, especially useful for Ordinal Modeling.
- excluded_columns : list
A list of columns which will be considered ineligible to be independent variables.
- limiting_sql : string
A custom SQL WHERE clause used to filter the rows used to build the model. (e.g., “id > 105”).
- active_build_id : integer
The ID of the current active build, the build used to score predictions.
- cross_validation_parameters : dict
Cross validation parameter grid for tree methods, e.g. {“n_estimators”: [100, 200, 500], “learning_rate”: [0.01, 0.1], “max_depth”: [2, 3]}.
- number_of_folds : integer
Number of folds for cross validation. Default value is 5.
- notifications : dict::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- parent_id : integer
The ID of the parent job that will trigger this model.
- running_as : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- time_zone : string
The time zone of this model.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- hidden : boolean
The hidden status of the object.
- user : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- created_at : string/date-time
The time the model was created.
- updated_at : string/date-time
The time the model was updated.
- current_build_state : string
The status of the current model build. One of “succeeded”, “failed”, “queued”, or “running,”or “idle”, if no build has been attempted.
- current_build_exception : string
Exception message, if applicable, of the current model build.
- builds : list::
A list of trained models available for making predictions. - id : integer
The ID of the model build.
- name : string
- The name of the model build.
- created_at : string
- The time the model build was created.
- description : string
- A description of the model build.
- root_mean_squared_error : number/float
- A key metric for continuous models. Nil for other model types.
- r_squared_error : number/float
- A key metric for continuous models. Nil for other model types.
- roc_auc : number/float
- A key metric for binary, multinomial, and ordinal models. Nil for other model types.
- predictions : list::
The tables upon which the model will be applied. - id : integer
The ID of the model to which to apply the prediction.
- table_name : string
- The qualified name of the table on which to apply the predictive model.
- primary_key : list
- The primary key or composite keys of the table being predicted.
- limiting_sql : string
- A SQL WHERE clause used to scope the rows to be predicted.
- output_table : string
- The qualified name of the table to be created which will contain the model’s predictions.
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- state : string
- The status of the prediction. One of: “succeeded”, “failed”, “queued”, or “running,”or “idle”, if no build has been attempted.
- last_output_location : string
The output JSON for the last build.
- archived : string
The archival status of the requested object(s).
-
put_predictions
(id, table_name, primary_key, *, limiting_sql='DEFAULT', output_table='DEFAULT', schedule='DEFAULT')¶ Add a table on which to apply the predictive model
Parameters: - id : integer
The ID of the model to which to apply the prediction.
- table_name : string
The qualified name of the table on which to apply the predictive model.
- primary_key : list
The primary key or composite keys of the table being predicted.
- limiting_sql : string, optional
A SQL WHERE clause used to scope the rows to be predicted.
- output_table : string, optional
The qualified name of the table to be created which will contain the model’s predictions.
- schedule : dict, optional::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
Returns: - id : integer
The ID of the model to which to apply the prediction.
- table_name : string
The qualified name of the table on which to apply the predictive model.
- primary_key : list
The primary key or composite keys of the table being predicted.
- limiting_sql : string
A SQL WHERE clause used to scope the rows to be predicted.
- output_table : string
The qualified name of the table to be created which will contain the model’s predictions.
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- state : string
The status of the prediction. One of: “succeeded”, “failed”, “queued”, or “running,”or “idle”, if no build has been attempted.
-
put_projects
(id, project_id)¶ Add a models to a project
Parameters: - id : integer
ID of the resource
- project_id : integer
The ID of the project
Returns: - None
Response code 204: success
-
put_schedules
(id, schedule)¶ Schedule the model build
Parameters: - id : integer
The ID of the model associated with this schedule.
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
Returns: - id : integer
The ID of the model associated with this schedule.
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
Set the permissions groups has on this object
Parameters: - id : integer
ID of the resource to be shared
- group_ids : list
An array of one or more group IDs
- permission_level : string
Options are: “read”, “write”, or “manage”
- share_email_body : string, optional
Custom body text for e-mail sent on a share.
- send_shared_email : boolean, optional
Send email to the recipients of a share.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
Set the permissions users have on this object
Parameters: - id : integer
ID of the resource to be shared
- user_ids : list
An array of one or more user IDs
- permission_level : string
Options are: “read”, “write”, or “manage”
- share_email_body : string, optional
Custom body text for e-mail sent on a share.
- send_shared_email : boolean, optional
Send email to the recipients of a share.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
-
Notebooks¶
-
class
Notebooks
(session_kwargs, return_type='civis')¶ Methods
-
delete_deployments
(notebook_id, deployment_id)¶ Delete a Notebook deployment
Parameters: - notebook_id : integer
The ID of the owning Notebook
- deployment_id : integer
The ID for this deployment
Returns: - None
Response code 204: success
-
delete_projects
(id, project_id)¶ Remove a Notebook from a project
Parameters: - id : integer
ID of the resource
- project_id : integer
The ID of the project
Returns: - None
Response code 204: success
Revoke the permissions a group has on this object
Parameters: - id : integer
ID of the resource to be revoked
- group_id : integer
ID of the group
Returns: - None
Response code 204: success
Revoke the permissions a user has on this object
Parameters: - id : integer
ID of the resource to be revoked
- user_id : integer
ID of the user
Returns: - None
Response code 204: success
-
get
(id)¶ Get a Notebook
Parameters: - id : integer
Returns: - 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.
- notebook_url : string
Time-limited URL to get the .ipynb file for this notebook.
- notebook_preview_url : string
Time-limited URL to get the .htm preview file for this notebook.
- requirements_url : string
Time-limited URL to get the requirements.txt file for this notebook.
- file_id : string
The file ID for the S3 file containing the .ipynb file.
- requirements_file_id : string
The file ID for the S3 file containing the requirements.txt file.
- user : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- docker_image_name : string
The name of the docker image to pull from DockerHub.
- docker_image_tag : string
The tag of the docker image to pull from DockerHub (default: latest).
- memory : integer
The amount of memory allocated to the notebook.
- cpu : integer
The amount of cpu allocated to the the notebook.
- created_at : string/time
- updated_at : string/time
- most_recent_deployment : dict::
- deployment_id : integer
- The ID for this deployment.
- user_id : integer
- The ID of the owner.
- host : string
- Domain of the deployment.
- name : string
- Name of the deployment.
- docker_image_name : string
- The name of the docker image to pull from DockerHub.
- docker_image_tag : string
- The tag of the docker image to pull from DockerHub (default: latest).
- display_url : string
- URL that displays the deployed platform object and includes auth token.
- memory : integer
- The memory allocated to the deployment.
- cpu : integer
- The cpu allocated to the deployment.
- state : string
- The state of the deployment.
- state_message : string
- A detailed description of the state.
- created_at : string/time
- updated_at : string/time
- published : boolean
- notebook_id : integer
- The ID of owning Notebook
- credentials : list
A list of credential IDs to pass to the notebook.
- git_url : string
The URL of the repository that will be cloned.
- git_branch : string
The name of the branch that will be cloned.
- git_file : string
The name of the notebook file within a repository that will be included in the deployment.
- environment_variables : dict
Environment variables to be passed into the Notebook.
- idle_timeout : integer
How long the notebook will stay alive without any kernel activity.
- archived : string
The archival status of the requested object(s).
- hidden : boolean
The hidden status of the object.
-
get_deployments
(notebook_id, deployment_id)¶ Get details about a Notebook deployment
Parameters: - notebook_id : integer
The ID of the owning Notebook
- deployment_id : integer
The ID for this deployment
Returns: - deployment_id : integer
The ID for this deployment.
- user_id : integer
The ID of the owner.
- host : string
Domain of the deployment.
- name : string
Name of the deployment.
- docker_image_name : string
The name of the docker image to pull from DockerHub.
- docker_image_tag : string
The tag of the docker image to pull from DockerHub (default: latest).
- display_url : string
URL that displays the deployed platform object and includes auth token.
- memory : integer
The memory allocated to the deployment.
- cpu : integer
The cpu allocated to the deployment.
- state : string
The state of the deployment.
- state_message : string
A detailed description of the state.
- created_at : string/time
- updated_at : string/time
- published : boolean
- notebook_id : integer
The ID of owning Notebook
-
list
(*, hidden='DEFAULT', archived='DEFAULT', author='DEFAULT', status='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶ List Notebooks
Parameters: - hidden : boolean, optional
If specified to be true, returns hidden objects. Defaults to false, returning non-hidden objects.
- archived : string, optional
The archival status of the requested object(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.
- iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: - 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 : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- created_at : string/time
- updated_at : string/time
- most_recent_deployment : dict::
- deployment_id : integer
- The ID for this deployment.
- user_id : integer
- The ID of the owner.
- host : string
- Domain of the deployment.
- name : string
- Name of the deployment.
- docker_image_name : string
- The name of the docker image to pull from DockerHub.
- docker_image_tag : string
- The tag of the docker image to pull from DockerHub (default: latest).
- memory : integer
- The memory allocated to the deployment.
- cpu : integer
- The cpu allocated to the deployment.
- state : string
- The state of the deployment.
- state_message : string
- A detailed description of the state.
- created_at : string/time
- updated_at : string/time
- published : boolean
- notebook_id : integer
- The ID of owning Notebook
- archived : string
The archival status of the requested object(s).
-
list_deployments
(notebook_id, *, deployment_id='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶ List deployments for a Notebook
Parameters: - notebook_id : integer
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.
- iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: - deployment_id : integer
The ID for this deployment.
- user_id : integer
The ID of the owner.
- host : string
Domain of the deployment.
- name : string
Name of the deployment.
- docker_image_name : string
The name of the docker image to pull from DockerHub.
- docker_image_tag : string
The tag of the docker image to pull from DockerHub (default: latest).
- memory : integer
The memory allocated to the deployment.
- cpu : integer
The cpu allocated to the deployment.
- state : string
The state of the deployment.
- state_message : string
A detailed description of the state.
- created_at : string/time
- updated_at : string/time
- published : boolean
- notebook_id : integer
The ID of owning Notebook
-
list_projects
(id, *, hidden='DEFAULT')¶ List the projects a Notebook belongs to
Parameters: - id : integer
The ID of the resource.
- hidden : boolean, optional
If specified to be true, returns hidden objects. Defaults to false, returning non-hidden objects.
Returns: - id : integer
The ID for this project.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- name : string
The name of this project.
- description : string
A description of the project
- users : list::
Users who can see the project - id : integer
The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- auto_share : boolean
- created_at : string/time
- updated_at : string/time
- archived : string
The archival status of the requested object(s).
List users and groups permissioned on this object
Parameters: - id : integer
The ID of the object.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
-
list_update_links
(id)¶ Get URLs to update notebook
Parameters: - id : integer
Returns: - update_url : string
Time-limited URL to PUT new contents of the .ipynb file for this notebook.
- update_preview_url : string
Time-limited URL to PUT new contents of the .htm preview file for this notebook.
-
patch
(id, *, name='DEFAULT', language='DEFAULT', description='DEFAULT', file_id='DEFAULT', requirements_file_id='DEFAULT', requirements='DEFAULT', docker_image_name='DEFAULT', docker_image_tag='DEFAULT', memory='DEFAULT', cpu='DEFAULT', credentials='DEFAULT', git_url='DEFAULT', git_branch='DEFAULT', git_file='DEFAULT', environment_variables='DEFAULT', idle_timeout='DEFAULT')¶ Update some attributes of this Notebook
Parameters: - id : integer
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).
- memory : integer, optional
The amount of memory allocated to the notebook.
- cpu : integer, optional
The amount of cpu allocated to the the notebook.
- credentials : list, optional
A list of credential IDs to pass to the notebook.
- git_url : string, optional
The URL of the repository that will be cloned.
- git_branch : string, optional
The name of the branch that will be cloned.
- git_file : string, optional
The name of the notebook file within a repository that will be included in the deployment.
- environment_variables : dict, optional
Environment variables to be passed into the Notebook.
- idle_timeout : integer, optional
How long the notebook will stay alive without any kernel activity.
Returns: - 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.
- notebook_url : string
Time-limited URL to get the .ipynb file for this notebook.
- notebook_preview_url : string
Time-limited URL to get the .htm preview file for this notebook.
- requirements_url : string
Time-limited URL to get the requirements.txt file for this notebook.
- file_id : string
The file ID for the S3 file containing the .ipynb file.
- requirements_file_id : string
The file ID for the S3 file containing the requirements.txt file.
- user : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- docker_image_name : string
The name of the docker image to pull from DockerHub.
- docker_image_tag : string
The tag of the docker image to pull from DockerHub (default: latest).
- memory : integer
The amount of memory allocated to the notebook.
- cpu : integer
The amount of cpu allocated to the the notebook.
- created_at : string/time
- updated_at : string/time
- most_recent_deployment : dict::
- deployment_id : integer
- The ID for this deployment.
- user_id : integer
- The ID of the owner.
- host : string
- Domain of the deployment.
- name : string
- Name of the deployment.
- docker_image_name : string
- The name of the docker image to pull from DockerHub.
- docker_image_tag : string
- The tag of the docker image to pull from DockerHub (default: latest).
- display_url : string
- URL that displays the deployed platform object and includes auth token.
- memory : integer
- The memory allocated to the deployment.
- cpu : integer
- The cpu allocated to the deployment.
- state : string
- The state of the deployment.
- state_message : string
- A detailed description of the state.
- created_at : string/time
- updated_at : string/time
- published : boolean
- notebook_id : integer
- The ID of owning Notebook
- credentials : list
A list of credential IDs to pass to the notebook.
- git_url : string
The URL of the repository that will be cloned.
- git_branch : string
The name of the branch that will be cloned.
- git_file : string
The name of the notebook file within a repository that will be included in the deployment.
- environment_variables : dict
Environment variables to be passed into the Notebook.
- idle_timeout : integer
How long the notebook will stay alive without any kernel activity.
- archived : string
The archival status of the requested object(s).
- hidden : boolean
The hidden status of the object.
-
post
(*, name='DEFAULT', language='DEFAULT', description='DEFAULT', file_id='DEFAULT', requirements_file_id='DEFAULT', requirements='DEFAULT', docker_image_name='DEFAULT', docker_image_tag='DEFAULT', memory='DEFAULT', cpu='DEFAULT', credentials='DEFAULT', git_url='DEFAULT', git_branch='DEFAULT', git_file='DEFAULT', environment_variables='DEFAULT', idle_timeout='DEFAULT', hidden='DEFAULT')¶ Create a Notebook
Parameters: - 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).
- memory : integer, optional
The amount of memory allocated to the notebook.
- cpu : integer, optional
The amount of cpu allocated to the the notebook.
- credentials : list, optional
A list of credential IDs to pass to the notebook.
- git_url : string, optional
The URL of the repository that will be cloned.
- git_branch : string, optional
The name of the branch that will be cloned.
- git_file : string, optional
The name of the notebook file within a repository that will be included in the deployment.
- environment_variables : dict, optional
Environment variables to be passed into the Notebook.
- idle_timeout : integer, optional
How long the notebook will stay alive without any kernel activity.
- hidden : boolean, optional
The hidden status of the object.
Returns: - 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.
- notebook_url : string
Time-limited URL to get the .ipynb file for this notebook.
- notebook_preview_url : string
Time-limited URL to get the .htm preview file for this notebook.
- requirements_url : string
Time-limited URL to get the requirements.txt file for this notebook.
- file_id : string
The file ID for the S3 file containing the .ipynb file.
- requirements_file_id : string
The file ID for the S3 file containing the requirements.txt file.
- user : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- docker_image_name : string
The name of the docker image to pull from DockerHub.
- docker_image_tag : string
The tag of the docker image to pull from DockerHub (default: latest).
- memory : integer
The amount of memory allocated to the notebook.
- cpu : integer
The amount of cpu allocated to the the notebook.
- created_at : string/time
- updated_at : string/time
- most_recent_deployment : dict::
- deployment_id : integer
- The ID for this deployment.
- user_id : integer
- The ID of the owner.
- host : string
- Domain of the deployment.
- name : string
- Name of the deployment.
- docker_image_name : string
- The name of the docker image to pull from DockerHub.
- docker_image_tag : string
- The tag of the docker image to pull from DockerHub (default: latest).
- display_url : string
- URL that displays the deployed platform object and includes auth token.
- memory : integer
- The memory allocated to the deployment.
- cpu : integer
- The cpu allocated to the deployment.
- state : string
- The state of the deployment.
- state_message : string
- A detailed description of the state.
- created_at : string/time
- updated_at : string/time
- published : boolean
- notebook_id : integer
- The ID of owning Notebook
- credentials : list
A list of credential IDs to pass to the notebook.
- git_url : string
The URL of the repository that will be cloned.
- git_branch : string
The name of the branch that will be cloned.
- git_file : string
The name of the notebook file within a repository that will be included in the deployment.
- environment_variables : dict
Environment variables to be passed into the Notebook.
- idle_timeout : integer
How long the notebook will stay alive without any kernel activity.
- archived : string
The archival status of the requested object(s).
- hidden : boolean
The hidden status of the object.
-
post_clone
(id)¶ Clone this notebook
Parameters: - id : integer
Returns: - 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.
- notebook_url : string
Time-limited URL to get the .ipynb file for this notebook.
- notebook_preview_url : string
Time-limited URL to get the .htm preview file for this notebook.
- requirements_url : string
Time-limited URL to get the requirements.txt file for this notebook.
- file_id : string
The file ID for the S3 file containing the .ipynb file.
- requirements_file_id : string
The file ID for the S3 file containing the requirements.txt file.
- user : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- docker_image_name : string
The name of the docker image to pull from DockerHub.
- docker_image_tag : string
The tag of the docker image to pull from DockerHub (default: latest).
- memory : integer
The amount of memory allocated to the notebook.
- cpu : integer
The amount of cpu allocated to the the notebook.
- created_at : string/time
- updated_at : string/time
- most_recent_deployment : dict::
- deployment_id : integer
- The ID for this deployment.
- user_id : integer
- The ID of the owner.
- host : string
- Domain of the deployment.
- name : string
- Name of the deployment.
- docker_image_name : string
- The name of the docker image to pull from DockerHub.
- docker_image_tag : string
- The tag of the docker image to pull from DockerHub (default: latest).
- display_url : string
- URL that displays the deployed platform object and includes auth token.
- memory : integer
- The memory allocated to the deployment.
- cpu : integer
- The cpu allocated to the deployment.
- state : string
- The state of the deployment.
- state_message : string
- A detailed description of the state.
- created_at : string/time
- updated_at : string/time
- published : boolean
- notebook_id : integer
- The ID of owning Notebook
- credentials : list
A list of credential IDs to pass to the notebook.
- git_url : string
The URL of the repository that will be cloned.
- git_branch : string
The name of the branch that will be cloned.
- git_file : string
The name of the notebook file within a repository that will be included in the deployment.
- environment_variables : dict
Environment variables to be passed into the Notebook.
- idle_timeout : integer
How long the notebook will stay alive without any kernel activity.
- archived : string
The archival status of the requested object(s).
- hidden : boolean
The hidden status of the object.
-
post_deployments
(notebook_id, *, deployment_id='DEFAULT', published='DEFAULT')¶ Deploy a Notebook
Parameters: - notebook_id : integer
The ID of the owning Notebook
- deployment_id : integer, optional
The ID for this deployment
- published : boolean, optional
Returns: - deployment_id : integer
The ID for this deployment.
- user_id : integer
The ID of the owner.
- host : string
Domain of the deployment.
- name : string
Name of the deployment.
- docker_image_name : string
The name of the docker image to pull from DockerHub.
- docker_image_tag : string
The tag of the docker image to pull from DockerHub (default: latest).
- display_url : string
URL that displays the deployed platform object and includes auth token.
- memory : integer
The memory allocated to the deployment.
- cpu : integer
The cpu allocated to the deployment.
- state : string
The state of the deployment.
- state_message : string
A detailed description of the state.
- created_at : string/time
- updated_at : string/time
- published : boolean
- notebook_id : integer
The ID of owning Notebook
-
put
(id, *, name='DEFAULT', language='DEFAULT', description='DEFAULT', file_id='DEFAULT', requirements_file_id='DEFAULT', requirements='DEFAULT', docker_image_name='DEFAULT', docker_image_tag='DEFAULT', memory='DEFAULT', cpu='DEFAULT', credentials='DEFAULT', git_url='DEFAULT', git_branch='DEFAULT', git_file='DEFAULT', environment_variables='DEFAULT', idle_timeout='DEFAULT')¶ Replace all attributes of this Notebook
Parameters: - id : integer
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).
- memory : integer, optional
The amount of memory allocated to the notebook.
- cpu : integer, optional
The amount of cpu allocated to the the notebook.
- credentials : list, optional
A list of credential IDs to pass to the notebook.
- git_url : string, optional
The URL of the repository that will be cloned.
- git_branch : string, optional
The name of the branch that will be cloned.
- git_file : string, optional
The name of the notebook file within a repository that will be included in the deployment.
- environment_variables : dict, optional
Environment variables to be passed into the Notebook.
- idle_timeout : integer, optional
How long the notebook will stay alive without any kernel activity.
Returns: - 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.
- notebook_url : string
Time-limited URL to get the .ipynb file for this notebook.
- notebook_preview_url : string
Time-limited URL to get the .htm preview file for this notebook.
- requirements_url : string
Time-limited URL to get the requirements.txt file for this notebook.
- file_id : string
The file ID for the S3 file containing the .ipynb file.
- requirements_file_id : string
The file ID for the S3 file containing the requirements.txt file.
- user : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- docker_image_name : string
The name of the docker image to pull from DockerHub.
- docker_image_tag : string
The tag of the docker image to pull from DockerHub (default: latest).
- memory : integer
The amount of memory allocated to the notebook.
- cpu : integer
The amount of cpu allocated to the the notebook.
- created_at : string/time
- updated_at : string/time
- most_recent_deployment : dict::
- deployment_id : integer
- The ID for this deployment.
- user_id : integer
- The ID of the owner.
- host : string
- Domain of the deployment.
- name : string
- Name of the deployment.
- docker_image_name : string
- The name of the docker image to pull from DockerHub.
- docker_image_tag : string
- The tag of the docker image to pull from DockerHub (default: latest).
- display_url : string
- URL that displays the deployed platform object and includes auth token.
- memory : integer
- The memory allocated to the deployment.
- cpu : integer
- The cpu allocated to the deployment.
- state : string
- The state of the deployment.
- state_message : string
- A detailed description of the state.
- created_at : string/time
- updated_at : string/time
- published : boolean
- notebook_id : integer
- The ID of owning Notebook
- credentials : list
A list of credential IDs to pass to the notebook.
- git_url : string
The URL of the repository that will be cloned.
- git_branch : string
The name of the branch that will be cloned.
- git_file : string
The name of the notebook file within a repository that will be included in the deployment.
- environment_variables : dict
Environment variables to be passed into the Notebook.
- idle_timeout : integer
How long the notebook will stay alive without any kernel activity.
- archived : string
The archival status of the requested object(s).
- hidden : boolean
The hidden status of the object.
-
put_archive
(id, status)¶ Update the archive status of this object
Parameters: - id : integer
The ID of the object.
- status : boolean
The desired archived status of the object.
Returns: - 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.
- notebook_url : string
Time-limited URL to get the .ipynb file for this notebook.
- notebook_preview_url : string
Time-limited URL to get the .htm preview file for this notebook.
- requirements_url : string
Time-limited URL to get the requirements.txt file for this notebook.
- file_id : string
The file ID for the S3 file containing the .ipynb file.
- requirements_file_id : string
The file ID for the S3 file containing the requirements.txt file.
- user : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- docker_image_name : string
The name of the docker image to pull from DockerHub.
- docker_image_tag : string
The tag of the docker image to pull from DockerHub (default: latest).
- memory : integer
The amount of memory allocated to the notebook.
- cpu : integer
The amount of cpu allocated to the the notebook.
- created_at : string/time
- updated_at : string/time
- most_recent_deployment : dict::
- deployment_id : integer
- The ID for this deployment.
- user_id : integer
- The ID of the owner.
- host : string
- Domain of the deployment.
- name : string
- Name of the deployment.
- docker_image_name : string
- The name of the docker image to pull from DockerHub.
- docker_image_tag : string
- The tag of the docker image to pull from DockerHub (default: latest).
- display_url : string
- URL that displays the deployed platform object and includes auth token.
- memory : integer
- The memory allocated to the deployment.
- cpu : integer
- The cpu allocated to the deployment.
- state : string
- The state of the deployment.
- state_message : string
- A detailed description of the state.
- created_at : string/time
- updated_at : string/time
- published : boolean
- notebook_id : integer
- The ID of owning Notebook
- credentials : list
A list of credential IDs to pass to the notebook.
- git_url : string
The URL of the repository that will be cloned.
- git_branch : string
The name of the branch that will be cloned.
- git_file : string
The name of the notebook file within a repository that will be included in the deployment.
- environment_variables : dict
Environment variables to be passed into the Notebook.
- idle_timeout : integer
How long the notebook will stay alive without any kernel activity.
- archived : string
The archival status of the requested object(s).
- hidden : boolean
The hidden status of the object.
-
put_projects
(id, project_id)¶ Add a Notebook to a project
Parameters: - id : integer
ID of the resource
- project_id : integer
The ID of the project
Returns: - None
Response code 204: success
Set the permissions groups has on this object
Parameters: - id : integer
ID of the resource to be shared
- group_ids : list
An array of one or more group IDs
- permission_level : string
Options are: “read”, “write”, or “manage”
- share_email_body : string, optional
Custom body text for e-mail sent on a share.
- send_shared_email : boolean, optional
Send email to the recipients of a share.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
Set the permissions users have on this object
Parameters: - id : integer
ID of the resource to be shared
- user_ids : list
An array of one or more user IDs
- permission_level : string
Options are: “read”, “write”, or “manage”
- share_email_body : string, optional
Custom body text for e-mail sent on a share.
- send_shared_email : boolean, optional
Send email to the recipients of a share.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
-
Notifications¶
-
class
Notifications
(session_kwargs, return_type='civis')¶ Methods
-
list
(*, last_event_id='DEFAULT', r='DEFAULT', mock='DEFAULT')¶ Receive a stream of notifications as they come in
Parameters: - 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
Returns: - None
Response code 200: success
-
Ontology¶
Predictions¶
-
class
Predictions
(session_kwargs, return_type='civis')¶ Methods
-
delete_runs
(id, run_id)¶ Cancel a run
Parameters: - id : integer
The ID of the prediction.
- run_id : integer
The ID of the run.
Returns: - None
Response code 202: success
-
get
(id)¶ Show the specified prediction
Parameters: - id : integer
The ID of the prediction.
Returns: - id : integer
The ID of the prediction.
- model_id : integer
The ID of the model used for this prediction.
- scored_table_id : integer
The ID of the source table for this prediction.
- scored_table_name : string
The name of the source table for this prediction.
- output_table_name : 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.
- started_at : string/date-time
The start time of the last run of this prediction.
- finished_at : string/date-time
The end time of the last run of this prediction.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- scored_tables : list::
An array of created prediction tables. - id : integer
The ID of the table with created predictions.
- schema : string
The schema of table with created predictions.
- name : string
The name of table with created predictions.
- created_at : string/date-time
The time when the table with created predictions was created.
- score_stats : list::
An array of metrics on the created predictions. - score_name : string
The name of the score.
- histogram : list
- The histogram of the distribution of scores.
- avg_score : number/float
- The average score.
- min_score : number/float
- The minimum score.
- max_score : number/float
- The maximum score.
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- limiting_sql : string
A SQL WHERE clause used to scope the rows to be predicted.
- primary_key : list
The primary key or composite keys of the table being predicted.
-
get_runs
(id, run_id)¶ Check status of a run
Parameters: - id : integer
The ID of the prediction.
- run_id : integer
The ID of the run.
Returns: - id : integer
The ID of the prediction run.
- prediction_id : integer
The ID of the prediction.
- state : string
The state of the prediction run.
- exception : string
The exception, if any, returned by the prediction run.
- name : string
The name of table created by this predictions run.
- created_at : string/date-time
The time when the table with created predictions was created.
- score_stats : list::
An array of metrics on the created predictions. - score_name : string
The name of the score.
- histogram : list
- The histogram of the distribution of scores.
- avg_score : number/float
- The average score.
- min_score : number/float
- The minimum score.
- max_score : number/float
- The maximum score.
-
list
(*, model_id='DEFAULT')¶ List predictions
Parameters: - model_id : integer, optional
If specified, only return predictions associated with this model ID.
Returns: - id : integer
The ID of the prediction.
- model_id : integer
The ID of the model used for this prediction.
- scored_table_id : integer
The ID of the source table for this prediction.
- scored_table_name : string
The name of the source table for this prediction.
- output_table_name : 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.
- started_at : string/date-time
The start time of the last run of this prediction.
- finished_at : string/date-time
The end time of the last run of this prediction.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
-
list_runs
(id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶ List runs for the given prediction
Parameters: - id : integer
The ID of the prediction.
- limit : integer, optional
Number of results to return. Defaults to 20. Maximum allowed is 100.
- page_num : integer, optional
Page number of the results to return. Defaults to the first page, 1.
- order : string, optional
The field on which to order the result set. Defaults to id. Must be one of: id.
- order_dir : string, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: - id : integer
The ID of the prediction run.
- prediction_id : integer
The ID of the prediction.
- state : string
The state of the prediction run.
- exception : string
The exception, if any, returned by the prediction run.
- name : string
The name of table created by this predictions run.
- created_at : string/date-time
The time when the table with created predictions was created.
- score_stats : list::
An array of metrics on the created predictions. - score_name : string
The name of the score.
- histogram : list
- The histogram of the distribution of scores.
- avg_score : number/float
- The average score.
- min_score : number/float
- The minimum score.
- max_score : number/float
- The maximum score.
-
list_runs_logs
(id, run_id, *, last_id='DEFAULT', limit='DEFAULT')¶ Get the logs for a run
Parameters: - id : integer
The ID of the prediction.
- run_id : integer
The ID of the run.
- last_id : integer, optional
The ID of the last log message received. Log entries with this ID value or lower will be omitted.Logs are sorted by ID if this value is provided, and are otherwise sorted by createdAt.
- limit : integer, optional
The maximum number of log messages to return. Default of 10000.
Returns: - id : integer
The ID of the log.
- created_at : string/date-time
The time the log was created.
- message : string
The log message.
- level : string
The level of the log. One of unknown,fatal,error,warn,info,debug.
-
list_schedules
(id)¶ Show the prediction schedule
Parameters: - id : integer
ID of the prediction associated with this schedule.
Returns: - id : integer
ID of the prediction associated with this schedule.
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- score_on_model_build : boolean
Whether the prediction will run after a rebuild of the associated model.
-
patch
(id, *, output_table_name='DEFAULT', limiting_sql='DEFAULT', primary_key='DEFAULT')¶ Update a prediction
Parameters: - id : integer
The ID of the prediction.
- output_table_name : string, optional
The name of the output table for this prediction.
- limiting_sql : string, optional
A SQL WHERE clause used to scope the rows to be predicted.
- primary_key : list, optional
The primary key or composite keys of the table being predicted.
Returns: - id : integer
The ID of the prediction.
- model_id : integer
The ID of the model used for this prediction.
- scored_table_id : integer
The ID of the source table for this prediction.
- scored_table_name : string
The name of the source table for this prediction.
- output_table_name : 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.
- started_at : string/date-time
The start time of the last run of this prediction.
- finished_at : string/date-time
The end time of the last run of this prediction.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- scored_tables : list::
An array of created prediction tables. - id : integer
The ID of the table with created predictions.
- schema : string
The schema of table with created predictions.
- name : string
The name of table with created predictions.
- created_at : string/date-time
The time when the table with created predictions was created.
- score_stats : list::
An array of metrics on the created predictions. - score_name : string
The name of the score.
- histogram : list
- The histogram of the distribution of scores.
- avg_score : number/float
- The average score.
- min_score : number/float
- The minimum score.
- max_score : number/float
- The maximum score.
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- limiting_sql : string
A SQL WHERE clause used to scope the rows to be predicted.
- primary_key : list
The primary key or composite keys of the table being predicted.
-
post_runs
(id)¶ Start a run
Parameters: - id : integer
The ID of the prediction.
Returns: - id : integer
The ID of the prediction run.
- prediction_id : integer
The ID of the prediction.
- state : string
The state of the prediction run.
- exception : string
The exception, if any, returned by the prediction run.
- name : string
The name of table created by this predictions run.
- created_at : string/date-time
The time when the table with created predictions was created.
- score_stats : list::
An array of metrics on the created predictions. - score_name : string
The name of the score.
- histogram : list
- The histogram of the distribution of scores.
- avg_score : number/float
- The average score.
- min_score : number/float
- The minimum score.
- max_score : number/float
- The maximum score.
-
put_schedules
(id, *, schedule='DEFAULT', score_on_model_build='DEFAULT')¶ Schedule the prediction
Parameters: - id : integer
ID of the prediction associated with this schedule.
- schedule : dict, optional::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- score_on_model_build : boolean, optional
Whether the prediction will run after a rebuild of the associated model.
Returns: - id : integer
ID of the prediction associated with this schedule.
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- score_on_model_build : boolean
Whether the prediction will run after a rebuild of the associated model.
-
Projects¶
-
class
Projects
(session_kwargs, return_type='civis')¶ Methods
Revoke the permissions a group has on this object
Parameters: - id : integer
ID of the resource to be revoked
- group_id : integer
ID of the group
Returns: - None
Response code 204: success
Revoke the permissions a user has on this object
Parameters: - id : integer
ID of the resource to be revoked
- user_id : integer
ID of the user
Returns: - None
Response code 204: success
-
get
(project_id)¶ Get a detailed view of a project and the objects in it
Parameters: - project_id : integer
Returns: - id : integer
The ID for this project.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- name : string
The name of this project.
- description : string
A description of the project
- users : list::
Users who can see the project - id : integer
The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- auto_share : boolean
- created_at : string/time
- updated_at : string/time
- tables : list::
- schema : string
- name : string
- row_count : integer
- column_count : integer
- created_at : string/time
- updated_at : string/time
- surveys : list::
- id : integer
- The object ID.
- created_at : string/time
- updated_at : string/time
- scripts : list::
- id : integer
- The object ID.
- created_at : string/time
- updated_at : string/time
- name : string
- type : string
- finished_at : string/time
- state : string
- imports : list::
- id : integer
- The object ID.
- created_at : string/time
- updated_at : string/time
- name : string
- type : string
- finished_at : string/time
- state : string
- models : list::
- id : integer
- The object ID.
- created_at : string/time
- updated_at : string/time
- name : string
- state : string
- notebooks : list::
- id : integer
- The object ID.
- created_at : string/time
- updated_at : string/time
- name : string
- current_deployment_id : integer
- workflows : list::
- id : integer
- The object ID.
- created_at : string/time
- updated_at : string/time
- name : string
- state : string
- reports : list::
- id : integer
- The object ID.
- created_at : string/time
- updated_at : string/time
- name : string
- state : string
- script_templates : list::
- id : integer
- The object ID.
- created_at : string/time
- updated_at : string/time
- name : string
- files : list::
- id : integer
- The object ID.
- created_at : string/time
- updated_at : string/time
- file_name : string
- file_size : integer
- expired : boolean
- app_instances : list::
- id : integer
- The object ID.
- created_at : string/time
- updated_at : string/time
- name : string
- slug : string
- all_objects : list::
- project_id : integer
- object_id : integer
- object_type : string
- fco_type : string
- sub_type : string
- name : string
- icon : string
- author : string
- archived : string
- The archival status of the requested object(s).
- note : string
- hidden : boolean
The hidden status of the object.
- archived : string
The archival status of the requested object(s).
-
list
(*, author='DEFAULT', permission='DEFAULT', hidden='DEFAULT', archived='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶ List projects
Parameters: - 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.
- hidden : boolean, optional
If specified to be true, returns hidden objects. Defaults to false, returning non-hidden objects.
- archived : string, optional
The archival status of the requested object(s).
- limit : integer, optional
Number of results to return. Defaults to 20. Maximum allowed is 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.
- iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: - id : integer
The ID for this project.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- name : string
The name of this project.
- description : string
A description of the project
- users : list::
Users who can see the project - id : integer
The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- auto_share : boolean
- created_at : string/time
- updated_at : string/time
- archived : string
The archival status of the requested object(s).
List users and groups permissioned on this object
Parameters: - id : integer
The ID of the object.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
-
post
(name, description, *, note='DEFAULT', hidden='DEFAULT')¶ Create a project
Parameters: - name : string
The name of this project.
- description : string
A description of the project
- note : string, optional
Notes for the project
- hidden : boolean, optional
The hidden status of the object.
Returns: - id : integer
The ID for this project.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- name : string
The name of this project.
- description : string
A description of the project
- users : list::
Users who can see the project - id : integer
The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- auto_share : boolean
- created_at : string/time
- updated_at : string/time
- tables : list::
- schema : string
- name : string
- row_count : integer
- column_count : integer
- created_at : string/time
- updated_at : string/time
- surveys : list::
- id : integer
- The object ID.
- created_at : string/time
- updated_at : string/time
- scripts : list::
- id : integer
- The object ID.
- created_at : string/time
- updated_at : string/time
- name : string
- type : string
- finished_at : string/time
- state : string
- imports : list::
- id : integer
- The object ID.
- created_at : string/time
- updated_at : string/time
- name : string
- type : string
- finished_at : string/time
- state : string
- models : list::
- id : integer
- The object ID.
- created_at : string/time
- updated_at : string/time
- name : string
- state : string
- notebooks : list::
- id : integer
- The object ID.
- created_at : string/time
- updated_at : string/time
- name : string
- current_deployment_id : integer
- workflows : list::
- id : integer
- The object ID.
- created_at : string/time
- updated_at : string/time
- name : string
- state : string
- reports : list::
- id : integer
- The object ID.
- created_at : string/time
- updated_at : string/time
- name : string
- state : string
- script_templates : list::
- id : integer
- The object ID.
- created_at : string/time
- updated_at : string/time
- name : string
- files : list::
- id : integer
- The object ID.
- created_at : string/time
- updated_at : string/time
- file_name : string
- file_size : integer
- expired : boolean
- app_instances : list::
- id : integer
- The object ID.
- created_at : string/time
- updated_at : string/time
- name : string
- slug : string
- all_objects : list::
- project_id : integer
- object_id : integer
- object_type : string
- fco_type : string
- sub_type : string
- name : string
- icon : string
- author : string
- archived : string
- The archival status of the requested object(s).
- note : string
- hidden : boolean
The hidden status of the object.
- archived : string
The archival status of the requested object(s).
-
put
(project_id, *, name='DEFAULT', description='DEFAULT', note='DEFAULT')¶ Update a project
Parameters: - project_id : integer
- name : string, optional
The name of this project.
- description : string, optional
A description of the project
- note : string, optional
Notes for the project
Returns: - id : integer
The ID for this project.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- name : string
The name of this project.
- description : string
A description of the project
- users : list::
Users who can see the project - id : integer
The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- auto_share : boolean
- created_at : string/time
- updated_at : string/time
- tables : list::
- schema : string
- name : string
- row_count : integer
- column_count : integer
- created_at : string/time
- updated_at : string/time
- surveys : list::
- id : integer
- The object ID.
- created_at : string/time
- updated_at : string/time
- scripts : list::
- id : integer
- The object ID.
- created_at : string/time
- updated_at : string/time
- name : string
- type : string
- finished_at : string/time
- state : string
- imports : list::
- id : integer
- The object ID.
- created_at : string/time
- updated_at : string/time
- name : string
- type : string
- finished_at : string/time
- state : string
- models : list::
- id : integer
- The object ID.
- created_at : string/time
- updated_at : string/time
- name : string
- state : string
- notebooks : list::
- id : integer
- The object ID.
- created_at : string/time
- updated_at : string/time
- name : string
- current_deployment_id : integer
- workflows : list::
- id : integer
- The object ID.
- created_at : string/time
- updated_at : string/time
- name : string
- state : string
- reports : list::
- id : integer
- The object ID.
- created_at : string/time
- updated_at : string/time
- name : string
- state : string
- script_templates : list::
- id : integer
- The object ID.
- created_at : string/time
- updated_at : string/time
- name : string
- files : list::
- id : integer
- The object ID.
- created_at : string/time
- updated_at : string/time
- file_name : string
- file_size : integer
- expired : boolean
- app_instances : list::
- id : integer
- The object ID.
- created_at : string/time
- updated_at : string/time
- name : string
- slug : string
- all_objects : list::
- project_id : integer
- object_id : integer
- object_type : string
- fco_type : string
- sub_type : string
- name : string
- icon : string
- author : string
- archived : string
- The archival status of the requested object(s).
- note : string
- hidden : boolean
The hidden status of the object.
- archived : string
The archival status of the requested object(s).
-
put_archive
(id, status)¶ Update the archive status of this object
Parameters: - id : integer
The ID of the object.
- status : boolean
The desired archived status of the object.
Returns: - id : integer
The ID for this project.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- name : string
The name of this project.
- description : string
A description of the project
- users : list::
Users who can see the project - id : integer
The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- auto_share : boolean
- created_at : string/time
- updated_at : string/time
- tables : list::
- schema : string
- name : string
- row_count : integer
- column_count : integer
- created_at : string/time
- updated_at : string/time
- surveys : list::
- id : integer
- The object ID.
- created_at : string/time
- updated_at : string/time
- scripts : list::
- id : integer
- The object ID.
- created_at : string/time
- updated_at : string/time
- name : string
- type : string
- finished_at : string/time
- state : string
- imports : list::
- id : integer
- The object ID.
- created_at : string/time
- updated_at : string/time
- name : string
- type : string
- finished_at : string/time
- state : string
- models : list::
- id : integer
- The object ID.
- created_at : string/time
- updated_at : string/time
- name : string
- state : string
- notebooks : list::
- id : integer
- The object ID.
- created_at : string/time
- updated_at : string/time
- name : string
- current_deployment_id : integer
- workflows : list::
- id : integer
- The object ID.
- created_at : string/time
- updated_at : string/time
- name : string
- state : string
- reports : list::
- id : integer
- The object ID.
- created_at : string/time
- updated_at : string/time
- name : string
- state : string
- script_templates : list::
- id : integer
- The object ID.
- created_at : string/time
- updated_at : string/time
- name : string
- files : list::
- id : integer
- The object ID.
- created_at : string/time
- updated_at : string/time
- file_name : string
- file_size : integer
- expired : boolean
- app_instances : list::
- id : integer
- The object ID.
- created_at : string/time
- updated_at : string/time
- name : string
- slug : string
- all_objects : list::
- project_id : integer
- object_id : integer
- object_type : string
- fco_type : string
- sub_type : string
- name : string
- icon : string
- author : string
- archived : string
- The archival status of the requested object(s).
- note : string
- hidden : boolean
The hidden status of the object.
- archived : string
The archival status of the requested object(s).
Set the permissions groups has on this object
Parameters: - id : integer
ID of the resource to be shared
- group_ids : list
An array of one or more group IDs
- permission_level : string
Options are: “read”, “write”, or “manage”
- share_email_body : string, optional
Custom body text for e-mail sent on a share.
- send_shared_email : boolean, optional
Send email to the recipients of a share.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
Set the permissions users have on this object
Parameters: - id : integer
ID of the resource to be shared
- user_ids : list
An array of one or more user IDs
- permission_level : string
Options are: “read”, “write”, or “manage”
- share_email_body : string, optional
Custom body text for e-mail sent on a share.
- send_shared_email : boolean, optional
Send email to the recipients of a share.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
Queries¶
-
class
Queries
(session_kwargs, return_type='civis')¶ Methods
-
delete_runs
(id, run_id)¶ Cancel a run
Parameters: - id : integer
The ID of the query.
- run_id : integer
The ID of the run.
Returns: - None
Response code 202: success
-
get
(id)¶ Get details about a query
Parameters: - id : integer
The query ID.
Returns: - id : integer
The query ID.
- database : integer
The database ID.
- sql : string
The SQL to execute.
- credential : integer
The credential ID.
- result_rows : list
A preview of rows returned by the query.
- result_columns : list
A preview of columns returned by the query.
- script_id : integer
The ID of the script associated with this query.
- exception : string
Exception returned from the query, null if the query was a success.
- created_at : string/time
- updated_at : string/time
- finished_at : string/date-time
The end time of the last run.
- state : string
The state of the last run.
- last_run_id : integer
The ID of the last run.
- hidden : boolean
The hidden status of the object.
- name : string
The name of the query.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- started_at : string/date-time
The start time of the last run.
- report_id : integer
The ID of the report associated with this query.
-
get_runs
(id, run_id)¶ Check status of a run
Parameters: - id : integer
The ID of the query.
- run_id : integer
The ID of the run.
Returns: - id : integer
The ID of the run.
- query_id : integer
The ID of the query.
- state : string
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- is_cancel_requested : boolean
True if run cancel requested, else false.
- started_at : string/time
The time the last run started at.
- finished_at : string/time
The time the last run completed.
- error : string
The error, if any, returned by the run.
-
list
(*, database_id='DEFAULT', author_id='DEFAULT', created_before='DEFAULT', hidden='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶ List
Parameters: - database_id : integer, optional
The database ID.
- author_id : integer, optional
The author of the query.
- created_before : string, optional
An upper bound for the creation date of the query.
- hidden : boolean, optional
If specified to be true, returns hidden objects. Defaults to false, returning non-hidden objects.
- limit : integer, optional
Number of results to return. Defaults to 20. Maximum allowed is 50.
- page_num : integer, optional
Page number of the results to return. Defaults to the first page, 1.
- order : string, optional
The field on which to order the result set. Defaults to created_at. Must be one of: created_at.
- order_dir : string, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: - id : integer
The query ID.
- database : integer
The database ID.
- sql : string
The SQL to execute.
- credential : integer
The credential ID.
- result_rows : list
A preview of rows returned by the query.
- result_columns : list
A preview of columns returned by the query.
- script_id : integer
The ID of the script associated with this query.
- exception : string
Exception returned from the query, null if the query was a success.
- created_at : string/time
- updated_at : string/time
- finished_at : string/date-time
The end time of the last run.
- state : string
The state of the last run.
- last_run_id : integer
The ID of the last run.
- preview_rows : integer
The number of rows to save from the query’s result (maximum: 100).
- started_at : string/date-time
The start time of the last run.
- report_id : integer
The ID of the report associated with this query.
-
list_runs
(id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶ List runs for the given query
Parameters: - id : integer
The ID of the query.
- limit : integer, optional
Number of results to return. Defaults to 20. Maximum allowed is 100.
- page_num : integer, optional
Page number of the results to return. Defaults to the first page, 1.
- order : string, optional
The field on which to order the result set. Defaults to id. Must be one of: id.
- order_dir : string, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: - id : integer
The ID of the run.
- query_id : integer
The ID of the query.
- state : string
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- is_cancel_requested : boolean
True if run cancel requested, else false.
- started_at : string/time
The time the last run started at.
- finished_at : string/time
The time the last run completed.
- error : string
The error, if any, returned by the run.
-
list_runs_logs
(id, run_id, *, last_id='DEFAULT', limit='DEFAULT')¶ Get the logs for a run
Parameters: - id : integer
The ID of the query.
- run_id : integer
The ID of the run.
- last_id : integer, optional
The ID of the last log message received. Log entries with this ID value or lower will be omitted.Logs are sorted by ID if this value is provided, and are otherwise sorted by createdAt.
- limit : integer, optional
The maximum number of log messages to return. Default of 10000.
Returns: - id : integer
The ID of the log.
- created_at : string/date-time
The time the log was created.
- message : string
The log message.
- level : string
The level of the log. One of unknown,fatal,error,warn,info,debug.
-
post
(database, sql, preview_rows, *, credential='DEFAULT', hidden='DEFAULT', interactive='DEFAULT', include_header='DEFAULT', compression='DEFAULT', column_delimiter='DEFAULT', unquoted='DEFAULT', filename_prefix='DEFAULT')¶ Execute a query
Parameters: - database : integer
The database ID.
- sql : string
The SQL to execute.
- preview_rows : integer
The number of rows to save from the query’s result (maximum: 100).
- credential : integer, optional
The credential ID.
- hidden : boolean, optional
The hidden status of the object.
- 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.
Returns: - id : integer
The query ID.
- database : integer
The database ID.
- sql : string
The SQL to execute.
- credential : integer
The credential ID.
- result_rows : list
A preview of rows returned by the query.
- result_columns : list
A preview of columns returned by the query.
- script_id : integer
The ID of the script associated with this query.
- exception : string
Exception returned from the query, null if the query was a success.
- created_at : string/time
- updated_at : string/time
- finished_at : string/date-time
The end time of the last run.
- state : string
The state of the last run.
- last_run_id : integer
The ID of the last run.
- hidden : boolean
The hidden status of the object.
- interactive : boolean
Deprecated and not used.
- preview_rows : integer
The number of rows to save from the query’s result (maximum: 100).
- include_header : 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].
- column_delimiter : string
The delimiter to use. One of comma or tab, or pipe [default: comma].
- unquoted : boolean
If true, will not quote fields.
- filename_prefix : string
The output filename prefix.
- started_at : string/date-time
The start time of the last run.
- report_id : integer
The ID of the report associated with this query.
-
post_runs
(id)¶ Start a run
Parameters: - id : integer
The ID of the query.
Returns: - id : integer
The ID of the run.
- query_id : integer
The ID of the query.
- state : string
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- is_cancel_requested : boolean
True if run cancel requested, else false.
- started_at : string/time
The time the last run started at.
- finished_at : string/time
The time the last run completed.
- error : string
The error, if any, returned by the run.
-
put_scripts
(id, script_id)¶ Update the query’s associated script
Parameters: - id : integer
The query ID.
- script_id : integer
The ID of the script associated with this query.
Returns: - id : integer
The query ID.
- database : integer
The database ID.
- sql : string
The SQL to execute.
- credential : integer
The credential ID.
- result_rows : list
A preview of rows returned by the query.
- result_columns : list
A preview of columns returned by the query.
- script_id : integer
The ID of the script associated with this query.
- exception : string
Exception returned from the query, null if the query was a success.
- created_at : string/time
- updated_at : string/time
- finished_at : string/date-time
The end time of the last run.
- state : string
The state of the last run.
- last_run_id : integer
The ID of the last run.
- hidden : boolean
The hidden status of the object.
- name : string
The name of the query.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- started_at : string/date-time
The start time of the last run.
- report_id : integer
The ID of the report associated with this query.
-
Remote_Hosts¶
-
civis.resources._resources.
Remote_Hosts
¶ alias of
civis.resources._resources.RemoteHosts
Reports¶
-
class
Reports
(session_kwargs, return_type='civis')¶ Methods
-
delete_grants
(id)¶ Revoke permission for this report to perform Civis platform API operations on your behalf
Parameters: - id : integer
The ID of this report.
Returns: - None
Response code 204: success
-
delete_projects
(id, project_id)¶ Remove a Report from a project
Parameters: - id : integer
ID of the resource
- project_id : integer
The ID of the project
Returns: - None
Response code 204: success
Revoke the permissions a group has on this object
Parameters: - id : integer
ID of the resource to be revoked
- group_id : integer
ID of the group
Returns: - None
Response code 204: success
Revoke the permissions a user has on this object
Parameters: - id : integer
ID of the resource to be revoked
- user_id : integer
ID of the user
Returns: - None
Response code 204: success
Revoke the permissions a group has on this object
Parameters: - id : integer
ID of the resource to be revoked
- group_id : integer
ID of the group
Returns: - None
Response code 204: success
Revoke the permissions a user has on this object
Parameters: - id : integer
ID of the resource to be revoked
- user_id : integer
ID of the user
Returns: - None
Response code 204: success
-
get
(id)¶ Show a single report
Parameters: - id : integer
The ID of this report.
Returns: - id : integer
The ID of this report.
- name : string
The name of the report.
- user : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- created_at : string/time
- updated_at : string/time
- projects : list::
A list of projects containing the report. - id : integer
The ID for the project.
- name : string
- The name of the project.
- state : string
The status of the report’s last run.
- finished_at : string/time
The time that the report’s last run finished.
- viz_updated_at : string/time
The time that the report’s visualization was last updated.
- script : dict::
- id : integer
- The ID for the script.
- name : string
- The name of the script.
- sql : string
- The raw SQL query for the script.
- job_path : string
The link to details of the job that backs this report.
- tableau_id : integer
- template_id : integer
The ID of the template used for this report.
- auth_thumbnail_url : string
URL for a thumbnail of the report.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- archived : string
The archival status of the requested object(s).
- hidden : boolean
The hidden status of the object.
- auth_data_url : string
- auth_code_url : string
- config : string
Any configuration metadata for this report.
- valid_output_file : boolean
Whether the job (a script or a query) that backs the report currently has a valid output file.
- provide_api_key : boolean
Whether the report requests an API Key from the report viewer.
- api_key : string
A Civis API key that can be used by this report.
- api_key_id : integer
The ID of the API key. Can be used for auditing API use by this report.
- app_state : dict
Any application state blob for this report.
- use_viewers_tableau_username : boolean
Apply user level filtering on Tableau reports.
-
get_solutions
(id)¶ Show a single solutions report
Parameters: - id : integer
The ID of this report.
Returns: - id : integer
The ID of this report.
- name : string
The name of the report.
- user : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- created_at : string/time
- updated_at : string/time
- host : string
The host for the solution
- display_url : string
The URL to display the solution report.
- service_id : integer
The id of the backing service
-
list
(*, type='DEFAULT', author='DEFAULT', template_id='DEFAULT', hidden='DEFAULT', archived='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶ List
Parameters: - 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.
- hidden : boolean, optional
If specified to be true, returns hidden objects. Defaults to false, returning non-hidden objects.
- archived : string, optional
The archival status of the requested object(s).
- limit : integer, optional
Number of results to return. Defaults to 20. Maximum allowed is 50.
- page_num : integer, optional
Page number of the results to return. Defaults to the first page, 1.
- order : string, optional
The field on which to order the result set. Defaults to updated_at. Must be one of: updated_at, name, created_at.
- order_dir : string, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: - id : integer
The ID of this report.
- name : string
The name of the report.
- user : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- created_at : string/time
- updated_at : string/time
- projects : list::
A list of projects containing the report. - id : integer
The ID for the project.
- name : string
- The name of the project.
- state : string
The status of the report’s last run.
- finished_at : string/time
The time that the report’s last run finished.
- viz_updated_at : string/time
The time that the report’s visualization was last updated.
- script : dict::
- id : integer
- The ID for the script.
- name : string
- The name of the script.
- sql : string
- The raw SQL query for the script.
- job_path : string
The link to details of the job that backs this report.
- tableau_id : integer
- template_id : integer
The ID of the template used for this report.
- auth_thumbnail_url : string
URL for a thumbnail of the report.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- archived : string
The archival status of the requested object(s).
-
list_projects
(id, *, hidden='DEFAULT')¶ List the projects a Report belongs to
Parameters: - id : integer
The ID of the resource.
- hidden : boolean, optional
If specified to be true, returns hidden objects. Defaults to false, returning non-hidden objects.
Returns: - id : integer
The ID for this project.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- name : string
The name of this project.
- description : string
A description of the project
- users : list::
Users who can see the project - id : integer
The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- auto_share : boolean
- created_at : string/time
- updated_at : string/time
- archived : string
The archival status of the requested object(s).
List users and groups permissioned on this object
Parameters: - id : integer
The ID of the object.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
-
list_snapshots
(id)¶ Get details about the report’s snapshot automation settings
Parameters: - id : integer
The ID of this report.
Returns: - id : integer
The ID of this report.
- state : string
The status of the job’s last run.
- finished_at : string/time
The time that the job’s last run finished.
- send_email_on_completion : boolean
Whether the job will send emails on completion.
- email_template : string
Custom email template.
- recipient_email_addresses : string
Email addresses to send report to, comma separated.
- email_subject : string
Subject for Email.
- height : integer
The height of the cropped snapshot image in screen pixels. The default value is 900 pixels. Minimum value is 600 pixels.
- width : integer
The width of the cropped snapshot image in screen pixels. The default value is 1440 pixels. Minimum value is 600 pixels.
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- parent_id : integer
The ID of the parent job that will trigger this snapshot.
List users and groups permissioned on this object
Parameters: - id : integer
The ID of the object.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
-
patch
(id, *, name='DEFAULT', script_id='DEFAULT', code_body='DEFAULT', config='DEFAULT', app_state='DEFAULT', provide_api_key='DEFAULT', template_id='DEFAULT', use_viewers_tableau_username='DEFAULT')¶ Update a report
Parameters: - id : integer
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 : dict, 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.
Returns: - id : integer
The ID of this report.
- name : string
The name of the report.
- user : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- created_at : string/time
- updated_at : string/time
- projects : list::
A list of projects containing the report. - id : integer
The ID for the project.
- name : string
- The name of the project.
- state : string
The status of the report’s last run.
- finished_at : string/time
The time that the report’s last run finished.
- viz_updated_at : string/time
The time that the report’s visualization was last updated.
- script : dict::
- id : integer
- The ID for the script.
- name : string
- The name of the script.
- sql : string
- The raw SQL query for the script.
- job_path : string
The link to details of the job that backs this report.
- tableau_id : integer
- template_id : integer
The ID of the template used for this report.
- auth_thumbnail_url : string
URL for a thumbnail of the report.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- archived : string
The archival status of the requested object(s).
- hidden : boolean
The hidden status of the object.
- auth_data_url : string
- auth_code_url : string
- config : string
Any configuration metadata for this report.
- valid_output_file : boolean
Whether the job (a script or a query) that backs the report currently has a valid output file.
- provide_api_key : boolean
Whether the report requests an API Key from the report viewer.
- api_key : string
A Civis API key that can be used by this report.
- api_key_id : integer
The ID of the API key. Can be used for auditing API use by this report.
- app_state : dict
Any application state blob for this report.
- use_viewers_tableau_username : boolean
Apply user level filtering on Tableau reports.
-
patch_snapshots
(id, *, state='DEFAULT', finished_at='DEFAULT', send_email_on_completion='DEFAULT', email_template='DEFAULT', recipient_email_addresses='DEFAULT', email_subject='DEFAULT', height='DEFAULT', width='DEFAULT', schedule='DEFAULT', parent_id='DEFAULT')¶ Update the report’s snapshot automation settings
Parameters: - id : integer
The ID of this report.
- state : string, optional
The status of the job’s last run.
- finished_at : string/time, optional
The time that the job’s last run finished.
- send_email_on_completion : boolean, optional
Whether the job will send emails on completion.
- email_template : string, optional
Custom email template.
- recipient_email_addresses : string, optional
Email addresses to send report to, comma separated.
- email_subject : string, optional
Subject for Email.
- height : integer, optional
The height of the cropped snapshot image in screen pixels. The default value is 900 pixels. Minimum value is 600 pixels.
- width : integer, optional
The width of the cropped snapshot image in screen pixels. The default value is 1440 pixels. Minimum value is 600 pixels.
- schedule : dict, optional::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- parent_id : integer, optional
The ID of the parent job that will trigger this snapshot.
Returns: - id : integer
The ID of this report.
- state : string
The status of the job’s last run.
- finished_at : string/time
The time that the job’s last run finished.
- send_email_on_completion : boolean
Whether the job will send emails on completion.
- email_template : string
Custom email template.
- recipient_email_addresses : string
Email addresses to send report to, comma separated.
- email_subject : string
Subject for Email.
- height : integer
The height of the cropped snapshot image in screen pixels. The default value is 900 pixels. Minimum value is 600 pixels.
- width : integer
The width of the cropped snapshot image in screen pixels. The default value is 1440 pixels. Minimum value is 600 pixels.
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- parent_id : integer
The ID of the parent job that will trigger this snapshot.
-
post
(*, script_id='DEFAULT', name='DEFAULT', code_body='DEFAULT', app_state='DEFAULT', provide_api_key='DEFAULT', template_id='DEFAULT', hidden='DEFAULT')¶ Create a report
Parameters: - 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 : dict, 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.
- hidden : boolean, optional
The hidden status of the object.
Returns: - id : integer
The ID of this report.
- name : string
The name of the report.
- user : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- created_at : string/time
- updated_at : string/time
- projects : list::
A list of projects containing the report. - id : integer
The ID for the project.
- name : string
- The name of the project.
- state : string
The status of the report’s last run.
- finished_at : string/time
The time that the report’s last run finished.
- viz_updated_at : string/time
The time that the report’s visualization was last updated.
- script : dict::
- id : integer
- The ID for the script.
- name : string
- The name of the script.
- sql : string
- The raw SQL query for the script.
- job_path : string
The link to details of the job that backs this report.
- tableau_id : integer
- template_id : integer
The ID of the template used for this report.
- auth_thumbnail_url : string
URL for a thumbnail of the report.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- archived : string
The archival status of the requested object(s).
- hidden : boolean
The hidden status of the object.
- auth_data_url : string
- auth_code_url : string
- config : string
Any configuration metadata for this report.
- valid_output_file : boolean
Whether the job (a script or a query) that backs the report currently has a valid output file.
- provide_api_key : boolean
Whether the report requests an API Key from the report viewer.
- api_key : string
A Civis API key that can be used by this report.
- api_key_id : integer
The ID of the API key. Can be used for auditing API use by this report.
- app_state : dict
Any application state blob for this report.
- use_viewers_tableau_username : boolean
Apply user level filtering on Tableau reports.
-
post_grants
(id)¶ Grant this report the ability to perform Civis platform API operations on your behalf
Parameters: - id : integer
The ID of this report.
Returns: - id : integer
The ID of this report.
- name : string
The name of the report.
- user : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- created_at : string/time
- updated_at : string/time
- projects : list::
A list of projects containing the report. - id : integer
The ID for the project.
- name : string
- The name of the project.
- state : string
The status of the report’s last run.
- finished_at : string/time
The time that the report’s last run finished.
- viz_updated_at : string/time
The time that the report’s visualization was last updated.
- script : dict::
- id : integer
- The ID for the script.
- name : string
- The name of the script.
- sql : string
- The raw SQL query for the script.
- job_path : string
The link to details of the job that backs this report.
- tableau_id : integer
- template_id : integer
The ID of the template used for this report.
- auth_thumbnail_url : string
URL for a thumbnail of the report.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- archived : string
The archival status of the requested object(s).
- hidden : boolean
The hidden status of the object.
- auth_data_url : string
- auth_code_url : string
- config : string
Any configuration metadata for this report.
- valid_output_file : boolean
Whether the job (a script or a query) that backs the report currently has a valid output file.
- provide_api_key : boolean
Whether the report requests an API Key from the report viewer.
- api_key : string
A Civis API key that can be used by this report.
- api_key_id : integer
The ID of the API key. Can be used for auditing API use by this report.
- app_state : dict
Any application state blob for this report.
- use_viewers_tableau_username : boolean
Apply user level filtering on Tableau reports.
-
post_snapshots
(id, *, state='DEFAULT', finished_at='DEFAULT', send_email_on_completion='DEFAULT', email_template='DEFAULT', recipient_email_addresses='DEFAULT', email_subject='DEFAULT', height='DEFAULT', width='DEFAULT', schedule='DEFAULT', parent_id='DEFAULT')¶ Generate and optionally email a snapshot of the specified report
Parameters: - id : integer
The ID of this report.
- state : string, optional
The status of the job’s last run.
- finished_at : string/time, optional
The time that the job’s last run finished.
- send_email_on_completion : boolean, optional
Whether the job will send emails on completion.
- email_template : string, optional
Custom email template.
- recipient_email_addresses : string, optional
Email addresses to send report to, comma separated.
- email_subject : string, optional
Subject for Email.
- height : integer, optional
The height of the cropped snapshot image in screen pixels. The default value is 900 pixels. Minimum value is 600 pixels.
- width : integer, optional
The width of the cropped snapshot image in screen pixels. The default value is 1440 pixels. Minimum value is 600 pixels.
- schedule : dict, optional::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- parent_id : integer, optional
The ID of the parent job that will trigger this snapshot.
Returns: - id : integer
The ID of this report.
- state : string
The status of the job’s last run.
- finished_at : string/time
The time that the job’s last run finished.
- send_email_on_completion : boolean
Whether the job will send emails on completion.
- email_template : string
Custom email template.
- recipient_email_addresses : string
Email addresses to send report to, comma separated.
- email_subject : string
Subject for Email.
- height : integer
The height of the cropped snapshot image in screen pixels. The default value is 900 pixels. Minimum value is 600 pixels.
- width : integer
The width of the cropped snapshot image in screen pixels. The default value is 1440 pixels. Minimum value is 600 pixels.
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- parent_id : integer
The ID of the parent job that will trigger this snapshot.
-
put_archive
(id, status)¶ Update the archive status of this object
Parameters: - id : integer
The ID of the object.
- status : boolean
The desired archived status of the object.
Returns: - id : integer
The ID of this report.
- name : string
The name of the report.
- user : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- created_at : string/time
- updated_at : string/time
- projects : list::
A list of projects containing the report. - id : integer
The ID for the project.
- name : string
- The name of the project.
- state : string
The status of the report’s last run.
- finished_at : string/time
The time that the report’s last run finished.
- viz_updated_at : string/time
The time that the report’s visualization was last updated.
- script : dict::
- id : integer
- The ID for the script.
- name : string
- The name of the script.
- sql : string
- The raw SQL query for the script.
- job_path : string
The link to details of the job that backs this report.
- tableau_id : integer
- template_id : integer
The ID of the template used for this report.
- auth_thumbnail_url : string
URL for a thumbnail of the report.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- archived : string
The archival status of the requested object(s).
- hidden : boolean
The hidden status of the object.
- auth_data_url : string
- auth_code_url : string
- config : string
Any configuration metadata for this report.
- valid_output_file : boolean
Whether the job (a script or a query) that backs the report currently has a valid output file.
- provide_api_key : boolean
Whether the report requests an API Key from the report viewer.
- api_key : string
A Civis API key that can be used by this report.
- api_key_id : integer
The ID of the API key. Can be used for auditing API use by this report.
- app_state : dict
Any application state blob for this report.
- use_viewers_tableau_username : boolean
Apply user level filtering on Tableau reports.
-
put_projects
(id, project_id)¶ Add a Report to a project
Parameters: - id : integer
ID of the resource
- project_id : integer
The ID of the project
Returns: - None
Response code 204: success
Set the permissions groups has on this object
Parameters: - id : integer
ID of the resource to be shared
- group_ids : list
An array of one or more group IDs
- permission_level : string
Options are: “read”, “write”, or “manage”
- share_email_body : string, optional
Custom body text for e-mail sent on a share.
- send_shared_email : boolean, optional
Send email to the recipients of a share.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
Set the permissions users have on this object
Parameters: - id : integer
ID of the resource to be shared
- user_ids : list
An array of one or more user IDs
- permission_level : string
Options are: “read”, “write”, or “manage”
- share_email_body : string, optional
Custom body text for e-mail sent on a share.
- send_shared_email : boolean, optional
Send email to the recipients of a share.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
Set the permissions groups has on this object
Parameters: - id : integer
ID of the resource to be shared
- group_ids : list
An array of one or more group IDs
- permission_level : string
Options are: “read”, “write”, or “manage”
- share_email_body : string, optional
Custom body text for e-mail sent on a share.
- send_shared_email : boolean, optional
Send email to the recipients of a share.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
Set the permissions users have on this object
Parameters: - id : integer
ID of the resource to be shared
- user_ids : list
An array of one or more user IDs
- permission_level : string
Options are: “read”, “write”, or “manage”
- share_email_body : string, optional
Custom body text for e-mail sent on a share.
- send_shared_email : boolean, optional
Send email to the recipients of a share.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
-
Results¶
-
class
Results
(session_kwargs, return_type='civis')¶ Methods
-
delete_grants
(id)¶ Revoke permission for this report to perform Civis platform API operations on your behalf
Parameters: - id : integer
The ID of this report.
Returns: - None
Response code 204: success
-
delete_projects
(id, project_id)¶ Remove a Report from a project
Parameters: - id : integer
ID of the resource
- project_id : integer
The ID of the project
Returns: - None
Response code 204: success
Revoke the permissions a group has on this object
Parameters: - id : integer
ID of the resource to be revoked
- group_id : integer
ID of the group
Returns: - None
Response code 204: success
Revoke the permissions a user has on this object
Parameters: - id : integer
ID of the resource to be revoked
- user_id : integer
ID of the user
Returns: - None
Response code 204: success
Revoke the permissions a group has on this object
Parameters: - id : integer
ID of the resource to be revoked
- group_id : integer
ID of the group
Returns: - None
Response code 204: success
Revoke the permissions a user has on this object
Parameters: - id : integer
ID of the resource to be revoked
- user_id : integer
ID of the user
Returns: - None
Response code 204: success
-
get
(id)¶ Show a single report
Parameters: - id : integer
The ID of this report.
Returns: - id : integer
The ID of this report.
- name : string
The name of the report.
- user : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- created_at : string/time
- updated_at : string/time
- projects : list::
A list of projects containing the report. - id : integer
The ID for the project.
- name : string
- The name of the project.
- state : string
The status of the report’s last run.
- finished_at : string/time
The time that the report’s last run finished.
- viz_updated_at : string/time
The time that the report’s visualization was last updated.
- script : dict::
- id : integer
- The ID for the script.
- name : string
- The name of the script.
- sql : string
- The raw SQL query for the script.
- job_path : string
The link to details of the job that backs this report.
- tableau_id : integer
- template_id : integer
The ID of the template used for this report.
- auth_thumbnail_url : string
URL for a thumbnail of the report.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- archived : string
The archival status of the requested object(s).
- hidden : boolean
The hidden status of the object.
- auth_data_url : string
- auth_code_url : string
- config : string
Any configuration metadata for this report.
- valid_output_file : boolean
Whether the job (a script or a query) that backs the report currently has a valid output file.
- provide_api_key : boolean
Whether the report requests an API Key from the report viewer.
- api_key : string
A Civis API key that can be used by this report.
- api_key_id : integer
The ID of the API key. Can be used for auditing API use by this report.
- app_state : dict
Any application state blob for this report.
- use_viewers_tableau_username : boolean
Apply user level filtering on Tableau reports.
-
get_solutions
(id)¶ Show a single solutions report
Parameters: - id : integer
The ID of this report.
Returns: - id : integer
The ID of this report.
- name : string
The name of the report.
- user : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- created_at : string/time
- updated_at : string/time
- host : string
The host for the solution
- display_url : string
The URL to display the solution report.
- service_id : integer
The id of the backing service
-
list
(*, type='DEFAULT', author='DEFAULT', template_id='DEFAULT', hidden='DEFAULT', archived='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶ List
Parameters: - 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.
- hidden : boolean, optional
If specified to be true, returns hidden objects. Defaults to false, returning non-hidden objects.
- archived : string, optional
The archival status of the requested object(s).
- limit : integer, optional
Number of results to return. Defaults to 20. Maximum allowed is 50.
- page_num : integer, optional
Page number of the results to return. Defaults to the first page, 1.
- order : string, optional
The field on which to order the result set. Defaults to updated_at. Must be one of: updated_at, name, created_at.
- order_dir : string, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: - id : integer
The ID of this report.
- name : string
The name of the report.
- user : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- created_at : string/time
- updated_at : string/time
- projects : list::
A list of projects containing the report. - id : integer
The ID for the project.
- name : string
- The name of the project.
- state : string
The status of the report’s last run.
- finished_at : string/time
The time that the report’s last run finished.
- viz_updated_at : string/time
The time that the report’s visualization was last updated.
- script : dict::
- id : integer
- The ID for the script.
- name : string
- The name of the script.
- sql : string
- The raw SQL query for the script.
- job_path : string
The link to details of the job that backs this report.
- tableau_id : integer
- template_id : integer
The ID of the template used for this report.
- auth_thumbnail_url : string
URL for a thumbnail of the report.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- archived : string
The archival status of the requested object(s).
-
list_projects
(id, *, hidden='DEFAULT')¶ List the projects a Report belongs to
Parameters: - id : integer
The ID of the resource.
- hidden : boolean, optional
If specified to be true, returns hidden objects. Defaults to false, returning non-hidden objects.
Returns: - id : integer
The ID for this project.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- name : string
The name of this project.
- description : string
A description of the project
- users : list::
Users who can see the project - id : integer
The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- auto_share : boolean
- created_at : string/time
- updated_at : string/time
- archived : string
The archival status of the requested object(s).
List users and groups permissioned on this object
Parameters: - id : integer
The ID of the object.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
-
list_snapshots
(id)¶ Get details about the report’s snapshot automation settings
Parameters: - id : integer
The ID of this report.
Returns: - id : integer
The ID of this report.
- state : string
The status of the job’s last run.
- finished_at : string/time
The time that the job’s last run finished.
- send_email_on_completion : boolean
Whether the job will send emails on completion.
- email_template : string
Custom email template.
- recipient_email_addresses : string
Email addresses to send report to, comma separated.
- email_subject : string
Subject for Email.
- height : integer
The height of the cropped snapshot image in screen pixels. The default value is 900 pixels. Minimum value is 600 pixels.
- width : integer
The width of the cropped snapshot image in screen pixels. The default value is 1440 pixels. Minimum value is 600 pixels.
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- parent_id : integer
The ID of the parent job that will trigger this snapshot.
List users and groups permissioned on this object
Parameters: - id : integer
The ID of the object.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
-
patch
(id, *, name='DEFAULT', script_id='DEFAULT', code_body='DEFAULT', config='DEFAULT', app_state='DEFAULT', provide_api_key='DEFAULT', template_id='DEFAULT', use_viewers_tableau_username='DEFAULT')¶ Update a report
Parameters: - id : integer
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 : dict, 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.
Returns: - id : integer
The ID of this report.
- name : string
The name of the report.
- user : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- created_at : string/time
- updated_at : string/time
- projects : list::
A list of projects containing the report. - id : integer
The ID for the project.
- name : string
- The name of the project.
- state : string
The status of the report’s last run.
- finished_at : string/time
The time that the report’s last run finished.
- viz_updated_at : string/time
The time that the report’s visualization was last updated.
- script : dict::
- id : integer
- The ID for the script.
- name : string
- The name of the script.
- sql : string
- The raw SQL query for the script.
- job_path : string
The link to details of the job that backs this report.
- tableau_id : integer
- template_id : integer
The ID of the template used for this report.
- auth_thumbnail_url : string
URL for a thumbnail of the report.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- archived : string
The archival status of the requested object(s).
- hidden : boolean
The hidden status of the object.
- auth_data_url : string
- auth_code_url : string
- config : string
Any configuration metadata for this report.
- valid_output_file : boolean
Whether the job (a script or a query) that backs the report currently has a valid output file.
- provide_api_key : boolean
Whether the report requests an API Key from the report viewer.
- api_key : string
A Civis API key that can be used by this report.
- api_key_id : integer
The ID of the API key. Can be used for auditing API use by this report.
- app_state : dict
Any application state blob for this report.
- use_viewers_tableau_username : boolean
Apply user level filtering on Tableau reports.
-
patch_snapshots
(id, *, state='DEFAULT', finished_at='DEFAULT', send_email_on_completion='DEFAULT', email_template='DEFAULT', recipient_email_addresses='DEFAULT', email_subject='DEFAULT', height='DEFAULT', width='DEFAULT', schedule='DEFAULT', parent_id='DEFAULT')¶ Update the report’s snapshot automation settings
Parameters: - id : integer
The ID of this report.
- state : string, optional
The status of the job’s last run.
- finished_at : string/time, optional
The time that the job’s last run finished.
- send_email_on_completion : boolean, optional
Whether the job will send emails on completion.
- email_template : string, optional
Custom email template.
- recipient_email_addresses : string, optional
Email addresses to send report to, comma separated.
- email_subject : string, optional
Subject for Email.
- height : integer, optional
The height of the cropped snapshot image in screen pixels. The default value is 900 pixels. Minimum value is 600 pixels.
- width : integer, optional
The width of the cropped snapshot image in screen pixels. The default value is 1440 pixels. Minimum value is 600 pixels.
- schedule : dict, optional::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- parent_id : integer, optional
The ID of the parent job that will trigger this snapshot.
Returns: - id : integer
The ID of this report.
- state : string
The status of the job’s last run.
- finished_at : string/time
The time that the job’s last run finished.
- send_email_on_completion : boolean
Whether the job will send emails on completion.
- email_template : string
Custom email template.
- recipient_email_addresses : string
Email addresses to send report to, comma separated.
- email_subject : string
Subject for Email.
- height : integer
The height of the cropped snapshot image in screen pixels. The default value is 900 pixels. Minimum value is 600 pixels.
- width : integer
The width of the cropped snapshot image in screen pixels. The default value is 1440 pixels. Minimum value is 600 pixels.
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- parent_id : integer
The ID of the parent job that will trigger this snapshot.
-
post
(*, script_id='DEFAULT', name='DEFAULT', code_body='DEFAULT', app_state='DEFAULT', provide_api_key='DEFAULT', template_id='DEFAULT', hidden='DEFAULT')¶ Create a report
Parameters: - 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 : dict, 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.
- hidden : boolean, optional
The hidden status of the object.
Returns: - id : integer
The ID of this report.
- name : string
The name of the report.
- user : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- created_at : string/time
- updated_at : string/time
- projects : list::
A list of projects containing the report. - id : integer
The ID for the project.
- name : string
- The name of the project.
- state : string
The status of the report’s last run.
- finished_at : string/time
The time that the report’s last run finished.
- viz_updated_at : string/time
The time that the report’s visualization was last updated.
- script : dict::
- id : integer
- The ID for the script.
- name : string
- The name of the script.
- sql : string
- The raw SQL query for the script.
- job_path : string
The link to details of the job that backs this report.
- tableau_id : integer
- template_id : integer
The ID of the template used for this report.
- auth_thumbnail_url : string
URL for a thumbnail of the report.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- archived : string
The archival status of the requested object(s).
- hidden : boolean
The hidden status of the object.
- auth_data_url : string
- auth_code_url : string
- config : string
Any configuration metadata for this report.
- valid_output_file : boolean
Whether the job (a script or a query) that backs the report currently has a valid output file.
- provide_api_key : boolean
Whether the report requests an API Key from the report viewer.
- api_key : string
A Civis API key that can be used by this report.
- api_key_id : integer
The ID of the API key. Can be used for auditing API use by this report.
- app_state : dict
Any application state blob for this report.
- use_viewers_tableau_username : boolean
Apply user level filtering on Tableau reports.
-
post_grants
(id)¶ Grant this report the ability to perform Civis platform API operations on your behalf
Parameters: - id : integer
The ID of this report.
Returns: - id : integer
The ID of this report.
- name : string
The name of the report.
- user : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- created_at : string/time
- updated_at : string/time
- projects : list::
A list of projects containing the report. - id : integer
The ID for the project.
- name : string
- The name of the project.
- state : string
The status of the report’s last run.
- finished_at : string/time
The time that the report’s last run finished.
- viz_updated_at : string/time
The time that the report’s visualization was last updated.
- script : dict::
- id : integer
- The ID for the script.
- name : string
- The name of the script.
- sql : string
- The raw SQL query for the script.
- job_path : string
The link to details of the job that backs this report.
- tableau_id : integer
- template_id : integer
The ID of the template used for this report.
- auth_thumbnail_url : string
URL for a thumbnail of the report.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- archived : string
The archival status of the requested object(s).
- hidden : boolean
The hidden status of the object.
- auth_data_url : string
- auth_code_url : string
- config : string
Any configuration metadata for this report.
- valid_output_file : boolean
Whether the job (a script or a query) that backs the report currently has a valid output file.
- provide_api_key : boolean
Whether the report requests an API Key from the report viewer.
- api_key : string
A Civis API key that can be used by this report.
- api_key_id : integer
The ID of the API key. Can be used for auditing API use by this report.
- app_state : dict
Any application state blob for this report.
- use_viewers_tableau_username : boolean
Apply user level filtering on Tableau reports.
-
post_snapshots
(id, *, state='DEFAULT', finished_at='DEFAULT', send_email_on_completion='DEFAULT', email_template='DEFAULT', recipient_email_addresses='DEFAULT', email_subject='DEFAULT', height='DEFAULT', width='DEFAULT', schedule='DEFAULT', parent_id='DEFAULT')¶ Generate and optionally email a snapshot of the specified report
Parameters: - id : integer
The ID of this report.
- state : string, optional
The status of the job’s last run.
- finished_at : string/time, optional
The time that the job’s last run finished.
- send_email_on_completion : boolean, optional
Whether the job will send emails on completion.
- email_template : string, optional
Custom email template.
- recipient_email_addresses : string, optional
Email addresses to send report to, comma separated.
- email_subject : string, optional
Subject for Email.
- height : integer, optional
The height of the cropped snapshot image in screen pixels. The default value is 900 pixels. Minimum value is 600 pixels.
- width : integer, optional
The width of the cropped snapshot image in screen pixels. The default value is 1440 pixels. Minimum value is 600 pixels.
- schedule : dict, optional::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- parent_id : integer, optional
The ID of the parent job that will trigger this snapshot.
Returns: - id : integer
The ID of this report.
- state : string
The status of the job’s last run.
- finished_at : string/time
The time that the job’s last run finished.
- send_email_on_completion : boolean
Whether the job will send emails on completion.
- email_template : string
Custom email template.
- recipient_email_addresses : string
Email addresses to send report to, comma separated.
- email_subject : string
Subject for Email.
- height : integer
The height of the cropped snapshot image in screen pixels. The default value is 900 pixels. Minimum value is 600 pixels.
- width : integer
The width of the cropped snapshot image in screen pixels. The default value is 1440 pixels. Minimum value is 600 pixels.
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- parent_id : integer
The ID of the parent job that will trigger this snapshot.
-
put_archive
(id, status)¶ Update the archive status of this object
Parameters: - id : integer
The ID of the object.
- status : boolean
The desired archived status of the object.
Returns: - id : integer
The ID of this report.
- name : string
The name of the report.
- user : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- created_at : string/time
- updated_at : string/time
- projects : list::
A list of projects containing the report. - id : integer
The ID for the project.
- name : string
- The name of the project.
- state : string
The status of the report’s last run.
- finished_at : string/time
The time that the report’s last run finished.
- viz_updated_at : string/time
The time that the report’s visualization was last updated.
- script : dict::
- id : integer
- The ID for the script.
- name : string
- The name of the script.
- sql : string
- The raw SQL query for the script.
- job_path : string
The link to details of the job that backs this report.
- tableau_id : integer
- template_id : integer
The ID of the template used for this report.
- auth_thumbnail_url : string
URL for a thumbnail of the report.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- archived : string
The archival status of the requested object(s).
- hidden : boolean
The hidden status of the object.
- auth_data_url : string
- auth_code_url : string
- config : string
Any configuration metadata for this report.
- valid_output_file : boolean
Whether the job (a script or a query) that backs the report currently has a valid output file.
- provide_api_key : boolean
Whether the report requests an API Key from the report viewer.
- api_key : string
A Civis API key that can be used by this report.
- api_key_id : integer
The ID of the API key. Can be used for auditing API use by this report.
- app_state : dict
Any application state blob for this report.
- use_viewers_tableau_username : boolean
Apply user level filtering on Tableau reports.
-
put_projects
(id, project_id)¶ Add a Report to a project
Parameters: - id : integer
ID of the resource
- project_id : integer
The ID of the project
Returns: - None
Response code 204: success
Set the permissions groups has on this object
Parameters: - id : integer
ID of the resource to be shared
- group_ids : list
An array of one or more group IDs
- permission_level : string
Options are: “read”, “write”, or “manage”
- share_email_body : string, optional
Custom body text for e-mail sent on a share.
- send_shared_email : boolean, optional
Send email to the recipients of a share.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
Set the permissions users have on this object
Parameters: - id : integer
ID of the resource to be shared
- user_ids : list
An array of one or more user IDs
- permission_level : string
Options are: “read”, “write”, or “manage”
- share_email_body : string, optional
Custom body text for e-mail sent on a share.
- send_shared_email : boolean, optional
Send email to the recipients of a share.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
Set the permissions groups has on this object
Parameters: - id : integer
ID of the resource to be shared
- group_ids : list
An array of one or more group IDs
- permission_level : string
Options are: “read”, “write”, or “manage”
- share_email_body : string, optional
Custom body text for e-mail sent on a share.
- send_shared_email : boolean, optional
Send email to the recipients of a share.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
Set the permissions users have on this object
Parameters: - id : integer
ID of the resource to be shared
- user_ids : list
An array of one or more user IDs
- permission_level : string
Options are: “read”, “write”, or “manage”
- share_email_body : string, optional
Custom body text for e-mail sent on a share.
- send_shared_email : boolean, optional
Send email to the recipients of a share.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
-
Scripts¶
-
class
Scripts
(session_kwargs, return_type='civis')¶ Methods
-
delete_containers_projects
(id, project_id)¶ Remove a container docker from a project
Parameters: - id : integer
ID of the resource
- project_id : integer
The ID of the project
Returns: - None
Response code 204: success
-
delete_containers_runs
(id, run_id)¶ Cancel a run
Parameters: - id : integer
The ID of the container.
- run_id : integer
The ID of the run.
Returns: - None
Response code 202: success
Revoke the permissions a group has on this object
Parameters: - id : integer
ID of the resource to be revoked
- group_id : integer
ID of the group
Returns: - None
Response code 204: success
Revoke the permissions a user has on this object
Parameters: - id : integer
ID of the resource to be revoked
- user_id : integer
ID of the user
Returns: - None
Response code 204: success
-
delete_custom_projects
(id, project_id)¶ Remove a Job from a project
Parameters: - id : integer
ID of the resource
- project_id : integer
The ID of the project
Returns: - None
Response code 204: success
-
delete_custom_runs
(id, run_id)¶ Cancel a run
Parameters: - id : integer
The ID of the custom.
- run_id : integer
The ID of the run.
Returns: - None
Response code 202: success
Revoke the permissions a group has on this object
Parameters: - id : integer
ID of the resource to be revoked
- group_id : integer
ID of the group
Returns: - None
Response code 204: success
Revoke the permissions a user has on this object
Parameters: - id : integer
ID of the resource to be revoked
- user_id : integer
ID of the user
Returns: - None
Response code 204: success
-
delete_javascript_projects
(id, project_id)¶ Remove a scripted sql from a project
Parameters: - id : integer
ID of the resource
- project_id : integer
The ID of the project
Returns: - None
Response code 204: success
-
delete_javascript_runs
(id, run_id)¶ Cancel a run
Parameters: - id : integer
The ID of the javascript.
- run_id : integer
The ID of the run.
Returns: - None
Response code 202: success
Revoke the permissions a group has on this object
Parameters: - id : integer
ID of the resource to be revoked
- group_id : integer
ID of the group
Returns: - None
Response code 204: success
Revoke the permissions a user has on this object
Parameters: - id : integer
ID of the resource to be revoked
- user_id : integer
ID of the user
Returns: - None
Response code 204: success
-
delete_python3_projects
(id, project_id)¶ Remove a python docker from a project
Parameters: - id : integer
ID of the resource
- project_id : integer
The ID of the project
Returns: - None
Response code 204: success
-
delete_python3_runs
(id, run_id)¶ Cancel a run
Parameters: - id : integer
The ID of the python.
- run_id : integer
The ID of the run.
Returns: - None
Response code 202: success
Revoke the permissions a group has on this object
Parameters: - id : integer
ID of the resource to be revoked
- group_id : integer
ID of the group
Returns: - None
Response code 204: success
Revoke the permissions a user has on this object
Parameters: - id : integer
ID of the resource to be revoked
- user_id : integer
ID of the user
Returns: - None
Response code 204: success
-
delete_r_projects
(id, project_id)¶ Remove a r docker from a project
Parameters: - id : integer
ID of the resource
- project_id : integer
The ID of the project
Returns: - None
Response code 204: success
-
delete_r_runs
(id, run_id)¶ Cancel a run
Parameters: - id : integer
The ID of the r.
- run_id : integer
The ID of the run.
Returns: - None
Response code 202: success
Revoke the permissions a group has on this object
Parameters: - id : integer
ID of the resource to be revoked
- group_id : integer
ID of the group
Returns: - None
Response code 204: success
Revoke the permissions a user has on this object
Parameters: - id : integer
ID of the resource to be revoked
- user_id : integer
ID of the user
Returns: - None
Response code 204: success
-
delete_sql_projects
(id, project_id)¶ Remove a scripts from a project
Parameters: - id : integer
ID of the resource
- project_id : integer
The ID of the project
Returns: - None
Response code 204: success
-
delete_sql_runs
(id, run_id)¶ Cancel a run
Parameters: - id : integer
The ID of the sql.
- run_id : integer
The ID of the run.
Returns: - None
Response code 202: success
Revoke the permissions a group has on this object
Parameters: - id : integer
ID of the resource to be revoked
- group_id : integer
ID of the group
Returns: - None
Response code 204: success
Revoke the permissions a user has on this object
Parameters: - id : integer
ID of the resource to be revoked
- user_id : integer
ID of the user
Returns: - None
Response code 204: success
-
get
(id)¶ Get details about a script
Parameters: - id : integer
The ID for the script.
Returns: - id : integer
The ID for the script.
- name : string
The name of the script.
- type : string
The type of script.
- created_at : string/time
The time this script was created.
- updated_at : string/time
The time this script was last updated.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- state : string
The status of the script’s last run.
- finished_at : string/time
The time that the script’s last run finished.
- category : string
The category of the script.
- projects : list::
A list of projects containing the script. - id : integer
The ID for the project.
- name : string
- The name of the project.
- parent_id : integer
The ID of the parent job that will trigger this script
- user_context : string
“runner” or “author”, who to execute the script as when run as a template.
- params : list::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- label : string
- The label to present to users when asking them for the value.
- description : string
- A short sentence or fragment describing this parameter to the end user.
- type : string
- The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, database, credential_aws, credential_redshift, or credential_custom
- required : boolean
- Whether this param is required.
- value : string
- The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- default : string
- If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
- is_template : boolean
Whether others scripts use this one as a template.
- published_as_template_id : integer
The ID of the template that this script is backing.
- from_template_id : integer
The ID of the template this script uses, if any.
- template_dependents_count : integer
How many other scripts use this one as a template.
- template_script_name : string
The name of the template script.
- links : dict::
- details : string
- The details link to get more information about the script.
- runs : string
- The runs link to get the run information list for this script.
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- notifications : dict::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- running_as : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- next_run_at : string/time
The time of the next scheduled run.
- time_zone : string
The time zone of this script.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- hidden : boolean
The hidden status of the object.
- target_project_id : integer
Target project to which script outputs will be added.
- archived : string
The archival status of the requested object(s).
- sql : string
The raw SQL query for the script.
- expanded_arguments : dict
Expanded arguments for use in injecting into different environments.
- template_script_id : integer
The ID of the template script, if any.
-
get_containers
(id)¶ View a container
Parameters: - id : integer
The ID for the script.
Returns: - id : integer
The ID for the script.
- name : string
The name of the container.
- type : string
The type of the script (e.g Container)
- created_at : string/time
The time this script was created.
- updated_at : string/time
The time the script was last updated.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- state : string
The status of the script’s last run.
- finished_at : string/time
The time that the script’s last run finished.
- category : string
The category of the script.
- projects : list::
A list of projects containing the script. - id : integer
The ID for the project.
- name : string
- The name of the project.
- parent_id : integer
The ID of the parent job that will trigger this script
- user_context : string
“runner” or “author”, who to execute the script as when run as a template.
- params : list::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- label : string
- The label to present to users when asking them for the value.
- description : string
- A short sentence or fragment describing this parameter to the end user.
- type : string
- The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, database, credential_aws, credential_redshift, or credential_custom
- required : boolean
- Whether this param is required.
- value : string
- The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- default : string
- If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
- is_template : boolean
Whether others scripts use this one as a template.
- template_dependents_count : integer
How many other scripts use this one as a template.
- published_as_template_id : integer
The ID of the template that this script is backing.
- from_template_id : integer
The ID of the template script.
- template_script_name : string
The name of the template script.
- links : dict::
- details : string
- The details link to get more information about the script.
- runs : string
- The runs link to get the run information list for this script.
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- notifications : dict::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- running_as : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- required_resources : dict::
- cpu : integer
- The number of CPU shares to allocate for the container. Each core has 1024 shares.
- memory : integer
- The amount of RAM to allocate for the container (in MiB).
- disk_space : number/float
- The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.
- repo_http_uri : string
The location of a github repo to clone into the container, e.g. github.com/my-user/my-repo.git.
- repo_ref : string
The tag or branch of the github repo to clone into the container.
- remote_host_credential_id : integer
The id of the database credentials to pass into the environment of the container.
- git_credential_id : integer
The id of the git credential to be used when checking out the specified git repo. If not supplied, the first git credential you’ve submitted will be used. Unnecessary if no git repo is specified or the git repo is public.
- docker_command : string
The command to run on the container. Will be run via sh as: [“sh”, “-c”, dockerCommand]
- docker_image_name : string
The name of the docker image to pull from DockerHub.
- docker_image_tag : string
The tag of the docker image to pull from DockerHub (default: latest).
- cancel_timeout : 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.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- time_zone : string
The time zone of this script.
- hidden : boolean
The hidden status of the object.
- archived : string
The archival status of the requested object(s).
- target_project_id : integer
Target project to which script outputs will be added.
-
get_containers_runs
(id, run_id)¶ Check status of a run
Parameters: - id : integer
The ID of the container.
- run_id : integer
The ID of the run.
Returns: - id : integer
The ID of the run.
- container_id : integer
The ID of the container.
- state : string
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- is_cancel_requested : boolean
True if run cancel requested, else false.
- started_at : string/time
The time the last run started at.
- finished_at : string/time
The time the last run completed.
- error : string
The error, if any, returned by the run.
-
get_custom
(id)¶ Get a Custom Script
Parameters: - id : integer
Returns: - id : integer
The ID for the script.
- name : string
The name of the script.
- type : string
The type of the script (e.g Custom)
- created_at : string/time
The time this script was created.
- updated_at : string/time
The time the script was last updated.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- state : string
The status of the script’s last run.
- finished_at : string/time
The time that the script’s last run finished.
- category : string
- projects : list::
A list of projects containing the script. - id : integer
The ID for the project.
- name : string
- The name of the project.
- parent_id : integer
The ID of the parent job that will trigger this script
- params : list::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- label : string
- The label to present to users when asking them for the value.
- description : string
- A short sentence or fragment describing this parameter to the end user.
- type : string
- The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, database, credential_aws, credential_redshift, or credential_custom
- required : boolean
- Whether this param is required.
- value : string
- The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- default : string
- If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
- from_template_id : integer
The ID of the template script.
- ui_report_url : integer
The url of the custom HTML.
- template_script_name : string
The name of the template script.
- template_note : string
The template’s note.
- remote_host_id : integer
The remote host ID that this script will connect to.
- credential_id : integer
The credential that this script will use.
- code_preview : string
The code that this script will run with arguments inserted.
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- notifications : dict::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- running_as : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- time_zone : string
The time zone of this script.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- hidden : boolean
The hidden status of the object.
- archived : string
The archival status of the requested object(s).
- target_project_id : integer
Target project to which script outputs will be added.
-
get_custom_runs
(id, run_id)¶ Check status of a run
Parameters: - id : integer
The ID of the custom.
- run_id : integer
The ID of the run.
Returns: - id : integer
The ID of the run.
- custom_id : integer
The ID of the custom.
- state : string
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- is_cancel_requested : boolean
True if run cancel requested, else false.
- started_at : string/time
The time the last run started at.
- finished_at : string/time
The time the last run completed.
- error : string
The error, if any, returned by the run.
-
get_javascript
(id)¶ Get a JavaScript Script
Parameters: - id : integer
Returns: - 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)
- created_at : string/time
The time this script was created.
- updated_at : string/time
The time the script was last updated.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- state : string
The status of the script’s last run.
- finished_at : string/time
The time that the script’s last run finished.
- category : string
The category of the script.
- projects : list::
A list of projects containing the script. - id : integer
The ID for the project.
- name : string
- The name of the project.
- parent_id : integer
The ID of the parent job that will trigger this script
- user_context : string
“runner” or “author”, who to execute the script as when run as a template.
- params : list::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- label : string
- The label to present to users when asking them for the value.
- description : string
- A short sentence or fragment describing this parameter to the end user.
- type : string
- The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, database, credential_aws, credential_redshift, or credential_custom
- required : boolean
- Whether this param is required.
- value : string
- The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- default : string
- If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
- is_template : boolean
Whether others scripts use this one as a template.
- published_as_template_id : integer
The ID of the template that this script is backing.
- from_template_id : integer
The ID of the template this script uses, if any.
- template_dependents_count : integer
How many other scripts use this one as a template.
- template_script_name : string
The name of the template script.
- links : dict::
- details : string
- The details link to get more information about the script.
- runs : string
- The runs link to get the run information list for this script.
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- notifications : dict::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- running_as : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- next_run_at : string/time
The time of the next scheduled run.
- time_zone : string
The time zone of this script.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- hidden : boolean
The hidden status of the object.
- target_project_id : integer
Target project to which script outputs will be added.
- archived : string
The archival status of the requested object(s).
- source : string
The body/text of the script.
- remote_host_id : integer
The remote host ID that this script will connect to.
- credential_id : integer
The credential that this script will use.
-
get_javascript_runs
(id, run_id)¶ Check status of a run
Parameters: - id : integer
The ID of the javascript.
- run_id : integer
The ID of the run.
Returns: - id : integer
The ID of the run.
- javascript_id : integer
The ID of the javascript.
- state : string
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- is_cancel_requested : boolean
True if run cancel requested, else false.
- started_at : string/time
The time the last run started at.
- finished_at : string/time
The time the last run completed.
- error : string
The error, if any, returned by the run.
-
get_python3
(id)¶ Get a Python Script
Parameters: - id : integer
Returns: - 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)
- created_at : string/time
The time this script was created.
- updated_at : string/time
The time the script was last updated.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- state : string
The status of the script’s last run.
- finished_at : string/time
The time that the script’s last run finished.
- category : string
The category of the script.
- projects : list::
A list of projects containing the script. - id : integer
The ID for the project.
- name : string
- The name of the project.
- parent_id : integer
The ID of the parent job that will trigger this script
- user_context : string
“runner” or “author”, who to execute the script as when run as a template.
- params : list::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- label : string
- The label to present to users when asking them for the value.
- description : string
- A short sentence or fragment describing this parameter to the end user.
- type : string
- The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, database, credential_aws, credential_redshift, or credential_custom
- required : boolean
- Whether this param is required.
- value : string
- The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- default : string
- If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
- is_template : boolean
Whether others scripts use this one as a template.
- published_as_template_id : integer
The ID of the template that this script is backing.
- from_template_id : integer
The ID of the template this script uses, if any.
- template_dependents_count : integer
How many other scripts use this one as a template.
- template_script_name : string
The name of the template script.
- links : dict::
- details : string
- The details link to get more information about the script.
- runs : string
- The runs link to get the run information list for this script.
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- notifications : dict::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- running_as : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- next_run_at : string/time
The time of the next scheduled run.
- time_zone : string
The time zone of this script.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- hidden : boolean
The hidden status of the object.
- target_project_id : integer
Target project to which script outputs will be added.
- archived : string
The archival status of the requested object(s).
- required_resources : dict::
- cpu : integer
- The number of CPU shares to allocate for the container. Each core has 1024 shares. Must be at least 2 shares.
- memory : integer
- The amount of RAM to allocate for the container (in MiB). Must be at least 4 MiB.
- disk_space : number/float
- The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.
- source : string
The body/text of the script.
- cancel_timeout : 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.
-
get_python3_runs
(id, run_id)¶ Check status of a run
Parameters: - id : integer
The ID of the python.
- run_id : integer
The ID of the run.
Returns: - id : integer
The ID of the run.
- python_id : integer
The ID of the python.
- state : string
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- is_cancel_requested : boolean
True if run cancel requested, else false.
- started_at : string/time
The time the last run started at.
- finished_at : string/time
The time the last run completed.
- error : string
The error, if any, returned by the run.
-
get_r
(id)¶ Get an R Script
Parameters: - id : integer
Returns: - 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)
- created_at : string/time
The time this script was created.
- updated_at : string/time
The time the script was last updated.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- state : string
The status of the script’s last run.
- finished_at : string/time
The time that the script’s last run finished.
- category : string
The category of the script.
- projects : list::
A list of projects containing the script. - id : integer
The ID for the project.
- name : string
- The name of the project.
- parent_id : integer
The ID of the parent job that will trigger this script
- user_context : string
“runner” or “author”, who to execute the script as when run as a template.
- params : list::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- label : string
- The label to present to users when asking them for the value.
- description : string
- A short sentence or fragment describing this parameter to the end user.
- type : string
- The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, database, credential_aws, credential_redshift, or credential_custom
- required : boolean
- Whether this param is required.
- value : string
- The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- default : string
- If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
- is_template : boolean
Whether others scripts use this one as a template.
- published_as_template_id : integer
The ID of the template that this script is backing.
- from_template_id : integer
The ID of the template this script uses, if any.
- template_dependents_count : integer
How many other scripts use this one as a template.
- template_script_name : string
The name of the template script.
- links : dict::
- details : string
- The details link to get more information about the script.
- runs : string
- The runs link to get the run information list for this script.
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- notifications : dict::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- running_as : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- next_run_at : string/time
The time of the next scheduled run.
- time_zone : string
The time zone of this script.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- hidden : boolean
The hidden status of the object.
- target_project_id : integer
Target project to which script outputs will be added.
- archived : string
The archival status of the requested object(s).
- required_resources : dict::
- cpu : integer
- The number of CPU shares to allocate for the container. Each core has 1024 shares. Must be at least 2 shares.
- memory : integer
- The amount of RAM to allocate for the container (in MiB). Must be at least 4 MiB.
- disk_space : number/float
- The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.
- source : string
The body/text of the script.
- cancel_timeout : 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.
-
get_r_runs
(id, run_id)¶ Check status of a run
Parameters: - id : integer
The ID of the r.
- run_id : integer
The ID of the run.
Returns: - id : integer
The ID of the run.
- r_id : integer
The ID of the r.
- state : string
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- is_cancel_requested : boolean
True if run cancel requested, else false.
- started_at : string/time
The time the last run started at.
- finished_at : string/time
The time the last run completed.
- error : string
The error, if any, returned by the run.
-
get_sql
(id)¶ Get a SQL script
Parameters: - id : integer
Returns: - 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)
- created_at : string/time
The time this script was created.
- updated_at : string/time
The time the script was last updated.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- state : string
The status of the script’s last run.
- finished_at : string/time
The time that the script’s last run finished.
- category : string
The category of the script.
- projects : list::
A list of projects containing the script. - id : integer
The ID for the project.
- name : string
- The name of the project.
- parent_id : integer
The ID of the parent job that will trigger this script
- user_context : string
“runner” or “author”, who to execute the script as when run as a template.
- params : list::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- label : string
- The label to present to users when asking them for the value.
- description : string
- A short sentence or fragment describing this parameter to the end user.
- type : string
- The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, database, credential_aws, credential_redshift, or credential_custom
- required : boolean
- Whether this param is required.
- value : string
- The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- default : string
- If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
- is_template : boolean
Whether others scripts use this one as a template.
- published_as_template_id : integer
The ID of the template that this script is backing.
- from_template_id : integer
The ID of the template this script uses, if any.
- template_dependents_count : integer
How many other scripts use this one as a template.
- template_script_name : string
The name of the template script.
- links : dict::
- details : string
- The details link to get more information about the script.
- runs : string
- The runs link to get the run information list for this script.
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- notifications : dict::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- running_as : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- next_run_at : string/time
The time of the next scheduled run.
- time_zone : string
The time zone of this script.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- hidden : boolean
The hidden status of the object.
- target_project_id : integer
Target project to which script outputs will be added.
- archived : string
The archival status of the requested object(s).
- sql : string
The raw SQL query for the script.
- expanded_arguments : dict
Expanded arguments for use in injecting into different environments.
- remote_host_id : integer
The remote host ID that this script will connect to.
- credential_id : integer
The credential that this script will use.
- code_preview : string
The code that this script will run with arguments inserted.
- csv_settings : dict::
- include_header : boolean
- Whether or not to include headers in the output data. Default: true
- compression : string
- The type of compression to use, if any, one of “none”, “zip”, or “gzip”. Default: gzip
- column_delimiter : string
- Which delimiter to use, one of “comma”, “tab”, or “pipe”. Default: comma
- unquoted : boolean
- Whether or not to quote fields. Default: false
- force_multifile : boolean
- Whether or not the csv should be split into multiple files. Default: false
- filename_prefix : string
- A user specified filename prefix for the output file to have. Default: null
-
get_sql_runs
(id, run_id)¶ Check status of a run
Parameters: - id : integer
The ID of the sql.
- run_id : integer
The ID of the run.
Returns: - id : integer
The ID of this run.
- sql_id : integer
The ID of this sql.
- state : string
The state of this run.
- is_cancel_requested : boolean
True if run cancel requested, else false.
- started_at : string/time
The time the last run started.
- finished_at : string/time
The time that this run finished.
- error : string
The error message for this run, if present.
- output : list::
A list of the outputs of this script. - output_name : string
The name of the output file.
- file_id : integer
- The unique ID of the output file.
- path : string
- The temporary link to download this output file, valid for 36 hours.
-
list
(*, type='DEFAULT', category='DEFAULT', author='DEFAULT', status='DEFAULT', hidden='DEFAULT', archived='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶ List scripts
Parameters: - type : string, optional
If specified, return objects 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 objects from this author. Must use user IDs. A comma separated list of IDs is also accepted to return objects from multiple authors.
- status : string, optional
If specified, returns objects with one of these statuses. It accepts a comma-separated list, possible values are ‘running’, ‘failed’, ‘succeeded’, ‘idle’, ‘scheduled’.
- hidden : boolean, optional
If specified to be true, returns hidden objects. Defaults to false, returning non-hidden objects.
- archived : string, optional
The archival status of the requested object(s).
- limit : integer, optional
Number of results to return. Defaults to 20. Maximum allowed is 50.
- page_num : integer, optional
Page number of the results to return. Defaults to the first page, 1.
- order : string, optional
The field on which to order the result set. Defaults to updated_at. Must be one of: updated_at, name, created_at, last_run.updated_at.
- order_dir : string, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: - 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)
- created_at : string/time
The time this script was created.
- updated_at : string/time
The time the script was last updated.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- state : string
The status of the script’s last run.
- finished_at : string/time
The time that the script’s last run finished.
- projects : list::
A list of projects containing the script. - id : integer
The ID for the project.
- name : string
- The name of the project.
- parent_id : integer
The ID of the parent job that will trigger this script
- is_template : boolean
Whether others scripts use this one as a template.
- from_template_id : integer
The ID of the template this script uses, if any.
- links : dict::
- details : string
- The details link to get more information about the script.
- runs : string
- The runs link to get the run information list for this script.
- time_zone : string
The time zone of this script.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- archived : string
The archival status of the requested object(s).
- template_script_id : integer
The ID of the template script, if any.
-
list_containers_projects
(id, *, hidden='DEFAULT')¶ List the projects a container docker belongs to
Parameters: - id : integer
The ID of the resource.
- hidden : boolean, optional
If specified to be true, returns hidden objects. Defaults to false, returning non-hidden objects.
Returns: - id : integer
The ID for this project.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- name : string
The name of this project.
- description : string
A description of the project
- users : list::
Users who can see the project - id : integer
The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- auto_share : boolean
- created_at : string/time
- updated_at : string/time
- archived : string
The archival status of the requested object(s).
-
list_containers_runs
(id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶ List runs for the given container
Parameters: - id : integer
The ID of the container.
- limit : integer, optional
Number of results to return. Defaults to 20. Maximum allowed is 100.
- page_num : integer, optional
Page number of the results to return. Defaults to the first page, 1.
- order : string, optional
The field on which to order the result set. Defaults to id. Must be one of: id.
- order_dir : string, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: - id : integer
The ID of the run.
- container_id : integer
The ID of the container.
- state : string
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- is_cancel_requested : boolean
True if run cancel requested, else false.
- started_at : string/time
The time the last run started at.
- finished_at : string/time
The time the last run completed.
- error : string
The error, if any, returned by the run.
-
list_containers_runs_logs
(id, run_id, *, last_id='DEFAULT', limit='DEFAULT')¶ Get the logs for a run
Parameters: - id : integer
The ID of the container.
- run_id : integer
The ID of the run.
- last_id : integer, optional
The ID of the last log message received. Log entries with this ID value or lower will be omitted.Logs are sorted by ID if this value is provided, and are otherwise sorted by createdAt.
- limit : integer, optional
The maximum number of log messages to return. Default of 10000.
Returns: - id : integer
The ID of the log.
- created_at : string/date-time
The time the log was created.
- message : string
The log message.
- level : string
The level of the log. One of unknown,fatal,error,warn,info,debug.
-
list_containers_runs_outputs
(id, run_id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶ List the outputs for a run
Parameters: - id : integer
The ID of the container script.
- run_id : integer
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.
- iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: - object_type : string
The type of the output. Valid values are File, Table, Report, Project, or Credential
- object_id : integer
The ID of the output object.
- name : string
The name of the output object.
- link : string
The link to retrieve the output object.
List users and groups permissioned on this object
Parameters: - id : integer
The ID of the object.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
-
list_custom
(*, from_template_id='DEFAULT', author='DEFAULT', status='DEFAULT', hidden='DEFAULT', archived='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶ List Custom Scripts
Parameters: - 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 objects from this author. Must use user IDs. A comma separated list of IDs is also accepted to return objects from multiple authors.
- status : string, optional
If specified, returns objects with one of these statuses. It accepts a comma-separated list, possible values are ‘running’, ‘failed’, ‘succeeded’, ‘idle’, ‘scheduled’.
- hidden : boolean, optional
If specified to be true, returns hidden objects. Defaults to false, returning non-hidden objects.
- archived : string, optional
The archival status of the requested object(s).
- limit : integer, optional
Number of results to return. Defaults to its maximum of 50.
- page_num : integer, optional
Page number of the results to return. Defaults to the first page, 1.
- order : string, optional
The field on which to order the result set. Defaults to updated_at. Must be one of: updated_at, name, created_at.
- order_dir : string, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to asc.
- iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: - id : integer
The ID for the script.
- name : string
The name of the script.
- type : string
The type of the script (e.g Custom)
- created_at : string/time
The time this script was created.
- updated_at : string/time
The time the script was last updated.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- state : string
The status of the script’s last run.
- finished_at : string/time
The time that the script’s last run finished.
- projects : list::
A list of projects containing the script. - id : integer
The ID for the project.
- name : string
- The name of the project.
- parent_id : integer
The ID of the parent job that will trigger this script
- from_template_id : integer
The ID of the template script.
- time_zone : string
The time zone of this script.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- archived : string
The archival status of the requested object(s).
-
list_custom_projects
(id, *, hidden='DEFAULT')¶ List the projects a Job belongs to
Parameters: - id : integer
The ID of the resource.
- hidden : boolean, optional
If specified to be true, returns hidden objects. Defaults to false, returning non-hidden objects.
Returns: - id : integer
The ID for this project.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- name : string
The name of this project.
- description : string
A description of the project
- users : list::
Users who can see the project - id : integer
The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- auto_share : boolean
- created_at : string/time
- updated_at : string/time
- archived : string
The archival status of the requested object(s).
-
list_custom_runs
(id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶ List runs for the given custom
Parameters: - id : integer
The ID of the custom.
- limit : integer, optional
Number of results to return. Defaults to 20. Maximum allowed is 100.
- page_num : integer, optional
Page number of the results to return. Defaults to the first page, 1.
- order : string, optional
The field on which to order the result set. Defaults to id. Must be one of: id.
- order_dir : string, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: - id : integer
The ID of the run.
- custom_id : integer
The ID of the custom.
- state : string
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- is_cancel_requested : boolean
True if run cancel requested, else false.
- started_at : string/time
The time the last run started at.
- finished_at : string/time
The time the last run completed.
- error : string
The error, if any, returned by the run.
-
list_custom_runs_logs
(id, run_id, *, last_id='DEFAULT', limit='DEFAULT')¶ Get the logs for a run
Parameters: - id : integer
The ID of the custom.
- run_id : integer
The ID of the run.
- last_id : integer, optional
The ID of the last log message received. Log entries with this ID value or lower will be omitted.Logs are sorted by ID if this value is provided, and are otherwise sorted by createdAt.
- limit : integer, optional
The maximum number of log messages to return. Default of 10000.
Returns: - id : integer
The ID of the log.
- created_at : string/date-time
The time the log was created.
- message : string
The log message.
- level : string
The level of the log. One of unknown,fatal,error,warn,info,debug.
-
list_custom_runs_outputs
(id, run_id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶ List the outputs for a run
Parameters: - id : integer
The ID of the custom script.
- run_id : integer
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.
- iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: - object_type : string
The type of the output. Valid values are File, Table, Report, Project, or Credential
- object_id : integer
The ID of the output object.
- name : string
The name of the output object.
- link : string
The link to retrieve the output object.
List users and groups permissioned on this object
Parameters: - id : integer
The ID of the object.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
-
list_history
(id)¶ Get the run history and outputs of this script
Parameters: - id : integer
The ID for the script.
Returns: - id : integer
The ID of this run.
- sql_id : integer
The ID of this sql.
- state : string
The state of this run.
- is_cancel_requested : boolean
True if run cancel requested, else false.
- finished_at : string/time
The time that this run finished.
- error : string
The error message for this run, if present.
- output : list::
A list of the outputs of this script. - output_name : string
The name of the output file.
- file_id : integer
- The unique ID of the output file.
- path : string
- The temporary link to download this output file, valid for 36 hours.
-
list_javascript_projects
(id, *, hidden='DEFAULT')¶ List the projects a scripted sql belongs to
Parameters: - id : integer
The ID of the resource.
- hidden : boolean, optional
If specified to be true, returns hidden objects. Defaults to false, returning non-hidden objects.
Returns: - id : integer
The ID for this project.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- name : string
The name of this project.
- description : string
A description of the project
- users : list::
Users who can see the project - id : integer
The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- auto_share : boolean
- created_at : string/time
- updated_at : string/time
- archived : string
The archival status of the requested object(s).
-
list_javascript_runs
(id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶ List runs for the given javascript
Parameters: - id : integer
The ID of the javascript.
- limit : integer, optional
Number of results to return. Defaults to 20. Maximum allowed is 100.
- page_num : integer, optional
Page number of the results to return. Defaults to the first page, 1.
- order : string, optional
The field on which to order the result set. Defaults to id. Must be one of: id.
- order_dir : string, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: - id : integer
The ID of the run.
- javascript_id : integer
The ID of the javascript.
- state : string
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- is_cancel_requested : boolean
True if run cancel requested, else false.
- started_at : string/time
The time the last run started at.
- finished_at : string/time
The time the last run completed.
- error : string
The error, if any, returned by the run.
-
list_javascript_runs_logs
(id, run_id, *, last_id='DEFAULT', limit='DEFAULT')¶ Get the logs for a run
Parameters: - id : integer
The ID of the javascript.
- run_id : integer
The ID of the run.
- last_id : integer, optional
The ID of the last log message received. Log entries with this ID value or lower will be omitted.Logs are sorted by ID if this value is provided, and are otherwise sorted by createdAt.
- limit : integer, optional
The maximum number of log messages to return. Default of 10000.
Returns: - id : integer
The ID of the log.
- created_at : string/date-time
The time the log was created.
- message : string
The log message.
- level : string
The level of the log. One of unknown,fatal,error,warn,info,debug.
-
list_javascript_runs_outputs
(id, run_id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶ List the outputs for a run
Parameters: - id : integer
The ID of the javascript script.
- run_id : integer
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.
- iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: - object_type : string
The type of the output. Valid values are File, Table, Report, Project, or Credential
- object_id : integer
The ID of the output object.
- name : string
The name of the output object.
- link : string
The link to retrieve the output object.
List users and groups permissioned on this object
Parameters: - id : integer
The ID of the object.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
-
list_python3_projects
(id, *, hidden='DEFAULT')¶ List the projects a python docker belongs to
Parameters: - id : integer
The ID of the resource.
- hidden : boolean, optional
If specified to be true, returns hidden objects. Defaults to false, returning non-hidden objects.
Returns: - id : integer
The ID for this project.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- name : string
The name of this project.
- description : string
A description of the project
- users : list::
Users who can see the project - id : integer
The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- auto_share : boolean
- created_at : string/time
- updated_at : string/time
- archived : string
The archival status of the requested object(s).
-
list_python3_runs
(id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶ List runs for the given python
Parameters: - id : integer
The ID of the python.
- limit : integer, optional
Number of results to return. Defaults to 20. Maximum allowed is 100.
- page_num : integer, optional
Page number of the results to return. Defaults to the first page, 1.
- order : string, optional
The field on which to order the result set. Defaults to id. Must be one of: id.
- order_dir : string, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: - id : integer
The ID of the run.
- python_id : integer
The ID of the python.
- state : string
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- is_cancel_requested : boolean
True if run cancel requested, else false.
- started_at : string/time
The time the last run started at.
- finished_at : string/time
The time the last run completed.
- error : string
The error, if any, returned by the run.
-
list_python3_runs_logs
(id, run_id, *, last_id='DEFAULT', limit='DEFAULT')¶ Get the logs for a run
Parameters: - id : integer
The ID of the python.
- run_id : integer
The ID of the run.
- last_id : integer, optional
The ID of the last log message received. Log entries with this ID value or lower will be omitted.Logs are sorted by ID if this value is provided, and are otherwise sorted by createdAt.
- limit : integer, optional
The maximum number of log messages to return. Default of 10000.
Returns: - id : integer
The ID of the log.
- created_at : string/date-time
The time the log was created.
- message : string
The log message.
- level : string
The level of the log. One of unknown,fatal,error,warn,info,debug.
-
list_python3_runs_outputs
(id, run_id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶ List the outputs for a run
Parameters: - id : integer
The ID of the python script.
- run_id : integer
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.
- iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: - object_type : string
The type of the output. Valid values are File, Table, Report, Project, or Credential
- object_id : integer
The ID of the output object.
- name : string
The name of the output object.
- link : string
The link to retrieve the output object.
List users and groups permissioned on this object
Parameters: - id : integer
The ID of the object.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
-
list_r_projects
(id, *, hidden='DEFAULT')¶ List the projects a r docker belongs to
Parameters: - id : integer
The ID of the resource.
- hidden : boolean, optional
If specified to be true, returns hidden objects. Defaults to false, returning non-hidden objects.
Returns: - id : integer
The ID for this project.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- name : string
The name of this project.
- description : string
A description of the project
- users : list::
Users who can see the project - id : integer
The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- auto_share : boolean
- created_at : string/time
- updated_at : string/time
- archived : string
The archival status of the requested object(s).
-
list_r_runs
(id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶ List runs for the given r
Parameters: - id : integer
The ID of the r.
- limit : integer, optional
Number of results to return. Defaults to 20. Maximum allowed is 100.
- page_num : integer, optional
Page number of the results to return. Defaults to the first page, 1.
- order : string, optional
The field on which to order the result set. Defaults to id. Must be one of: id.
- order_dir : string, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: - id : integer
The ID of the run.
- r_id : integer
The ID of the r.
- state : string
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- is_cancel_requested : boolean
True if run cancel requested, else false.
- started_at : string/time
The time the last run started at.
- finished_at : string/time
The time the last run completed.
- error : string
The error, if any, returned by the run.
-
list_r_runs_logs
(id, run_id, *, last_id='DEFAULT', limit='DEFAULT')¶ Get the logs for a run
Parameters: - id : integer
The ID of the r.
- run_id : integer
The ID of the run.
- last_id : integer, optional
The ID of the last log message received. Log entries with this ID value or lower will be omitted.Logs are sorted by ID if this value is provided, and are otherwise sorted by createdAt.
- limit : integer, optional
The maximum number of log messages to return. Default of 10000.
Returns: - id : integer
The ID of the log.
- created_at : string/date-time
The time the log was created.
- message : string
The log message.
- level : string
The level of the log. One of unknown,fatal,error,warn,info,debug.
-
list_r_runs_outputs
(id, run_id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶ List the outputs for a run
Parameters: - id : integer
The ID of the r script.
- run_id : integer
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.
- iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: - object_type : string
The type of the output. Valid values are File, Table, Report, Project, or Credential
- object_id : integer
The ID of the output object.
- name : string
The name of the output object.
- link : string
The link to retrieve the output object.
List users and groups permissioned on this object
Parameters: - id : integer
The ID of the object.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
-
list_sql_projects
(id, *, hidden='DEFAULT')¶ List the projects a scripts belongs to
Parameters: - id : integer
The ID of the resource.
- hidden : boolean, optional
If specified to be true, returns hidden objects. Defaults to false, returning non-hidden objects.
Returns: - id : integer
The ID for this project.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- name : string
The name of this project.
- description : string
A description of the project
- users : list::
Users who can see the project - id : integer
The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- auto_share : boolean
- created_at : string/time
- updated_at : string/time
- archived : string
The archival status of the requested object(s).
-
list_sql_runs
(id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶ List runs for the given sql
Parameters: - id : integer
The ID of the sql.
- limit : integer, optional
Number of results to return. Defaults to 20. Maximum allowed is 100.
- page_num : integer, optional
Page number of the results to return. Defaults to the first page, 1.
- order : string, optional
The field on which to order the result set. Defaults to id. Must be one of: id.
- order_dir : string, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: - id : integer
The ID of this run.
- sql_id : integer
The ID of this sql.
- state : string
The state of this run.
- is_cancel_requested : boolean
True if run cancel requested, else false.
- started_at : string/time
The time the last run started.
- finished_at : string/time
The time that this run finished.
- error : string
The error message for this run, if present.
- output : list::
A list of the outputs of this script. - output_name : string
The name of the output file.
- file_id : integer
- The unique ID of the output file.
- path : string
- The temporary link to download this output file, valid for 36 hours.
-
list_sql_runs_logs
(id, run_id, *, last_id='DEFAULT', limit='DEFAULT')¶ Get the logs for a run
Parameters: - id : integer
The ID of the sql.
- run_id : integer
The ID of the run.
- last_id : integer, optional
The ID of the last log message received. Log entries with this ID value or lower will be omitted.Logs are sorted by ID if this value is provided, and are otherwise sorted by createdAt.
- limit : integer, optional
The maximum number of log messages to return. Default of 10000.
Returns: - id : integer
The ID of the log.
- created_at : string/date-time
The time the log was created.
- message : string
The log message.
- level : string
The level of the log. One of unknown,fatal,error,warn,info,debug.
-
list_sql_runs_outputs
(id, run_id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶ List the outputs for a run
Parameters: - id : integer
The ID of the sql script.
- run_id : integer
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.
- iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: - object_type : string
The type of the output. Valid values are File, Table, Report, Project, or Credential
- object_id : integer
The ID of the output object.
- name : string
The name of the output object.
- link : string
The link to retrieve the output object.
List users and groups permissioned on this object
Parameters: - id : integer
The ID of the object.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
-
list_types
()¶ List available script types
Returns: - name : string
The name of the type.
-
patch
(id, *, name='DEFAULT', sql='DEFAULT', params='DEFAULT', arguments='DEFAULT', template_script_id='DEFAULT', schedule='DEFAULT', notifications='DEFAULT', parent_id='DEFAULT')¶ Update a script
Parameters: - id : integer
The ID for the script.
- name : string, optional
The name of the script.
- sql : string, optional
The raw SQL query for the script.
- params : list, optional::
A definition of the parameters this script accepts in the arguments field. Cannot be set if this script uses a template script. - name : string
The variable’s name as used within your code.
- label : string
- The label to present to users when asking them for the value.
- description : string
- A short sentence or fragment describing this parameter to the end user.
- type : string
- The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, database, credential_aws, credential_redshift, or credential_custom
- required : boolean
- Whether this param is required.
- value : string
- The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- default : string
- If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- arguments : dict, optional
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
- 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 : dict, optional::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- notifications : dict, optional::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- parent_id : integer, optional
The ID of the parent job that will trigger this script
Returns: - id : integer
The ID for the script.
- name : string
The name of the script.
- type : string
The type of script.
- created_at : string/time
The time this script was created.
- updated_at : string/time
The time this script was last updated.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- state : string
The status of the script’s last run.
- finished_at : string/time
The time that the script’s last run finished.
- category : string
The category of the script.
- projects : list::
A list of projects containing the script. - id : integer
The ID for the project.
- name : string
- The name of the project.
- parent_id : integer
The ID of the parent job that will trigger this script
- user_context : string
“runner” or “author”, who to execute the script as when run as a template.
- params : list::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- label : string
- The label to present to users when asking them for the value.
- description : string
- A short sentence or fragment describing this parameter to the end user.
- type : string
- The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, database, credential_aws, credential_redshift, or credential_custom
- required : boolean
- Whether this param is required.
- value : string
- The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- default : string
- If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
- is_template : boolean
Whether others scripts use this one as a template.
- published_as_template_id : integer
The ID of the template that this script is backing.
- from_template_id : integer
The ID of the template this script uses, if any.
- template_dependents_count : integer
How many other scripts use this one as a template.
- template_script_name : string
The name of the template script.
- links : dict::
- details : string
- The details link to get more information about the script.
- runs : string
- The runs link to get the run information list for this script.
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- notifications : dict::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- running_as : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- next_run_at : string/time
The time of the next scheduled run.
- time_zone : string
The time zone of this script.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- hidden : boolean
The hidden status of the object.
- target_project_id : integer
Target project to which script outputs will be added.
- archived : string
The archival status of the requested object(s).
- sql : string
The raw SQL query for the script.
- expanded_arguments : dict
Expanded arguments for use in injecting into different environments.
- template_script_id : integer
The ID of the template script, if any.
-
patch_containers
(id, *, name='DEFAULT', parent_id='DEFAULT', user_context='DEFAULT', params='DEFAULT', arguments='DEFAULT', schedule='DEFAULT', notifications='DEFAULT', required_resources='DEFAULT', repo_http_uri='DEFAULT', repo_ref='DEFAULT', remote_host_credential_id='DEFAULT', git_credential_id='DEFAULT', docker_command='DEFAULT', docker_image_name='DEFAULT', docker_image_tag='DEFAULT', cancel_timeout='DEFAULT', time_zone='DEFAULT', target_project_id='DEFAULT')¶ Update a container
Parameters: - id : integer
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 : list, optional::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- label : string
- The label to present to users when asking them for the value.
- description : string
- A short sentence or fragment describing this parameter to the end user.
- type : string
- The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, database, credential_aws, credential_redshift, or credential_custom
- required : boolean
- Whether this param is required.
- value : string
- The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- default : string
- If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- arguments : dict, optional
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
- schedule : dict, optional::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- notifications : dict, optional::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- required_resources : dict, optional::
- cpu : integer
- The number of CPU shares to allocate for the container. Each core has 1024 shares.
- memory : integer
- The amount of RAM to allocate for the container (in MiB).
- disk_space : number/float
- The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.
- 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]
- 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).
- 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.
Returns: - id : integer
The ID for the script.
- name : string
The name of the container.
- type : string
The type of the script (e.g Container)
- created_at : string/time
The time this script was created.
- updated_at : string/time
The time the script was last updated.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- state : string
The status of the script’s last run.
- finished_at : string/time
The time that the script’s last run finished.
- category : string
The category of the script.
- projects : list::
A list of projects containing the script. - id : integer
The ID for the project.
- name : string
- The name of the project.
- parent_id : integer
The ID of the parent job that will trigger this script
- user_context : string
“runner” or “author”, who to execute the script as when run as a template.
- params : list::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- label : string
- The label to present to users when asking them for the value.
- description : string
- A short sentence or fragment describing this parameter to the end user.
- type : string
- The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, database, credential_aws, credential_redshift, or credential_custom
- required : boolean
- Whether this param is required.
- value : string
- The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- default : string
- If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
- is_template : boolean
Whether others scripts use this one as a template.
- template_dependents_count : integer
How many other scripts use this one as a template.
- published_as_template_id : integer
The ID of the template that this script is backing.
- from_template_id : integer
The ID of the template script.
- template_script_name : string
The name of the template script.
- links : dict::
- details : string
- The details link to get more information about the script.
- runs : string
- The runs link to get the run information list for this script.
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- notifications : dict::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- running_as : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- required_resources : dict::
- cpu : integer
- The number of CPU shares to allocate for the container. Each core has 1024 shares.
- memory : integer
- The amount of RAM to allocate for the container (in MiB).
- disk_space : number/float
- The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.
- repo_http_uri : string
The location of a github repo to clone into the container, e.g. github.com/my-user/my-repo.git.
- repo_ref : string
The tag or branch of the github repo to clone into the container.
- remote_host_credential_id : integer
The id of the database credentials to pass into the environment of the container.
- git_credential_id : integer
The id of the git credential to be used when checking out the specified git repo. If not supplied, the first git credential you’ve submitted will be used. Unnecessary if no git repo is specified or the git repo is public.
- docker_command : string
The command to run on the container. Will be run via sh as: [“sh”, “-c”, dockerCommand]
- docker_image_name : string
The name of the docker image to pull from DockerHub.
- docker_image_tag : string
The tag of the docker image to pull from DockerHub (default: latest).
- cancel_timeout : 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.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- time_zone : string
The time zone of this script.
- hidden : boolean
The hidden status of the object.
- archived : string
The archival status of the requested object(s).
- target_project_id : integer
Target project to which script outputs will be added.
-
patch_custom
(id, *, name='DEFAULT', parent_id='DEFAULT', arguments='DEFAULT', remote_host_id='DEFAULT', credential_id='DEFAULT', schedule='DEFAULT', notifications='DEFAULT', time_zone='DEFAULT', target_project_id='DEFAULT')¶ Update some attributes of this Custom Script
Parameters: - id : integer
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 : dict, optional
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
- 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 : dict, optional::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- notifications : dict, optional::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- time_zone : string, optional
The time zone of this script.
- target_project_id : integer, optional
Target project to which script outputs will be added.
Returns: - id : integer
The ID for the script.
- name : string
The name of the script.
- type : string
The type of the script (e.g Custom)
- created_at : string/time
The time this script was created.
- updated_at : string/time
The time the script was last updated.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- state : string
The status of the script’s last run.
- finished_at : string/time
The time that the script’s last run finished.
- category : string
- projects : list::
A list of projects containing the script. - id : integer
The ID for the project.
- name : string
- The name of the project.
- parent_id : integer
The ID of the parent job that will trigger this script
- params : list::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- label : string
- The label to present to users when asking them for the value.
- description : string
- A short sentence or fragment describing this parameter to the end user.
- type : string
- The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, database, credential_aws, credential_redshift, or credential_custom
- required : boolean
- Whether this param is required.
- value : string
- The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- default : string
- If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
- from_template_id : integer
The ID of the template script.
- ui_report_url : integer
The url of the custom HTML.
- template_script_name : string
The name of the template script.
- template_note : string
The template’s note.
- remote_host_id : integer
The remote host ID that this script will connect to.
- credential_id : integer
The credential that this script will use.
- code_preview : string
The code that this script will run with arguments inserted.
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- notifications : dict::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- running_as : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- time_zone : string
The time zone of this script.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- hidden : boolean
The hidden status of the object.
- archived : string
The archival status of the requested object(s).
- target_project_id : integer
Target project to which script outputs will be added.
-
patch_javascript
(id, *, name='DEFAULT', parent_id='DEFAULT', user_context='DEFAULT', params='DEFAULT', arguments='DEFAULT', schedule='DEFAULT', notifications='DEFAULT', next_run_at='DEFAULT', time_zone='DEFAULT', target_project_id='DEFAULT', source='DEFAULT', remote_host_id='DEFAULT', credential_id='DEFAULT')¶ Update some attributes of this JavaScript Script
Parameters: - id : integer
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 : list, optional::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- label : string
- The label to present to users when asking them for the value.
- description : string
- A short sentence or fragment describing this parameter to the end user.
- type : string
- The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, database, credential_aws, credential_redshift, or credential_custom
- required : boolean
- Whether this param is required.
- value : string
- The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- default : string
- If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- arguments : dict, optional
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
- schedule : dict, optional::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- notifications : dict, optional::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- next_run_at : string/time, 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.
Returns: - 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)
- created_at : string/time
The time this script was created.
- updated_at : string/time
The time the script was last updated.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- state : string
The status of the script’s last run.
- finished_at : string/time
The time that the script’s last run finished.
- category : string
The category of the script.
- projects : list::
A list of projects containing the script. - id : integer
The ID for the project.
- name : string
- The name of the project.
- parent_id : integer
The ID of the parent job that will trigger this script
- user_context : string
“runner” or “author”, who to execute the script as when run as a template.
- params : list::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- label : string
- The label to present to users when asking them for the value.
- description : string
- A short sentence or fragment describing this parameter to the end user.
- type : string
- The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, database, credential_aws, credential_redshift, or credential_custom
- required : boolean
- Whether this param is required.
- value : string
- The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- default : string
- If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
- is_template : boolean
Whether others scripts use this one as a template.
- published_as_template_id : integer
The ID of the template that this script is backing.
- from_template_id : integer
The ID of the template this script uses, if any.
- template_dependents_count : integer
How many other scripts use this one as a template.
- template_script_name : string
The name of the template script.
- links : dict::
- details : string
- The details link to get more information about the script.
- runs : string
- The runs link to get the run information list for this script.
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- notifications : dict::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- running_as : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- next_run_at : string/time
The time of the next scheduled run.
- time_zone : string
The time zone of this script.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- hidden : boolean
The hidden status of the object.
- target_project_id : integer
Target project to which script outputs will be added.
- archived : string
The archival status of the requested object(s).
- source : string
The body/text of the script.
- remote_host_id : integer
The remote host ID that this script will connect to.
- credential_id : integer
The credential that this script will use.
-
patch_python3
(id, *, name='DEFAULT', parent_id='DEFAULT', user_context='DEFAULT', params='DEFAULT', arguments='DEFAULT', schedule='DEFAULT', notifications='DEFAULT', next_run_at='DEFAULT', time_zone='DEFAULT', target_project_id='DEFAULT', required_resources='DEFAULT', source='DEFAULT', cancel_timeout='DEFAULT')¶ Update some attributes of this Python Script
Parameters: - id : integer
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 : list, optional::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- label : string
- The label to present to users when asking them for the value.
- description : string
- A short sentence or fragment describing this parameter to the end user.
- type : string
- The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, database, credential_aws, credential_redshift, or credential_custom
- required : boolean
- Whether this param is required.
- value : string
- The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- default : string
- If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- arguments : dict, optional
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
- schedule : dict, optional::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- notifications : dict, optional::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- next_run_at : string/time, 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 : dict, optional::
- cpu : integer
- The number of CPU shares to allocate for the container. Each core has 1024 shares. Must be at least 2 shares.
- memory : integer
- The amount of RAM to allocate for the container (in MiB). Must be at least 4 MiB.
- disk_space : number/float
- The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.
- 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.
Returns: - 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)
- created_at : string/time
The time this script was created.
- updated_at : string/time
The time the script was last updated.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- state : string
The status of the script’s last run.
- finished_at : string/time
The time that the script’s last run finished.
- category : string
The category of the script.
- projects : list::
A list of projects containing the script. - id : integer
The ID for the project.
- name : string
- The name of the project.
- parent_id : integer
The ID of the parent job that will trigger this script
- user_context : string
“runner” or “author”, who to execute the script as when run as a template.
- params : list::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- label : string
- The label to present to users when asking them for the value.
- description : string
- A short sentence or fragment describing this parameter to the end user.
- type : string
- The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, database, credential_aws, credential_redshift, or credential_custom
- required : boolean
- Whether this param is required.
- value : string
- The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- default : string
- If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
- is_template : boolean
Whether others scripts use this one as a template.
- published_as_template_id : integer
The ID of the template that this script is backing.
- from_template_id : integer
The ID of the template this script uses, if any.
- template_dependents_count : integer
How many other scripts use this one as a template.
- template_script_name : string
The name of the template script.
- links : dict::
- details : string
- The details link to get more information about the script.
- runs : string
- The runs link to get the run information list for this script.
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- notifications : dict::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- running_as : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- next_run_at : string/time
The time of the next scheduled run.
- time_zone : string
The time zone of this script.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- hidden : boolean
The hidden status of the object.
- target_project_id : integer
Target project to which script outputs will be added.
- archived : string
The archival status of the requested object(s).
- required_resources : dict::
- cpu : integer
- The number of CPU shares to allocate for the container. Each core has 1024 shares. Must be at least 2 shares.
- memory : integer
- The amount of RAM to allocate for the container (in MiB). Must be at least 4 MiB.
- disk_space : number/float
- The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.
- source : string
The body/text of the script.
- cancel_timeout : 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.
-
patch_r
(id, *, name='DEFAULT', parent_id='DEFAULT', user_context='DEFAULT', params='DEFAULT', arguments='DEFAULT', schedule='DEFAULT', notifications='DEFAULT', next_run_at='DEFAULT', time_zone='DEFAULT', target_project_id='DEFAULT', required_resources='DEFAULT', source='DEFAULT', cancel_timeout='DEFAULT')¶ Update some attributes of this R Script
Parameters: - id : integer
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 : list, optional::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- label : string
- The label to present to users when asking them for the value.
- description : string
- A short sentence or fragment describing this parameter to the end user.
- type : string
- The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, database, credential_aws, credential_redshift, or credential_custom
- required : boolean
- Whether this param is required.
- value : string
- The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- default : string
- If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- arguments : dict, optional
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
- schedule : dict, optional::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- notifications : dict, optional::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- next_run_at : string/time, 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 : dict, optional::
- cpu : integer
- The number of CPU shares to allocate for the container. Each core has 1024 shares. Must be at least 2 shares.
- memory : integer
- The amount of RAM to allocate for the container (in MiB). Must be at least 4 MiB.
- disk_space : number/float
- The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.
- 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.
Returns: - 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)
- created_at : string/time
The time this script was created.
- updated_at : string/time
The time the script was last updated.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- state : string
The status of the script’s last run.
- finished_at : string/time
The time that the script’s last run finished.
- category : string
The category of the script.
- projects : list::
A list of projects containing the script. - id : integer
The ID for the project.
- name : string
- The name of the project.
- parent_id : integer
The ID of the parent job that will trigger this script
- user_context : string
“runner” or “author”, who to execute the script as when run as a template.
- params : list::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- label : string
- The label to present to users when asking them for the value.
- description : string
- A short sentence or fragment describing this parameter to the end user.
- type : string
- The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, database, credential_aws, credential_redshift, or credential_custom
- required : boolean
- Whether this param is required.
- value : string
- The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- default : string
- If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
- is_template : boolean
Whether others scripts use this one as a template.
- published_as_template_id : integer
The ID of the template that this script is backing.
- from_template_id : integer
The ID of the template this script uses, if any.
- template_dependents_count : integer
How many other scripts use this one as a template.
- template_script_name : string
The name of the template script.
- links : dict::
- details : string
- The details link to get more information about the script.
- runs : string
- The runs link to get the run information list for this script.
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- notifications : dict::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- running_as : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- next_run_at : string/time
The time of the next scheduled run.
- time_zone : string
The time zone of this script.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- hidden : boolean
The hidden status of the object.
- target_project_id : integer
Target project to which script outputs will be added.
- archived : string
The archival status of the requested object(s).
- required_resources : dict::
- cpu : integer
- The number of CPU shares to allocate for the container. Each core has 1024 shares. Must be at least 2 shares.
- memory : integer
- The amount of RAM to allocate for the container (in MiB). Must be at least 4 MiB.
- disk_space : number/float
- The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.
- source : string
The body/text of the script.
- cancel_timeout : 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.
-
patch_sql
(id, *, name='DEFAULT', parent_id='DEFAULT', user_context='DEFAULT', params='DEFAULT', arguments='DEFAULT', schedule='DEFAULT', notifications='DEFAULT', next_run_at='DEFAULT', time_zone='DEFAULT', target_project_id='DEFAULT', sql='DEFAULT', remote_host_id='DEFAULT', credential_id='DEFAULT', csv_settings='DEFAULT')¶ Update some attributes of this SQL script
Parameters: - id : integer
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 : list, optional::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- label : string
- The label to present to users when asking them for the value.
- description : string
- A short sentence or fragment describing this parameter to the end user.
- type : string
- The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, database, credential_aws, credential_redshift, or credential_custom
- required : boolean
- Whether this param is required.
- value : string
- The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- default : string
- If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- arguments : dict, optional
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
- schedule : dict, optional::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- notifications : dict, optional::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- next_run_at : string/time, 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 : dict, optional::
- include_header : boolean
- Whether or not to include headers in the output data. Default: true
- compression : string
- The type of compression to use, if any, one of “none”, “zip”, or “gzip”. Default: gzip
- column_delimiter : string
- Which delimiter to use, one of “comma”, “tab”, or “pipe”. Default: comma
- unquoted : boolean
- Whether or not to quote fields. Default: false
- force_multifile : boolean
- Whether or not the csv should be split into multiple files. Default: false
- filename_prefix : string
- A user specified filename prefix for the output file to have. Default: null
Returns: - 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)
- created_at : string/time
The time this script was created.
- updated_at : string/time
The time the script was last updated.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- state : string
The status of the script’s last run.
- finished_at : string/time
The time that the script’s last run finished.
- category : string
The category of the script.
- projects : list::
A list of projects containing the script. - id : integer
The ID for the project.
- name : string
- The name of the project.
- parent_id : integer
The ID of the parent job that will trigger this script
- user_context : string
“runner” or “author”, who to execute the script as when run as a template.
- params : list::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- label : string
- The label to present to users when asking them for the value.
- description : string
- A short sentence or fragment describing this parameter to the end user.
- type : string
- The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, database, credential_aws, credential_redshift, or credential_custom
- required : boolean
- Whether this param is required.
- value : string
- The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- default : string
- If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
- is_template : boolean
Whether others scripts use this one as a template.
- published_as_template_id : integer
The ID of the template that this script is backing.
- from_template_id : integer
The ID of the template this script uses, if any.
- template_dependents_count : integer
How many other scripts use this one as a template.
- template_script_name : string
The name of the template script.
- links : dict::
- details : string
- The details link to get more information about the script.
- runs : string
- The runs link to get the run information list for this script.
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- notifications : dict::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- running_as : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- next_run_at : string/time
The time of the next scheduled run.
- time_zone : string
The time zone of this script.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- hidden : boolean
The hidden status of the object.
- target_project_id : integer
Target project to which script outputs will be added.
- archived : string
The archival status of the requested object(s).
- sql : string
The raw SQL query for the script.
- expanded_arguments : dict
Expanded arguments for use in injecting into different environments.
- remote_host_id : integer
The remote host ID that this script will connect to.
- credential_id : integer
The credential that this script will use.
- code_preview : string
The code that this script will run with arguments inserted.
- csv_settings : dict::
- include_header : boolean
- Whether or not to include headers in the output data. Default: true
- compression : string
- The type of compression to use, if any, one of “none”, “zip”, or “gzip”. Default: gzip
- column_delimiter : string
- Which delimiter to use, one of “comma”, “tab”, or “pipe”. Default: comma
- unquoted : boolean
- Whether or not to quote fields. Default: false
- force_multifile : boolean
- Whether or not the csv should be split into multiple files. Default: false
- filename_prefix : string
- A user specified filename prefix for the output file to have. Default: null
-
post
(name, remote_host_id, credential_id, sql, *, params='DEFAULT', arguments='DEFAULT', template_script_id='DEFAULT', notifications='DEFAULT', hidden='DEFAULT')¶ Create a script
Parameters: - name : string
The name of the script.
- remote_host_id : integer
The database ID.
- credential_id : integer
The credential ID.
- sql : string
The raw SQL query for the script.
- params : list, optional::
A definition of the parameters this script accepts in the arguments field. Cannot be set if this script uses a template script. - name : string
The variable’s name as used within your code.
- label : string
- The label to present to users when asking them for the value.
- description : string
- A short sentence or fragment describing this parameter to the end user.
- type : string
- The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, database, credential_aws, credential_redshift, or credential_custom
- required : boolean
- Whether this param is required.
- value : string
- The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- default : string
- If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- arguments : dict, optional
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
- template_script_id : integer, optional
The ID of the template script, if any. A script cannot both have a template script and be a template for other scripts.
- notifications : dict, optional::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- hidden : boolean, optional
The hidden status of the object.
Returns: - 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)
- created_at : string/time
The time this script was created.
- updated_at : string/time
The time the script was last updated.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- state : string
The status of the script’s last run.
- finished_at : string/time
The time that the script’s last run finished.
- category : string
The category of the script.
- projects : list::
A list of projects containing the script. - id : integer
The ID for the project.
- name : string
- The name of the project.
- parent_id : integer
The ID of the parent job that will trigger this script
- user_context : string
“runner” or “author”, who to execute the script as when run as a template.
- params : list::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- label : string
- The label to present to users when asking them for the value.
- description : string
- A short sentence or fragment describing this parameter to the end user.
- type : string
- The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, database, credential_aws, credential_redshift, or credential_custom
- required : boolean
- Whether this param is required.
- value : string
- The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- default : string
- If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
- is_template : boolean
Whether others scripts use this one as a template.
- published_as_template_id : integer
The ID of the template that this script is backing.
- from_template_id : integer
The ID of the template this script uses, if any.
- template_dependents_count : integer
How many other scripts use this one as a template.
- template_script_name : string
The name of the template script.
- links : dict::
- details : string
- The details link to get more information about the script.
- runs : string
- The runs link to get the run information list for this script.
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- notifications : dict::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- running_as : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- next_run_at : string/time
The time of the next scheduled run.
- time_zone : string
The time zone of this script.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- hidden : boolean
The hidden status of the object.
- target_project_id : integer
Target project to which script outputs will be added.
- archived : string
The archival status of the requested object(s).
- template_script_id : integer
The ID of the template script, if any.
-
post_cancel
(id)¶ Cancel a run
Parameters: - id : integer
The ID of the job.
Returns: - id : integer
The ID of the run.
- state : string
The state of the run, one of ‘queued’, ‘running’ or ‘cancelled’.
- is_cancel_requested : boolean
True if run cancel requested, else false.
-
post_containers
(required_resources, docker_command, docker_image_name, *, name='DEFAULT', parent_id='DEFAULT', user_context='DEFAULT', params='DEFAULT', arguments='DEFAULT', schedule='DEFAULT', notifications='DEFAULT', repo_http_uri='DEFAULT', repo_ref='DEFAULT', remote_host_credential_id='DEFAULT', git_credential_id='DEFAULT', docker_image_tag='DEFAULT', cancel_timeout='DEFAULT', time_zone='DEFAULT', hidden='DEFAULT', target_project_id='DEFAULT')¶ Create a container
Parameters: - required_resources : dict::
- cpu : integer
- The number of CPU shares to allocate for the container. Each core has 1024 shares.
- memory : integer
- The amount of RAM to allocate for the container (in MiB).
- disk_space : number/float
- The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.
- docker_command : string
The command to run on the container. Will be run via sh as: [“sh”, “-c”, dockerCommand]
- docker_image_name : string
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 : list, optional::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- label : string
- The label to present to users when asking them for the value.
- description : string
- A short sentence or fragment describing this parameter to the end user.
- type : string
- The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, database, credential_aws, credential_redshift, or credential_custom
- required : boolean
- Whether this param is required.
- value : string
- The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- default : string
- If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- arguments : dict, optional
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
- schedule : dict, optional::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- notifications : dict, optional::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- 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_image_tag : string, optional
The tag of the docker image to pull from DockerHub (default: latest).
- 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.
- hidden : boolean, optional
The hidden status of the object.
- target_project_id : integer, optional
Target project to which script outputs will be added.
Returns: - id : integer
The ID for the script.
- name : string
The name of the container.
- type : string
The type of the script (e.g Container)
- created_at : string/time
The time this script was created.
- updated_at : string/time
The time the script was last updated.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- state : string
The status of the script’s last run.
- finished_at : string/time
The time that the script’s last run finished.
- category : string
The category of the script.
- projects : list::
A list of projects containing the script. - id : integer
The ID for the project.
- name : string
- The name of the project.
- parent_id : integer
The ID of the parent job that will trigger this script
- user_context : string
“runner” or “author”, who to execute the script as when run as a template.
- params : list::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- label : string
- The label to present to users when asking them for the value.
- description : string
- A short sentence or fragment describing this parameter to the end user.
- type : string
- The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, database, credential_aws, credential_redshift, or credential_custom
- required : boolean
- Whether this param is required.
- value : string
- The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- default : string
- If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
- is_template : boolean
Whether others scripts use this one as a template.
- template_dependents_count : integer
How many other scripts use this one as a template.
- published_as_template_id : integer
The ID of the template that this script is backing.
- from_template_id : integer
The ID of the template script.
- template_script_name : string
The name of the template script.
- links : dict::
- details : string
- The details link to get more information about the script.
- runs : string
- The runs link to get the run information list for this script.
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- notifications : dict::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- running_as : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- required_resources : dict::
- cpu : integer
- The number of CPU shares to allocate for the container. Each core has 1024 shares.
- memory : integer
- The amount of RAM to allocate for the container (in MiB).
- disk_space : number/float
- The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.
- repo_http_uri : string
The location of a github repo to clone into the container, e.g. github.com/my-user/my-repo.git.
- repo_ref : string
The tag or branch of the github repo to clone into the container.
- remote_host_credential_id : integer
The id of the database credentials to pass into the environment of the container.
- git_credential_id : integer
The id of the git credential to be used when checking out the specified git repo. If not supplied, the first git credential you’ve submitted will be used. Unnecessary if no git repo is specified or the git repo is public.
- docker_command : string
The command to run on the container. Will be run via sh as: [“sh”, “-c”, dockerCommand]
- docker_image_name : string
The name of the docker image to pull from DockerHub.
- docker_image_tag : string
The tag of the docker image to pull from DockerHub (default: latest).
- cancel_timeout : 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.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- time_zone : string
The time zone of this script.
- hidden : boolean
The hidden status of the object.
- archived : string
The archival status of the requested object(s).
- target_project_id : integer
Target project to which script outputs will be added.
-
post_containers_clone
(id, *, clone_schedule='DEFAULT', clone_triggers='DEFAULT', clone_notifications='DEFAULT')¶ Clone this Container Script
Parameters: - id : integer
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.
Returns: - id : integer
The ID for the script.
- name : string
The name of the container.
- type : string
The type of the script (e.g Container)
- created_at : string/time
The time this script was created.
- updated_at : string/time
The time the script was last updated.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- state : string
The status of the script’s last run.
- finished_at : string/time
The time that the script’s last run finished.
- category : string
The category of the script.
- projects : list::
A list of projects containing the script. - id : integer
The ID for the project.
- name : string
- The name of the project.
- parent_id : integer
The ID of the parent job that will trigger this script
- user_context : string
“runner” or “author”, who to execute the script as when run as a template.
- params : list::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- label : string
- The label to present to users when asking them for the value.
- description : string
- A short sentence or fragment describing this parameter to the end user.
- type : string
- The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, database, credential_aws, credential_redshift, or credential_custom
- required : boolean
- Whether this param is required.
- value : string
- The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- default : string
- If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
- is_template : boolean
Whether others scripts use this one as a template.
- template_dependents_count : integer
How many other scripts use this one as a template.
- published_as_template_id : integer
The ID of the template that this script is backing.
- from_template_id : integer
The ID of the template script.
- template_script_name : string
The name of the template script.
- links : dict::
- details : string
- The details link to get more information about the script.
- runs : string
- The runs link to get the run information list for this script.
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- notifications : dict::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- running_as : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- required_resources : dict::
- cpu : integer
- The number of CPU shares to allocate for the container. Each core has 1024 shares.
- memory : integer
- The amount of RAM to allocate for the container (in MiB).
- disk_space : number/float
- The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.
- repo_http_uri : string
The location of a github repo to clone into the container, e.g. github.com/my-user/my-repo.git.
- repo_ref : string
The tag or branch of the github repo to clone into the container.
- remote_host_credential_id : integer
The id of the database credentials to pass into the environment of the container.
- git_credential_id : integer
The id of the git credential to be used when checking out the specified git repo. If not supplied, the first git credential you’ve submitted will be used. Unnecessary if no git repo is specified or the git repo is public.
- docker_command : string
The command to run on the container. Will be run via sh as: [“sh”, “-c”, dockerCommand]
- docker_image_name : string
The name of the docker image to pull from DockerHub.
- docker_image_tag : string
The tag of the docker image to pull from DockerHub (default: latest).
- cancel_timeout : 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.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- time_zone : string
The time zone of this script.
- hidden : boolean
The hidden status of the object.
- archived : string
The archival status of the requested object(s).
- target_project_id : integer
Target project to which script outputs will be added.
-
post_containers_runs
(id)¶ Start a run
Parameters: - id : integer
The ID of the container.
Returns: - id : integer
The ID of the run.
- container_id : integer
The ID of the container.
- state : string
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- is_cancel_requested : boolean
True if run cancel requested, else false.
- started_at : string/time
The time the last run started at.
- finished_at : string/time
The time the last run completed.
- error : string
The error, if any, returned by the run.
-
post_containers_runs_outputs
(id, run_id, object_type, object_id)¶ Add an output for a run
Parameters: - id : integer
The ID of the container script.
- run_id : integer
The ID of the run.
- object_type : string
The type of the output. Valid values are File, Table, Report, Project, or Credential
- object_id : integer
The ID of the output object.
Returns: - object_type : string
The type of the output. Valid values are File, Table, Report, Project, or Credential
- object_id : integer
The ID of the output object.
- name : string
The name of the output object.
- link : string
The link to retrieve the output object.
-
post_custom
(from_template_id, *, name='DEFAULT', parent_id='DEFAULT', arguments='DEFAULT', remote_host_id='DEFAULT', credential_id='DEFAULT', schedule='DEFAULT', notifications='DEFAULT', time_zone='DEFAULT', hidden='DEFAULT', target_project_id='DEFAULT')¶ Create a Custom Script
Parameters: - from_template_id : integer
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 : dict, optional
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
- 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 : dict, optional::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- notifications : dict, optional::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- time_zone : string, optional
The time zone of this script.
- hidden : boolean, optional
The hidden status of the object.
- target_project_id : integer, optional
Target project to which script outputs will be added.
Returns: - id : integer
The ID for the script.
- name : string
The name of the script.
- type : string
The type of the script (e.g Custom)
- created_at : string/time
The time this script was created.
- updated_at : string/time
The time the script was last updated.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- state : string
The status of the script’s last run.
- finished_at : string/time
The time that the script’s last run finished.
- category : string
- projects : list::
A list of projects containing the script. - id : integer
The ID for the project.
- name : string
- The name of the project.
- parent_id : integer
The ID of the parent job that will trigger this script
- params : list::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- label : string
- The label to present to users when asking them for the value.
- description : string
- A short sentence or fragment describing this parameter to the end user.
- type : string
- The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, database, credential_aws, credential_redshift, or credential_custom
- required : boolean
- Whether this param is required.
- value : string
- The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- default : string
- If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
- from_template_id : integer
The ID of the template script.
- ui_report_url : integer
The url of the custom HTML.
- template_script_name : string
The name of the template script.
- template_note : string
The template’s note.
- remote_host_id : integer
The remote host ID that this script will connect to.
- credential_id : integer
The credential that this script will use.
- code_preview : string
The code that this script will run with arguments inserted.
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- notifications : dict::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- running_as : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- time_zone : string
The time zone of this script.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- hidden : boolean
The hidden status of the object.
- archived : string
The archival status of the requested object(s).
- target_project_id : integer
Target project to which script outputs will be added.
-
post_custom_clone
(id, *, clone_schedule='DEFAULT', clone_triggers='DEFAULT', clone_notifications='DEFAULT')¶ Clone this Custom Script
Parameters: - id : integer
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.
Returns: - id : integer
The ID for the script.
- name : string
The name of the script.
- type : string
The type of the script (e.g Custom)
- created_at : string/time
The time this script was created.
- updated_at : string/time
The time the script was last updated.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- state : string
The status of the script’s last run.
- finished_at : string/time
The time that the script’s last run finished.
- category : string
- projects : list::
A list of projects containing the script. - id : integer
The ID for the project.
- name : string
- The name of the project.
- parent_id : integer
The ID of the parent job that will trigger this script
- params : list::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- label : string
- The label to present to users when asking them for the value.
- description : string
- A short sentence or fragment describing this parameter to the end user.
- type : string
- The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, database, credential_aws, credential_redshift, or credential_custom
- required : boolean
- Whether this param is required.
- value : string
- The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- default : string
- If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
- from_template_id : integer
The ID of the template script.
- ui_report_url : integer
The url of the custom HTML.
- template_script_name : string
The name of the template script.
- template_note : string
The template’s note.
- remote_host_id : integer
The remote host ID that this script will connect to.
- credential_id : integer
The credential that this script will use.
- code_preview : string
The code that this script will run with arguments inserted.
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- notifications : dict::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- running_as : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- time_zone : string
The time zone of this script.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- hidden : boolean
The hidden status of the object.
- archived : string
The archival status of the requested object(s).
- target_project_id : integer
Target project to which script outputs will be added.
-
post_custom_runs
(id)¶ Start a run
Parameters: - id : integer
The ID of the custom.
Returns: - id : integer
The ID of the run.
- custom_id : integer
The ID of the custom.
- state : string
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- is_cancel_requested : boolean
True if run cancel requested, else false.
- started_at : string/time
The time the last run started at.
- finished_at : string/time
The time the last run completed.
- error : string
The error, if any, returned by the run.
-
post_custom_runs_outputs
(id, run_id, object_type, object_id)¶ Add an output for a run
Parameters: - id : integer
The ID of the custom script.
- run_id : integer
The ID of the run.
- object_type : string
The type of the output. Valid values are File, Table, Report, Project, or Credential
- object_id : integer
The ID of the output object.
Returns: - object_type : string
The type of the output. Valid values are File, Table, Report, Project, or Credential
- object_id : integer
The ID of the output object.
- name : string
The name of the output object.
- link : string
The link to retrieve the output object.
-
post_javascript
(name, source, remote_host_id, credential_id, *, parent_id='DEFAULT', user_context='DEFAULT', params='DEFAULT', arguments='DEFAULT', schedule='DEFAULT', notifications='DEFAULT', next_run_at='DEFAULT', time_zone='DEFAULT', hidden='DEFAULT', target_project_id='DEFAULT')¶ Create a JavaScript Script
Parameters: - name : string
The name of the script.
- source : string
The body/text of the script.
- remote_host_id : integer
The remote host ID that this script will connect to.
- credential_id : integer
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 : list, optional::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- label : string
- The label to present to users when asking them for the value.
- description : string
- A short sentence or fragment describing this parameter to the end user.
- type : string
- The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, database, credential_aws, credential_redshift, or credential_custom
- required : boolean
- Whether this param is required.
- value : string
- The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- default : string
- If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- arguments : dict, optional
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
- schedule : dict, optional::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- notifications : dict, optional::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- next_run_at : string/time, optional
The time of the next scheduled run.
- time_zone : string, optional
The time zone of this script.
- hidden : boolean, optional
The hidden status of the object.
- target_project_id : integer, optional
Target project to which script outputs will be added.
Returns: - 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)
- created_at : string/time
The time this script was created.
- updated_at : string/time
The time the script was last updated.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- state : string
The status of the script’s last run.
- finished_at : string/time
The time that the script’s last run finished.
- category : string
The category of the script.
- projects : list::
A list of projects containing the script. - id : integer
The ID for the project.
- name : string
- The name of the project.
- parent_id : integer
The ID of the parent job that will trigger this script
- user_context : string
“runner” or “author”, who to execute the script as when run as a template.
- params : list::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- label : string
- The label to present to users when asking them for the value.
- description : string
- A short sentence or fragment describing this parameter to the end user.
- type : string
- The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, database, credential_aws, credential_redshift, or credential_custom
- required : boolean
- Whether this param is required.
- value : string
- The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- default : string
- If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
- is_template : boolean
Whether others scripts use this one as a template.
- published_as_template_id : integer
The ID of the template that this script is backing.
- from_template_id : integer
The ID of the template this script uses, if any.
- template_dependents_count : integer
How many other scripts use this one as a template.
- template_script_name : string
The name of the template script.
- links : dict::
- details : string
- The details link to get more information about the script.
- runs : string
- The runs link to get the run information list for this script.
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- notifications : dict::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- running_as : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- next_run_at : string/time
The time of the next scheduled run.
- time_zone : string
The time zone of this script.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- hidden : boolean
The hidden status of the object.
- target_project_id : integer
Target project to which script outputs will be added.
- archived : string
The archival status of the requested object(s).
- source : string
The body/text of the script.
- remote_host_id : integer
The remote host ID that this script will connect to.
- credential_id : integer
The credential that this script will use.
-
post_javascript_clone
(id, *, clone_schedule='DEFAULT', clone_triggers='DEFAULT', clone_notifications='DEFAULT')¶ Clone this JavaScript Script
Parameters: - id : integer
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.
Returns: - 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)
- created_at : string/time
The time this script was created.
- updated_at : string/time
The time the script was last updated.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- state : string
The status of the script’s last run.
- finished_at : string/time
The time that the script’s last run finished.
- category : string
The category of the script.
- projects : list::
A list of projects containing the script. - id : integer
The ID for the project.
- name : string
- The name of the project.
- parent_id : integer
The ID of the parent job that will trigger this script
- user_context : string
“runner” or “author”, who to execute the script as when run as a template.
- params : list::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- label : string
- The label to present to users when asking them for the value.
- description : string
- A short sentence or fragment describing this parameter to the end user.
- type : string
- The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, database, credential_aws, credential_redshift, or credential_custom
- required : boolean
- Whether this param is required.
- value : string
- The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- default : string
- If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
- is_template : boolean
Whether others scripts use this one as a template.
- published_as_template_id : integer
The ID of the template that this script is backing.
- from_template_id : integer
The ID of the template this script uses, if any.
- template_dependents_count : integer
How many other scripts use this one as a template.
- template_script_name : string
The name of the template script.
- links : dict::
- details : string
- The details link to get more information about the script.
- runs : string
- The runs link to get the run information list for this script.
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- notifications : dict::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- running_as : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- next_run_at : string/time
The time of the next scheduled run.
- time_zone : string
The time zone of this script.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- hidden : boolean
The hidden status of the object.
- target_project_id : integer
Target project to which script outputs will be added.
- archived : string
The archival status of the requested object(s).
- source : string
The body/text of the script.
- remote_host_id : integer
The remote host ID that this script will connect to.
- credential_id : integer
The credential that this script will use.
-
post_javascript_runs
(id)¶ Start a run
Parameters: - id : integer
The ID of the javascript.
Returns: - id : integer
The ID of the run.
- javascript_id : integer
The ID of the javascript.
- state : string
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- is_cancel_requested : boolean
True if run cancel requested, else false.
- started_at : string/time
The time the last run started at.
- finished_at : string/time
The time the last run completed.
- error : string
The error, if any, returned by the run.
-
post_javascript_runs_outputs
(id, run_id, object_type, object_id)¶ Add an output for a run
Parameters: - id : integer
The ID of the javascript script.
- run_id : integer
The ID of the run.
- object_type : string
The type of the output. Valid values are File, Table, Report, Project, or Credential
- object_id : integer
The ID of the output object.
Returns: - object_type : string
The type of the output. Valid values are File, Table, Report, Project, or Credential
- object_id : integer
The ID of the output object.
- name : string
The name of the output object.
- link : string
The link to retrieve the output object.
-
post_python3
(name, source, *, parent_id='DEFAULT', user_context='DEFAULT', params='DEFAULT', arguments='DEFAULT', schedule='DEFAULT', notifications='DEFAULT', next_run_at='DEFAULT', time_zone='DEFAULT', hidden='DEFAULT', target_project_id='DEFAULT', required_resources='DEFAULT', cancel_timeout='DEFAULT')¶ Create a Python Script
Parameters: - name : string
The name of the script.
- source : string
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 : list, optional::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- label : string
- The label to present to users when asking them for the value.
- description : string
- A short sentence or fragment describing this parameter to the end user.
- type : string
- The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, database, credential_aws, credential_redshift, or credential_custom
- required : boolean
- Whether this param is required.
- value : string
- The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- default : string
- If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- arguments : dict, optional
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
- schedule : dict, optional::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- notifications : dict, optional::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- next_run_at : string/time, optional
The time of the next scheduled run.
- time_zone : string, optional
The time zone of this script.
- hidden : boolean, optional
The hidden status of the object.
- target_project_id : integer, optional
Target project to which script outputs will be added.
- required_resources : dict, optional::
- cpu : integer
- The number of CPU shares to allocate for the container. Each core has 1024 shares. Must be at least 2 shares.
- memory : integer
- The amount of RAM to allocate for the container (in MiB). Must be at least 4 MiB.
- disk_space : number/float
- The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.
- 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.
Returns: - 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)
- created_at : string/time
The time this script was created.
- updated_at : string/time
The time the script was last updated.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- state : string
The status of the script’s last run.
- finished_at : string/time
The time that the script’s last run finished.
- category : string
The category of the script.
- projects : list::
A list of projects containing the script. - id : integer
The ID for the project.
- name : string
- The name of the project.
- parent_id : integer
The ID of the parent job that will trigger this script
- user_context : string
“runner” or “author”, who to execute the script as when run as a template.
- params : list::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- label : string
- The label to present to users when asking them for the value.
- description : string
- A short sentence or fragment describing this parameter to the end user.
- type : string
- The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, database, credential_aws, credential_redshift, or credential_custom
- required : boolean
- Whether this param is required.
- value : string
- The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- default : string
- If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
- is_template : boolean
Whether others scripts use this one as a template.
- published_as_template_id : integer
The ID of the template that this script is backing.
- from_template_id : integer
The ID of the template this script uses, if any.
- template_dependents_count : integer
How many other scripts use this one as a template.
- template_script_name : string
The name of the template script.
- links : dict::
- details : string
- The details link to get more information about the script.
- runs : string
- The runs link to get the run information list for this script.
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- notifications : dict::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- running_as : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- next_run_at : string/time
The time of the next scheduled run.
- time_zone : string
The time zone of this script.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- hidden : boolean
The hidden status of the object.
- target_project_id : integer
Target project to which script outputs will be added.
- archived : string
The archival status of the requested object(s).
- required_resources : dict::
- cpu : integer
- The number of CPU shares to allocate for the container. Each core has 1024 shares. Must be at least 2 shares.
- memory : integer
- The amount of RAM to allocate for the container (in MiB). Must be at least 4 MiB.
- disk_space : number/float
- The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.
- source : string
The body/text of the script.
- cancel_timeout : 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.
-
post_python3_clone
(id, *, clone_schedule='DEFAULT', clone_triggers='DEFAULT', clone_notifications='DEFAULT')¶ Clone this Python Script
Parameters: - id : integer
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.
Returns: - 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)
- created_at : string/time
The time this script was created.
- updated_at : string/time
The time the script was last updated.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- state : string
The status of the script’s last run.
- finished_at : string/time
The time that the script’s last run finished.
- category : string
The category of the script.
- projects : list::
A list of projects containing the script. - id : integer
The ID for the project.
- name : string
- The name of the project.
- parent_id : integer
The ID of the parent job that will trigger this script
- user_context : string
“runner” or “author”, who to execute the script as when run as a template.
- params : list::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- label : string
- The label to present to users when asking them for the value.
- description : string
- A short sentence or fragment describing this parameter to the end user.
- type : string
- The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, database, credential_aws, credential_redshift, or credential_custom
- required : boolean
- Whether this param is required.
- value : string
- The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- default : string
- If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
- is_template : boolean
Whether others scripts use this one as a template.
- published_as_template_id : integer
The ID of the template that this script is backing.
- from_template_id : integer
The ID of the template this script uses, if any.
- template_dependents_count : integer
How many other scripts use this one as a template.
- template_script_name : string
The name of the template script.
- links : dict::
- details : string
- The details link to get more information about the script.
- runs : string
- The runs link to get the run information list for this script.
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- notifications : dict::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- running_as : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- next_run_at : string/time
The time of the next scheduled run.
- time_zone : string
The time zone of this script.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- hidden : boolean
The hidden status of the object.
- target_project_id : integer
Target project to which script outputs will be added.
- archived : string
The archival status of the requested object(s).
- required_resources : dict::
- cpu : integer
- The number of CPU shares to allocate for the container. Each core has 1024 shares. Must be at least 2 shares.
- memory : integer
- The amount of RAM to allocate for the container (in MiB). Must be at least 4 MiB.
- disk_space : number/float
- The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.
- source : string
The body/text of the script.
- cancel_timeout : 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.
-
post_python3_runs
(id)¶ Start a run
Parameters: - id : integer
The ID of the python.
Returns: - id : integer
The ID of the run.
- python_id : integer
The ID of the python.
- state : string
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- is_cancel_requested : boolean
True if run cancel requested, else false.
- started_at : string/time
The time the last run started at.
- finished_at : string/time
The time the last run completed.
- error : string
The error, if any, returned by the run.
-
post_python3_runs_outputs
(id, run_id, object_type, object_id)¶ Add an output for a run
Parameters: - id : integer
The ID of the python script.
- run_id : integer
The ID of the run.
- object_type : string
The type of the output. Valid values are File, Table, Report, Project, or Credential
- object_id : integer
The ID of the output object.
Returns: - object_type : string
The type of the output. Valid values are File, Table, Report, Project, or Credential
- object_id : integer
The ID of the output object.
- name : string
The name of the output object.
- link : string
The link to retrieve the output object.
-
post_r
(name, source, *, parent_id='DEFAULT', user_context='DEFAULT', params='DEFAULT', arguments='DEFAULT', schedule='DEFAULT', notifications='DEFAULT', next_run_at='DEFAULT', time_zone='DEFAULT', hidden='DEFAULT', target_project_id='DEFAULT', required_resources='DEFAULT', cancel_timeout='DEFAULT')¶ Create an R Script
Parameters: - name : string
The name of the script.
- source : string
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 : list, optional::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- label : string
- The label to present to users when asking them for the value.
- description : string
- A short sentence or fragment describing this parameter to the end user.
- type : string
- The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, database, credential_aws, credential_redshift, or credential_custom
- required : boolean
- Whether this param is required.
- value : string
- The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- default : string
- If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- arguments : dict, optional
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
- schedule : dict, optional::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- notifications : dict, optional::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- next_run_at : string/time, optional
The time of the next scheduled run.
- time_zone : string, optional
The time zone of this script.
- hidden : boolean, optional
The hidden status of the object.
- target_project_id : integer, optional
Target project to which script outputs will be added.
- required_resources : dict, optional::
- cpu : integer
- The number of CPU shares to allocate for the container. Each core has 1024 shares. Must be at least 2 shares.
- memory : integer
- The amount of RAM to allocate for the container (in MiB). Must be at least 4 MiB.
- disk_space : number/float
- The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.
- 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.
Returns: - 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)
- created_at : string/time
The time this script was created.
- updated_at : string/time
The time the script was last updated.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- state : string
The status of the script’s last run.
- finished_at : string/time
The time that the script’s last run finished.
- category : string
The category of the script.
- projects : list::
A list of projects containing the script. - id : integer
The ID for the project.
- name : string
- The name of the project.
- parent_id : integer
The ID of the parent job that will trigger this script
- user_context : string
“runner” or “author”, who to execute the script as when run as a template.
- params : list::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- label : string
- The label to present to users when asking them for the value.
- description : string
- A short sentence or fragment describing this parameter to the end user.
- type : string
- The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, database, credential_aws, credential_redshift, or credential_custom
- required : boolean
- Whether this param is required.
- value : string
- The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- default : string
- If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
- is_template : boolean
Whether others scripts use this one as a template.
- published_as_template_id : integer
The ID of the template that this script is backing.
- from_template_id : integer
The ID of the template this script uses, if any.
- template_dependents_count : integer
How many other scripts use this one as a template.
- template_script_name : string
The name of the template script.
- links : dict::
- details : string
- The details link to get more information about the script.
- runs : string
- The runs link to get the run information list for this script.
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- notifications : dict::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- running_as : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- next_run_at : string/time
The time of the next scheduled run.
- time_zone : string
The time zone of this script.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- hidden : boolean
The hidden status of the object.
- target_project_id : integer
Target project to which script outputs will be added.
- archived : string
The archival status of the requested object(s).
- required_resources : dict::
- cpu : integer
- The number of CPU shares to allocate for the container. Each core has 1024 shares. Must be at least 2 shares.
- memory : integer
- The amount of RAM to allocate for the container (in MiB). Must be at least 4 MiB.
- disk_space : number/float
- The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.
- source : string
The body/text of the script.
- cancel_timeout : 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.
-
post_r_clone
(id, *, clone_schedule='DEFAULT', clone_triggers='DEFAULT', clone_notifications='DEFAULT')¶ Clone this R Script
Parameters: - id : integer
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.
Returns: - 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)
- created_at : string/time
The time this script was created.
- updated_at : string/time
The time the script was last updated.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- state : string
The status of the script’s last run.
- finished_at : string/time
The time that the script’s last run finished.
- category : string
The category of the script.
- projects : list::
A list of projects containing the script. - id : integer
The ID for the project.
- name : string
- The name of the project.
- parent_id : integer
The ID of the parent job that will trigger this script
- user_context : string
“runner” or “author”, who to execute the script as when run as a template.
- params : list::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- label : string
- The label to present to users when asking them for the value.
- description : string
- A short sentence or fragment describing this parameter to the end user.
- type : string
- The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, database, credential_aws, credential_redshift, or credential_custom
- required : boolean
- Whether this param is required.
- value : string
- The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- default : string
- If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
- is_template : boolean
Whether others scripts use this one as a template.
- published_as_template_id : integer
The ID of the template that this script is backing.
- from_template_id : integer
The ID of the template this script uses, if any.
- template_dependents_count : integer
How many other scripts use this one as a template.
- template_script_name : string
The name of the template script.
- links : dict::
- details : string
- The details link to get more information about the script.
- runs : string
- The runs link to get the run information list for this script.
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- notifications : dict::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- running_as : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- next_run_at : string/time
The time of the next scheduled run.
- time_zone : string
The time zone of this script.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- hidden : boolean
The hidden status of the object.
- target_project_id : integer
Target project to which script outputs will be added.
- archived : string
The archival status of the requested object(s).
- required_resources : dict::
- cpu : integer
- The number of CPU shares to allocate for the container. Each core has 1024 shares. Must be at least 2 shares.
- memory : integer
- The amount of RAM to allocate for the container (in MiB). Must be at least 4 MiB.
- disk_space : number/float
- The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.
- source : string
The body/text of the script.
- cancel_timeout : 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.
-
post_r_runs
(id)¶ Start a run
Parameters: - id : integer
The ID of the r.
Returns: - id : integer
The ID of the run.
- r_id : integer
The ID of the r.
- state : string
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- is_cancel_requested : boolean
True if run cancel requested, else false.
- started_at : string/time
The time the last run started at.
- finished_at : string/time
The time the last run completed.
- error : string
The error, if any, returned by the run.
-
post_r_runs_outputs
(id, run_id, object_type, object_id)¶ Add an output for a run
Parameters: - id : integer
The ID of the r script.
- run_id : integer
The ID of the run.
- object_type : string
The type of the output. Valid values are File, Table, Report, Project, or Credential
- object_id : integer
The ID of the output object.
Returns: - object_type : string
The type of the output. Valid values are File, Table, Report, Project, or Credential
- object_id : integer
The ID of the output object.
- name : string
The name of the output object.
- link : string
The link to retrieve the output object.
-
post_run
(id)¶ Run a script
Parameters: - id : integer
The ID for the script.
Returns: - None
Response code 204: success
-
post_sql
(name, sql, remote_host_id, credential_id, *, parent_id='DEFAULT', user_context='DEFAULT', params='DEFAULT', arguments='DEFAULT', schedule='DEFAULT', notifications='DEFAULT', next_run_at='DEFAULT', time_zone='DEFAULT', hidden='DEFAULT', target_project_id='DEFAULT', csv_settings='DEFAULT')¶ Create a SQL script
Parameters: - name : string
The name of the script.
- sql : string
The raw SQL query for the script.
- remote_host_id : integer
The remote host ID that this script will connect to.
- credential_id : integer
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 : list, optional::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- label : string
- The label to present to users when asking them for the value.
- description : string
- A short sentence or fragment describing this parameter to the end user.
- type : string
- The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, database, credential_aws, credential_redshift, or credential_custom
- required : boolean
- Whether this param is required.
- value : string
- The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- default : string
- If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- arguments : dict, optional
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
- schedule : dict, optional::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- notifications : dict, optional::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- next_run_at : string/time, optional
The time of the next scheduled run.
- time_zone : string, optional
The time zone of this script.
- hidden : boolean, optional
The hidden status of the object.
- target_project_id : integer, optional
Target project to which script outputs will be added.
- csv_settings : dict, optional::
- include_header : boolean
- Whether or not to include headers in the output data. Default: true
- compression : string
- The type of compression to use, if any, one of “none”, “zip”, or “gzip”. Default: gzip
- column_delimiter : string
- Which delimiter to use, one of “comma”, “tab”, or “pipe”. Default: comma
- unquoted : boolean
- Whether or not to quote fields. Default: false
- force_multifile : boolean
- Whether or not the csv should be split into multiple files. Default: false
- filename_prefix : string
- A user specified filename prefix for the output file to have. Default: null
Returns: - 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)
- created_at : string/time
The time this script was created.
- updated_at : string/time
The time the script was last updated.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- state : string
The status of the script’s last run.
- finished_at : string/time
The time that the script’s last run finished.
- category : string
The category of the script.
- projects : list::
A list of projects containing the script. - id : integer
The ID for the project.
- name : string
- The name of the project.
- parent_id : integer
The ID of the parent job that will trigger this script
- user_context : string
“runner” or “author”, who to execute the script as when run as a template.
- params : list::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- label : string
- The label to present to users when asking them for the value.
- description : string
- A short sentence or fragment describing this parameter to the end user.
- type : string
- The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, database, credential_aws, credential_redshift, or credential_custom
- required : boolean
- Whether this param is required.
- value : string
- The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- default : string
- If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
- is_template : boolean
Whether others scripts use this one as a template.
- published_as_template_id : integer
The ID of the template that this script is backing.
- from_template_id : integer
The ID of the template this script uses, if any.
- template_dependents_count : integer
How many other scripts use this one as a template.
- template_script_name : string
The name of the template script.
- links : dict::
- details : string
- The details link to get more information about the script.
- runs : string
- The runs link to get the run information list for this script.
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- notifications : dict::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- running_as : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- next_run_at : string/time
The time of the next scheduled run.
- time_zone : string
The time zone of this script.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- hidden : boolean
The hidden status of the object.
- target_project_id : integer
Target project to which script outputs will be added.
- archived : string
The archival status of the requested object(s).
- sql : string
The raw SQL query for the script.
- expanded_arguments : dict
Expanded arguments for use in injecting into different environments.
- remote_host_id : integer
The remote host ID that this script will connect to.
- credential_id : integer
The credential that this script will use.
- code_preview : string
The code that this script will run with arguments inserted.
- csv_settings : dict::
- include_header : boolean
- Whether or not to include headers in the output data. Default: true
- compression : string
- The type of compression to use, if any, one of “none”, “zip”, or “gzip”. Default: gzip
- column_delimiter : string
- Which delimiter to use, one of “comma”, “tab”, or “pipe”. Default: comma
- unquoted : boolean
- Whether or not to quote fields. Default: false
- force_multifile : boolean
- Whether or not the csv should be split into multiple files. Default: false
- filename_prefix : string
- A user specified filename prefix for the output file to have. Default: null
-
post_sql_clone
(id, *, clone_schedule='DEFAULT', clone_triggers='DEFAULT', clone_notifications='DEFAULT')¶ Clone this SQL script
Parameters: - id : integer
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.
Returns: - 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)
- created_at : string/time
The time this script was created.
- updated_at : string/time
The time the script was last updated.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- state : string
The status of the script’s last run.
- finished_at : string/time
The time that the script’s last run finished.
- category : string
The category of the script.
- projects : list::
A list of projects containing the script. - id : integer
The ID for the project.
- name : string
- The name of the project.
- parent_id : integer
The ID of the parent job that will trigger this script
- user_context : string
“runner” or “author”, who to execute the script as when run as a template.
- params : list::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- label : string
- The label to present to users when asking them for the value.
- description : string
- A short sentence or fragment describing this parameter to the end user.
- type : string
- The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, database, credential_aws, credential_redshift, or credential_custom
- required : boolean
- Whether this param is required.
- value : string
- The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- default : string
- If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
- is_template : boolean
Whether others scripts use this one as a template.
- published_as_template_id : integer
The ID of the template that this script is backing.
- from_template_id : integer
The ID of the template this script uses, if any.
- template_dependents_count : integer
How many other scripts use this one as a template.
- template_script_name : string
The name of the template script.
- links : dict::
- details : string
- The details link to get more information about the script.
- runs : string
- The runs link to get the run information list for this script.
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- notifications : dict::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- running_as : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- next_run_at : string/time
The time of the next scheduled run.
- time_zone : string
The time zone of this script.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- hidden : boolean
The hidden status of the object.
- target_project_id : integer
Target project to which script outputs will be added.
- archived : string
The archival status of the requested object(s).
- sql : string
The raw SQL query for the script.
- expanded_arguments : dict
Expanded arguments for use in injecting into different environments.
- remote_host_id : integer
The remote host ID that this script will connect to.
- credential_id : integer
The credential that this script will use.
- code_preview : string
The code that this script will run with arguments inserted.
- csv_settings : dict::
- include_header : boolean
- Whether or not to include headers in the output data. Default: true
- compression : string
- The type of compression to use, if any, one of “none”, “zip”, or “gzip”. Default: gzip
- column_delimiter : string
- Which delimiter to use, one of “comma”, “tab”, or “pipe”. Default: comma
- unquoted : boolean
- Whether or not to quote fields. Default: false
- force_multifile : boolean
- Whether or not the csv should be split into multiple files. Default: false
- filename_prefix : string
- A user specified filename prefix for the output file to have. Default: null
-
post_sql_runs
(id)¶ Start a run
Parameters: - id : integer
The ID of the sql.
Returns: - id : integer
The ID of this run.
- sql_id : integer
The ID of this sql.
- state : string
The state of this run.
- is_cancel_requested : boolean
True if run cancel requested, else false.
- started_at : string/time
The time the last run started.
- finished_at : string/time
The time that this run finished.
- error : string
The error message for this run, if present.
- output : list::
A list of the outputs of this script. - output_name : string
The name of the output file.
- file_id : integer
- The unique ID of the output file.
- path : string
- The temporary link to download this output file, valid for 36 hours.
-
put_containers
(id, required_resources, docker_command, docker_image_name, *, name='DEFAULT', parent_id='DEFAULT', user_context='DEFAULT', params='DEFAULT', arguments='DEFAULT', schedule='DEFAULT', notifications='DEFAULT', repo_http_uri='DEFAULT', repo_ref='DEFAULT', remote_host_credential_id='DEFAULT', git_credential_id='DEFAULT', docker_image_tag='DEFAULT', cancel_timeout='DEFAULT', time_zone='DEFAULT', target_project_id='DEFAULT')¶ Edit a container
Parameters: - id : integer
The ID for the script.
- required_resources : dict::
- cpu : integer
- The number of CPU shares to allocate for the container. Each core has 1024 shares.
- memory : integer
- The amount of RAM to allocate for the container (in MiB).
- disk_space : number/float
- The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.
- docker_command : string
The command to run on the container. Will be run via sh as: [“sh”, “-c”, dockerCommand]
- docker_image_name : string
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 : list, optional::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- label : string
- The label to present to users when asking them for the value.
- description : string
- A short sentence or fragment describing this parameter to the end user.
- type : string
- The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, database, credential_aws, credential_redshift, or credential_custom
- required : boolean
- Whether this param is required.
- value : string
- The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- default : string
- If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- arguments : dict, optional
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
- schedule : dict, optional::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- notifications : dict, optional::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- 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_image_tag : string, optional
The tag of the docker image to pull from DockerHub (default: latest).
- 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.
Returns: - id : integer
The ID for the script.
- name : string
The name of the container.
- type : string
The type of the script (e.g Container)
- created_at : string/time
The time this script was created.
- updated_at : string/time
The time the script was last updated.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- state : string
The status of the script’s last run.
- finished_at : string/time
The time that the script’s last run finished.
- category : string
The category of the script.
- projects : list::
A list of projects containing the script. - id : integer
The ID for the project.
- name : string
- The name of the project.
- parent_id : integer
The ID of the parent job that will trigger this script
- user_context : string
“runner” or “author”, who to execute the script as when run as a template.
- params : list::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- label : string
- The label to present to users when asking them for the value.
- description : string
- A short sentence or fragment describing this parameter to the end user.
- type : string
- The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, database, credential_aws, credential_redshift, or credential_custom
- required : boolean
- Whether this param is required.
- value : string
- The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- default : string
- If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
- is_template : boolean
Whether others scripts use this one as a template.
- template_dependents_count : integer
How many other scripts use this one as a template.
- published_as_template_id : integer
The ID of the template that this script is backing.
- from_template_id : integer
The ID of the template script.
- template_script_name : string
The name of the template script.
- links : dict::
- details : string
- The details link to get more information about the script.
- runs : string
- The runs link to get the run information list for this script.
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- notifications : dict::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- running_as : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- required_resources : dict::
- cpu : integer
- The number of CPU shares to allocate for the container. Each core has 1024 shares.
- memory : integer
- The amount of RAM to allocate for the container (in MiB).
- disk_space : number/float
- The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.
- repo_http_uri : string
The location of a github repo to clone into the container, e.g. github.com/my-user/my-repo.git.
- repo_ref : string
The tag or branch of the github repo to clone into the container.
- remote_host_credential_id : integer
The id of the database credentials to pass into the environment of the container.
- git_credential_id : integer
The id of the git credential to be used when checking out the specified git repo. If not supplied, the first git credential you’ve submitted will be used. Unnecessary if no git repo is specified or the git repo is public.
- docker_command : string
The command to run on the container. Will be run via sh as: [“sh”, “-c”, dockerCommand]
- docker_image_name : string
The name of the docker image to pull from DockerHub.
- docker_image_tag : string
The tag of the docker image to pull from DockerHub (default: latest).
- cancel_timeout : 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.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- time_zone : string
The time zone of this script.
- hidden : boolean
The hidden status of the object.
- archived : string
The archival status of the requested object(s).
- target_project_id : integer
Target project to which script outputs will be added.
-
put_containers_archive
(id, status)¶ Update the archive status of this object
Parameters: - id : integer
The ID of the object.
- status : boolean
The desired archived status of the object.
Returns: - id : integer
The ID for the script.
- name : string
The name of the container.
- type : string
The type of the script (e.g Container)
- created_at : string/time
The time this script was created.
- updated_at : string/time
The time the script was last updated.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- state : string
The status of the script’s last run.
- finished_at : string/time
The time that the script’s last run finished.
- category : string
The category of the script.
- projects : list::
A list of projects containing the script. - id : integer
The ID for the project.
- name : string
- The name of the project.
- parent_id : integer
The ID of the parent job that will trigger this script
- user_context : string
“runner” or “author”, who to execute the script as when run as a template.
- params : list::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- label : string
- The label to present to users when asking them for the value.
- description : string
- A short sentence or fragment describing this parameter to the end user.
- type : string
- The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, database, credential_aws, credential_redshift, or credential_custom
- required : boolean
- Whether this param is required.
- value : string
- The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- default : string
- If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
- is_template : boolean
Whether others scripts use this one as a template.
- template_dependents_count : integer
How many other scripts use this one as a template.
- published_as_template_id : integer
The ID of the template that this script is backing.
- from_template_id : integer
The ID of the template script.
- template_script_name : string
The name of the template script.
- links : dict::
- details : string
- The details link to get more information about the script.
- runs : string
- The runs link to get the run information list for this script.
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- notifications : dict::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- running_as : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- required_resources : dict::
- cpu : integer
- The number of CPU shares to allocate for the container. Each core has 1024 shares.
- memory : integer
- The amount of RAM to allocate for the container (in MiB).
- disk_space : number/float
- The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.
- repo_http_uri : string
The location of a github repo to clone into the container, e.g. github.com/my-user/my-repo.git.
- repo_ref : string
The tag or branch of the github repo to clone into the container.
- remote_host_credential_id : integer
The id of the database credentials to pass into the environment of the container.
- git_credential_id : integer
The id of the git credential to be used when checking out the specified git repo. If not supplied, the first git credential you’ve submitted will be used. Unnecessary if no git repo is specified or the git repo is public.
- docker_command : string
The command to run on the container. Will be run via sh as: [“sh”, “-c”, dockerCommand]
- docker_image_name : string
The name of the docker image to pull from DockerHub.
- docker_image_tag : string
The tag of the docker image to pull from DockerHub (default: latest).
- cancel_timeout : 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.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- time_zone : string
The time zone of this script.
- hidden : boolean
The hidden status of the object.
- archived : string
The archival status of the requested object(s).
- target_project_id : integer
Target project to which script outputs will be added.
-
put_containers_projects
(id, project_id)¶ Add a container docker to a project
Parameters: - id : integer
ID of the resource
- project_id : integer
The ID of the project
Returns: - None
Response code 204: success
Set the permissions groups has on this object
Parameters: - id : integer
ID of the resource to be shared
- group_ids : list
An array of one or more group IDs
- permission_level : string
Options are: “read”, “write”, or “manage”
- share_email_body : string, optional
Custom body text for e-mail sent on a share.
- send_shared_email : boolean, optional
Send email to the recipients of a share.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
Set the permissions users have on this object
Parameters: - id : integer
ID of the resource to be shared
- user_ids : list
An array of one or more user IDs
- permission_level : string
Options are: “read”, “write”, or “manage”
- share_email_body : string, optional
Custom body text for e-mail sent on a share.
- send_shared_email : boolean, optional
Send email to the recipients of a share.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
-
put_custom
(id, *, name='DEFAULT', parent_id='DEFAULT', arguments='DEFAULT', remote_host_id='DEFAULT', credential_id='DEFAULT', schedule='DEFAULT', notifications='DEFAULT', time_zone='DEFAULT', target_project_id='DEFAULT')¶ Replace all attributes of this Custom Script
Parameters: - id : integer
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 : dict, optional
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
- 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 : dict, optional::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- notifications : dict, optional::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- time_zone : string, optional
The time zone of this script.
- target_project_id : integer, optional
Target project to which script outputs will be added.
Returns: - id : integer
The ID for the script.
- name : string
The name of the script.
- type : string
The type of the script (e.g Custom)
- created_at : string/time
The time this script was created.
- updated_at : string/time
The time the script was last updated.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- state : string
The status of the script’s last run.
- finished_at : string/time
The time that the script’s last run finished.
- category : string
- projects : list::
A list of projects containing the script. - id : integer
The ID for the project.
- name : string
- The name of the project.
- parent_id : integer
The ID of the parent job that will trigger this script
- params : list::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- label : string
- The label to present to users when asking them for the value.
- description : string
- A short sentence or fragment describing this parameter to the end user.
- type : string
- The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, database, credential_aws, credential_redshift, or credential_custom
- required : boolean
- Whether this param is required.
- value : string
- The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- default : string
- If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
- from_template_id : integer
The ID of the template script.
- ui_report_url : integer
The url of the custom HTML.
- template_script_name : string
The name of the template script.
- template_note : string
The template’s note.
- remote_host_id : integer
The remote host ID that this script will connect to.
- credential_id : integer
The credential that this script will use.
- code_preview : string
The code that this script will run with arguments inserted.
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- notifications : dict::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- running_as : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- time_zone : string
The time zone of this script.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- hidden : boolean
The hidden status of the object.
- archived : string
The archival status of the requested object(s).
- target_project_id : integer
Target project to which script outputs will be added.
-
put_custom_archive
(id, status)¶ Update the archive status of this object
Parameters: - id : integer
The ID of the object.
- status : boolean
The desired archived status of the object.
Returns: - id : integer
The ID for the script.
- name : string
The name of the script.
- type : string
The type of the script (e.g Custom)
- created_at : string/time
The time this script was created.
- updated_at : string/time
The time the script was last updated.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- state : string
The status of the script’s last run.
- finished_at : string/time
The time that the script’s last run finished.
- category : string
- projects : list::
A list of projects containing the script. - id : integer
The ID for the project.
- name : string
- The name of the project.
- parent_id : integer
The ID of the parent job that will trigger this script
- params : list::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- label : string
- The label to present to users when asking them for the value.
- description : string
- A short sentence or fragment describing this parameter to the end user.
- type : string
- The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, database, credential_aws, credential_redshift, or credential_custom
- required : boolean
- Whether this param is required.
- value : string
- The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- default : string
- If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
- from_template_id : integer
The ID of the template script.
- ui_report_url : integer
The url of the custom HTML.
- template_script_name : string
The name of the template script.
- template_note : string
The template’s note.
- remote_host_id : integer
The remote host ID that this script will connect to.
- credential_id : integer
The credential that this script will use.
- code_preview : string
The code that this script will run with arguments inserted.
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- notifications : dict::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- running_as : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- time_zone : string
The time zone of this script.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- hidden : boolean
The hidden status of the object.
- archived : string
The archival status of the requested object(s).
- target_project_id : integer
Target project to which script outputs will be added.
-
put_custom_projects
(id, project_id)¶ Add a Job to a project
Parameters: - id : integer
ID of the resource
- project_id : integer
The ID of the project
Returns: - None
Response code 204: success
Set the permissions groups has on this object
Parameters: - id : integer
ID of the resource to be shared
- group_ids : list
An array of one or more group IDs
- permission_level : string
Options are: “read”, “write”, or “manage”
- share_email_body : string, optional
Custom body text for e-mail sent on a share.
- send_shared_email : boolean, optional
Send email to the recipients of a share.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
Set the permissions users have on this object
Parameters: - id : integer
ID of the resource to be shared
- user_ids : list
An array of one or more user IDs
- permission_level : string
Options are: “read”, “write”, or “manage”
- share_email_body : string, optional
Custom body text for e-mail sent on a share.
- send_shared_email : boolean, optional
Send email to the recipients of a share.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
-
put_javascript
(id, name, source, remote_host_id, credential_id, *, parent_id='DEFAULT', user_context='DEFAULT', params='DEFAULT', arguments='DEFAULT', schedule='DEFAULT', notifications='DEFAULT', next_run_at='DEFAULT', time_zone='DEFAULT', target_project_id='DEFAULT')¶ Replace all attributes of this JavaScript Script
Parameters: - id : integer
The ID for the script.
- name : string
The name of the script.
- source : string
The body/text of the script.
- remote_host_id : integer
The remote host ID that this script will connect to.
- credential_id : integer
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 : list, optional::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- label : string
- The label to present to users when asking them for the value.
- description : string
- A short sentence or fragment describing this parameter to the end user.
- type : string
- The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, database, credential_aws, credential_redshift, or credential_custom
- required : boolean
- Whether this param is required.
- value : string
- The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- default : string
- If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- arguments : dict, optional
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
- schedule : dict, optional::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- notifications : dict, optional::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- next_run_at : string/time, 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.
Returns: - 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)
- created_at : string/time
The time this script was created.
- updated_at : string/time
The time the script was last updated.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- state : string
The status of the script’s last run.
- finished_at : string/time
The time that the script’s last run finished.
- category : string
The category of the script.
- projects : list::
A list of projects containing the script. - id : integer
The ID for the project.
- name : string
- The name of the project.
- parent_id : integer
The ID of the parent job that will trigger this script
- user_context : string
“runner” or “author”, who to execute the script as when run as a template.
- params : list::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- label : string
- The label to present to users when asking them for the value.
- description : string
- A short sentence or fragment describing this parameter to the end user.
- type : string
- The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, database, credential_aws, credential_redshift, or credential_custom
- required : boolean
- Whether this param is required.
- value : string
- The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- default : string
- If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
- is_template : boolean
Whether others scripts use this one as a template.
- published_as_template_id : integer
The ID of the template that this script is backing.
- from_template_id : integer
The ID of the template this script uses, if any.
- template_dependents_count : integer
How many other scripts use this one as a template.
- template_script_name : string
The name of the template script.
- links : dict::
- details : string
- The details link to get more information about the script.
- runs : string
- The runs link to get the run information list for this script.
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- notifications : dict::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- running_as : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- next_run_at : string/time
The time of the next scheduled run.
- time_zone : string
The time zone of this script.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- hidden : boolean
The hidden status of the object.
- target_project_id : integer
Target project to which script outputs will be added.
- archived : string
The archival status of the requested object(s).
- source : string
The body/text of the script.
- remote_host_id : integer
The remote host ID that this script will connect to.
- credential_id : integer
The credential that this script will use.
-
put_javascript_archive
(id, status)¶ Update the archive status of this object
Parameters: - id : integer
The ID of the object.
- status : boolean
The desired archived status of the object.
Returns: - 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)
- created_at : string/time
The time this script was created.
- updated_at : string/time
The time the script was last updated.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- state : string
The status of the script’s last run.
- finished_at : string/time
The time that the script’s last run finished.
- category : string
The category of the script.
- projects : list::
A list of projects containing the script. - id : integer
The ID for the project.
- name : string
- The name of the project.
- parent_id : integer
The ID of the parent job that will trigger this script
- user_context : string
“runner” or “author”, who to execute the script as when run as a template.
- params : list::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- label : string
- The label to present to users when asking them for the value.
- description : string
- A short sentence or fragment describing this parameter to the end user.
- type : string
- The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, database, credential_aws, credential_redshift, or credential_custom
- required : boolean
- Whether this param is required.
- value : string
- The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- default : string
- If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
- is_template : boolean
Whether others scripts use this one as a template.
- published_as_template_id : integer
The ID of the template that this script is backing.
- from_template_id : integer
The ID of the template this script uses, if any.
- template_dependents_count : integer
How many other scripts use this one as a template.
- template_script_name : string
The name of the template script.
- links : dict::
- details : string
- The details link to get more information about the script.
- runs : string
- The runs link to get the run information list for this script.
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- notifications : dict::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- running_as : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- next_run_at : string/time
The time of the next scheduled run.
- time_zone : string
The time zone of this script.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- hidden : boolean
The hidden status of the object.
- target_project_id : integer
Target project to which script outputs will be added.
- archived : string
The archival status of the requested object(s).
- source : string
The body/text of the script.
- remote_host_id : integer
The remote host ID that this script will connect to.
- credential_id : integer
The credential that this script will use.
-
put_javascript_projects
(id, project_id)¶ Add a scripted sql to a project
Parameters: - id : integer
ID of the resource
- project_id : integer
The ID of the project
Returns: - None
Response code 204: success
Set the permissions groups has on this object
Parameters: - id : integer
ID of the resource to be shared
- group_ids : list
An array of one or more group IDs
- permission_level : string
Options are: “read”, “write”, or “manage”
- share_email_body : string, optional
Custom body text for e-mail sent on a share.
- send_shared_email : boolean, optional
Send email to the recipients of a share.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
Set the permissions users have on this object
Parameters: - id : integer
ID of the resource to be shared
- user_ids : list
An array of one or more user IDs
- permission_level : string
Options are: “read”, “write”, or “manage”
- share_email_body : string, optional
Custom body text for e-mail sent on a share.
- send_shared_email : boolean, optional
Send email to the recipients of a share.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
-
put_python3
(id, name, source, *, parent_id='DEFAULT', user_context='DEFAULT', params='DEFAULT', arguments='DEFAULT', schedule='DEFAULT', notifications='DEFAULT', next_run_at='DEFAULT', time_zone='DEFAULT', target_project_id='DEFAULT', required_resources='DEFAULT', cancel_timeout='DEFAULT')¶ Replace all attributes of this Python Script
Parameters: - id : integer
The ID for the script.
- name : string
The name of the script.
- source : string
The body/text of the script.
- 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 : list, optional::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- label : string
- The label to present to users when asking them for the value.
- description : string
- A short sentence or fragment describing this parameter to the end user.
- type : string
- The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, database, credential_aws, credential_redshift, or credential_custom
- required : boolean
- Whether this param is required.
- value : string
- The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- default : string
- If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- arguments : dict, optional
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
- schedule : dict, optional::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- notifications : dict, optional::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- next_run_at : string/time, 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 : dict, optional::
- cpu : integer
- The number of CPU shares to allocate for the container. Each core has 1024 shares. Must be at least 2 shares.
- memory : integer
- The amount of RAM to allocate for the container (in MiB). Must be at least 4 MiB.
- disk_space : number/float
- The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.
- 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.
Returns: - 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)
- created_at : string/time
The time this script was created.
- updated_at : string/time
The time the script was last updated.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- state : string
The status of the script’s last run.
- finished_at : string/time
The time that the script’s last run finished.
- category : string
The category of the script.
- projects : list::
A list of projects containing the script. - id : integer
The ID for the project.
- name : string
- The name of the project.
- parent_id : integer
The ID of the parent job that will trigger this script
- user_context : string
“runner” or “author”, who to execute the script as when run as a template.
- params : list::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- label : string
- The label to present to users when asking them for the value.
- description : string
- A short sentence or fragment describing this parameter to the end user.
- type : string
- The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, database, credential_aws, credential_redshift, or credential_custom
- required : boolean
- Whether this param is required.
- value : string
- The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- default : string
- If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
- is_template : boolean
Whether others scripts use this one as a template.
- published_as_template_id : integer
The ID of the template that this script is backing.
- from_template_id : integer
The ID of the template this script uses, if any.
- template_dependents_count : integer
How many other scripts use this one as a template.
- template_script_name : string
The name of the template script.
- links : dict::
- details : string
- The details link to get more information about the script.
- runs : string
- The runs link to get the run information list for this script.
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- notifications : dict::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- running_as : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- next_run_at : string/time
The time of the next scheduled run.
- time_zone : string
The time zone of this script.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- hidden : boolean
The hidden status of the object.
- target_project_id : integer
Target project to which script outputs will be added.
- archived : string
The archival status of the requested object(s).
- required_resources : dict::
- cpu : integer
- The number of CPU shares to allocate for the container. Each core has 1024 shares. Must be at least 2 shares.
- memory : integer
- The amount of RAM to allocate for the container (in MiB). Must be at least 4 MiB.
- disk_space : number/float
- The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.
- source : string
The body/text of the script.
- cancel_timeout : 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.
-
put_python3_archive
(id, status)¶ Update the archive status of this object
Parameters: - id : integer
The ID of the object.
- status : boolean
The desired archived status of the object.
Returns: - 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)
- created_at : string/time
The time this script was created.
- updated_at : string/time
The time the script was last updated.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- state : string
The status of the script’s last run.
- finished_at : string/time
The time that the script’s last run finished.
- category : string
The category of the script.
- projects : list::
A list of projects containing the script. - id : integer
The ID for the project.
- name : string
- The name of the project.
- parent_id : integer
The ID of the parent job that will trigger this script
- user_context : string
“runner” or “author”, who to execute the script as when run as a template.
- params : list::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- label : string
- The label to present to users when asking them for the value.
- description : string
- A short sentence or fragment describing this parameter to the end user.
- type : string
- The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, database, credential_aws, credential_redshift, or credential_custom
- required : boolean
- Whether this param is required.
- value : string
- The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- default : string
- If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
- is_template : boolean
Whether others scripts use this one as a template.
- published_as_template_id : integer
The ID of the template that this script is backing.
- from_template_id : integer
The ID of the template this script uses, if any.
- template_dependents_count : integer
How many other scripts use this one as a template.
- template_script_name : string
The name of the template script.
- links : dict::
- details : string
- The details link to get more information about the script.
- runs : string
- The runs link to get the run information list for this script.
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- notifications : dict::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- running_as : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- next_run_at : string/time
The time of the next scheduled run.
- time_zone : string
The time zone of this script.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- hidden : boolean
The hidden status of the object.
- target_project_id : integer
Target project to which script outputs will be added.
- archived : string
The archival status of the requested object(s).
- required_resources : dict::
- cpu : integer
- The number of CPU shares to allocate for the container. Each core has 1024 shares. Must be at least 2 shares.
- memory : integer
- The amount of RAM to allocate for the container (in MiB). Must be at least 4 MiB.
- disk_space : number/float
- The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.
- source : string
The body/text of the script.
- cancel_timeout : 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.
-
put_python3_projects
(id, project_id)¶ Add a python docker to a project
Parameters: - id : integer
ID of the resource
- project_id : integer
The ID of the project
Returns: - None
Response code 204: success
Set the permissions groups has on this object
Parameters: - id : integer
ID of the resource to be shared
- group_ids : list
An array of one or more group IDs
- permission_level : string
Options are: “read”, “write”, or “manage”
- share_email_body : string, optional
Custom body text for e-mail sent on a share.
- send_shared_email : boolean, optional
Send email to the recipients of a share.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
Set the permissions users have on this object
Parameters: - id : integer
ID of the resource to be shared
- user_ids : list
An array of one or more user IDs
- permission_level : string
Options are: “read”, “write”, or “manage”
- share_email_body : string, optional
Custom body text for e-mail sent on a share.
- send_shared_email : boolean, optional
Send email to the recipients of a share.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
-
put_r
(id, name, source, *, parent_id='DEFAULT', user_context='DEFAULT', params='DEFAULT', arguments='DEFAULT', schedule='DEFAULT', notifications='DEFAULT', next_run_at='DEFAULT', time_zone='DEFAULT', target_project_id='DEFAULT', required_resources='DEFAULT', cancel_timeout='DEFAULT')¶ Replace all attributes of this R Script
Parameters: - id : integer
The ID for the script.
- name : string
The name of the script.
- source : string
The body/text of the script.
- 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 : list, optional::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- label : string
- The label to present to users when asking them for the value.
- description : string
- A short sentence or fragment describing this parameter to the end user.
- type : string
- The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, database, credential_aws, credential_redshift, or credential_custom
- required : boolean
- Whether this param is required.
- value : string
- The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- default : string
- If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- arguments : dict, optional
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
- schedule : dict, optional::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- notifications : dict, optional::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- next_run_at : string/time, 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 : dict, optional::
- cpu : integer
- The number of CPU shares to allocate for the container. Each core has 1024 shares. Must be at least 2 shares.
- memory : integer
- The amount of RAM to allocate for the container (in MiB). Must be at least 4 MiB.
- disk_space : number/float
- The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.
- 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.
Returns: - 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)
- created_at : string/time
The time this script was created.
- updated_at : string/time
The time the script was last updated.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- state : string
The status of the script’s last run.
- finished_at : string/time
The time that the script’s last run finished.
- category : string
The category of the script.
- projects : list::
A list of projects containing the script. - id : integer
The ID for the project.
- name : string
- The name of the project.
- parent_id : integer
The ID of the parent job that will trigger this script
- user_context : string
“runner” or “author”, who to execute the script as when run as a template.
- params : list::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- label : string
- The label to present to users when asking them for the value.
- description : string
- A short sentence or fragment describing this parameter to the end user.
- type : string
- The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, database, credential_aws, credential_redshift, or credential_custom
- required : boolean
- Whether this param is required.
- value : string
- The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- default : string
- If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
- is_template : boolean
Whether others scripts use this one as a template.
- published_as_template_id : integer
The ID of the template that this script is backing.
- from_template_id : integer
The ID of the template this script uses, if any.
- template_dependents_count : integer
How many other scripts use this one as a template.
- template_script_name : string
The name of the template script.
- links : dict::
- details : string
- The details link to get more information about the script.
- runs : string
- The runs link to get the run information list for this script.
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- notifications : dict::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- running_as : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- next_run_at : string/time
The time of the next scheduled run.
- time_zone : string
The time zone of this script.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- hidden : boolean
The hidden status of the object.
- target_project_id : integer
Target project to which script outputs will be added.
- archived : string
The archival status of the requested object(s).
- required_resources : dict::
- cpu : integer
- The number of CPU shares to allocate for the container. Each core has 1024 shares. Must be at least 2 shares.
- memory : integer
- The amount of RAM to allocate for the container (in MiB). Must be at least 4 MiB.
- disk_space : number/float
- The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.
- source : string
The body/text of the script.
- cancel_timeout : 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.
-
put_r_archive
(id, status)¶ Update the archive status of this object
Parameters: - id : integer
The ID of the object.
- status : boolean
The desired archived status of the object.
Returns: - 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)
- created_at : string/time
The time this script was created.
- updated_at : string/time
The time the script was last updated.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- state : string
The status of the script’s last run.
- finished_at : string/time
The time that the script’s last run finished.
- category : string
The category of the script.
- projects : list::
A list of projects containing the script. - id : integer
The ID for the project.
- name : string
- The name of the project.
- parent_id : integer
The ID of the parent job that will trigger this script
- user_context : string
“runner” or “author”, who to execute the script as when run as a template.
- params : list::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- label : string
- The label to present to users when asking them for the value.
- description : string
- A short sentence or fragment describing this parameter to the end user.
- type : string
- The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, database, credential_aws, credential_redshift, or credential_custom
- required : boolean
- Whether this param is required.
- value : string
- The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- default : string
- If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
- is_template : boolean
Whether others scripts use this one as a template.
- published_as_template_id : integer
The ID of the template that this script is backing.
- from_template_id : integer
The ID of the template this script uses, if any.
- template_dependents_count : integer
How many other scripts use this one as a template.
- template_script_name : string
The name of the template script.
- links : dict::
- details : string
- The details link to get more information about the script.
- runs : string
- The runs link to get the run information list for this script.
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- notifications : dict::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- running_as : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- next_run_at : string/time
The time of the next scheduled run.
- time_zone : string
The time zone of this script.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- hidden : boolean
The hidden status of the object.
- target_project_id : integer
Target project to which script outputs will be added.
- archived : string
The archival status of the requested object(s).
- required_resources : dict::
- cpu : integer
- The number of CPU shares to allocate for the container. Each core has 1024 shares. Must be at least 2 shares.
- memory : integer
- The amount of RAM to allocate for the container (in MiB). Must be at least 4 MiB.
- disk_space : number/float
- The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.
- source : string
The body/text of the script.
- cancel_timeout : 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.
-
put_r_projects
(id, project_id)¶ Add a r docker to a project
Parameters: - id : integer
ID of the resource
- project_id : integer
The ID of the project
Returns: - None
Response code 204: success
Set the permissions groups has on this object
Parameters: - id : integer
ID of the resource to be shared
- group_ids : list
An array of one or more group IDs
- permission_level : string
Options are: “read”, “write”, or “manage”
- share_email_body : string, optional
Custom body text for e-mail sent on a share.
- send_shared_email : boolean, optional
Send email to the recipients of a share.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
Set the permissions users have on this object
Parameters: - id : integer
ID of the resource to be shared
- user_ids : list
An array of one or more user IDs
- permission_level : string
Options are: “read”, “write”, or “manage”
- share_email_body : string, optional
Custom body text for e-mail sent on a share.
- send_shared_email : boolean, optional
Send email to the recipients of a share.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
-
put_sql
(id, name, sql, remote_host_id, credential_id, *, parent_id='DEFAULT', user_context='DEFAULT', params='DEFAULT', arguments='DEFAULT', schedule='DEFAULT', notifications='DEFAULT', next_run_at='DEFAULT', time_zone='DEFAULT', target_project_id='DEFAULT', csv_settings='DEFAULT')¶ Replace all attributes of this SQL script
Parameters: - id : integer
The ID for the script.
- name : string
The name of the script.
- sql : string
The raw SQL query for the script.
- remote_host_id : integer
The remote host ID that this script will connect to.
- credential_id : integer
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 : list, optional::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- label : string
- The label to present to users when asking them for the value.
- description : string
- A short sentence or fragment describing this parameter to the end user.
- type : string
- The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, database, credential_aws, credential_redshift, or credential_custom
- required : boolean
- Whether this param is required.
- value : string
- The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- default : string
- If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- arguments : dict, optional
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
- schedule : dict, optional::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- notifications : dict, optional::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- next_run_at : string/time, 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 : dict, optional::
- include_header : boolean
- Whether or not to include headers in the output data. Default: true
- compression : string
- The type of compression to use, if any, one of “none”, “zip”, or “gzip”. Default: gzip
- column_delimiter : string
- Which delimiter to use, one of “comma”, “tab”, or “pipe”. Default: comma
- unquoted : boolean
- Whether or not to quote fields. Default: false
- force_multifile : boolean
- Whether or not the csv should be split into multiple files. Default: false
- filename_prefix : string
- A user specified filename prefix for the output file to have. Default: null
Returns: - 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)
- created_at : string/time
The time this script was created.
- updated_at : string/time
The time the script was last updated.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- state : string
The status of the script’s last run.
- finished_at : string/time
The time that the script’s last run finished.
- category : string
The category of the script.
- projects : list::
A list of projects containing the script. - id : integer
The ID for the project.
- name : string
- The name of the project.
- parent_id : integer
The ID of the parent job that will trigger this script
- user_context : string
“runner” or “author”, who to execute the script as when run as a template.
- params : list::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- label : string
- The label to present to users when asking them for the value.
- description : string
- A short sentence or fragment describing this parameter to the end user.
- type : string
- The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, database, credential_aws, credential_redshift, or credential_custom
- required : boolean
- Whether this param is required.
- value : string
- The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- default : string
- If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
- is_template : boolean
Whether others scripts use this one as a template.
- published_as_template_id : integer
The ID of the template that this script is backing.
- from_template_id : integer
The ID of the template this script uses, if any.
- template_dependents_count : integer
How many other scripts use this one as a template.
- template_script_name : string
The name of the template script.
- links : dict::
- details : string
- The details link to get more information about the script.
- runs : string
- The runs link to get the run information list for this script.
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- notifications : dict::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- running_as : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- next_run_at : string/time
The time of the next scheduled run.
- time_zone : string
The time zone of this script.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- hidden : boolean
The hidden status of the object.
- target_project_id : integer
Target project to which script outputs will be added.
- archived : string
The archival status of the requested object(s).
- sql : string
The raw SQL query for the script.
- expanded_arguments : dict
Expanded arguments for use in injecting into different environments.
- remote_host_id : integer
The remote host ID that this script will connect to.
- credential_id : integer
The credential that this script will use.
- code_preview : string
The code that this script will run with arguments inserted.
- csv_settings : dict::
- include_header : boolean
- Whether or not to include headers in the output data. Default: true
- compression : string
- The type of compression to use, if any, one of “none”, “zip”, or “gzip”. Default: gzip
- column_delimiter : string
- Which delimiter to use, one of “comma”, “tab”, or “pipe”. Default: comma
- unquoted : boolean
- Whether or not to quote fields. Default: false
- force_multifile : boolean
- Whether or not the csv should be split into multiple files. Default: false
- filename_prefix : string
- A user specified filename prefix for the output file to have. Default: null
-
put_sql_archive
(id, status)¶ Update the archive status of this object
Parameters: - id : integer
The ID of the object.
- status : boolean
The desired archived status of the object.
Returns: - 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)
- created_at : string/time
The time this script was created.
- updated_at : string/time
The time the script was last updated.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- state : string
The status of the script’s last run.
- finished_at : string/time
The time that the script’s last run finished.
- category : string
The category of the script.
- projects : list::
A list of projects containing the script. - id : integer
The ID for the project.
- name : string
- The name of the project.
- parent_id : integer
The ID of the parent job that will trigger this script
- user_context : string
“runner” or “author”, who to execute the script as when run as a template.
- params : list::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- label : string
- The label to present to users when asking them for the value.
- description : string
- A short sentence or fragment describing this parameter to the end user.
- type : string
- The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, database, credential_aws, credential_redshift, or credential_custom
- required : boolean
- Whether this param is required.
- value : string
- The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- default : string
- If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- arguments : dict
Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params.
- is_template : boolean
Whether others scripts use this one as a template.
- published_as_template_id : integer
The ID of the template that this script is backing.
- from_template_id : integer
The ID of the template this script uses, if any.
- template_dependents_count : integer
How many other scripts use this one as a template.
- template_script_name : string
The name of the template script.
- links : dict::
- details : string
- The details link to get more information about the script.
- runs : string
- The runs link to get the run information list for this script.
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- notifications : dict::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- success_email_from_name : string
- Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_to : string
- Address for replies to success emails; defaults to the author of the job.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- stall_warning_minutes : integer
- Stall warning emails will be sent after this amount of minutes.
- success_on : boolean
- If success email notifications are on.
- failure_on : boolean
- If failure email notifications are on.
- running_as : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- next_run_at : string/time
The time of the next scheduled run.
- time_zone : string
The time zone of this script.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- hidden : boolean
The hidden status of the object.
- target_project_id : integer
Target project to which script outputs will be added.
- archived : string
The archival status of the requested object(s).
- sql : string
The raw SQL query for the script.
- expanded_arguments : dict
Expanded arguments for use in injecting into different environments.
- remote_host_id : integer
The remote host ID that this script will connect to.
- credential_id : integer
The credential that this script will use.
- code_preview : string
The code that this script will run with arguments inserted.
- csv_settings : dict::
- include_header : boolean
- Whether or not to include headers in the output data. Default: true
- compression : string
- The type of compression to use, if any, one of “none”, “zip”, or “gzip”. Default: gzip
- column_delimiter : string
- Which delimiter to use, one of “comma”, “tab”, or “pipe”. Default: comma
- unquoted : boolean
- Whether or not to quote fields. Default: false
- force_multifile : boolean
- Whether or not the csv should be split into multiple files. Default: false
- filename_prefix : string
- A user specified filename prefix for the output file to have. Default: null
-
put_sql_projects
(id, project_id)¶ Add a scripts to a project
Parameters: - id : integer
ID of the resource
- project_id : integer
The ID of the project
Returns: - None
Response code 204: success
Set the permissions groups has on this object
Parameters: - id : integer
ID of the resource to be shared
- group_ids : list
An array of one or more group IDs
- permission_level : string
Options are: “read”, “write”, or “manage”
- share_email_body : string, optional
Custom body text for e-mail sent on a share.
- send_shared_email : boolean, optional
Send email to the recipients of a share.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
Set the permissions users have on this object
Parameters: - id : integer
ID of the resource to be shared
- user_ids : list
An array of one or more user IDs
- permission_level : string
Options are: “read”, “write”, or “manage”
- share_email_body : string, optional
Custom body text for e-mail sent on a share.
- send_shared_email : boolean, optional
Send email to the recipients of a share.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
-
Search¶
-
class
Search
(session_kwargs, return_type='civis')¶ Methods
-
list
(*, query='DEFAULT', type='DEFAULT', offset='DEFAULT', order='DEFAULT', owner='DEFAULT', limit='DEFAULT', archived='DEFAULT')¶ Perform a search
Parameters: - 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 50.
- archived : string, optional
If specified, return only results with the chosen archived status; either ‘true’, ‘false’, or ‘all’. Defaults to ‘false’.
Returns: - total_results : integer
The number of items matching the search query.
- aggregations : dict
Aggregations by owner and type for the search results.
- results : list::
The items returned by the search. - score : number/float
The relevance score from the search request.
- type : string
- The type of the item.
- id : integer
- The ID of the item.
- name : string
- The name of the item.
- type_name : string
- The verbose name of the type.
- updated_at : string/time
- The time the item was last updated.
- owner : string
- The owner of the item.
-
list_types
()¶ List available search types
Returns: - type : string
The name of the item type.
-
Tables¶
-
class
Tables
(session_kwargs, return_type='civis')¶ Methods
-
get
(id)¶ Show basic table info
Parameters: - id : integer
Returns: - id : integer
The ID of the table.
- database_id : 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
- is_view : boolean
True if this table represents a view. False if it represents a regular table.
- row_count : integer
The number of rows in the table.
- column_count : integer
The number of columns in the table.
- size_mb : number/float
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.
- refresh_status : string
How up-to-date the table’s statistics on row counts, null counts, distinct counts, and values distributions are. One of: refreshing, stale, or current.
- last_refresh : string/date-time
The time of the last statistics refresh.
- refresh_id : string
The ID of the most recent statistics refresh.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- ontology_mapping : dict
The ontology-key to column-name mapping. See /ontology for the list of valid ontology keys.
- columns : list::
- name : string
- Name of the column.
- sql_type : string
- SQL type of the column.
- sample_values : list
- 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.
- min_value : string
- Smallest value in the column.
- max_value : string
- Largest value in the column.
- avg_value : number/float
- Average value of the column, where applicable.
- stddev : number/float
- Stddev of the column, where applicable.
- value_distribution_percent : dict
- A mapping between each value in the column and the percentage of rows with that value.Only present for tables with fewer than approximately 25,000,000 rows and for columns with fewer than twenty distinct values.
- coverage_count : integer
- Number of non-null values in the column.
- null_count : integer
- Number of null values in the column.
- possible_dependent_variable_types : list
- Possible dependent variable types the column may be used to model. Null if it may not be used as a dependent variable.
- useable_as_independent_variable : boolean
- Whether the column may be used as an independent variable to train a model.
- useable_as_primary_key : boolean
- Whether the column may be used as an primary key to identify table rows.
- value_distribution : dict
- An object mapping distinct values in the column to the number of times they appear in the column
- distinct_count : integer
- Number of distinct values in the column.
- joins : list::
- id : integer
- left_table_id : integer
- left_identifier : string
- right_table_id : integer
- right_identifier : string
- on : string
- left_join : boolean
- created_at : string/time
- updated_at : string/time
- multipart_key : list
- enhancements : list::
- type : string
- created_at : string/time
- updated_at : string/time
- join_id : integer
- view_def : string
- table_def : string
- outgoing_table_matches : list::
- source_table_id : integer
Source table
- target_type : string
Target type
- target_id : integer
Target ID
- target : dict::
- name : string
- job : dict::
id : integer
name : string
type : string
- state : string
Whether the job is idle, queued, running, cancelled, or failed.
created_at : string/date-time
updated_at : string/date-time
- runs : list::
Information about the most recent runs of the job. - id : integer - state : string - created_at : string/time
The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- hidden : boolean
The hidden status of the object.
- match_options : dict::
- max_matches : integer
- threshold : string
-
get_enhancements_cass_ncoa
(id, source_table_id)¶ View the status of a CASS / NCOA table enhancement
Parameters: - id : integer
The ID of the enhancement.
- source_table_id : integer
The ID of the table that was enhanced.
Returns: - id : integer
The ID of the enhancement.
- source_table_id : integer
The ID of the table that was enhanced.
- state : string
The state of the enhancement, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- enhanced_table_schema : string
The schema name of the table created by the enhancement.
- enhanced_table_name : string
The name of the table created by the enhancement.
- perform_ncoa : boolean
Whether to update addresses for records matching the National Change of Address (NCOA) database.
- ncoa_credential_id : integer
Credential to use when performing NCOA updates. Required if ‘performNcoa’ is true.
- output_level : string
The set of fields persisted by a CASS or NCOA enhancement.For CASS enhancements, one of ‘cass’ or ‘all.’For NCOA enhancements, one of ‘cass’, ‘ncoa’ , ‘coalesced’ or ‘all’.By default, all fields will be returned.
-
get_enhancements_geocodings
(id, source_table_id)¶ View the status of a geocoding table enhancement
Parameters: - id : integer
The ID of the enhancement.
- source_table_id : integer
The ID of the table that was enhanced.
Returns: - id : integer
The ID of the enhancement.
- source_table_id : integer
The ID of the table that was enhanced.
- state : string
The state of the enhancement, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- enhanced_table_schema : string
The schema name of the table created by the enhancement.
- enhanced_table_name : string
The name of the table created by the enhancement.
-
get_enhancements_prepared_matchings
(id, source_table_id)¶ View a prepared matching enhancement
Parameters: - id : integer
The ID of the enhancement.
- source_table_id : integer
The ID of the table that was enhanced.
Returns: - id : integer
The ID of the enhancement.
- source_table_id : integer
The ID of the table that was enhanced.
- state : string
The state of the enhancement, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- enhanced_table_schema : string
The schema name of the table created by the enhancement.
- enhanced_table_name : string
The name of the table created by the enhancement.
- threshold : number/float
The confidence threshold which must be met for two individuals to be declared a match. Must be less than or equal to 1 and greater than or equal to 0.
- max_matches : integer
The maximum number of individuals a person may be matched with.A value of 0 indicates that all matches should be returned.
- match_table_id : integer
The ID of the Dynamo table to match against.
-
get_enhancements_table_matchings
(id, source_table_id)¶ View a table matching enhancement
Parameters: - id : integer
The ID of the enhancement.
- source_table_id : integer
The ID of the table that was enhanced.
Returns: - id : integer
The ID of the enhancement.
- source_table_id : integer
The ID of the table that was enhanced.
- state : string
The state of the enhancement, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- enhanced_table_schema : string
The schema name of the table created by the enhancement.
- enhanced_table_name : string
The name of the table created by the enhancement.
- threshold : number/float
The confidence threshold which must be met for two individuals to be declared a match. Must be less than or equal to 1 and greater than or equal to 0.
- max_matches : integer
The maximum number of individuals a person may be matched with.A value of 0 indicates that all matches should be returned.
- match_table_id : integer
The ID of the Redshift table to match against.
-
list
(*, database_id='DEFAULT', schema='DEFAULT', name='DEFAULT', search='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶ List tables
Parameters: - database_id : integer, optional
The ID of the database.
- schema : string, optional
If specified, will be used to filter the tables returned. Substring matching is supported with “%” and “*” wildcards (e.g., “schema=%census%” will return both “client_census.table” and “census_2010.table”).
- name : string, optional
If specified, will be used to filter the tables returned. Substring matching is supported with “%” and “*” wildcards (e.g., “name=%table%” will return both “table1” and “my table”).
- search : string, optional
If specified, will be used to filter the tables returned. Will search across schema and name (in the full form schema.name) and will return any full name containing the search string.
- limit : integer, optional
Number of results to return. Defaults to 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.
- iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: - id : integer
The ID of the table.
- database_id : 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
- is_view : boolean
True if this table represents a view. False if it represents a regular table.
- row_count : integer
The number of rows in the table.
- column_count : integer
The number of columns in the table.
- size_mb : number/float
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.
- refresh_status : string
How up-to-date the table’s statistics on row counts, null counts, distinct counts, and values distributions are. One of: refreshing, stale, or current.
- last_refresh : string/date-time
The time of the last statistics refresh.
- refresh_id : string
The ID of the most recent statistics refresh.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
-
list_columns
(id, *, name='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶ List columns in the specified table
Parameters: - id : integer
- name : string, optional
Search for columns with the given name, within the specified table.
- limit : integer, optional
Number of results to return. Defaults to its maximum of 50.
- page_num : integer, optional
Page number of the results to return. Defaults to the first page, 1.
- order : string, optional
The field on which to order the result set. Defaults to name. Must be one of: name, order.
- order_dir : string, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to asc.
- iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: - name : string
Name of the column.
- sql_type : string
SQL type of the column.
- sample_values : list
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.
- min_value : string
Smallest value in the column.
- max_value : string
Largest value in the column.
- avg_value : number/float
Average value of the column, where applicable.
- stddev : number/float
Stddev of the column, where applicable.
- value_distribution_percent : dict
A mapping between each value in the column and the percentage of rows with that value.Only present for tables with fewer than approximately 25,000,000 rows and for columns with fewer than twenty distinct values.
- coverage_count : integer
Number of non-null values in the column.
- null_count : integer
Number of null values in the column.
- possible_dependent_variable_types : list
Possible dependent variable types the column may be used to model. Null if it may not be used as a dependent variable.
- useable_as_independent_variable : boolean
Whether the column may be used as an independent variable to train a model.
- useable_as_primary_key : boolean
Whether the column may be used as an primary key to identify table rows.
- value_distribution : dict
An object mapping distinct values in the column to the number of times they appear in the column
- distinct_count : integer
Number of distinct values in the column.
-
patch
(id, *, ontology_mapping='DEFAULT', description='DEFAULT')¶ Update a table
Parameters: - id : integer
The ID of the table.
- ontology_mapping : dict, 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.
Returns: - id : integer
The ID of the table.
- database_id : 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
- is_view : boolean
True if this table represents a view. False if it represents a regular table.
- row_count : integer
The number of rows in the table.
- column_count : integer
The number of columns in the table.
- size_mb : number/float
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.
- refresh_status : string
How up-to-date the table’s statistics on row counts, null counts, distinct counts, and values distributions are. One of: refreshing, stale, or current.
- last_refresh : string/date-time
The time of the last statistics refresh.
- refresh_id : string
The ID of the most recent statistics refresh.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- ontology_mapping : dict
The ontology-key to column-name mapping. See /ontology for the list of valid ontology keys.
-
post
(database_id, schema, name, data)¶ Import a file into a table
Parameters: - database_id : integer
The ID of the destination database.
- schema : string
The destination schema name.
- name : string
The destination table name, without the schema prefix.
- data : string
The file to import, uploaded using HTTP multipart.
Returns: - database_id : integer
The ID of the destination database.
- schema : string
The destination schema name.
- name : string
The destination table name, without the schema prefix.
- state : string
The state of the last run.
- started_at : string/date-time
The start time of the last run.
- finished_at : string/date-time
The end time of the last run.
-
post_enhancements_cass_ncoa
(source_table_id, *, perform_ncoa='DEFAULT', ncoa_credential_id='DEFAULT', output_level='DEFAULT')¶ Standardize addresses in a table
Parameters: - source_table_id : integer
The ID of the table to be enhanced.
- perform_ncoa : boolean, optional
Whether to update addresses for records matching the National Change of Address (NCOA) database.
- ncoa_credential_id : integer, optional
Credential to use when performing NCOA updates. Required if ‘performNcoa’ is true.
- output_level : string, optional
The set of fields persisted by a CASS or NCOA enhancement.For CASS enhancements, one of ‘cass’ or ‘all.’For NCOA enhancements, one of ‘cass’, ‘ncoa’ , ‘coalesced’ or ‘all’.By default, all fields will be returned.
Returns: - id : integer
The ID of the enhancement.
- source_table_id : integer
The ID of the table that was enhanced.
- state : string
The state of the enhancement, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- enhanced_table_schema : string
The schema name of the table created by the enhancement.
- enhanced_table_name : string
The name of the table created by the enhancement.
- perform_ncoa : boolean
Whether to update addresses for records matching the National Change of Address (NCOA) database.
- ncoa_credential_id : integer
Credential to use when performing NCOA updates. Required if ‘performNcoa’ is true.
- output_level : string
The set of fields persisted by a CASS or NCOA enhancement.For CASS enhancements, one of ‘cass’ or ‘all.’For NCOA enhancements, one of ‘cass’, ‘ncoa’ , ‘coalesced’ or ‘all’.By default, all fields will be returned.
-
post_enhancements_geocodings
(source_table_id)¶ Geocode a table
Parameters: - source_table_id : integer
The ID of the table to be enhanced.
Returns: - id : integer
The ID of the enhancement.
- source_table_id : integer
The ID of the table that was enhanced.
- state : string
The state of the enhancement, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- enhanced_table_schema : string
The schema name of the table created by the enhancement.
- enhanced_table_name : string
The name of the table created by the enhancement.
-
post_enhancements_prepared_matchings
(source_table_id, threshold, match_table_id, *, max_matches='DEFAULT')¶ Match person records against a dynamo table prepared by Civis
Parameters: - source_table_id : integer
The ID of the table to be enhanced.
- threshold : number/float
The confidence threshold which must be met for two individuals to be declared a match. Must be less than or equal to 1 and greater than or equal to 0.
- match_table_id : integer
The ID of the Dynamo table to match against.
- max_matches : integer, optional
The maximum number of individuals a person may be matched with.A value of 0 indicates that all matches should be returned.
Returns: - id : integer
The ID of the enhancement.
- source_table_id : integer
The ID of the table that was enhanced.
- state : string
The state of the enhancement, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- enhanced_table_schema : string
The schema name of the table created by the enhancement.
- enhanced_table_name : string
The name of the table created by the enhancement.
- threshold : number/float
The confidence threshold which must be met for two individuals to be declared a match. Must be less than or equal to 1 and greater than or equal to 0.
- max_matches : integer
The maximum number of individuals a person may be matched with.A value of 0 indicates that all matches should be returned.
- match_table_id : integer
The ID of the Dynamo table to match against.
-
post_enhancements_table_matchings
(source_table_id, threshold, match_table_id, *, max_matches='DEFAULT')¶ Match person records against an arbitrary Redshift table
Parameters: - source_table_id : integer
The ID of the table to be enhanced.
- threshold : number/float
The confidence threshold which must be met for two individuals to be declared a match. Must be less than or equal to 1 and greater than or equal to 0.
- match_table_id : integer
The ID of the Redshift table to match against.
- max_matches : integer, optional
The maximum number of individuals a person may be matched with.A value of 0 indicates that all matches should be returned.
Returns: - id : integer
The ID of the enhancement.
- source_table_id : integer
The ID of the table that was enhanced.
- state : string
The state of the enhancement, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- enhanced_table_schema : string
The schema name of the table created by the enhancement.
- enhanced_table_name : string
The name of the table created by the enhancement.
- threshold : number/float
The confidence threshold which must be met for two individuals to be declared a match. Must be less than or equal to 1 and greater than or equal to 0.
- max_matches : integer
The maximum number of individuals a person may be matched with.A value of 0 indicates that all matches should be returned.
- match_table_id : integer
The ID of the Redshift table to match against.
-
post_refresh
(id)¶ Request a refresh for column and table statistics
Parameters: - id : integer
Returns: - id : integer
The ID of the table.
- database_id : 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
- is_view : boolean
True if this table represents a view. False if it represents a regular table.
- row_count : integer
The number of rows in the table.
- column_count : integer
The number of columns in the table.
- size_mb : number/float
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.
- refresh_status : string
How up-to-date the table’s statistics on row counts, null counts, distinct counts, and values distributions are. One of: refreshing, stale, or current.
- last_refresh : string/date-time
The time of the last statistics refresh.
- refresh_id : string
The ID of the most recent statistics refresh.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- ontology_mapping : dict
The ontology-key to column-name mapping. See /ontology for the list of valid ontology keys.
- columns : list::
- name : string
- Name of the column.
- sql_type : string
- SQL type of the column.
- sample_values : list
- 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.
- min_value : string
- Smallest value in the column.
- max_value : string
- Largest value in the column.
- avg_value : number/float
- Average value of the column, where applicable.
- stddev : number/float
- Stddev of the column, where applicable.
- value_distribution_percent : dict
- A mapping between each value in the column and the percentage of rows with that value.Only present for tables with fewer than approximately 25,000,000 rows and for columns with fewer than twenty distinct values.
- coverage_count : integer
- Number of non-null values in the column.
- null_count : integer
- Number of null values in the column.
- possible_dependent_variable_types : list
- Possible dependent variable types the column may be used to model. Null if it may not be used as a dependent variable.
- useable_as_independent_variable : boolean
- Whether the column may be used as an independent variable to train a model.
- useable_as_primary_key : boolean
- Whether the column may be used as an primary key to identify table rows.
- value_distribution : dict
- An object mapping distinct values in the column to the number of times they appear in the column
- distinct_count : integer
- Number of distinct values in the column.
- joins : list::
- id : integer
- left_table_id : integer
- left_identifier : string
- right_table_id : integer
- right_identifier : string
- on : string
- left_join : boolean
- created_at : string/time
- updated_at : string/time
- multipart_key : list
- enhancements : list::
- type : string
- created_at : string/time
- updated_at : string/time
- join_id : integer
- view_def : string
- table_def : string
- outgoing_table_matches : list::
- source_table_id : integer
Source table
- target_type : string
Target type
- target_id : integer
Target ID
- target : dict::
- name : string
- job : dict::
id : integer
name : string
type : string
- state : string
Whether the job is idle, queued, running, cancelled, or failed.
created_at : string/date-time
updated_at : string/date-time
- runs : list::
Information about the most recent runs of the job. - id : integer - state : string - created_at : string/time
The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- last_run : dict::
- id : integer
- state : string
- created_at : string/time
- The time that the run was queued.
- started_at : string/time
- The time that the run started.
- finished_at : string/time
- The time that the run completed.
- error : string
- The error message for this run, if present.
- hidden : boolean
The hidden status of the object.
- match_options : dict::
- max_matches : integer
- threshold : string
-
Templates¶
-
class
Templates
(session_kwargs, return_type='civis')¶ Methods
Revoke the permissions a group has on this object
Parameters: - id : integer
ID of the resource to be revoked
- group_id : integer
ID of the group
Returns: - None
Response code 204: success
Revoke the permissions a user has on this object
Parameters: - id : integer
ID of the resource to be revoked
- user_id : integer
ID of the user
Returns: - None
Response code 204: success
-
delete_scripts_projects
(id, project_id)¶ Remove a Template::Script from a project
Parameters: - id : integer
ID of the resource
- project_id : integer
The ID of the project
Returns: - None
Response code 204: success
Revoke the permissions a group has on this object
Parameters: - id : integer
ID of the resource to be revoked
- group_id : integer
ID of the group
Returns: - None
Response code 204: success
Revoke the permissions a user has on this object
Parameters: - id : integer
ID of the resource to be revoked
- user_id : integer
ID of the user
Returns: - None
Response code 204: success
-
get_reports
(id)¶ Get a Report Template
Parameters: - id : integer
Returns: - 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
- created_at : string/time
- updated_at : string/time
- use_count : integer
The number of uses of this template.
- archived : boolean
Whether the template has been archived.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- tech_reviewed : boolean
Whether this template has been audited by Civis for security vulnerability and correctness.
- auth_code_url : string
A URL to the template’s stored code body.
- provide_api_key : boolean
Whether reports based on this template request an API Key from the report viewer.
- hidden : boolean
The hidden status of the object.
-
get_scripts
(id)¶ Get a Script Template
Parameters: - id : integer
Returns: - id : integer
- script_id : integer
The id of the script that this template uses.
- user_context : 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.
- created_at : string/time
- updated_at : string/time
- use_count : integer
The number of uses of this template.
- ui_report_id : integer
The id of the report that this template uses.
- tech_reviewed : 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 object.
-
list_reports
(*, hidden='DEFAULT', category='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶ List Report Templates
Parameters: - hidden : boolean, optional
If specified to be true, returns hidden objects. Defaults to false, returning non-hidden objects.
- 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.
- iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: - 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
- created_at : string/time
- updated_at : string/time
- use_count : integer
The number of uses of this template.
- archived : boolean
Whether the template has been archived.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- tech_reviewed : boolean
Whether this template has been audited by Civis for security vulnerability and correctness.
List users and groups permissioned on this object
Parameters: - id : integer
The ID of the object.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
-
list_scripts
(*, hidden='DEFAULT', category='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶ List Script Templates
Parameters: - hidden : boolean, optional
If specified to be true, returns hidden objects. Defaults to false, returning non-hidden objects.
- 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.
- iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: - id : integer
- script_id : integer
The id of the script that this template uses.
- user_context : 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.
- created_at : string/time
- updated_at : string/time
- use_count : integer
The number of uses of this template.
- ui_report_id : integer
The id of the report that this template uses.
- tech_reviewed : boolean
Whether this template has been audited by Civis for security vulnerability and correctness.
- archived : boolean
Whether the template has been archived.
-
list_scripts_projects
(id, *, hidden='DEFAULT')¶ List the projects a Template::Script belongs to
Parameters: - id : integer
The ID of the resource.
- hidden : boolean, optional
If specified to be true, returns hidden objects. Defaults to false, returning non-hidden objects.
Returns: - id : integer
The ID for this project.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- name : string
The name of this project.
- description : string
A description of the project
- users : list::
Users who can see the project - id : integer
The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- auto_share : boolean
- created_at : string/time
- updated_at : string/time
- archived : string
The archival status of the requested object(s).
List users and groups permissioned on this object
Parameters: - id : integer
The ID of the object.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
-
patch_reports
(id, *, name='DEFAULT', category='DEFAULT', archived='DEFAULT', code_body='DEFAULT', provide_api_key='DEFAULT')¶ Update some attributes of this Report Template
Parameters: - id : integer
- 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.
Returns: - 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
- created_at : string/time
- updated_at : string/time
- use_count : integer
The number of uses of this template.
- archived : boolean
Whether the template has been archived.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- tech_reviewed : boolean
Whether this template has been audited by Civis for security vulnerability and correctness.
- auth_code_url : string
A URL to the template’s stored code body.
- provide_api_key : boolean
Whether reports based on this template request an API Key from the report viewer.
- hidden : boolean
The hidden status of the object.
-
patch_scripts
(id, *, name='DEFAULT', note='DEFAULT', ui_report_id='DEFAULT', archived='DEFAULT')¶ Update some attributes of this Script Template
Parameters: - id : integer
- 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.
Returns: - id : integer
- script_id : integer
The id of the script that this template uses.
- user_context : 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.
- created_at : string/time
- updated_at : string/time
- use_count : integer
The number of uses of this template.
- ui_report_id : integer
The id of the report that this template uses.
- tech_reviewed : 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 object.
-
post_reports
(name, code_body, *, category='DEFAULT', archived='DEFAULT', provide_api_key='DEFAULT', hidden='DEFAULT')¶ Create a Report Template
Parameters: - name : string
The name of the template.
- code_body : string
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.
- hidden : boolean, optional
The hidden status of the object.
Returns: - 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
- created_at : string/time
- updated_at : string/time
- use_count : integer
The number of uses of this template.
- archived : boolean
Whether the template has been archived.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- tech_reviewed : boolean
Whether this template has been audited by Civis for security vulnerability and correctness.
- auth_code_url : string
A URL to the template’s stored code body.
- provide_api_key : boolean
Whether reports based on this template request an API Key from the report viewer.
- hidden : boolean
The hidden status of the object.
-
post_scripts
(script_id, name, *, note='DEFAULT', ui_report_id='DEFAULT', archived='DEFAULT', hidden='DEFAULT')¶ Create a Script Template
Parameters: - script_id : integer
The id of the script that this template uses.
- name : string
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.
- hidden : boolean, optional
The hidden status of the object.
Returns: - id : integer
- script_id : integer
The id of the script that this template uses.
- user_context : 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.
- created_at : string/time
- updated_at : string/time
- use_count : integer
The number of uses of this template.
- ui_report_id : integer
The id of the report that this template uses.
- tech_reviewed : 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 object.
-
put_reports
(id, name, code_body, *, category='DEFAULT', archived='DEFAULT', provide_api_key='DEFAULT')¶ Replace all attributes of this Report Template
Parameters: - id : integer
- name : string
The name of the template.
- code_body : string
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.
Returns: - 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
- created_at : string/time
- updated_at : string/time
- use_count : integer
The number of uses of this template.
- archived : boolean
Whether the template has been archived.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- tech_reviewed : boolean
Whether this template has been audited by Civis for security vulnerability and correctness.
- auth_code_url : string
A URL to the template’s stored code body.
- provide_api_key : boolean
Whether reports based on this template request an API Key from the report viewer.
- hidden : boolean
The hidden status of the object.
Set the permissions groups has on this object
Parameters: - id : integer
ID of the resource to be shared
- group_ids : list
An array of one or more group IDs
- permission_level : string
Options are: “read”, “write”, or “manage”
- share_email_body : string, optional
Custom body text for e-mail sent on a share.
- send_shared_email : boolean, optional
Send email to the recipients of a share.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
Set the permissions users have on this object
Parameters: - id : integer
ID of the resource to be shared
- user_ids : list
An array of one or more user IDs
- permission_level : string
Options are: “read”, “write”, or “manage”
- share_email_body : string, optional
Custom body text for e-mail sent on a share.
- send_shared_email : boolean, optional
Send email to the recipients of a share.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
-
put_scripts
(id, name, *, note='DEFAULT', ui_report_id='DEFAULT', archived='DEFAULT')¶ Replace all attributes of this Script Template
Parameters: - id : integer
- name : string
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.
Returns: - id : integer
- script_id : integer
The id of the script that this template uses.
- user_context : 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.
- created_at : string/time
- updated_at : string/time
- use_count : integer
The number of uses of this template.
- ui_report_id : integer
The id of the report that this template uses.
- tech_reviewed : 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 object.
-
put_scripts_projects
(id, project_id)¶ Add a Template::Script to a project
Parameters: - id : integer
ID of the resource
- project_id : integer
The ID of the project
Returns: - None
Response code 204: success
Set the permissions groups has on this object
Parameters: - id : integer
ID of the resource to be shared
- group_ids : list
An array of one or more group IDs
- permission_level : string
Options are: “read”, “write”, or “manage”
- share_email_body : string, optional
Custom body text for e-mail sent on a share.
- send_shared_email : boolean, optional
Send email to the recipients of a share.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
Set the permissions users have on this object
Parameters: - id : integer
ID of the resource to be shared
- user_ids : list
An array of one or more user IDs
- permission_level : string
Options are: “read”, “write”, or “manage”
- share_email_body : string, optional
Custom body text for e-mail sent on a share.
- send_shared_email : boolean, optional
Send email to the recipients of a share.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
Users¶
-
class
Users
(session_kwargs, return_type='civis')¶ Methods
-
delete_api_keys
(id, key_id)¶ Revoke the specified API key
Parameters: - id : string
The ID of the user or ‘me’.
- key_id : integer
The ID of the API key.
Returns: - id : integer
The ID of the API key.
- name : string
The name of the API key.
- expires_at : string/date-time
The date and time when the key expired.
- created_at : string/date-time
The date and time when the key was created.
- revoked_at : string/date-time
The date and time when the key was revoked.
- last_used_at : string/date-time
The date and time when the key was last used.
- scopes : list
The scopes which the key is permissioned on.
- use_count : 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 : list::
Constraints on the abilities of the created key - constraint : string
The path matcher of the constraint.
- constraint_type : string
- The type of constraint (exact/prefix/regex/verb).
- get_allowed : boolean
- Whether the constraint allows GET requests.
- head_allowed : boolean
- Whether the constraint allows HEAD requests.
- post_allowed : boolean
- Whether the constraint allows POST requests.
- put_allowed : boolean
- Whether the constraint allows PUT requests.
- patch_allowed : boolean
- Whether the constraint allows PATCH requests.
- delete_allowed : boolean
- Whether the constraint allows DELETE requests.
-
get
(id)¶ Show info about a user
Parameters: - id : integer
The ID of this user.
Returns: - 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 : string
The account status of this user.
- primary_group_id : integer
The ID of the primary group of this user.
- groups : list::
An array of all the groups this user is in. - id : integer
The ID of this group.
- name : string
- The name of this group.
- organization_id : integer
- The organization associated with this group.
- city : string
The city of this user.
- state : string
The state of this user.
- time_zone : string
The time zone of this user.
- initials : string
The initials of this user.
- department : string
The deartment of this user.
- title : string
The title of this user.
- github_username : string
The GitHub username of this user.
- prefers_sms_otp : string
The preference for phone authorization of this user
- vpn_enabled : string
The availability of vpn for this user.
- otp_required_for_login : string
The two factor authorization requirement for this user.
- phone : string
The phone number of this user.
-
get_api_keys
(id, key_id)¶ Show the specified API key
Parameters: - id : string
The ID of the user or ‘me’.
- key_id : integer
The ID of the API key.
Returns: - id : integer
The ID of the API key.
- name : string
The name of the API key.
- expires_at : string/date-time
The date and time when the key expired.
- created_at : string/date-time
The date and time when the key was created.
- revoked_at : string/date-time
The date and time when the key was revoked.
- last_used_at : string/date-time
The date and time when the key was last used.
- scopes : list
The scopes which the key is permissioned on.
- use_count : 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 : list::
Constraints on the abilities of the created key - constraint : string
The path matcher of the constraint.
- constraint_type : string
- The type of constraint (exact/prefix/regex/verb).
- get_allowed : boolean
- Whether the constraint allows GET requests.
- head_allowed : boolean
- Whether the constraint allows HEAD requests.
- post_allowed : boolean
- Whether the constraint allows POST requests.
- put_allowed : boolean
- Whether the constraint allows PUT requests.
- patch_allowed : boolean
- Whether the constraint allows PATCH requests.
- delete_allowed : boolean
- Whether the constraint allows DELETE requests.
-
list
(*, feature_flag='DEFAULT', account_status='DEFAULT', query='DEFAULT', group_id='DEFAULT', organization_id='DEFAULT', exclude_groups='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶ List users
Parameters: - feature_flag : string, optional
Return users that have a feature flag enabled.
- account_status : string, optional
The account status by which to filter users. May be one of “active”, “inactive”, or “all”.
- query : string, optional
Return users who match the given query, based on name, user, and email.
- 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.
- iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: - 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 : string
The account status of this user.
- primary_group_id : integer
The ID of the primary group of this user.
- groups : list::
An array of all the groups this user is in. - id : integer
The ID of this group.
- name : string
- The name of this group.
- organization_id : integer
- The organization associated with this group.
- created_at : string/date-time
The date and time when the user was created.
- current_sign_in_at : string/date-time
The date and time when the user’s current session began.
-
list_api_keys
(id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶ Show API keys belonging to the specified user
Parameters: - id : string
The ID of the user or ‘me’.
- limit : integer, optional
Number of results to return. Defaults to its maximum of 50.
- page_num : integer, optional
Page number of the results to return. Defaults to the first page, 1.
- order : string, optional
The field on which to order the result set. Defaults to id. Must be one of: id.
- order_dir : string, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: - id : integer
The ID of the API key.
- name : string
The name of the API key.
- expires_at : string/date-time
The date and time when the key expired.
- created_at : string/date-time
The date and time when the key was created.
- revoked_at : string/date-time
The date and time when the key was revoked.
- last_used_at : string/date-time
The date and time when the key was last used.
- scopes : list
The scopes which the key is permissioned on.
- use_count : 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.
- constraint_count : integer
The number of constraints on the created key
-
list_me
()¶ Show info about the logged-in user
Returns: - 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.
- last_checked_announcements : string/date-time
The date and time at which the user last checked their announcements.
- feature_flags : dict
The feature flag settings for this user.
- roles : list
The roles this user has, listed by slug.
- preferences : dict
This user’s preferences.
- custom_branding : string
The branding of Platform for this user.
- groups : list::
An array of all the groups this user is in. - id : integer
The ID of this group.
- name : string
- The name of this group.
- organization_id : integer
- The organization associated with this group.
- organization_name : string
The name of the organization the user belongs to.
- created_at : string/date-time
The date and time when the user was created.
- sign_in_count : integer
The number of times the user has signed in.
-
patch_me
(*, preferences='DEFAULT', last_checked_announcements='DEFAULT')¶ Update info about the logged-in user
Parameters: - preferences : dict, optional::
- app_index_order_field : string
- Order field for the apps index pages.
- app_index_order_dir : string
- Oder direction for the apps index pages.
- result_index_order_field : string
- Order field for the results index page.
- result_index_order_dir : string
- Order direction for the results index page.
- result_index_type_filter : string
- Type filter for the results index page.
- result_index_author_filter : string
- Author filter for the results index page.
- result_index_archived_filter : string
- Archived filter for the results index page.
- import_index_order_field : string
- Order field for the imports index page.
- import_index_order_dir : string
- Order direction for the imports index page.
- import_index_type_filter : string
- Type filter for the imports index page.
- import_index_author_filter : string
- Author filter for the imports index page.
- import_index_dest_filter : string
- Destination filter for the imports index page.
- import_index_status_filter : string
- Status filter for the imports index page.
- import_index_archived_filter : string
- Archived filter for the imports index page.
- export_index_order_field : string
- Order field for the exports index page.
- export_index_order_dir : string
- Order direction for the exports index page.
- export_index_type_filter : string
- Type filter for the exports index page.
- export_index_author_filter : string
- Author filter for the exports index page.
- export_index_status_filter : string
- Status filter for the exports index page.
- model_index_order_field : string
- Order field for the models index page.
- model_index_order_dir : string
- Order direction for the models index page.
- model_index_author_filter : string
- Author filter for the models index page.
- model_index_status_filter : string
- Status filter for the models index page.
- model_index_archived_filter : string
- Archived filter for the models index page.
- model_index_thumbnail_view : string
- Thumbnail view for the models index page.
- script_index_order_field : string
- Order field for the scripts index page.
- script_index_order_dir : string
- Order direction for the scripts index page.
- script_index_type_filter : string
- Type filter for the scripts index page.
- script_index_author_filter : string
- Author filter for the scripts index page.
- script_index_status_filter : string
- Status filter for the scripts index page.
- script_index_archived_filter : string
- Archived filter for the scripts index page.
- project_index_order_field : string
- Order field for the projects index page.
- project_index_order_dir : string
- Order direction for the projects index page.
- project_index_author_filter : string
- Author filter for the projects index page.
- project_index_archived_filter : string
- Archived filter for the projects index page.
- report_index_thumbnail_view : string
- Thumbnail view for the reports index page.
- project_detail_order_field : string
- Order field for projects detail pages.
- project_detail_order_dir : string
- Order direction for projects detail pages.
- project_detail_author_filter : string
- Author filter for projects detail pages.
- project_detail_type_filter : string
- Type filter for projects detail pages.
- project_detail_archived_filter : string
- Archived filter for the projects detail pages.
- enhancement_index_order_field : string
- Order field for the enhancements index page.
- enhancement_index_order_dir : string
- Order direction for the enhancements index page.
- enhancement_index_author_filter : string
- Author filter for the enhancements index page.
- enhancement_index_archived_filter : string
- Archived filter for the enhancements index page.
- preferred_server_id : integer
- ID of preferred server.
- civis_explore_skip_intro : boolean
- Whether the user is shown steps for each exploration.
- registration_index_order_field : string
- Order field for the registrations index page.
- registration_index_order_dir : string
- Order direction for the registrations index page.
- registration_index_status_filter : string
- Status filter for the registrations index page.
- upgrade_requested : string
- Whether a free trial upgrade has been requested.
- welcome_order_field : string
- Order direction for the welcome page.
- welcome_order_dir : string
- Order direction for the welcome page.
- welcome_author_filter : string
- Status filter for the welcome page.
- welcome_status_filter : string
- Status filter for the welcome page.
- welcome_archived_filter : string
- Status filter for the welcome page.
- data_pane_width : string
- Width of the data pane when expanded.
- data_pane_collapsed : string
- Whether the data pane is collapsed.
- notebook_order_field : string
- Order field for the notebooks page.
- notebook_order_dir : string
- Order direction for the notebooks page.
- notebook_author_filter : string
- Author filter for the notebooks page.
- notebook_archived_filter : string
- Archived filter for the notebooks page.
- notebook_status_filter : string
- Status filter for the notebooks page.
- workflow_index_order_field : string
- Order field for the workflows page.
- workflow_index_order_dir : string
- Order direction for the workflows page.
- workflow_index_author_filter : string
- Author filter for the workflows page.
- last_checked_announcements : string/date-time, optional
The date and time at which the user last checked their announcements.
Returns: - 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.
- last_checked_announcements : string/date-time
The date and time at which the user last checked their announcements.
- feature_flags : dict
The feature flag settings for this user.
- roles : list
The roles this user has, listed by slug.
- preferences : dict
This user’s preferences.
- custom_branding : string
The branding of Platform for this user.
- groups : list::
An array of all the groups this user is in. - id : integer
The ID of this group.
- name : string
- The name of this group.
- organization_id : integer
- The organization associated with this group.
- organization_name : string
The name of the organization the user belongs to.
- created_at : string/date-time
The date and time when the user was created.
- sign_in_count : integer
The number of times the user has signed in.
-
post_api_keys
(id, name, expires_in, *, constraints='DEFAULT')¶ Create a new API key belonging to the logged-in user
Parameters: - id : string
The ID of the user or ‘me’.
- name : string
The name of the API key.
- expires_in : integer
The number of seconds the key should last for.
- constraints : list, optional::
Constraints on the abilities of the created key. - constraint : string
The path matcher of the constraint.
- constraint_type : string
- The type of constraint (exact/prefix/regex/verb).
- get_allowed : boolean
- Whether the constraint allows GET requests.
- head_allowed : boolean
- Whether the constraint allows HEAD requests.
- post_allowed : boolean
- Whether the constraint allows POST requests.
- put_allowed : boolean
- Whether the constraint allows PUT requests.
- patch_allowed : boolean
- Whether the constraint allows PATCH requests.
- delete_allowed : boolean
- Whether the constraint allows DELETE requests.
Returns: - id : integer
The ID of the API key.
- name : string
The name of the API key.
- expires_at : string/date-time
The date and time when the key expired.
- created_at : string/date-time
The date and time when the key was created.
- revoked_at : string/date-time
The date and time when the key was revoked.
- last_used_at : string/date-time
The date and time when the key was last used.
- scopes : list
The scopes which the key is permissioned on.
- use_count : 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 : list::
Constraints on the abilities of the created key - constraint : string
The path matcher of the constraint.
- constraint_type : string
- The type of constraint (exact/prefix/regex/verb).
- get_allowed : boolean
- Whether the constraint allows GET requests.
- head_allowed : boolean
- Whether the constraint allows HEAD requests.
- post_allowed : boolean
- Whether the constraint allows POST requests.
- put_allowed : boolean
- Whether the constraint allows PUT requests.
- patch_allowed : boolean
- Whether the constraint allows PATCH requests.
- delete_allowed : boolean
- Whether the constraint allows DELETE requests.
- token : string
The API key.
-
Workflows¶
-
class
Workflows
(session_kwargs, return_type='civis')¶ Methods
-
delete_projects
(id, project_id)¶ Remove a Workflow::Workflow from a project
Parameters: - id : integer
ID of the resource
- project_id : integer
The ID of the project
Returns: - None
Response code 204: success
Revoke the permissions a group has on this object
Parameters: - id : integer
ID of the resource to be revoked
- group_id : integer
ID of the group
Returns: - None
Response code 204: success
Revoke the permissions a user has on this object
Parameters: - id : integer
ID of the resource to be revoked
- user_id : integer
ID of the user
Returns: - None
Response code 204: success
-
get
(id)¶ Get a Workflow
Parameters: - id : integer
Returns: - id : integer
The ID for this workflow.
- name : string
The name of this 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.
- validation_errors : string
The errors encountered when validating the workflow definition.
- file_id : string
The file id for the s3 file containing the workflow configuration.
- user : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- state : string
The state of the workflow. State is “running” if any execution is running, otherwise reflects most recent execution state.
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- time_zone : string
The time zone of this workflow.
- next_execution_at : string/time
The time of the next scheduled execution.
- notifications : dict::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- success_on : boolean
- If success email notifications are on
- failure_on : boolean
- If failure email notifications are on
- archived : string
The archival status of the requested object(s).
- hidden : boolean
The hidden status of the object.
- created_at : string/time
- updated_at : string/time
-
get_executions
(id, execution_id)¶ Get a workflow execution
Parameters: - id : integer
The ID for the workflow.
- execution_id : integer
The ID for the workflow execution.
Returns: - id : integer
The ID for this workflow execution.
- state : string
The state of this workflow execution.
- mistral_state : string
The state of this workflow as reported by mistral. One of running, paused, success, error, or cancelled
- mistral_state_info : string
The state info of this workflow as reported by mistral.
- user : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- definition : string
The definition of the workflow for this execution.
- tasks : list::
The tasks associated with this execution. - name : string
The name of the task.
- mistral_state : string
The state of this task. One of idle, waiting, running, running_delayed, success, or error
- mistral_state_info : string
Extra info associated with the state of the task.
- runs : list::
The runs associated with this task, in descending order by id. - id : integer
The ID of the run.
- job_id : integer
- The ID of the job associated with the run.
- started_at : string/time
The time this execution started.
- finished_at : string/time
The time this execution finished.
- created_at : string/time
The time this execution was created.
- updated_at : string/time
The time this execution was last updated.
-
list
(*, hidden='DEFAULT', archived='DEFAULT', author='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶ List Workflows
Parameters: - hidden : boolean, optional
If specified to be true, returns hidden objects. Defaults to false, returning non-hidden objects.
- archived : string, optional
The archival status of the requested object(s).
- author : string, optional
If specified, return workflows from this author. It accepts a comma- separated list of author ids.
- limit : integer, optional
Number of results to return. Defaults to 20. Maximum allowed is 50.
- page_num : integer, optional
Page number of the results to return. Defaults to the first page, 1.
- order : string, optional
The field on which to order the result set. Defaults to updated_at. Must be one of: updated_at, name, created_at.
- order_dir : string, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: - id : integer
The ID for this workflow.
- name : string
The name of this workflow.
- valid : boolean
The validity of the workflow definition.
- file_id : string
The file id for the s3 file containing the workflow configuration.
- user : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- state : string
The state of the workflow. State is “running” if any execution is running, otherwise reflects most recent execution state.
- time_zone : string
The time zone of this workflow.
- next_execution_at : string/time
The time of the next scheduled execution.
- archived : string
The archival status of the requested object(s).
- created_at : string/time
- updated_at : string/time
-
list_executions
(id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶ List workflow executions
Parameters: - id : integer
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.
- iterator : bool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
Returns: - id : integer
The ID for this workflow execution.
- state : string
The state of this workflow execution.
- mistral_state : string
The state of this workflow as reported by mistral. One of running, paused, success, error, or cancelled
- mistral_state_info : string
The state info of this workflow as reported by mistral.
- user : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- started_at : string/time
The time this execution started.
- finished_at : string/time
The time this execution finished.
- created_at : string/time
The time this execution was created.
- updated_at : string/time
The time this execution was last updated.
-
list_projects
(id, *, hidden='DEFAULT')¶ List the projects a Workflow::Workflow belongs to
Parameters: - id : integer
The ID of the resource.
- hidden : boolean, optional
If specified to be true, returns hidden objects. Defaults to false, returning non-hidden objects.
Returns: - id : integer
The ID for this project.
- author : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- name : string
The name of this project.
- description : string
A description of the project
- users : list::
Users who can see the project - id : integer
The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- auto_share : boolean
- created_at : string/time
- updated_at : string/time
- archived : string
The archival status of the requested object(s).
List users and groups permissioned on this object
Parameters: - id : integer
The ID of the object.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
-
patch
(id, *, name='DEFAULT', definition='DEFAULT', schedule='DEFAULT', time_zone='DEFAULT', notifications='DEFAULT')¶ Update some attributes of this Workflow
Parameters: - id : integer
The ID for this workflow.
- name : string, optional
The name of this workflow.
- definition : string, optional
The definition of the workflow in YAML format. Must not be specified if fromJobChain is specified.
- schedule : dict, optional::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- time_zone : string, optional
The time zone of this workflow.
- notifications : dict, optional::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- success_on : boolean
- If success email notifications are on
- failure_on : boolean
- If failure email notifications are on
Returns: - id : integer
The ID for this workflow.
- name : string
The name of this 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.
- validation_errors : string
The errors encountered when validating the workflow definition.
- file_id : string
The file id for the s3 file containing the workflow configuration.
- user : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- state : string
The state of the workflow. State is “running” if any execution is running, otherwise reflects most recent execution state.
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- time_zone : string
The time zone of this workflow.
- next_execution_at : string/time
The time of the next scheduled execution.
- notifications : dict::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- success_on : boolean
- If success email notifications are on
- failure_on : boolean
- If failure email notifications are on
- archived : string
The archival status of the requested object(s).
- hidden : boolean
The hidden status of the object.
- created_at : string/time
- updated_at : string/time
-
post
(name, *, from_job_chain='DEFAULT', definition='DEFAULT', schedule='DEFAULT', time_zone='DEFAULT', notifications='DEFAULT', hidden='DEFAULT')¶ Create a Workflow
Parameters: - name : string
The name of this 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 : dict, optional::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- time_zone : string, optional
The time zone of this workflow.
- notifications : dict, optional::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- success_on : boolean
- If success email notifications are on
- failure_on : boolean
- If failure email notifications are on
- hidden : boolean, optional
The hidden status of the object.
Returns: - id : integer
The ID for this workflow.
- name : string
The name of this 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.
- validation_errors : string
The errors encountered when validating the workflow definition.
- file_id : string
The file id for the s3 file containing the workflow configuration.
- user : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- state : string
The state of the workflow. State is “running” if any execution is running, otherwise reflects most recent execution state.
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- time_zone : string
The time zone of this workflow.
- next_execution_at : string/time
The time of the next scheduled execution.
- notifications : dict::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- success_on : boolean
- If success email notifications are on
- failure_on : boolean
- If failure email notifications are on
- archived : string
The archival status of the requested object(s).
- hidden : boolean
The hidden status of the object.
- created_at : string/time
- updated_at : string/time
-
post_clone
(id, *, clone_schedule='DEFAULT', clone_notifications='DEFAULT')¶ Clone this workflow
Parameters: - id : integer
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.
Returns: - id : integer
The ID for this workflow.
- name : string
The name of this 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.
- validation_errors : string
The errors encountered when validating the workflow definition.
- file_id : string
The file id for the s3 file containing the workflow configuration.
- user : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- state : string
The state of the workflow. State is “running” if any execution is running, otherwise reflects most recent execution state.
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- time_zone : string
The time zone of this workflow.
- next_execution_at : string/time
The time of the next scheduled execution.
- notifications : dict::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- success_on : boolean
- If success email notifications are on
- failure_on : boolean
- If failure email notifications are on
- archived : string
The archival status of the requested object(s).
- hidden : boolean
The hidden status of the object.
- created_at : string/time
- updated_at : string/time
-
post_executions
(id, *, target_task='DEFAULT')¶ Execute a workflow
Parameters: - id : integer
The ID for the workflow.
- target_task : string, optional
For a reverse workflow, the name of the task to target.
Returns: - id : integer
The ID for this workflow execution.
- state : string
The state of this workflow execution.
- mistral_state : string
The state of this workflow as reported by mistral. One of running, paused, success, error, or cancelled
- mistral_state_info : string
The state info of this workflow as reported by mistral.
- user : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- definition : string
The definition of the workflow for this execution.
- tasks : list::
The tasks associated with this execution. - name : string
The name of the task.
- mistral_state : string
The state of this task. One of idle, waiting, running, running_delayed, success, or error
- mistral_state_info : string
Extra info associated with the state of the task.
- runs : list::
The runs associated with this task, in descending order by id. - id : integer
The ID of the run.
- job_id : integer
- The ID of the job associated with the run.
- started_at : string/time
The time this execution started.
- finished_at : string/time
The time this execution finished.
- created_at : string/time
The time this execution was created.
- updated_at : string/time
The time this execution was last updated.
-
post_executions_cancel
(id, execution_id)¶ Cancel a workflow execution
Parameters: - id : integer
The ID for the workflow.
- execution_id : integer
The ID for the workflow execution.
Returns: - id : integer
The ID for this workflow execution.
- state : string
The state of this workflow execution.
- mistral_state : string
The state of this workflow as reported by mistral. One of running, paused, success, error, or cancelled
- mistral_state_info : string
The state info of this workflow as reported by mistral.
- user : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- definition : string
The definition of the workflow for this execution.
- tasks : list::
The tasks associated with this execution. - name : string
The name of the task.
- mistral_state : string
The state of this task. One of idle, waiting, running, running_delayed, success, or error
- mistral_state_info : string
Extra info associated with the state of the task.
- runs : list::
The runs associated with this task, in descending order by id. - id : integer
The ID of the run.
- job_id : integer
- The ID of the job associated with the run.
- started_at : string/time
The time this execution started.
- finished_at : string/time
The time this execution finished.
- created_at : string/time
The time this execution was created.
- updated_at : string/time
The time this execution was last updated.
-
post_executions_resume
(id, execution_id)¶ Resume a paused workflow execution
Parameters: - id : integer
The ID for the workflow.
- execution_id : integer
The ID for the workflow execution.
Returns: - id : integer
The ID for this workflow execution.
- state : string
The state of this workflow execution.
- mistral_state : string
The state of this workflow as reported by mistral. One of running, paused, success, error, or cancelled
- mistral_state_info : string
The state info of this workflow as reported by mistral.
- user : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- definition : string
The definition of the workflow for this execution.
- tasks : list::
The tasks associated with this execution. - name : string
The name of the task.
- mistral_state : string
The state of this task. One of idle, waiting, running, running_delayed, success, or error
- mistral_state_info : string
Extra info associated with the state of the task.
- runs : list::
The runs associated with this task, in descending order by id. - id : integer
The ID of the run.
- job_id : integer
- The ID of the job associated with the run.
- started_at : string/time
The time this execution started.
- finished_at : string/time
The time this execution finished.
- created_at : string/time
The time this execution was created.
- updated_at : string/time
The time this execution was last updated.
-
post_executions_retry
(id, execution_id, *, task_name='DEFAULT')¶ Retry a failed task, or all failed tasks in an execution
Parameters: - id : integer
The ID for the workflow.
- execution_id : integer
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.
Returns: - id : integer
The ID for this workflow execution.
- state : string
The state of this workflow execution.
- mistral_state : string
The state of this workflow as reported by mistral. One of running, paused, success, error, or cancelled
- mistral_state_info : string
The state info of this workflow as reported by mistral.
- user : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- definition : string
The definition of the workflow for this execution.
- tasks : list::
The tasks associated with this execution. - name : string
The name of the task.
- mistral_state : string
The state of this task. One of idle, waiting, running, running_delayed, success, or error
- mistral_state_info : string
Extra info associated with the state of the task.
- runs : list::
The runs associated with this task, in descending order by id. - id : integer
The ID of the run.
- job_id : integer
- The ID of the job associated with the run.
- started_at : string/time
The time this execution started.
- finished_at : string/time
The time this execution finished.
- created_at : string/time
The time this execution was created.
- updated_at : string/time
The time this execution was last updated.
-
put
(id, name, *, definition='DEFAULT', schedule='DEFAULT', time_zone='DEFAULT', notifications='DEFAULT')¶ Replace all attributes of this Workflow
Parameters: - id : integer
The ID for this workflow.
- name : string
The name of this workflow.
- definition : string, optional
The definition of the workflow in YAML format. Must not be specified if fromJobChain is specified.
- schedule : dict, optional::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- time_zone : string, optional
The time zone of this workflow.
- notifications : dict, optional::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- success_on : boolean
- If success email notifications are on
- failure_on : boolean
- If failure email notifications are on
Returns: - id : integer
The ID for this workflow.
- name : string
The name of this 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.
- validation_errors : string
The errors encountered when validating the workflow definition.
- file_id : string
The file id for the s3 file containing the workflow configuration.
- user : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- state : string
The state of the workflow. State is “running” if any execution is running, otherwise reflects most recent execution state.
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- time_zone : string
The time zone of this workflow.
- next_execution_at : string/time
The time of the next scheduled execution.
- notifications : dict::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- success_on : boolean
- If success email notifications are on
- failure_on : boolean
- If failure email notifications are on
- archived : string
The archival status of the requested object(s).
- hidden : boolean
The hidden status of the object.
- created_at : string/time
- updated_at : string/time
-
put_archive
(id, status)¶ Update the archive status of this object
Parameters: - id : integer
The ID of the object.
- status : boolean
The desired archived status of the object.
Returns: - id : integer
The ID for this workflow.
- name : string
The name of this 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.
- validation_errors : string
The errors encountered when validating the workflow definition.
- file_id : string
The file id for the s3 file containing the workflow configuration.
- user : dict::
- id : integer
- The ID of this user.
- name : string
- This user’s name.
- username : string
- This user’s username.
- initials : string
- This user’s initials.
- online : boolean
- Whether this user is online.
- state : string
The state of the workflow. State is “running” if any execution is running, otherwise reflects most recent execution state.
- schedule : dict::
- scheduled : boolean
- If the object is scheduled
- scheduled_days : list
- Day based on numeric value starting at 0 for Sunday
- scheduled_hours : list
- Hours of the day it is scheduled on
- scheduled_minutes : list
- Minutes of the day it is scheduled on
- scheduled_runs_per_hour : integer
- Alternative to scheduled minutes, number of times to run per hour
- time_zone : string
The time zone of this workflow.
- next_execution_at : string/time
The time of the next scheduled execution.
- notifications : dict::
- urls : list
- URLs to receive a POST request at job completion
- success_email_subject : string
- Custom subject line for success e-mail.
- success_email_body : string
- Custom body text for success e-mail, written in Markdown.
- success_email_addresses : list
- Addresses to notify by e-mail when the job completes successfully.
- failure_email_addresses : list
- Addresses to notify by e-mail when the job fails.
- success_on : boolean
- If success email notifications are on
- failure_on : boolean
- If failure email notifications are on
- archived : string
The archival status of the requested object(s).
- hidden : boolean
The hidden status of the object.
- created_at : string/time
- updated_at : string/time
-
put_projects
(id, project_id)¶ Add a Workflow::Workflow to a project
Parameters: - id : integer
ID of the resource
- project_id : integer
The ID of the project
Returns: - None
Response code 204: success
Set the permissions groups has on this object
Parameters: - id : integer
ID of the resource to be shared
- group_ids : list
An array of one or more group IDs
- permission_level : string
Options are: “read”, “write”, or “manage”
- share_email_body : string, optional
Custom body text for e-mail sent on a share.
- send_shared_email : boolean, optional
Send email to the recipients of a share.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
Set the permissions users have on this object
Parameters: - id : integer
ID of the resource to be shared
- user_ids : list
An array of one or more user IDs
- permission_level : string
Options are: “read”, “write”, or “manage”
- share_email_body : string, optional
Custom body text for e-mail sent on a share.
- send_shared_email : boolean, optional
Send email to the recipients of a share.
Returns: - readers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- writers : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- owners : dict::
- users : list::
- id : integer
- name : string
- groups : list::
- id : integer
- name : string
- total_user_shares : integer
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_shares : integer
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
-