API Resources¶
Admin¶
- class Admin(session_kwargs, client, return_type='civis')¶
Examples
>>> import civis >>> client = civis.APIClient() >>> client.admin.list_announcements(...)
Methods
Delete an announcement
Get a particular announcement
list_announcements
(*[, limit, page_num, ...])List announcements
list_organizations
(*[, status, org_type])List organizations
patch_announcements
(id, *[, subject, body, ...])Edit an announcement
patch_themes
(id, *[, name, ...])Edit a theme
post_announcements
(subject, body, *[, ...])Post an announcement
post_themes
(name, settings_json, *[, ...])Create a theme
- delete_announcements(id)¶
Delete an announcement
- Parameters
- idinteger
The ID of this announcement
- Returns
- None
Response code 204: success
- get_announcements(id)¶
Get a particular announcement
- Parameters
- idinteger
The ID of this announcement
- Returns
civis.response.Response
- idinteger
The ID of this announcement
- subjectstring
The subject of this announcement.
- bodystring
The body of this announcement.
- released_atstring/date-time
The date and time this announcement was released.
created_at : string/date-time
updated_at : string/date-time
- list_announcements(*, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶
List announcements
- Parameters
- limitinteger, optional
Number of results to return. Defaults to 10. Maximum allowed is 50.
- page_numinteger, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstring, optional
The field on which to order the result set. Defaults to released_at. Must be one of: released_at.
- order_dirstring, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iteratorbool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
- Returns
civis.response.PaginatedResponse
- idinteger
The ID of this announcement
- subjectstring
The subject of this announcement.
- bodystring
The body of this announcement.
- released_atstring/date-time
The date and time this announcement was released.
created_at : string/date-time
updated_at : string/date-time
- list_organizations(*, status='DEFAULT', org_type='DEFAULT')¶
List organizations
- Parameters
- statusarray, optional
The status of the organization (active/trial/inactive).
- org_typearray, optional
The organization type (platform/ads/survey_vendor/other).
- Returns
civis.response.Response
- idinteger
The ID of this organization.
- namestring
The name of this organization.
- slugstring
The slug of this organization.
- account_manager_idinteger
The user ID of the Account Manager.
- cs_specialist_idinteger
The user ID of the Client Success Specialist.
- statusstring
The status of the organization (active/trial/inactive).
- org_typestring
The organization type (platform/ads/survey_vendor/other).
- custom_brandingstring
The custom branding settings.
- contract_sizeinteger
The monthly contract size.
- max_analyst_usersinteger
The max number of full platform users for the org.
- max_report_usersinteger
The max number of report-only platform users for the org.
- verticalstring
The business vertical that the organization belongs to.
- cs_metadatastring
Additional metadata about the organization in JSON format.
- remove_footer_in_emailsboolean
If true, emails sent by platform will not include Civis text.
- salesforce_account_idstring
The SalesForce Account ID for this organization.
- tableau_site_idstring
The Tableau Site ID for this organization.
- fedramp_enabledboolean
Flag denoting whether this organization is FedRAMP compliant.
- created_by_idinteger
The ID of the user who created this organization
- last_updated_by_idinteger
The ID of the user who last updated this organization
- advanced_settingsdict::
- dedicated_dj_pool_enabledboolean
If true, the Organization has a dedicated delayed jobs pool. Defaults to false.
- tableau_refresh_historylist
The number of tableau refreshes used this month.
- patch_announcements(id, *, subject='DEFAULT', body='DEFAULT', released_at='DEFAULT')¶
Edit an announcement
- Parameters
- idinteger
The ID of this announcement
- subjectstring, optional
The subject of this announcement.
- bodystring, optional
The body of this announcement.
- released_atstring/date-time, optional
The date and time this announcement was released.
- Returns
civis.response.Response
- idinteger
The ID of this announcement
- subjectstring
The subject of this announcement.
- bodystring
The body of this announcement.
- released_atstring/date-time
The date and time this announcement was released.
created_at : string/date-time
updated_at : string/date-time
- patch_themes(id, *, name='DEFAULT', organization_ids='DEFAULT', settings_json='DEFAULT', logo_file_id='DEFAULT')¶
Edit a theme
- Parameters
- idinteger
The ID of this theme.
- namestring, optional
The name of this theme.
- organization_idslist, optional
List of organization ID’s allowed to see this theme.
- settings_jsonstring, optional
The JSON-encoded theme configuration.
- logo_file_idstring, optional
The ID of the logo image file.
- Returns
civis.response.Response
- idinteger
The ID of this theme.
- namestring
The name of this theme.
- organization_idslist
List of organization ID’s allowed to use this theme.
- settingsstring
The theme configuration object.
- logo_filedict::
- idinteger
The ID of the logo image file.
- download_urlstring
The URL of the logo image file.
created_at : string/date-time
updated_at : string/date-time
- post_announcements(subject, body, *, released_at='DEFAULT')¶
Post an announcement
- Parameters
- subjectstring
The subject of this announcement.
- bodystring
The body of this announcement.
- released_atstring/date-time, optional
The date and time this announcement was released.
- Returns
civis.response.Response
- idinteger
The ID of this announcement
- subjectstring
The subject of this announcement.
- bodystring
The body of this announcement.
- released_atstring/date-time
The date and time this announcement was released.
created_at : string/date-time
updated_at : string/date-time
- post_themes(name, settings_json, *, organization_ids='DEFAULT', logo_file_id='DEFAULT')¶
Create a theme
- Parameters
- namestring
The name of this theme.
- settings_jsonstring
The JSON-encoded theme configuration.
- organization_idslist, optional
List of organization ID’s allowed to see this theme.
- logo_file_idstring, optional
The ID of the logo image file.
- Returns
civis.response.Response
- idinteger
The ID of this theme.
- namestring
The name of this theme.
- organization_idslist
List of organization ID’s allowed to use this theme.
- settingsstring
The theme configuration object.
- logo_filedict::
- idinteger
The ID of the logo image file.
- download_urlstring
The URL of the logo image file.
created_at : string/date-time
updated_at : string/date-time
Aliases¶
- class Aliases(session_kwargs, client, return_type='civis')¶
Examples
>>> import civis >>> client = civis.APIClient() >>> client.aliases.list_shares(...)
Methods
delete
(id)Delete an alias
delete_shares_groups
(id, group_id)Revoke the permissions a group has on this object
delete_shares_users
(id, user_id)Revoke the permissions a user has on this object
get
(id)Get an Alias
get_object_type
(object_type, alias)Get details about an alias within an FCO type
list
(*[, object_type, limit, page_num, ...])List Aliases
list_dependencies
(id, *[, user_id])List dependent objects for this object
list_shares
(id)List users and groups permissioned on this object
patch
(id, *[, object_id, object_type, ...])Update some attributes of this Alias
post
(object_id, object_type, alias, *[, ...])Create an Alias
put
(id, object_id, object_type, alias, *[, ...])Replace all attributes of this Alias
put_shares_groups
(id, group_ids, ...[, ...])Set the permissions groups has on this object
put_shares_users
(id, user_ids, ...[, ...])Set the permissions users have on this object
put_transfer
(id, user_id, ...[, email_body, ...])Transfer ownership of this object to another user
- delete(id)¶
Delete an alias
- Parameters
- idinteger
The id of the Alias object.
- Returns
- None
Response code 204: success
Revoke the permissions a group has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- group_idinteger
The ID of the group.
- Returns
- None
Response code 204: success
Revoke the permissions a user has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger
The ID of the user.
- Returns
- None
Response code 204: success
- get(id)¶
Get an Alias
- Parameters
- idinteger
- Returns
civis.response.Response
- idinteger
The id of the Alias object.
- object_idinteger
The id of the object
- object_typestring
The type of the object. Valid types include: cass_ncoa, container_script, geocode, python_script, r_script, salesforce_export, javascript_script, sql_script, project, notebook, workflow, template_script, template_report, service, report, tableau and service_report.
- aliasstring
The alias of the object
- user_idinteger
The id of the user who created the alias
- display_namestring
The display name of the Alias object. Defaults to object name if not provided.
- get_object_type(object_type, alias)¶
Get details about an alias within an FCO type
- Parameters
- object_typestring
The type of the object. Valid types include: cass_ncoa, container_script, geocode, python_script, r_script, salesforce_export, javascript_script, sql_script, project, notebook, workflow, template_script, template_report, service, report, tableau and service_report.
- aliasstring
The alias of the object
- Returns
civis.response.Response
- idinteger
The id of the Alias object.
- object_idinteger
The id of the object
- object_typestring
The type of the object. Valid types include: cass_ncoa, container_script, geocode, python_script, r_script, salesforce_export, javascript_script, sql_script, project, notebook, workflow, template_script, template_report, service, report, tableau and service_report.
- aliasstring
The alias of the object
- user_idinteger
The id of the user who created the alias
- display_namestring
The display name of the Alias object. Defaults to object name if not provided.
- list(*, object_type='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶
List Aliases
- Parameters
- object_typestring, optional
Filter results by object type. Pass multiple object types with a comma- separatedlist. Valid types include: cass_ncoa, container_script, geocode, python_script, r_script, salesforce_export, javascript_script, sql_script, project, notebook, workflow, template_script, template_report, service, report, tableau and service_report.
- limitinteger, optional
Number of results to return. Defaults to 50. Maximum allowed is 1000.
- page_numinteger, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstring, optional
The field on which to order the result set. Defaults to id. Must be one of: id, object_type.
- order_dirstring, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to asc.
- iteratorbool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
- Returns
civis.response.PaginatedResponse
- idinteger
The id of the Alias object.
- object_idinteger
The id of the object
- object_typestring
The type of the object. Valid types include: cass_ncoa, container_script, geocode, python_script, r_script, salesforce_export, javascript_script, sql_script, project, notebook, workflow, template_script, template_report, service, report, tableau and service_report.
- aliasstring
The alias of the object
- user_idinteger
The id of the user who created the alias
- display_namestring
The display name of the Alias object. Defaults to object name if not provided.
- list_dependencies(id, *, user_id='DEFAULT')¶
List dependent objects for this object
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger, optional
ID of target user
- Returns
civis.response.Response
- object_typestring
Dependent object type
- fco_typestring
Human readable dependent object type
- idinteger
Dependent object ID
- namestring
Dependent object name, or nil if the requesting user cannot read this object
- permission_levelstring
Permission level of target user (not user’s groups) for dependent object, or null if no target user
- shareableboolean
Whether or not the requesting user can share this object.
List users and groups permissioned on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
- patch(id, *, object_id='DEFAULT', object_type='DEFAULT', alias='DEFAULT', display_name='DEFAULT')¶
Update some attributes of this Alias
- Parameters
- idinteger
The id of the Alias object.
- object_idinteger, optional
The id of the object
- object_typestring, optional
The type of the object. Valid types include: cass_ncoa, container_script, geocode, python_script, r_script, salesforce_export, javascript_script, sql_script, project, notebook, workflow, template_script, template_report, service, report, tableau and service_report.
- aliasstring, optional
The alias of the object
- display_namestring, optional
The display name of the Alias object. Defaults to object name if not provided.
- Returns
civis.response.Response
- idinteger
The id of the Alias object.
- object_idinteger
The id of the object
- object_typestring
The type of the object. Valid types include: cass_ncoa, container_script, geocode, python_script, r_script, salesforce_export, javascript_script, sql_script, project, notebook, workflow, template_script, template_report, service, report, tableau and service_report.
- aliasstring
The alias of the object
- user_idinteger
The id of the user who created the alias
- display_namestring
The display name of the Alias object. Defaults to object name if not provided.
- post(object_id, object_type, alias, *, display_name='DEFAULT')¶
Create an Alias
- Parameters
- object_idinteger
The id of the object
- object_typestring
The type of the object. Valid types include: cass_ncoa, container_script, geocode, python_script, r_script, salesforce_export, javascript_script, sql_script, project, notebook, workflow, template_script, template_report, service, report, tableau and service_report.
- aliasstring
The alias of the object
- display_namestring, optional
The display name of the Alias object. Defaults to object name if not provided.
- Returns
civis.response.Response
- idinteger
The id of the Alias object.
- object_idinteger
The id of the object
- object_typestring
The type of the object. Valid types include: cass_ncoa, container_script, geocode, python_script, r_script, salesforce_export, javascript_script, sql_script, project, notebook, workflow, template_script, template_report, service, report, tableau and service_report.
- aliasstring
The alias of the object
- user_idinteger
The id of the user who created the alias
- display_namestring
The display name of the Alias object. Defaults to object name if not provided.
- put(id, object_id, object_type, alias, *, display_name='DEFAULT')¶
Replace all attributes of this Alias
- Parameters
- idinteger
The id of the Alias object.
- object_idinteger
The id of the object
- object_typestring
The type of the object. Valid types include: cass_ncoa, container_script, geocode, python_script, r_script, salesforce_export, javascript_script, sql_script, project, notebook, workflow, template_script, template_report, service, report, tableau and service_report.
- aliasstring
The alias of the object
- display_namestring, optional
The display name of the Alias object. Defaults to object name if not provided.
- Returns
civis.response.Response
- idinteger
The id of the Alias object.
- object_idinteger
The id of the object
- object_typestring
The type of the object. Valid types include: cass_ncoa, container_script, geocode, python_script, r_script, salesforce_export, javascript_script, sql_script, project, notebook, workflow, template_script, template_report, service, report, tableau and service_report.
- aliasstring
The alias of the object
- user_idinteger
The id of the user who created the alias
- display_namestring
The display name of the Alias object. Defaults to object name if not provided.
Set the permissions groups has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- group_idslist
An array of one or more group IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
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
- idinteger
The ID of the resource that is shared.
- user_idslist
An array of one or more user IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
- put_transfer(id, user_id, include_dependencies, *, email_body='DEFAULT', send_email='DEFAULT')¶
Transfer ownership of this object to another user
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger
ID of target user
- include_dependenciesboolean
Whether or not to give manage permissions on all dependencies
- email_bodystring, optional
Custom body text for e-mail sent on transfer.
- send_emailboolean, optional
Send email to the target user of the transfer?
- Returns
civis.response.Response
- dependencieslist::
Dependent objects for this object - object_type : string
Dependent object type
- fco_typestring
Human readable dependent object type
- idinteger
Dependent object ID
- namestring
Dependent object name, or nil if the requesting user cannot read this object
- permission_levelstring
Permission level of target user (not user’s groups) for dependent object, or null if no target user
- sharedboolean
Whether dependent object was successfully shared with target user
Announcements¶
- class Announcements(session_kwargs, client, return_type='civis')¶
Examples
>>> import civis >>> client = civis.APIClient() >>> client.announcements.list(...)
Methods
list
(*[, limit, page_num, order, order_dir, ...])List announcements
- list(*, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶
List announcements
- Parameters
- limitinteger, optional
Number of results to return. Defaults to 10. Maximum allowed is 50.
- page_numinteger, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstring, optional
The field on which to order the result set. Defaults to released_at. Must be one of: released_at.
- order_dirstring, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iteratorbool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
- Returns
civis.response.PaginatedResponse
- idinteger
The ID of this announcement
- subjectstring
The subject of this announcement.
- bodystring
The body of this announcement.
- released_atstring/date-time
The date and time this announcement was released.
created_at : string/date-time
updated_at : string/date-time
Clusters¶
- class Clusters(session_kwargs, client, return_type='civis')¶
Examples
>>> import civis >>> client = civis.APIClient() >>> client.clusters.list_kubernetes(...)
Methods
delete_kubernetes_partitions
(id, ...)Delete a Cluster Partition
get_kubernetes
(id, *[, include_usage_stats])Describe a Kubernetes Cluster
get_kubernetes_instance_configs
(...[, ...])Describe an Instance Config
get_kubernetes_partitions
(id, ...[, ...])Describe a Cluster Partition
list_kubernetes
(*[, organization_slug, ...])List Kubernetes Clusters
Get stats about deployments associated with a Kubernetes Cluster
list_kubernetes_deployments
(id, *[, ...])List the deployments associated with a Kubernetes Cluster
List active workloads in an Instance Config
Get graphs of historical resource usage in an Instance Config
Get statistics about the current users of an Instance Config
list_kubernetes_partitions
(id, *[, ...])List Cluster Partitions for given cluster
patch_kubernetes
(id, *[, raw_cluster_slug, ...])Update a Kubernetes Cluster
patch_kubernetes_partitions
(id, ...[, ...])Update a Cluster Partition
post_kubernetes
(*[, organization_id, ...])Create a Kubernetes Cluster
post_kubernetes_partitions
(id, ...)Create a Cluster Partition for given cluster
- delete_kubernetes_partitions(id, cluster_partition_id)¶
Delete a Cluster Partition
- Parameters
- idinteger
The ID of the cluster which this partition belongs to.
- cluster_partition_idinteger
The ID of this cluster partition.
- Returns
- None
Response code 204: success
- get_kubernetes(id, *, include_usage_stats='DEFAULT')¶
Describe a Kubernetes Cluster
- Parameters
- idinteger
- include_usage_statsboolean, optional
When true, usage stats are returned in instance config objects. Defaults to false.
- Returns
civis.response.Response
- idinteger
The ID of this cluster.
- organization_idstring
The id of this cluster’s organization.
- organization_namestring
The name of this cluster’s organization.
- organization_slugstring
The slug of this cluster’s organization.
- raw_cluster_slugstring
The slug of this cluster’s raw configuration.
- custom_partitionsboolean
Whether this cluster has a custom partition configuration.
- cluster_partitionslist::
List of cluster partitions associated with this cluster. - cluster_partition_id : integer
The ID of this cluster partition.
- namestring
The name of the cluster partition.
- labelslist
Labels associated with this partition.
- instance_configslist::
The instances configured for this cluster partition. - instance_config_id : integer
The ID of this InstanceConfig.
- instance_typestring
An EC2 instance type. Possible values include t2.large, m4.xlarge, m4.2xlarge, m4.4xlarge, m5.12xlarge, c5.18xlarge, and p2.xlarge.
- min_instancesinteger
The minimum number of instances of that type in this cluster.
- max_instancesinteger
The maximum number of instances of that type in this cluster.
- instance_max_memoryinteger
The amount of memory (RAM) available to a single instance of that type in megabytes.
- instance_max_cpuinteger
The number of processor shares available to a single instance of that type in millicores.
- instance_max_diskinteger
The amount of disk available to a single instance of that type in gigabytes.
- usage_statsdict::
- pending_memory_requestedinteger
The sum of memory requests (in MB) for pending deployments in this instance config.
- pending_cpu_requestedinteger
The sum of cpu requests (in millicores) for pending deployments in this instance config.
- running_memory_requestedinteger
The sum of memory requests (in MB) for running deployments in this instance config.
- running_cpu_requestedinteger
The sum of cpu requests (in millicores) for running deployments in this instance config.
- pending_deploymentsinteger
The number of pending deployments in this instance config.
- running_deploymentsinteger
The number of running deployments in this instance config.
- default_instance_config_idinteger
The id of the InstanceConfig that is the default for this partition.
- is_nat_enabledboolean
Whether this cluster needs a NAT gateway or not.
- hoursnumber/float
The number of hours used this month for this cluster.
- get_kubernetes_instance_configs(instance_config_id, *, include_usage_stats='DEFAULT')¶
Describe an Instance Config
- Parameters
- instance_config_idinteger
The ID of this instance config.
- include_usage_statsboolean, optional
When true, usage stats are returned in instance config objects. Defaults to false.
- Returns
civis.response.Response
- instance_config_idinteger
The ID of this InstanceConfig.
- instance_typestring
An EC2 instance type. Possible values include t2.large, m4.xlarge, m4.2xlarge, m4.4xlarge, m5.12xlarge, c5.18xlarge, and p2.xlarge.
- min_instancesinteger
The minimum number of instances of that type in this cluster.
- max_instancesinteger
The maximum number of instances of that type in this cluster.
- instance_max_memoryinteger
The amount of memory (RAM) available to a single instance of that type in megabytes.
- instance_max_cpuinteger
The number of processor shares available to a single instance of that type in millicores.
- instance_max_diskinteger
The amount of disk available to a single instance of that type in gigabytes.
- usage_statsdict::
- pending_memory_requestedinteger
The sum of memory requests (in MB) for pending deployments in this instance config.
- pending_cpu_requestedinteger
The sum of cpu requests (in millicores) for pending deployments in this instance config.
- running_memory_requestedinteger
The sum of memory requests (in MB) for running deployments in this instance config.
- running_cpu_requestedinteger
The sum of cpu requests (in millicores) for running deployments in this instance config.
- pending_deploymentsinteger
The number of pending deployments in this instance config.
- running_deploymentsinteger
The number of running deployments in this instance config.
- cluster_partition_idinteger
The ID of this InstanceConfig’s cluster partition
- cluster_partition_namestring
The name of this InstanceConfig’s cluster partition
- get_kubernetes_partitions(id, cluster_partition_id, *, include_usage_stats='DEFAULT')¶
Describe a Cluster Partition
- Parameters
- idinteger
The ID of the cluster which this partition belongs to.
- cluster_partition_idinteger
The ID of this cluster partition.
- include_usage_statsboolean, optional
When true, usage stats are returned in instance config objects. Defaults to false.
- Returns
civis.response.Response
- cluster_partition_idinteger
The ID of this cluster partition.
- namestring
The name of the cluster partition.
- labelslist
Labels associated with this partition.
- instance_configslist::
The instances configured for this cluster partition. - instance_config_id : integer
The ID of this InstanceConfig.
- instance_typestring
An EC2 instance type. Possible values include t2.large, m4.xlarge, m4.2xlarge, m4.4xlarge, m5.12xlarge, c5.18xlarge, and p2.xlarge.
- min_instancesinteger
The minimum number of instances of that type in this cluster.
- max_instancesinteger
The maximum number of instances of that type in this cluster.
- instance_max_memoryinteger
The amount of memory (RAM) available to a single instance of that type in megabytes.
- instance_max_cpuinteger
The number of processor shares available to a single instance of that type in millicores.
- instance_max_diskinteger
The amount of disk available to a single instance of that type in gigabytes.
- usage_statsdict::
- pending_memory_requestedinteger
The sum of memory requests (in MB) for pending deployments in this instance config.
- pending_cpu_requestedinteger
The sum of cpu requests (in millicores) for pending deployments in this instance config.
- running_memory_requestedinteger
The sum of memory requests (in MB) for running deployments in this instance config.
- running_cpu_requestedinteger
The sum of cpu requests (in millicores) for running deployments in this instance config.
- pending_deploymentsinteger
The number of pending deployments in this instance config.
- running_deploymentsinteger
The number of running deployments in this instance config.
- default_instance_config_idinteger
The id of the InstanceConfig that is the default for this partition.
- list_kubernetes(*, organization_slug='DEFAULT', raw_cluster_slug='DEFAULT', exclude_inactive_orgs='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶
List Kubernetes Clusters
- Parameters
- organization_slugstring, optional
The slug of this cluster’s organization.
- raw_cluster_slugstring, optional
The slug of this cluster’s raw configuration.
- exclude_inactive_orgsboolean, optional
When true, excludes KubeClusters associated with inactive orgs. Defaults to false.
- limitinteger, optional
Number of results to return. Defaults to its maximum of 50.
- page_numinteger, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstring, optional
The field on which to order the result set. Defaults to organization_id. Must be one of: organization_id, created_at.
- order_dirstring, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to asc.
- iteratorbool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
- Returns
civis.response.PaginatedResponse
- idinteger
The ID of this cluster.
- organization_idstring
The id of this cluster’s organization.
- organization_namestring
The name of this cluster’s organization.
- organization_slugstring
The slug of this cluster’s organization.
- raw_cluster_slugstring
The slug of this cluster’s raw configuration.
- custom_partitionsboolean
Whether this cluster has a custom partition configuration.
- cluster_partitionslist::
List of cluster partitions associated with this cluster. - cluster_partition_id : integer
The ID of this cluster partition.
- namestring
The name of the cluster partition.
- labelslist
Labels associated with this partition.
- instance_configslist::
The instances configured for this cluster partition. - instance_config_id : integer
The ID of this InstanceConfig.
- instance_typestring
An EC2 instance type. Possible values include t2.large, m4.xlarge, m4.2xlarge, m4.4xlarge, m5.12xlarge, c5.18xlarge, and p2.xlarge.
- min_instancesinteger
The minimum number of instances of that type in this cluster.
- max_instancesinteger
The maximum number of instances of that type in this cluster.
- instance_max_memoryinteger
The amount of memory (RAM) available to a single instance of that type in megabytes.
- instance_max_cpuinteger
The number of processor shares available to a single instance of that type in millicores.
- instance_max_diskinteger
The amount of disk available to a single instance of that type in gigabytes.
- usage_statsdict::
- pending_memory_requestedinteger
The sum of memory requests (in MB) for pending deployments in this instance config.
- pending_cpu_requestedinteger
The sum of cpu requests (in millicores) for pending deployments in this instance config.
- running_memory_requestedinteger
The sum of memory requests (in MB) for running deployments in this instance config.
- running_cpu_requestedinteger
The sum of cpu requests (in millicores) for running deployments in this instance config.
- pending_deploymentsinteger
The number of pending deployments in this instance config.
- running_deploymentsinteger
The number of running deployments in this instance config.
- default_instance_config_idinteger
The id of the InstanceConfig that is the default for this partition.
- is_nat_enabledboolean
Whether this cluster needs a NAT gateway or not.
- list_kubernetes_deployment_stats(id)¶
Get stats about deployments associated with a Kubernetes Cluster
- Parameters
- idinteger
The ID of this cluster.
- Returns
civis.response.Response
- base_typestring
The base type of this deployment
- statestring
State of the deployment
- countinteger
Number of deployments of base type and state
- total_cpuinteger
Total amount of CPU in millicores for deployments of base type and state
- total_memoryinteger
Total amount of Memory in megabytes for deployments of base type and state
- list_kubernetes_deployments(id, *, base_type='DEFAULT', state='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶
List the deployments associated with a Kubernetes Cluster
- Parameters
- idinteger
The id of the cluster.
- base_typestring, optional
If specified, return deployments of these base types. It accepts a comma- separated list, possible values are ‘Notebook’, ‘Service’, ‘Run’.
- statestring, optional
If specified, return deployments in these states. It accepts a comma- separated list, possible values are pending, running, terminated, sleeping
- limitinteger, optional
Number of results to return. Defaults to its maximum of 50.
- page_numinteger, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstring, optional
The field on which to order the result set. Defaults to created_at. Must be one of: created_at.
- order_dirstring, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to asc.
- iteratorbool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
- Returns
civis.response.PaginatedResponse
- idinteger
The id of this deployment.
- namestring
The name of the deployment.
- base_idinteger
The id of the base object associated with the deployment.
- base_typestring
The base type of this deployment.
- statestring
The state of the deployment.
- cpuinteger
The CPU in millicores required by the deployment.
- memoryinteger
The memory in MB required by the deployment.
- disk_spaceinteger
The disk space in GB required by the deployment.
- instance_typestring
The EC2 instance type requested for the deployment.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- max_memory_usagenumber/float
If the deployment has finished, the maximum amount of memory used during the deployment, in MB.
- max_cpu_usagenumber/float
If the deployment has finished, the maximum amount of cpu used during the deployment, in millicores.
created_at : string/time
updated_at : string/time
- list_kubernetes_instance_configs_active_workloads(id, *, state='DEFAULT')¶
List active workloads in an Instance Config
- Parameters
- idinteger
The id of the instance config.
- statestring, optional
If specified, return workloads in these states. It accepts a comma- separated list, possible values are pending, running
- Returns
civis.response.Response
- idinteger
The id of this deployment.
- base_typestring
The base type of this deployment.
- base_idinteger
The id of the base object associated with this deployment.
- base_object_namestring
The name of the base object associated with this deployment. Null if you do not have permission to read the object.
- job_typestring
If the base object is a job run you have permission to read, the type of the job. One of “python_script”, “r_script”, “container_script”, or “custom_script”.
- job_idinteger
If the base object is a job run you have permission to read, the id of the job.
- job_cancel_requested_atstring/time
If the base object is a job run you have permission to read, and it was requested to be cancelled, the timestamp of that request.
- statestring
The state of this deployment.
- cpuinteger
The CPU in millicores requested by this deployment.
- memoryinteger
The memory in MB requested by this deployment.
- disk_spaceinteger
The disk space in GB requested by this deployment.
- userdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- created_atstring/time
The timestamp of when the deployment began.
- cancellableboolean
True if you have permission to cancel this deployment.
- list_kubernetes_instance_configs_historical_graphs(instance_config_id, *, timeframe='DEFAULT')¶
Get graphs of historical resource usage in an Instance Config
- Parameters
- instance_config_idinteger
The ID of this instance config.
- timeframestring, optional
The span of time that the graphs cover. Must be one of 1_day, 1_week.
- Returns
civis.response.Response
- cpu_graph_urlstring
URL for the graph of historical CPU usage in this instance config.
- mem_graph_urlstring
URL for the graph of historical memory usage in this instance config.
- list_kubernetes_instance_configs_user_statistics(instance_config_id, *, order='DEFAULT', order_dir='DEFAULT')¶
Get statistics about the current users of an Instance Config
- Parameters
- instance_config_idinteger
The ID of this instance config.
- orderstring, optional
The field on which to order the result set. Defaults to running_deployments. Must be one of pending_memory_requested, pending_cpu_requested, running_memory_requested, running_cpu_requested, pending_deployments, running_deployments.
- order_dirstring, optional
Direction in which to sort, either asc (ascending) or desc (descending). Defaults to desc.
- Returns
civis.response.Response
- user_idstring
The owning user’s ID
- user_namestring
The owning user’s name
- pending_deploymentsinteger
The number of deployments belonging to the owning user in “pending” state
- pending_memory_requestedinteger
The sum of memory requests (in MB) for deployments belonging to the owning user in “pending” state
- pending_cpu_requestedinteger
The sum of CPU requests (in millicores) for deployments belonging to the owning user in “pending” state
- running_deploymentsinteger
The number of deployments belonging to the owning user in “running” state
- running_memory_requestedinteger
The sum of memory requests (in MB) for deployments belonging to the owning user in “running” state
- running_cpu_requestedinteger
The sum of CPU requests (in millicores) for deployments belonging to the owning user in “running” state
- list_kubernetes_partitions(id, *, include_usage_stats='DEFAULT')¶
List Cluster Partitions for given cluster
- Parameters
- idinteger
- include_usage_statsboolean, optional
When true, usage stats are returned in instance config objects. Defaults to false.
- Returns
civis.response.Response
- cluster_partition_idinteger
The ID of this cluster partition.
- namestring
The name of the cluster partition.
- labelslist
Labels associated with this partition.
- instance_configslist::
The instances configured for this cluster partition. - instance_config_id : integer
The ID of this InstanceConfig.
- instance_typestring
An EC2 instance type. Possible values include t2.large, m4.xlarge, m4.2xlarge, m4.4xlarge, m5.12xlarge, c5.18xlarge, and p2.xlarge.
- min_instancesinteger
The minimum number of instances of that type in this cluster.
- max_instancesinteger
The maximum number of instances of that type in this cluster.
- instance_max_memoryinteger
The amount of memory (RAM) available to a single instance of that type in megabytes.
- instance_max_cpuinteger
The number of processor shares available to a single instance of that type in millicores.
- instance_max_diskinteger
The amount of disk available to a single instance of that type in gigabytes.
- usage_statsdict::
- pending_memory_requestedinteger
The sum of memory requests (in MB) for pending deployments in this instance config.
- pending_cpu_requestedinteger
The sum of cpu requests (in millicores) for pending deployments in this instance config.
- running_memory_requestedinteger
The sum of memory requests (in MB) for running deployments in this instance config.
- running_cpu_requestedinteger
The sum of cpu requests (in millicores) for running deployments in this instance config.
- pending_deploymentsinteger
The number of pending deployments in this instance config.
- running_deploymentsinteger
The number of running deployments in this instance config.
- default_instance_config_idinteger
The id of the InstanceConfig that is the default for this partition.
- patch_kubernetes(id, *, raw_cluster_slug='DEFAULT', is_nat_enabled='DEFAULT')¶
Update a Kubernetes Cluster
- Parameters
- idinteger
The ID of this cluster.
- raw_cluster_slugstring, optional
The slug of this cluster’s raw configuration.
- is_nat_enabledboolean, optional
Whether this cluster needs a NAT gateway or not.
- Returns
civis.response.Response
- idinteger
The ID of this cluster.
- organization_idstring
The id of this cluster’s organization.
- organization_namestring
The name of this cluster’s organization.
- organization_slugstring
The slug of this cluster’s organization.
- raw_cluster_slugstring
The slug of this cluster’s raw configuration.
- custom_partitionsboolean
Whether this cluster has a custom partition configuration.
- cluster_partitionslist::
List of cluster partitions associated with this cluster. - cluster_partition_id : integer
The ID of this cluster partition.
- namestring
The name of the cluster partition.
- labelslist
Labels associated with this partition.
- instance_configslist::
The instances configured for this cluster partition. - instance_config_id : integer
The ID of this InstanceConfig.
- instance_typestring
An EC2 instance type. Possible values include t2.large, m4.xlarge, m4.2xlarge, m4.4xlarge, m5.12xlarge, c5.18xlarge, and p2.xlarge.
- min_instancesinteger
The minimum number of instances of that type in this cluster.
- max_instancesinteger
The maximum number of instances of that type in this cluster.
- instance_max_memoryinteger
The amount of memory (RAM) available to a single instance of that type in megabytes.
- instance_max_cpuinteger
The number of processor shares available to a single instance of that type in millicores.
- instance_max_diskinteger
The amount of disk available to a single instance of that type in gigabytes.
- usage_statsdict::
- pending_memory_requestedinteger
The sum of memory requests (in MB) for pending deployments in this instance config.
- pending_cpu_requestedinteger
The sum of cpu requests (in millicores) for pending deployments in this instance config.
- running_memory_requestedinteger
The sum of memory requests (in MB) for running deployments in this instance config.
- running_cpu_requestedinteger
The sum of cpu requests (in millicores) for running deployments in this instance config.
- pending_deploymentsinteger
The number of pending deployments in this instance config.
- running_deploymentsinteger
The number of running deployments in this instance config.
- default_instance_config_idinteger
The id of the InstanceConfig that is the default for this partition.
- is_nat_enabledboolean
Whether this cluster needs a NAT gateway or not.
- hoursnumber/float
The number of hours used this month for this cluster.
- patch_kubernetes_partitions(id, cluster_partition_id, *, instance_configs='DEFAULT', name='DEFAULT', labels='DEFAULT')¶
Update a Cluster Partition
- Parameters
- idinteger
The ID of the cluster which this partition belongs to.
- cluster_partition_idinteger
The ID of this cluster partition.
- instance_configslist, optional::
The instances configured for this cluster partition. - instance_type : string
An EC2 instance type. Possible values include t2.large, m4.xlarge, m4.2xlarge, m4.4xlarge, m5.12xlarge, c5.18xlarge, and p2.xlarge.
- min_instancesinteger
The minimum number of instances of that type in this cluster.
- max_instancesinteger
The maximum number of instances of that type in this cluster.
- namestring, optional
The name of the cluster partition.
- labelslist, optional
Labels associated with this partition.
- Returns
civis.response.Response
- cluster_partition_idinteger
The ID of this cluster partition.
- namestring
The name of the cluster partition.
- labelslist
Labels associated with this partition.
- instance_configslist::
The instances configured for this cluster partition. - instance_config_id : integer
The ID of this InstanceConfig.
- instance_typestring
An EC2 instance type. Possible values include t2.large, m4.xlarge, m4.2xlarge, m4.4xlarge, m5.12xlarge, c5.18xlarge, and p2.xlarge.
- min_instancesinteger
The minimum number of instances of that type in this cluster.
- max_instancesinteger
The maximum number of instances of that type in this cluster.
- instance_max_memoryinteger
The amount of memory (RAM) available to a single instance of that type in megabytes.
- instance_max_cpuinteger
The number of processor shares available to a single instance of that type in millicores.
- instance_max_diskinteger
The amount of disk available to a single instance of that type in gigabytes.
- usage_statsdict::
- pending_memory_requestedinteger
The sum of memory requests (in MB) for pending deployments in this instance config.
- pending_cpu_requestedinteger
The sum of cpu requests (in millicores) for pending deployments in this instance config.
- running_memory_requestedinteger
The sum of memory requests (in MB) for running deployments in this instance config.
- running_cpu_requestedinteger
The sum of cpu requests (in millicores) for running deployments in this instance config.
- pending_deploymentsinteger
The number of pending deployments in this instance config.
- running_deploymentsinteger
The number of running deployments in this instance config.
- default_instance_config_idinteger
The id of the InstanceConfig that is the default for this partition.
- post_kubernetes(*, organization_id='DEFAULT', organization_slug='DEFAULT', raw_cluster_slug='DEFAULT', is_nat_enabled='DEFAULT')¶
Create a Kubernetes Cluster
- Parameters
- organization_idstring, optional
The id of this cluster’s organization.
- organization_slugstring, optional
The slug of this cluster’s organization.
- raw_cluster_slugstring, optional
The slug of this cluster’s raw configuration.
- is_nat_enabledboolean, optional
Whether this cluster needs a NAT gateway or not.
- Returns
civis.response.Response
- idinteger
The ID of this cluster.
- organization_idstring
The id of this cluster’s organization.
- organization_namestring
The name of this cluster’s organization.
- organization_slugstring
The slug of this cluster’s organization.
- raw_cluster_slugstring
The slug of this cluster’s raw configuration.
- custom_partitionsboolean
Whether this cluster has a custom partition configuration.
- cluster_partitionslist::
List of cluster partitions associated with this cluster. - cluster_partition_id : integer
The ID of this cluster partition.
- namestring
The name of the cluster partition.
- labelslist
Labels associated with this partition.
- instance_configslist::
The instances configured for this cluster partition. - instance_config_id : integer
The ID of this InstanceConfig.
- instance_typestring
An EC2 instance type. Possible values include t2.large, m4.xlarge, m4.2xlarge, m4.4xlarge, m5.12xlarge, c5.18xlarge, and p2.xlarge.
- min_instancesinteger
The minimum number of instances of that type in this cluster.
- max_instancesinteger
The maximum number of instances of that type in this cluster.
- instance_max_memoryinteger
The amount of memory (RAM) available to a single instance of that type in megabytes.
- instance_max_cpuinteger
The number of processor shares available to a single instance of that type in millicores.
- instance_max_diskinteger
The amount of disk available to a single instance of that type in gigabytes.
- usage_statsdict::
- pending_memory_requestedinteger
The sum of memory requests (in MB) for pending deployments in this instance config.
- pending_cpu_requestedinteger
The sum of cpu requests (in millicores) for pending deployments in this instance config.
- running_memory_requestedinteger
The sum of memory requests (in MB) for running deployments in this instance config.
- running_cpu_requestedinteger
The sum of cpu requests (in millicores) for running deployments in this instance config.
- pending_deploymentsinteger
The number of pending deployments in this instance config.
- running_deploymentsinteger
The number of running deployments in this instance config.
- default_instance_config_idinteger
The id of the InstanceConfig that is the default for this partition.
- is_nat_enabledboolean
Whether this cluster needs a NAT gateway or not.
- hoursnumber/float
The number of hours used this month for this cluster.
- post_kubernetes_partitions(id, instance_configs, name, labels)¶
Create a Cluster Partition for given cluster
- Parameters
- idinteger
The ID of the cluster which this partition belongs to.
- instance_configslist::
The instances configured for this cluster partition. - instance_type : string
An EC2 instance type. Possible values include t2.large, m4.xlarge, m4.2xlarge, m4.4xlarge, m5.12xlarge, c5.18xlarge, and p2.xlarge.
- min_instancesinteger
The minimum number of instances of that type in this cluster.
- max_instancesinteger
The maximum number of instances of that type in this cluster.
- namestring
The name of the cluster partition.
- labelslist
Labels associated with this partition.
- Returns
civis.response.Response
- cluster_partition_idinteger
The ID of this cluster partition.
- namestring
The name of the cluster partition.
- labelslist
Labels associated with this partition.
- instance_configslist::
The instances configured for this cluster partition. - instance_config_id : integer
The ID of this InstanceConfig.
- instance_typestring
An EC2 instance type. Possible values include t2.large, m4.xlarge, m4.2xlarge, m4.4xlarge, m5.12xlarge, c5.18xlarge, and p2.xlarge.
- min_instancesinteger
The minimum number of instances of that type in this cluster.
- max_instancesinteger
The maximum number of instances of that type in this cluster.
- instance_max_memoryinteger
The amount of memory (RAM) available to a single instance of that type in megabytes.
- instance_max_cpuinteger
The number of processor shares available to a single instance of that type in millicores.
- instance_max_diskinteger
The amount of disk available to a single instance of that type in gigabytes.
- usage_statsdict::
- pending_memory_requestedinteger
The sum of memory requests (in MB) for pending deployments in this instance config.
- pending_cpu_requestedinteger
The sum of cpu requests (in millicores) for pending deployments in this instance config.
- running_memory_requestedinteger
The sum of memory requests (in MB) for running deployments in this instance config.
- running_cpu_requestedinteger
The sum of cpu requests (in millicores) for running deployments in this instance config.
- pending_deploymentsinteger
The number of pending deployments in this instance config.
- running_deploymentsinteger
The number of running deployments in this instance config.
- default_instance_config_idinteger
The id of the InstanceConfig that is the default for this partition.
Credentials¶
- class Credentials(session_kwargs, client, return_type='civis')¶
Examples
>>> import civis >>> client = civis.APIClient() >>> client.credentials.list_types(...)
Methods
delete
(id)Delete a credential
delete_shares_groups
(id, group_id)Revoke the permissions a group has on this object
delete_shares_users
(id, user_id)Revoke the permissions a user has on this object
get
(id)Get a credential
list
(*[, type, remote_host_id, default, ...])List credentials
list_dependencies
(id, *[, user_id])List dependent objects for this object
list_shares
(id)List users and groups permissioned on this object
Get list of Credential Types
patch
(id, *[, name, type, description, ...])Update some attributes of a credential
post
(type, username, password, *[, name, ...])Create a credential
post_authenticate
(url, remote_host_type, ...)Authenticate against a remote host
post_temporary
(id, *[, duration])Generate a temporary credential for accessing S3
put
(id, type, username, password, *[, name, ...])Update an existing credential
put_shares_groups
(id, group_ids, ...[, ...])Set the permissions groups has on this object
put_shares_users
(id, user_ids, ...[, ...])Set the permissions users have on this object
put_transfer
(id, user_id, ...[, email_body, ...])Transfer ownership of this object to another user
- delete(id)¶
Delete a credential
- Parameters
- idinteger
The ID of the credential.
- Returns
- None
Response code 204: success
Revoke the permissions a group has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- group_idinteger
The ID of the group.
- Returns
- None
Response code 204: success
Revoke the permissions a user has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger
The ID of the user.
- Returns
- None
Response code 204: success
- get(id)¶
Get a credential
- Parameters
- idinteger
The ID of the credential.
- Returns
civis.response.Response
- idinteger
The ID of the credential.
- namestring
The name identifying the credential
- typestring
The credential’s type.
- usernamestring
The username for the credential.
- descriptionstring
A long description of the credential.
- ownerstring
The username of the user who this credential belongs to. Using user.username is preferred.
- userdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- remote_host_idinteger
The ID of the remote host associated with this credential.
- remote_host_namestring
The name of the remote host associated with this credential.
- statestring
The U.S. state for the credential. Only for VAN credentials.
- created_atstring/time
The creation time for this credential.
- updated_atstring/time
The last modification time for this credential.
- defaultboolean
Whether or not the credential is a default. Only for Database credentials.
- list(*, type='DEFAULT', remote_host_id='DEFAULT', default='DEFAULT', system_credentials='DEFAULT', users='DEFAULT', name='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶
List credentials
- Parameters
- typestring, optional
The type (or types) of credentials to return. One or more of: Amazon Web Services S3, Bitbucket, CASS/NCOA PAF, Certificate, Civis Platform, Custom, Database, Google, Github, Salesforce User, Salesforce Client, and TableauUser. Specify multiple values as a comma-separated list (e.g., “A,B”).
- remote_host_idinteger, optional
The ID of the remote host associated with the credentials to return.
- defaultboolean, optional
If true, will return a list with a single credential which is the current user’s default credential.
- system_credentialsboolean, optional
If true, will only return system credentials. System credentials can only be created and viewed by Civis Admins.
- usersstring, optional
A comma-separated list of user ids. If specified, returns set of credentials owned by the users that requesting user has at least read access on.
- namestring, optional
If specified, will be used to filter the credentials returned. Will search across name and will return any full name containing the search string.
- limitinteger, optional
Number of results to return. Defaults to its maximum of 1000.
- page_numinteger, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstring, optional
The field on which to order the result set. Defaults to updated_at. Must be one of: updated_at, created_at, name.
- order_dirstring, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iteratorbool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
- Returns
civis.response.PaginatedResponse
- idinteger
The ID of the credential.
- namestring
The name identifying the credential
- typestring
The credential’s type.
- usernamestring
The username for the credential.
- descriptionstring
A long description of the credential.
- ownerstring
The username of the user who this credential belongs to. Using user.username is preferred.
- userdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- remote_host_idinteger
The ID of the remote host associated with this credential.
- remote_host_namestring
The name of the remote host associated with this credential.
- statestring
The U.S. state for the credential. Only for VAN credentials.
- created_atstring/time
The creation time for this credential.
- updated_atstring/time
The last modification time for this credential.
- defaultboolean
Whether or not the credential is a default. Only for Database credentials.
- list_dependencies(id, *, user_id='DEFAULT')¶
List dependent objects for this object
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger, optional
ID of target user
- Returns
civis.response.Response
- object_typestring
Dependent object type
- fco_typestring
Human readable dependent object type
- idinteger
Dependent object ID
- namestring
Dependent object name, or nil if the requesting user cannot read this object
- permission_levelstring
Permission level of target user (not user’s groups) for dependent object, or null if no target user
- shareableboolean
Whether or not the requesting user can share this object.
List users and groups permissioned on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
- list_types()¶
Get list of Credential Types
- Returns
civis.response.Response
- typeslist
list of acceptable credential types
- patch(id, *, name='DEFAULT', type='DEFAULT', description='DEFAULT', username='DEFAULT', password='DEFAULT', remote_host_id='DEFAULT', user_id='DEFAULT', state='DEFAULT', system_credential='DEFAULT', default='DEFAULT')¶
Update some attributes of a credential
- Parameters
- idinteger
The ID of the credential.
- namestring, optional
The name identifying the credential.
- typestring, optional
The type of credential. Note: only these credentials can be created or edited via this API [“Amazon Web Services S3”, “CASS/NCOA PAF”, “Certificate”, “Civis Platform”, “Custom”, “Database”, “Google”, “Salesforce User”, “Salesforce Client”, “TableauUser”]
- descriptionstring, optional
A long description of the credential.
- usernamestring, optional
The username for the credential.
- passwordstring, optional
The password for the credential.
- remote_host_idinteger, optional
The ID of the remote host associated with the credential.
- user_idinteger, optional
The ID of the user the credential is created for. Note: This attribute is only accepted if you are a Civis Admin User.
- statestring, optional
The U.S. state for the credential. Only for VAN credentials.
- system_credentialboolean, optional
Boolean flag that sets a credential to be a system credential. System credentials can only be created by Civis Admins and will create a credential owned by the Civis Robot user.
- defaultboolean, optional
Whether or not the credential is a default. Only for Database credentials.
- Returns
civis.response.Response
- idinteger
The ID of the credential.
- namestring
The name identifying the credential
- typestring
The credential’s type.
- usernamestring
The username for the credential.
- descriptionstring
A long description of the credential.
- ownerstring
The username of the user who this credential belongs to. Using user.username is preferred.
- userdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- remote_host_idinteger
The ID of the remote host associated with this credential.
- remote_host_namestring
The name of the remote host associated with this credential.
- statestring
The U.S. state for the credential. Only for VAN credentials.
- created_atstring/time
The creation time for this credential.
- updated_atstring/time
The last modification time for this credential.
- defaultboolean
Whether or not the credential is a default. Only for Database credentials.
- post(type, username, password, *, name='DEFAULT', description='DEFAULT', remote_host_id='DEFAULT', user_id='DEFAULT', state='DEFAULT', system_credential='DEFAULT', default='DEFAULT')¶
Create a credential
- Parameters
- typestring
The type of credential. Note: only these credentials can be created or edited via this API [“Amazon Web Services S3”, “CASS/NCOA PAF”, “Certificate”, “Civis Platform”, “Custom”, “Database”, “Google”, “Salesforce User”, “Salesforce Client”, “TableauUser”]
- usernamestring
The username for the credential.
- passwordstring
The password for the credential.
- namestring, optional
The name identifying the credential.
- descriptionstring, optional
A long description of the credential.
- remote_host_idinteger, optional
The ID of the remote host associated with the credential.
- user_idinteger, optional
The ID of the user the credential is created for. Note: This attribute is only accepted if you are a Civis Admin User.
- statestring, optional
The U.S. state for the credential. Only for VAN credentials.
- system_credentialboolean, optional
Boolean flag that sets a credential to be a system credential. System credentials can only be created by Civis Admins and will create a credential owned by the Civis Robot user.
- defaultboolean, optional
Whether or not the credential is a default. Only for Database credentials.
- Returns
civis.response.Response
- idinteger
The ID of the credential.
- namestring
The name identifying the credential
- typestring
The credential’s type.
- usernamestring
The username for the credential.
- descriptionstring
A long description of the credential.
- ownerstring
The username of the user who this credential belongs to. Using user.username is preferred.
- userdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- remote_host_idinteger
The ID of the remote host associated with this credential.
- remote_host_namestring
The name of the remote host associated with this credential.
- statestring
The U.S. state for the credential. Only for VAN credentials.
- created_atstring/time
The creation time for this credential.
- updated_atstring/time
The last modification time for this credential.
- defaultboolean
Whether or not the credential is a default. Only for Database credentials.
- post_authenticate(url, remote_host_type, username, password)¶
Authenticate against a remote host
- Parameters
- urlstring
The URL to your host.
- remote_host_typestring
The type of remote host. One of: RemoteHostTypes::Bigquery, RemoteHostTypes::Bitbucket, RemoteHostTypes::GitSSH, RemoteHostTypes::Github, RemoteHostTypes::GoogleDoc, RemoteHostTypes::JDBC, RemoteHostTypes::Postgres, RemoteHostTypes::Redshift, RemoteHostTypes::S3Storage, and RemoteHostTypes::Salesforce
- usernamestring
The username for the credential.
- passwordstring
The password for the credential.
- Returns
civis.response.Response
- idinteger
The ID of the credential.
- namestring
The name identifying the credential
- typestring
The credential’s type.
- usernamestring
The username for the credential.
- descriptionstring
A long description of the credential.
- ownerstring
The username of the user who this credential belongs to. Using user.username is preferred.
- userdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- remote_host_idinteger
The ID of the remote host associated with this credential.
- remote_host_namestring
The name of the remote host associated with this credential.
- statestring
The U.S. state for the credential. Only for VAN credentials.
- created_atstring/time
The creation time for this credential.
- updated_atstring/time
The last modification time for this credential.
- defaultboolean
Whether or not the credential is a default. Only for Database credentials.
- post_temporary(id, *, duration='DEFAULT')¶
Generate a temporary credential for accessing S3
- Parameters
- idinteger
The ID of the credential.
- durationinteger, 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
civis.response.Response
- access_keystring
The identifier of the credential.
- secret_access_keystring
The secret part of the credential.
- session_tokenstring
The session token identifier.
- put(id, type, username, password, *, name='DEFAULT', description='DEFAULT', remote_host_id='DEFAULT', user_id='DEFAULT', state='DEFAULT', system_credential='DEFAULT', default='DEFAULT')¶
Update an existing credential
- Parameters
- idinteger
The ID of the credential.
- typestring
The type of credential. Note: only these credentials can be created or edited via this API [“Amazon Web Services S3”, “CASS/NCOA PAF”, “Certificate”, “Civis Platform”, “Custom”, “Database”, “Google”, “Salesforce User”, “Salesforce Client”, “TableauUser”]
- usernamestring
The username for the credential.
- passwordstring
The password for the credential.
- namestring, optional
The name identifying the credential.
- descriptionstring, optional
A long description of the credential.
- remote_host_idinteger, optional
The ID of the remote host associated with the credential.
- user_idinteger, optional
The ID of the user the credential is created for. Note: This attribute is only accepted if you are a Civis Admin User.
- statestring, optional
The U.S. state for the credential. Only for VAN credentials.
- system_credentialboolean, optional
Boolean flag that sets a credential to be a system credential. System credentials can only be created by Civis Admins and will create a credential owned by the Civis Robot user.
- defaultboolean, optional
Whether or not the credential is a default. Only for Database credentials.
- Returns
civis.response.Response
- idinteger
The ID of the credential.
- namestring
The name identifying the credential
- typestring
The credential’s type.
- usernamestring
The username for the credential.
- descriptionstring
A long description of the credential.
- ownerstring
The username of the user who this credential belongs to. Using user.username is preferred.
- userdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- remote_host_idinteger
The ID of the remote host associated with this credential.
- remote_host_namestring
The name of the remote host associated with this credential.
- statestring
The U.S. state for the credential. Only for VAN credentials.
- created_atstring/time
The creation time for this credential.
- updated_atstring/time
The last modification time for this credential.
- defaultboolean
Whether or not the credential is a default. Only for Database credentials.
Set the permissions groups has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- group_idslist
An array of one or more group IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
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
- idinteger
The ID of the resource that is shared.
- user_idslist
An array of one or more user IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
- put_transfer(id, user_id, include_dependencies, *, email_body='DEFAULT', send_email='DEFAULT')¶
Transfer ownership of this object to another user
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger
ID of target user
- include_dependenciesboolean
Whether or not to give manage permissions on all dependencies
- email_bodystring, optional
Custom body text for e-mail sent on transfer.
- send_emailboolean, optional
Send email to the target user of the transfer?
- Returns
civis.response.Response
- dependencieslist::
Dependent objects for this object - object_type : string
Dependent object type
- fco_typestring
Human readable dependent object type
- idinteger
Dependent object ID
- namestring
Dependent object name, or nil if the requesting user cannot read this object
- permission_levelstring
Permission level of target user (not user’s groups) for dependent object, or null if no target user
- sharedboolean
Whether dependent object was successfully shared with target user
Databases¶
- class Databases(session_kwargs, client, return_type='civis')¶
Examples
>>> import civis >>> client = civis.APIClient() >>> client.databases.list(...)
Methods
get
(id)Show database information
get_whitelist_ips
(id, whitelisted_ip_id)View details about a whitelisted IP
list
()List databases
Get the advanced settings for this database
list_schemas
(id, *[, name, credential_id])List schemas in this database
List whitelisted IPs for the specified database
patch_advanced_settings
(id, *[, ...])Update the advanced settings for this database
post_schemas_scan
(id, schema, *[, ...])Creates and enqueues a schema scanner job
put_advanced_settings
(id, export_caching_enabled)Edit the advanced settings for this database
- get(id)¶
Show database information
- Parameters
- idinteger
The ID for the database.
- Returns
civis.response.Response
- idinteger
The ID for the database.
- namestring
The name of the database.
- adapterstring
The type of the database.
- get_whitelist_ips(id, whitelisted_ip_id)¶
View details about a whitelisted IP
- Parameters
- idinteger
The ID of the database this rule is applied to.
- whitelisted_ip_idinteger
The ID of this whitelisted IP address.
- Returns
civis.response.Response
- idinteger
The ID of this whitelisted IP address.
- remote_host_idinteger
The ID of the database this rule is applied to.
- security_group_idstring
The ID of the security group this rule is applied to.
- subnet_maskstring
The subnet mask that is allowed by this rule.
- authorized_bystring
The user who authorized this rule.
- is_activeboolean
True if the rule is applied, false if it has been revoked.
- created_atstring/time
The time this rule was created.
- updated_atstring/time
The time this rule was last updated.
- list()¶
List databases
- Returns
civis.response.Response
- idinteger
The ID for the database.
- namestring
The name of the database.
- adapterstring
The type of the database.
- list_advanced_settings(id)¶
Get the advanced settings for this database
- Parameters
- idinteger
The ID of the database this advanced settings object belongs to.
- Returns
civis.response.Response
- export_caching_enabledboolean
Whether or not caching is enabled for export jobs run on this database server.
- list_schemas(id, *, name='DEFAULT', credential_id='DEFAULT')¶
List schemas in this database
- Parameters
- idinteger
The ID of the database.
- namestring, optional
If specified, will be used to filter the schemas returned. Substring matching is supported (e.g., “name=schema” will return both “schema1” and “schema2”).
- credential_idinteger, optional
If provided, schemas will be filtered based on the given credential.
- Returns
civis.response.Response
- schemastring
The name of a schema.
- list_whitelist_ips(id)¶
List whitelisted IPs for the specified database
- Parameters
- idinteger
The ID for the database.
- Returns
civis.response.Response
- idinteger
The ID of this whitelisted IP address.
- remote_host_idinteger
The ID of the database this rule is applied to.
- security_group_idstring
The ID of the security group this rule is applied to.
- subnet_maskstring
The subnet mask that is allowed by this rule.
- created_atstring/time
The time this rule was created.
- updated_atstring/time
The time this rule was last updated.
- patch_advanced_settings(id, *, export_caching_enabled='DEFAULT')¶
Update the advanced settings for this database
- Parameters
- idinteger
The ID of the database this advanced settings object belongs to.
- export_caching_enabledboolean, optional
Whether or not caching is enabled for export jobs run on this database server.
- Returns
civis.response.Response
- export_caching_enabledboolean
Whether or not caching is enabled for export jobs run on this database server.
- post_schemas_scan(id, schema, *, stats_priority='DEFAULT')¶
Creates and enqueues a schema scanner job
- Parameters
- idinteger
The ID of the database.
- schemastring
The name of the schema.
- stats_prioritystring, optional
When to sync table statistics for every table in the schema. Valid options are the following. Option: ‘flag’ means to flag stats for the next scheduled run of a full table scan on the database. Option: ‘block’ means to block this job on stats syncing. Option: ‘queue’ means to queue a separate job for syncing stats and do not block this job on the queued job. Defaults to ‘flag’
- Returns
civis.response.Response
- job_idinteger
The ID of the job created.
- run_idinteger
The ID of the run created.
- put_advanced_settings(id, export_caching_enabled)¶
Edit the advanced settings for this database
- Parameters
- idinteger
The ID of the database this advanced settings object belongs to.
- export_caching_enabledboolean
Whether or not caching is enabled for export jobs run on this database server.
- Returns
civis.response.Response
- export_caching_enabledboolean
Whether or not caching is enabled for export jobs run on this database server.
Endpoints¶
Enhancements¶
- class Enhancements(session_kwargs, client, return_type='civis')¶
Examples
>>> import civis >>> client = civis.APIClient() >>> client.enhancements.post_civis_data_match(...)
Methods
delete_cass_ncoa_projects
(id, project_id)Remove a CASS/NCOA Enhancement from a project
delete_cass_ncoa_runs
(id, run_id)Cancel a run
delete_cass_ncoa_shares_groups
(id, group_id)Revoke the permissions a group has on this object
delete_cass_ncoa_shares_users
(id, user_id)Revoke the permissions a user has on this object
delete_civis_data_match_projects
(id, project_id)Remove a Civis Data Match Enhancement from a project
delete_civis_data_match_runs
(id, run_id)Cancel a run
Revoke the permissions a group has on this object
delete_civis_data_match_shares_users
(id, user_id)Revoke the permissions a user has on this object
delete_geocode_projects
(id, project_id)Remove a Geocode Enhancement from a project
delete_geocode_runs
(id, run_id)Cancel a run
delete_geocode_shares_groups
(id, group_id)Revoke the permissions a group has on this object
delete_geocode_shares_users
(id, user_id)Revoke the permissions a user has on this object
get_cass_ncoa
(id)Get a CASS/NCOA Enhancement
get_cass_ncoa_runs
(id, run_id)Check status of a run
Get a Civis Data Match Enhancement
get_civis_data_match_runs
(id, run_id)Check status of a run
get_geocode
(id)Get a Geocode Enhancement
get_geocode_runs
(id, run_id)Check status of a run
list
(*[, type, author, status, archived, ...])List Enhancements
list_cass_ncoa_dependencies
(id, *[, user_id])List dependent objects for this object
list_cass_ncoa_projects
(id, *[, hidden])List the projects a CASS/NCOA Enhancement belongs to
list_cass_ncoa_runs
(id, *[, limit, ...])List runs for the given cass_ncoa
list_cass_ncoa_runs_logs
(id, run_id, *[, ...])Get the logs for a run
list_cass_ncoa_runs_outputs
(id, run_id, *[, ...])List the outputs for a run
List users and groups permissioned on this object
list_civis_data_match_dependencies
(id, *[, ...])List dependent objects for this object
list_civis_data_match_projects
(id, *[, hidden])List the projects a Civis Data Match Enhancement belongs to
list_civis_data_match_runs
(id, *[, limit, ...])List runs for the given civis_data_match
list_civis_data_match_runs_logs
(id, run_id, *)Get the logs for a run
list_civis_data_match_runs_outputs
(id, run_id, *)List the outputs for a run
List users and groups permissioned on this object
List the fields in a field mapping for Civis Data Match, Data Unification, and Table Deduplication jobs
list_geocode_dependencies
(id, *[, user_id])List dependent objects for this object
list_geocode_projects
(id, *[, hidden])List the projects a Geocode Enhancement belongs to
list_geocode_runs
(id, *[, limit, page_num, ...])List runs for the given geocode
list_geocode_runs_logs
(id, run_id, *[, ...])Get the logs for a run
list_geocode_runs_outputs
(id, run_id, *[, ...])List the outputs for a run
List users and groups permissioned on this object
List available enhancement types
patch_cass_ncoa
(id, *[, name, schedule, ...])Update some attributes of this CASS/NCOA Enhancement
patch_civis_data_match
(id, *[, name, ...])Update some attributes of this Civis Data Match Enhancement
patch_geocode
(id, *[, name, schedule, ...])Update some attributes of this Geocode Enhancement
post_cass_ncoa
(name, source, *[, schedule, ...])Create a CASS/NCOA Enhancement
Cancel a run
Start a run
post_civis_data_match
(name, ...[, schedule, ...])Create a Civis Data Match Enhancement
Cancel a run
post_civis_data_match_clone
(id, *[, ...])Clone this Civis Data Match Enhancement
Start a run
post_geocode
(name, remote_host_id, ...[, ...])Create a Geocode Enhancement
Cancel a run
Start a run
put_cass_ncoa
(id, name, source, *[, ...])Replace all attributes of this CASS/NCOA Enhancement
put_cass_ncoa_archive
(id, status)Update the archive status of this object
put_cass_ncoa_projects
(id, project_id)Add a CASS/NCOA Enhancement to a project
put_cass_ncoa_shares_groups
(id, group_ids, ...)Set the permissions groups has on this object
put_cass_ncoa_shares_users
(id, user_ids, ...)Set the permissions users have on this object
put_cass_ncoa_transfer
(id, user_id, ...[, ...])Transfer ownership of this object to another user
put_civis_data_match
(id, name, ...[, ...])Replace all attributes of this Civis Data Match Enhancement
put_civis_data_match_archive
(id, status)Update the archive status of this object
put_civis_data_match_projects
(id, project_id)Add a Civis Data Match Enhancement to a project
put_civis_data_match_shares_groups
(id, ...)Set the permissions groups has on this object
put_civis_data_match_shares_users
(id, ...[, ...])Set the permissions users have on this object
put_civis_data_match_transfer
(id, user_id, ...)Transfer ownership of this object to another user
put_geocode
(id, name, remote_host_id, ...[, ...])Replace all attributes of this Geocode Enhancement
put_geocode_archive
(id, status)Update the archive status of this object
put_geocode_projects
(id, project_id)Add a Geocode Enhancement to a project
put_geocode_shares_groups
(id, group_ids, ...)Set the permissions groups has on this object
put_geocode_shares_users
(id, user_ids, ...)Set the permissions users have on this object
put_geocode_transfer
(id, user_id, ...[, ...])Transfer ownership of this object to another user
- delete_cass_ncoa_projects(id, project_id)¶
Remove a CASS/NCOA Enhancement from a project
- Parameters
- idinteger
The ID of the CASS/NCOA Enhancement.
- project_idinteger
The ID of the project.
- Returns
- None
Response code 204: success
- delete_cass_ncoa_runs(id, run_id)¶
Cancel a run
- Parameters
- idinteger
The ID of the cass_ncoa.
- run_idinteger
The ID of the run.
- Returns
- None
Response code 202: success
Revoke the permissions a group has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- group_idinteger
The ID of the group.
- Returns
- None
Response code 204: success
Revoke the permissions a user has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger
The ID of the user.
- Returns
- None
Response code 204: success
- delete_civis_data_match_projects(id, project_id)¶
Remove a Civis Data Match Enhancement from a project
- Parameters
- idinteger
The ID of the Civis Data Match Enhancement.
- project_idinteger
The ID of the project.
- Returns
- None
Response code 204: success
- delete_civis_data_match_runs(id, run_id)¶
Cancel a run
- Parameters
- idinteger
The ID of the civis_data_match.
- run_idinteger
The ID of the run.
- Returns
- None
Response code 202: success
Revoke the permissions a group has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- group_idinteger
The ID of the group.
- Returns
- None
Response code 204: success
Revoke the permissions a user has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger
The ID of the user.
- Returns
- None
Response code 204: success
- delete_geocode_projects(id, project_id)¶
Remove a Geocode Enhancement from a project
- Parameters
- idinteger
The ID of the Geocode Enhancement.
- project_idinteger
The ID of the project.
- Returns
- None
Response code 204: success
- delete_geocode_runs(id, run_id)¶
Cancel a run
- Parameters
- idinteger
The ID of the geocode.
- run_idinteger
The ID of the run.
- Returns
- None
Response code 202: success
Revoke the permissions a group has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- group_idinteger
The ID of the group.
- Returns
- None
Response code 204: success
Revoke the permissions a user has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger
The ID of the user.
- Returns
- None
Response code 204: success
- get_cass_ncoa(id)¶
Get a CASS/NCOA Enhancement
- Parameters
- idinteger
- Returns
civis.response.Response
- idinteger
The ID for the enhancement.
- namestring
The name of the enhancement job.
- typestring
The type of the enhancement (e.g CASS-NCOA)
- created_atstring/time
The time this enhancement was created.
- updated_atstring/time
The time the enhancement was last updated.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- statestring
The status of the enhancement’s last run
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- parent_idinteger
Parent ID that triggers this enhancement.
- notificationsdict::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- running_asdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- sourcedict::
- database_tabledict::
- schemastring
The schema name of the source table.
- tablestring
The name of the source table.
- remote_host_idinteger
The ID of the database host for the table.
- credential_idinteger
The id of the credentials to be used when performing the enhancement.
- multipart_keylist
The source table primary key.
- destinationdict::
- database_tabledict::
- schemastring
The schema name for the output data.
- tablestring
The table name for the output data.
- column_mappingdict::
- address1string
The first address line.
- address2string
The second address line.
- citystring
The city of an address.
- statestring
The state of an address.
- zipstring
The zip code of an address.
- namestring
The full name of the resident at this address. If needed, separate multiple columns with +, e.g. first_name+last_name
- companystring
The name of the company located at this address.
- use_default_column_mappingboolean
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_ncoaboolean
Whether to update addresses for records matching the National Change of Address (NCOA) database.
- ncoa_credential_idinteger
Credential to use when performing NCOA updates. Required if ‘performNcoa’ is true.
- output_levelstring
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_sqlstring
The limiting SQL for the source table. “WHERE” should be omitted (e.g. state=’IL’).
- archivedstring
The archival status of the requested item(s).
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- get_cass_ncoa_runs(id, run_id)¶
Check status of a run
- Parameters
- idinteger
The ID of the cass_ncoa.
- run_idinteger
The ID of the run.
- Returns
civis.response.Response
- idinteger
The ID of the run.
- cass_ncoa_idinteger
The ID of the cass_ncoa.
- statestring
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- is_cancel_requestedboolean
True if run cancel requested, else false.
- started_atstring/time
The time the last run started at.
- finished_atstring/time
The time the last run completed.
- errorstring
The error, if any, returned by the run.
- get_civis_data_match(id)¶
Get a Civis Data Match Enhancement
- Parameters
- idinteger
- Returns
civis.response.Response
- idinteger
The ID for the enhancement.
- namestring
The name of the enhancement job.
- typestring
The type of the enhancement (e.g CASS-NCOA)
- created_atstring/time
The time this enhancement was created.
- updated_atstring/time
The time the enhancement was last updated.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- statestring
The status of the enhancement’s last run
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- parent_idinteger
Parent ID that triggers this enhancement.
- notificationsdict::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- running_asdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- input_field_mappingdict
The field (i.e., column) mapping for the input table. See https://api.civisanalytics.com/enhancements/field-mapping for a list of valid field types and descriptions. Each field type should be mapped to a string specifying a column name in the input table. For field types that support multiple values (e.g., the “phone” field), a list of column names can be provided (e.g., {“phone”: [“home_phone”, “mobile_phone”], …}).
- input_tabledict::
- database_namestring
The Redshift database name for the table.
- schemastring
The schema name for the table.
- tablestring
The table name.
- match_target_idinteger
The ID of the Civis Data match target. See /match_targets for IDs.
- output_tabledict::
- database_namestring
The Redshift database name for the table.
- schemastring
The schema name for the table.
- tablestring
The table name.
- max_matchesinteger
The maximum number of matches per record in the input table to return. Must be between 0 and 10. 0 returns all matches.
- thresholdnumber/float
The score threshold (between 0 and 1). Matches below this threshold will not be returned. The default value is 0.5.
- archivedboolean
Whether the Civis Data Match Job has been archived.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- get_civis_data_match_runs(id, run_id)¶
Check status of a run
- Parameters
- idinteger
The ID of the civis_data_match.
- run_idinteger
The ID of the run.
- Returns
civis.response.Response
- idinteger
The ID of the run.
- civis_data_match_idinteger
The ID of the civis_data_match.
- statestring
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- is_cancel_requestedboolean
True if run cancel requested, else false.
- started_atstring/time
The time the last run started at.
- finished_atstring/time
The time the last run completed.
- errorstring
The error, if any, returned by the run.
- get_geocode(id)¶
Get a Geocode Enhancement
- Parameters
- idinteger
- Returns
civis.response.Response
- idinteger
The ID for the enhancement.
- namestring
The name of the enhancement job.
- typestring
The type of the enhancement (e.g CASS-NCOA)
- created_atstring/time
The time this enhancement was created.
- updated_atstring/time
The time the enhancement was last updated.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- statestring
The status of the enhancement’s last run
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- parent_idinteger
Parent ID that triggers this enhancement.
- notificationsdict::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- running_asdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- remote_host_idinteger
The ID of the remote host.
- credential_idinteger
The ID of the remote host credential.
- source_schema_and_tablestring
The source database schema and table.
- multipart_keylist
The source table primary key.
- limiting_sqlstring
The limiting SQL for the source table. “WHERE” should be omitted (e.g. state=’IL’).
- target_schemastring
The output table schema.
- target_tablestring
The output table name.
- countrystring
The country of the addresses to be geocoded; either ‘us’ or ‘ca’.
- providerstring
The geocoding provider; one of postgis, nominatim, and geocoder_ca.
- output_addressboolean
Whether to output the parsed address. Only guaranteed for the ‘postgis’ provider.
- archivedstring
The archival status of the requested item(s).
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- get_geocode_runs(id, run_id)¶
Check status of a run
- Parameters
- idinteger
The ID of the geocode.
- run_idinteger
The ID of the run.
- Returns
civis.response.Response
- idinteger
The ID of the run.
- geocode_idinteger
The ID of the geocode.
- statestring
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- is_cancel_requestedboolean
True if run cancel requested, else false.
- started_atstring/time
The time the last run started at.
- finished_atstring/time
The time the last run completed.
- errorstring
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
- typestring, optional
If specified, return items of these types.
- authorstring, optional
If specified, return items from any of these authors. It accepts a comma- separated list of user IDs.
- statusstring, optional
If specified, returns items with one of these statuses. It accepts a comma- separated list, possible values are ‘running’, ‘failed’, ‘succeeded’, ‘idle’, ‘scheduled’.
- archivedstring, optional
The archival status of the requested item(s).
- limitinteger, optional
Number of results to return. Defaults to 20. Maximum allowed is 50.
- page_numinteger, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstring, 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_dirstring, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iteratorbool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
- Returns
civis.response.PaginatedResponse
- idinteger
The ID for the enhancement.
- namestring
The name of the enhancement job.
- typestring
The type of the enhancement (e.g CASS-NCOA)
- created_atstring/time
The time this enhancement was created.
- updated_atstring/time
The time the enhancement was last updated.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- statestring
The status of the enhancement’s last run
- archivedstring
The archival status of the requested item(s).
- list_cass_ncoa_dependencies(id, *, user_id='DEFAULT')¶
List dependent objects for this object
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger, optional
ID of target user
- Returns
civis.response.Response
- object_typestring
Dependent object type
- fco_typestring
Human readable dependent object type
- idinteger
Dependent object ID
- namestring
Dependent object name, or nil if the requesting user cannot read this object
- permission_levelstring
Permission level of target user (not user’s groups) for dependent object, or null if no target user
- shareableboolean
Whether or not the requesting user can share this object.
- list_cass_ncoa_projects(id, *, hidden='DEFAULT')¶
List the projects a CASS/NCOA Enhancement belongs to
- Parameters
- idinteger
The ID of the CASS/NCOA Enhancement.
- hiddenboolean, optional
If specified to be true, returns hidden items. Defaults to false, returning non-hidden items.
- Returns
civis.response.Response
- idinteger
The ID for this project.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- namestring
The name of this project.
- descriptionstring
A description of the project.
- userslist::
Users who can see the project. - id : integer
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
auto_share : boolean
created_at : string/time
updated_at : string/time
- archivedstring
The archival status of the requested item(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
- idinteger
The ID of the cass_ncoa.
- limitinteger, optional
Number of results to return. Defaults to 20. Maximum allowed is 100.
- page_numinteger, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstring, optional
The field on which to order the result set. Defaults to id. Must be one of: id.
- order_dirstring, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iteratorbool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
- Returns
civis.response.PaginatedResponse
- idinteger
The ID of the run.
- cass_ncoa_idinteger
The ID of the cass_ncoa.
- statestring
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- is_cancel_requestedboolean
True if run cancel requested, else false.
- started_atstring/time
The time the last run started at.
- finished_atstring/time
The time the last run completed.
- errorstring
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
- idinteger
The ID of the cass_ncoa.
- run_idinteger
The ID of the run.
- last_idinteger, 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.
- limitinteger, optional
The maximum number of log messages to return. Default of 10000.
- Returns
civis.response.Response
- idinteger
The ID of the log.
- created_atstring/date-time
The time the log was created.
- messagestring
The log message.
- levelstring
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
- idinteger
The ID of the job.
- run_idinteger
The ID of the run.
- limitinteger, optional
Number of results to return. Defaults to its maximum of 50.
- page_numinteger, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstring, optional
The field on which to order the result set. Defaults to created_at. Must be one of: created_at, id.
- order_dirstring, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iteratorbool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
- Returns
civis.response.PaginatedResponse
- object_typestring
The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue
- object_idinteger
The ID of the output.
- namestring
The name of the output.
- linkstring
The hypermedia link to the output.
value : string
List users and groups permissioned on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
- list_civis_data_match_dependencies(id, *, user_id='DEFAULT')¶
List dependent objects for this object
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger, optional
ID of target user
- Returns
civis.response.Response
- object_typestring
Dependent object type
- fco_typestring
Human readable dependent object type
- idinteger
Dependent object ID
- namestring
Dependent object name, or nil if the requesting user cannot read this object
- permission_levelstring
Permission level of target user (not user’s groups) for dependent object, or null if no target user
- shareableboolean
Whether or not the requesting user can share this object.
- list_civis_data_match_projects(id, *, hidden='DEFAULT')¶
List the projects a Civis Data Match Enhancement belongs to
- Parameters
- idinteger
The ID of the Civis Data Match Enhancement.
- hiddenboolean, optional
If specified to be true, returns hidden items. Defaults to false, returning non-hidden items.
- Returns
civis.response.Response
- idinteger
The ID for this project.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- namestring
The name of this project.
- descriptionstring
A description of the project.
- userslist::
Users who can see the project. - id : integer
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
auto_share : boolean
created_at : string/time
updated_at : string/time
- archivedstring
The archival status of the requested item(s).
- list_civis_data_match_runs(id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶
List runs for the given civis_data_match
- Parameters
- idinteger
The ID of the civis_data_match.
- limitinteger, optional
Number of results to return. Defaults to 20. Maximum allowed is 100.
- page_numinteger, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstring, optional
The field on which to order the result set. Defaults to id. Must be one of: id.
- order_dirstring, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iteratorbool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
- Returns
civis.response.PaginatedResponse
- idinteger
The ID of the run.
- civis_data_match_idinteger
The ID of the civis_data_match.
- statestring
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- is_cancel_requestedboolean
True if run cancel requested, else false.
- started_atstring/time
The time the last run started at.
- finished_atstring/time
The time the last run completed.
- errorstring
The error, if any, returned by the run.
- list_civis_data_match_runs_logs(id, run_id, *, last_id='DEFAULT', limit='DEFAULT')¶
Get the logs for a run
- Parameters
- idinteger
The ID of the civis_data_match.
- run_idinteger
The ID of the run.
- last_idinteger, 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.
- limitinteger, optional
The maximum number of log messages to return. Default of 10000.
- Returns
civis.response.Response
- idinteger
The ID of the log.
- created_atstring/date-time
The time the log was created.
- messagestring
The log message.
- levelstring
The level of the log. One of unknown,fatal,error,warn,info,debug.
- list_civis_data_match_runs_outputs(id, run_id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶
List the outputs for a run
- Parameters
- idinteger
The ID of the job.
- run_idinteger
The ID of the run.
- limitinteger, optional
Number of results to return. Defaults to its maximum of 50.
- page_numinteger, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstring, optional
The field on which to order the result set. Defaults to created_at. Must be one of: created_at, id.
- order_dirstring, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iteratorbool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
- Returns
civis.response.PaginatedResponse
- object_typestring
The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue
- object_idinteger
The ID of the output.
- namestring
The name of the output.
- linkstring
The hypermedia link to the output.
value : string
List users and groups permissioned on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
- list_field_mapping()¶
List the fields in a field mapping for Civis Data Match, Data Unification, and Table Deduplication jobs
- Returns
civis.response.Response
- fieldstring
The name of the field.
- descriptionstring
The description of the field.
- list_geocode_dependencies(id, *, user_id='DEFAULT')¶
List dependent objects for this object
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger, optional
ID of target user
- Returns
civis.response.Response
- object_typestring
Dependent object type
- fco_typestring
Human readable dependent object type
- idinteger
Dependent object ID
- namestring
Dependent object name, or nil if the requesting user cannot read this object
- permission_levelstring
Permission level of target user (not user’s groups) for dependent object, or null if no target user
- shareableboolean
Whether or not the requesting user can share this object.
- list_geocode_projects(id, *, hidden='DEFAULT')¶
List the projects a Geocode Enhancement belongs to
- Parameters
- idinteger
The ID of the Geocode Enhancement.
- hiddenboolean, optional
If specified to be true, returns hidden items. Defaults to false, returning non-hidden items.
- Returns
civis.response.Response
- idinteger
The ID for this project.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- namestring
The name of this project.
- descriptionstring
A description of the project.
- userslist::
Users who can see the project. - id : integer
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
auto_share : boolean
created_at : string/time
updated_at : string/time
- archivedstring
The archival status of the requested item(s).
- list_geocode_runs(id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶
List runs for the given geocode
- Parameters
- idinteger
The ID of the geocode.
- limitinteger, optional
Number of results to return. Defaults to 20. Maximum allowed is 100.
- page_numinteger, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstring, optional
The field on which to order the result set. Defaults to id. Must be one of: id.
- order_dirstring, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iteratorbool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
- Returns
civis.response.PaginatedResponse
- idinteger
The ID of the run.
- geocode_idinteger
The ID of the geocode.
- statestring
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- is_cancel_requestedboolean
True if run cancel requested, else false.
- started_atstring/time
The time the last run started at.
- finished_atstring/time
The time the last run completed.
- errorstring
The error, if any, returned by the run.
- list_geocode_runs_logs(id, run_id, *, last_id='DEFAULT', limit='DEFAULT')¶
Get the logs for a run
- Parameters
- idinteger
The ID of the geocode.
- run_idinteger
The ID of the run.
- last_idinteger, 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.
- limitinteger, optional
The maximum number of log messages to return. Default of 10000.
- Returns
civis.response.Response
- idinteger
The ID of the log.
- created_atstring/date-time
The time the log was created.
- messagestring
The log message.
- levelstring
The level of the log. One of unknown,fatal,error,warn,info,debug.
- list_geocode_runs_outputs(id, run_id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶
List the outputs for a run
- Parameters
- idinteger
The ID of the job.
- run_idinteger
The ID of the run.
- limitinteger, optional
Number of results to return. Defaults to its maximum of 50.
- page_numinteger, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstring, optional
The field on which to order the result set. Defaults to created_at. Must be one of: created_at, id.
- order_dirstring, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iteratorbool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
- Returns
civis.response.PaginatedResponse
- object_typestring
The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue
- object_idinteger
The ID of the output.
- namestring
The name of the output.
- linkstring
The hypermedia link to the output.
value : string
List users and groups permissioned on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
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
civis.response.Response
- namestring
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
- idinteger
The ID for the enhancement.
- namestring, optional
The name of the enhancement job.
- scheduledict, optional::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- parent_idinteger, optional
Parent ID that triggers this enhancement.
- notificationsdict, optional::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- sourcedict, optional::
- database_tabledict::
- schemastring
The schema name of the source table.
- tablestring
The name of the source table.
- remote_host_idinteger
The ID of the database host for the table.
- credential_idinteger
The id of the credentials to be used when performing the enhancement.
- multipart_keylist
The source table primary key.
- destinationdict, optional::
- database_tabledict::
- schemastring
The schema name for the output data.
- tablestring
The table name for the output data.
- column_mappingdict, optional::
- address1string
The first address line.
- address2string
The second address line.
- citystring
The city of an address.
- statestring
The state of an address.
- zipstring
The zip code of an address.
- namestring
The full name of the resident at this address. If needed, separate multiple columns with +, e.g. first_name+last_name
- companystring
The name of the company located at this address.
- use_default_column_mappingboolean, 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_ncoaboolean, optional
Whether to update addresses for records matching the National Change of Address (NCOA) database.
- ncoa_credential_idinteger, optional
Credential to use when performing NCOA updates. Required if ‘performNcoa’ is true.
- output_levelstring, 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_sqlstring, optional
The limiting SQL for the source table. “WHERE” should be omitted (e.g. state=’IL’).
- Returns
civis.response.Response
- idinteger
The ID for the enhancement.
- namestring
The name of the enhancement job.
- typestring
The type of the enhancement (e.g CASS-NCOA)
- created_atstring/time
The time this enhancement was created.
- updated_atstring/time
The time the enhancement was last updated.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- statestring
The status of the enhancement’s last run
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- parent_idinteger
Parent ID that triggers this enhancement.
- notificationsdict::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- running_asdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- sourcedict::
- database_tabledict::
- schemastring
The schema name of the source table.
- tablestring
The name of the source table.
- remote_host_idinteger
The ID of the database host for the table.
- credential_idinteger
The id of the credentials to be used when performing the enhancement.
- multipart_keylist
The source table primary key.
- destinationdict::
- database_tabledict::
- schemastring
The schema name for the output data.
- tablestring
The table name for the output data.
- column_mappingdict::
- address1string
The first address line.
- address2string
The second address line.
- citystring
The city of an address.
- statestring
The state of an address.
- zipstring
The zip code of an address.
- namestring
The full name of the resident at this address. If needed, separate multiple columns with +, e.g. first_name+last_name
- companystring
The name of the company located at this address.
- use_default_column_mappingboolean
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_ncoaboolean
Whether to update addresses for records matching the National Change of Address (NCOA) database.
- ncoa_credential_idinteger
Credential to use when performing NCOA updates. Required if ‘performNcoa’ is true.
- output_levelstring
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_sqlstring
The limiting SQL for the source table. “WHERE” should be omitted (e.g. state=’IL’).
- archivedstring
The archival status of the requested item(s).
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- patch_civis_data_match(id, *, name='DEFAULT', schedule='DEFAULT', parent_id='DEFAULT', notifications='DEFAULT', input_field_mapping='DEFAULT', input_table='DEFAULT', match_target_id='DEFAULT', output_table='DEFAULT', max_matches='DEFAULT', threshold='DEFAULT', archived='DEFAULT')¶
Update some attributes of this Civis Data Match Enhancement
- Parameters
- idinteger
The ID for the enhancement.
- namestring, optional
The name of the enhancement job.
- scheduledict, optional::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- parent_idinteger, optional
Parent ID that triggers this enhancement.
- notificationsdict, optional::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- input_field_mappingdict, optional
The field (i.e., column) mapping for the input table. See https://api.civisanalytics.com/enhancements/field-mapping for a list of valid field types and descriptions. Each field type should be mapped to a string specifying a column name in the input table. For field types that support multiple values (e.g., the “phone” field), a list of column names can be provided (e.g., {“phone”: [“home_phone”, “mobile_phone”], …}).
- input_tabledict, optional::
- database_namestring
The Redshift database name for the table.
- schemastring
The schema name for the table.
- tablestring
The table name.
- match_target_idinteger, optional
The ID of the Civis Data match target. See /match_targets for IDs.
- output_tabledict, optional::
- database_namestring
The Redshift database name for the table.
- schemastring
The schema name for the table.
- tablestring
The table name.
- max_matchesinteger, optional
The maximum number of matches per record in the input table to return. Must be between 0 and 10. 0 returns all matches.
- thresholdnumber/float, optional
The score threshold (between 0 and 1). Matches below this threshold will not be returned. The default value is 0.5.
- archivedboolean, optional
Whether the Civis Data Match Job has been archived.
- Returns
civis.response.Response
- idinteger
The ID for the enhancement.
- namestring
The name of the enhancement job.
- typestring
The type of the enhancement (e.g CASS-NCOA)
- created_atstring/time
The time this enhancement was created.
- updated_atstring/time
The time the enhancement was last updated.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- statestring
The status of the enhancement’s last run
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- parent_idinteger
Parent ID that triggers this enhancement.
- notificationsdict::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- running_asdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- input_field_mappingdict
The field (i.e., column) mapping for the input table. See https://api.civisanalytics.com/enhancements/field-mapping for a list of valid field types and descriptions. Each field type should be mapped to a string specifying a column name in the input table. For field types that support multiple values (e.g., the “phone” field), a list of column names can be provided (e.g., {“phone”: [“home_phone”, “mobile_phone”], …}).
- input_tabledict::
- database_namestring
The Redshift database name for the table.
- schemastring
The schema name for the table.
- tablestring
The table name.
- match_target_idinteger
The ID of the Civis Data match target. See /match_targets for IDs.
- output_tabledict::
- database_namestring
The Redshift database name for the table.
- schemastring
The schema name for the table.
- tablestring
The table name.
- max_matchesinteger
The maximum number of matches per record in the input table to return. Must be between 0 and 10. 0 returns all matches.
- thresholdnumber/float
The score threshold (between 0 and 1). Matches below this threshold will not be returned. The default value is 0.5.
- archivedboolean
Whether the Civis Data Match Job has been archived.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- patch_geocode(id, *, name='DEFAULT', schedule='DEFAULT', parent_id='DEFAULT', notifications='DEFAULT', remote_host_id='DEFAULT', credential_id='DEFAULT', source_schema_and_table='DEFAULT', multipart_key='DEFAULT', limiting_sql='DEFAULT', target_schema='DEFAULT', target_table='DEFAULT', country='DEFAULT', provider='DEFAULT', output_address='DEFAULT')¶
Update some attributes of this Geocode Enhancement
- Parameters
- idinteger
The ID for the enhancement.
- namestring, optional
The name of the enhancement job.
- scheduledict, optional::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- parent_idinteger, optional
Parent ID that triggers this enhancement.
- notificationsdict, optional::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- remote_host_idinteger, optional
The ID of the remote host.
- credential_idinteger, optional
The ID of the remote host credential.
- source_schema_and_tablestring, optional
The source database schema and table.
- multipart_keylist, optional
The source table primary key.
- limiting_sqlstring, optional
The limiting SQL for the source table. “WHERE” should be omitted (e.g. state=’IL’).
- target_schemastring, optional
The output table schema.
- target_tablestring, optional
The output table name.
- countrystring, optional
The country of the addresses to be geocoded; either ‘us’ or ‘ca’.
- providerstring, optional
The geocoding provider; one of postgis, nominatim, and geocoder_ca.
- output_addressboolean, optional
Whether to output the parsed address. Only guaranteed for the ‘postgis’ provider.
- Returns
civis.response.Response
- idinteger
The ID for the enhancement.
- namestring
The name of the enhancement job.
- typestring
The type of the enhancement (e.g CASS-NCOA)
- created_atstring/time
The time this enhancement was created.
- updated_atstring/time
The time the enhancement was last updated.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- statestring
The status of the enhancement’s last run
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- parent_idinteger
Parent ID that triggers this enhancement.
- notificationsdict::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- running_asdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- remote_host_idinteger
The ID of the remote host.
- credential_idinteger
The ID of the remote host credential.
- source_schema_and_tablestring
The source database schema and table.
- multipart_keylist
The source table primary key.
- limiting_sqlstring
The limiting SQL for the source table. “WHERE” should be omitted (e.g. state=’IL’).
- target_schemastring
The output table schema.
- target_tablestring
The output table name.
- countrystring
The country of the addresses to be geocoded; either ‘us’ or ‘ca’.
- providerstring
The geocoding provider; one of postgis, nominatim, and geocoder_ca.
- output_addressboolean
Whether to output the parsed address. Only guaranteed for the ‘postgis’ provider.
- archivedstring
The archival status of the requested item(s).
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- 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
- namestring
The name of the enhancement job.
- sourcedict::
- database_tabledict::
- schemastring
The schema name of the source table.
- tablestring
The name of the source table.
- remote_host_idinteger
The ID of the database host for the table.
- credential_idinteger
The id of the credentials to be used when performing the enhancement.
- multipart_keylist
The source table primary key.
- scheduledict, optional::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- parent_idinteger, optional
Parent ID that triggers this enhancement.
- notificationsdict, optional::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- destinationdict, optional::
- database_tabledict::
- schemastring
The schema name for the output data.
- tablestring
The table name for the output data.
- column_mappingdict, optional::
- address1string
The first address line.
- address2string
The second address line.
- citystring
The city of an address.
- statestring
The state of an address.
- zipstring
The zip code of an address.
- namestring
The full name of the resident at this address. If needed, separate multiple columns with +, e.g. first_name+last_name
- companystring
The name of the company located at this address.
- use_default_column_mappingboolean, 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_ncoaboolean, optional
Whether to update addresses for records matching the National Change of Address (NCOA) database.
- ncoa_credential_idinteger, optional
Credential to use when performing NCOA updates. Required if ‘performNcoa’ is true.
- output_levelstring, 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_sqlstring, optional
The limiting SQL for the source table. “WHERE” should be omitted (e.g. state=’IL’).
- Returns
civis.response.Response
- idinteger
The ID for the enhancement.
- namestring
The name of the enhancement job.
- typestring
The type of the enhancement (e.g CASS-NCOA)
- created_atstring/time
The time this enhancement was created.
- updated_atstring/time
The time the enhancement was last updated.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- statestring
The status of the enhancement’s last run
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- parent_idinteger
Parent ID that triggers this enhancement.
- notificationsdict::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- running_asdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- sourcedict::
- database_tabledict::
- schemastring
The schema name of the source table.
- tablestring
The name of the source table.
- remote_host_idinteger
The ID of the database host for the table.
- credential_idinteger
The id of the credentials to be used when performing the enhancement.
- multipart_keylist
The source table primary key.
- destinationdict::
- database_tabledict::
- schemastring
The schema name for the output data.
- tablestring
The table name for the output data.
- column_mappingdict::
- address1string
The first address line.
- address2string
The second address line.
- citystring
The city of an address.
- statestring
The state of an address.
- zipstring
The zip code of an address.
- namestring
The full name of the resident at this address. If needed, separate multiple columns with +, e.g. first_name+last_name
- companystring
The name of the company located at this address.
- use_default_column_mappingboolean
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_ncoaboolean
Whether to update addresses for records matching the National Change of Address (NCOA) database.
- ncoa_credential_idinteger
Credential to use when performing NCOA updates. Required if ‘performNcoa’ is true.
- output_levelstring
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_sqlstring
The limiting SQL for the source table. “WHERE” should be omitted (e.g. state=’IL’).
- archivedstring
The archival status of the requested item(s).
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- post_cass_ncoa_cancel(id)¶
Cancel a run
- Parameters
- idinteger
The ID of the job.
- Returns
civis.response.Response
- idinteger
The ID of the run.
- statestring
The state of the run, one of ‘queued’, ‘running’ or ‘cancelled’.
- is_cancel_requestedboolean
True if run cancel requested, else false.
- post_cass_ncoa_runs(id)¶
Start a run
- Parameters
- idinteger
The ID of the cass_ncoa.
- Returns
civis.response.Response
- idinteger
The ID of the run.
- cass_ncoa_idinteger
The ID of the cass_ncoa.
- statestring
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- is_cancel_requestedboolean
True if run cancel requested, else false.
- started_atstring/time
The time the last run started at.
- finished_atstring/time
The time the last run completed.
- errorstring
The error, if any, returned by the run.
- post_civis_data_match(name, input_field_mapping, input_table, match_target_id, output_table, *, schedule='DEFAULT', parent_id='DEFAULT', notifications='DEFAULT', max_matches='DEFAULT', threshold='DEFAULT', archived='DEFAULT')¶
Create a Civis Data Match Enhancement
- Parameters
- namestring
The name of the enhancement job.
- input_field_mappingdict
The field (i.e., column) mapping for the input table. See https://api.civisanalytics.com/enhancements/field-mapping for a list of valid field types and descriptions. Each field type should be mapped to a string specifying a column name in the input table. For field types that support multiple values (e.g., the “phone” field), a list of column names can be provided (e.g., {“phone”: [“home_phone”, “mobile_phone”], …}).
- input_tabledict::
- database_namestring
The Redshift database name for the table.
- schemastring
The schema name for the table.
- tablestring
The table name.
- match_target_idinteger
The ID of the Civis Data match target. See /match_targets for IDs.
- output_tabledict::
- database_namestring
The Redshift database name for the table.
- schemastring
The schema name for the table.
- tablestring
The table name.
- scheduledict, optional::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- parent_idinteger, optional
Parent ID that triggers this enhancement.
- notificationsdict, optional::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- max_matchesinteger, optional
The maximum number of matches per record in the input table to return. Must be between 0 and 10. 0 returns all matches.
- thresholdnumber/float, optional
The score threshold (between 0 and 1). Matches below this threshold will not be returned. The default value is 0.5.
- archivedboolean, optional
Whether the Civis Data Match Job has been archived.
- Returns
civis.response.Response
- idinteger
The ID for the enhancement.
- namestring
The name of the enhancement job.
- typestring
The type of the enhancement (e.g CASS-NCOA)
- created_atstring/time
The time this enhancement was created.
- updated_atstring/time
The time the enhancement was last updated.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- statestring
The status of the enhancement’s last run
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- parent_idinteger
Parent ID that triggers this enhancement.
- notificationsdict::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- running_asdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- input_field_mappingdict
The field (i.e., column) mapping for the input table. See https://api.civisanalytics.com/enhancements/field-mapping for a list of valid field types and descriptions. Each field type should be mapped to a string specifying a column name in the input table. For field types that support multiple values (e.g., the “phone” field), a list of column names can be provided (e.g., {“phone”: [“home_phone”, “mobile_phone”], …}).
- input_tabledict::
- database_namestring
The Redshift database name for the table.
- schemastring
The schema name for the table.
- tablestring
The table name.
- match_target_idinteger
The ID of the Civis Data match target. See /match_targets for IDs.
- output_tabledict::
- database_namestring
The Redshift database name for the table.
- schemastring
The schema name for the table.
- tablestring
The table name.
- max_matchesinteger
The maximum number of matches per record in the input table to return. Must be between 0 and 10. 0 returns all matches.
- thresholdnumber/float
The score threshold (between 0 and 1). Matches below this threshold will not be returned. The default value is 0.5.
- archivedboolean
Whether the Civis Data Match Job has been archived.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- post_civis_data_match_cancel(id)¶
Cancel a run
- Parameters
- idinteger
The ID of the job.
- Returns
civis.response.Response
- idinteger
The ID of the run.
- statestring
The state of the run, one of ‘queued’, ‘running’ or ‘cancelled’.
- is_cancel_requestedboolean
True if run cancel requested, else false.
- post_civis_data_match_clone(id, *, clone_schedule='DEFAULT', clone_triggers='DEFAULT', clone_notifications='DEFAULT')¶
Clone this Civis Data Match Enhancement
- Parameters
- idinteger
The ID for the enhancement.
- clone_scheduleboolean, optional
If true, also copy the schedule to the new enhancement.
- clone_triggersboolean, optional
If true, also copy the triggers to the new enhancement.
- clone_notificationsboolean, optional
If true, also copy the notifications to the new enhancement.
- Returns
civis.response.Response
- idinteger
The ID for the enhancement.
- namestring
The name of the enhancement job.
- typestring
The type of the enhancement (e.g CASS-NCOA)
- created_atstring/time
The time this enhancement was created.
- updated_atstring/time
The time the enhancement was last updated.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- statestring
The status of the enhancement’s last run
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- parent_idinteger
Parent ID that triggers this enhancement.
- notificationsdict::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- running_asdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- input_field_mappingdict
The field (i.e., column) mapping for the input table. See https://api.civisanalytics.com/enhancements/field-mapping for a list of valid field types and descriptions. Each field type should be mapped to a string specifying a column name in the input table. For field types that support multiple values (e.g., the “phone” field), a list of column names can be provided (e.g., {“phone”: [“home_phone”, “mobile_phone”], …}).
- input_tabledict::
- database_namestring
The Redshift database name for the table.
- schemastring
The schema name for the table.
- tablestring
The table name.
- match_target_idinteger
The ID of the Civis Data match target. See /match_targets for IDs.
- output_tabledict::
- database_namestring
The Redshift database name for the table.
- schemastring
The schema name for the table.
- tablestring
The table name.
- max_matchesinteger
The maximum number of matches per record in the input table to return. Must be between 0 and 10. 0 returns all matches.
- thresholdnumber/float
The score threshold (between 0 and 1). Matches below this threshold will not be returned. The default value is 0.5.
- archivedboolean
Whether the Civis Data Match Job has been archived.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- post_civis_data_match_runs(id)¶
Start a run
- Parameters
- idinteger
The ID of the civis_data_match.
- Returns
civis.response.Response
- idinteger
The ID of the run.
- civis_data_match_idinteger
The ID of the civis_data_match.
- statestring
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- is_cancel_requestedboolean
True if run cancel requested, else false.
- started_atstring/time
The time the last run started at.
- finished_atstring/time
The time the last run completed.
- errorstring
The error, if any, returned by the run.
- post_geocode(name, remote_host_id, credential_id, source_schema_and_table, *, schedule='DEFAULT', parent_id='DEFAULT', notifications='DEFAULT', multipart_key='DEFAULT', limiting_sql='DEFAULT', target_schema='DEFAULT', target_table='DEFAULT', country='DEFAULT', provider='DEFAULT', output_address='DEFAULT')¶
Create a Geocode Enhancement
- Parameters
- namestring
The name of the enhancement job.
- remote_host_idinteger
The ID of the remote host.
- credential_idinteger
The ID of the remote host credential.
- source_schema_and_tablestring
The source database schema and table.
- scheduledict, optional::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- parent_idinteger, optional
Parent ID that triggers this enhancement.
- notificationsdict, optional::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- multipart_keylist, optional
The source table primary key.
- limiting_sqlstring, optional
The limiting SQL for the source table. “WHERE” should be omitted (e.g. state=’IL’).
- target_schemastring, optional
The output table schema.
- target_tablestring, optional
The output table name.
- countrystring, optional
The country of the addresses to be geocoded; either ‘us’ or ‘ca’.
- providerstring, optional
The geocoding provider; one of postgis, nominatim, and geocoder_ca.
- output_addressboolean, optional
Whether to output the parsed address. Only guaranteed for the ‘postgis’ provider.
- Returns
civis.response.Response
- idinteger
The ID for the enhancement.
- namestring
The name of the enhancement job.
- typestring
The type of the enhancement (e.g CASS-NCOA)
- created_atstring/time
The time this enhancement was created.
- updated_atstring/time
The time the enhancement was last updated.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- statestring
The status of the enhancement’s last run
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- parent_idinteger
Parent ID that triggers this enhancement.
- notificationsdict::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- running_asdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- remote_host_idinteger
The ID of the remote host.
- credential_idinteger
The ID of the remote host credential.
- source_schema_and_tablestring
The source database schema and table.
- multipart_keylist
The source table primary key.
- limiting_sqlstring
The limiting SQL for the source table. “WHERE” should be omitted (e.g. state=’IL’).
- target_schemastring
The output table schema.
- target_tablestring
The output table name.
- countrystring
The country of the addresses to be geocoded; either ‘us’ or ‘ca’.
- providerstring
The geocoding provider; one of postgis, nominatim, and geocoder_ca.
- output_addressboolean
Whether to output the parsed address. Only guaranteed for the ‘postgis’ provider.
- archivedstring
The archival status of the requested item(s).
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- post_geocode_cancel(id)¶
Cancel a run
- Parameters
- idinteger
The ID of the job.
- Returns
civis.response.Response
- idinteger
The ID of the run.
- statestring
The state of the run, one of ‘queued’, ‘running’ or ‘cancelled’.
- is_cancel_requestedboolean
True if run cancel requested, else false.
- post_geocode_runs(id)¶
Start a run
- Parameters
- idinteger
The ID of the geocode.
- Returns
civis.response.Response
- idinteger
The ID of the run.
- geocode_idinteger
The ID of the geocode.
- statestring
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- is_cancel_requestedboolean
True if run cancel requested, else false.
- started_atstring/time
The time the last run started at.
- finished_atstring/time
The time the last run completed.
- errorstring
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
- idinteger
The ID for the enhancement.
- namestring
The name of the enhancement job.
- sourcedict::
- database_tabledict::
- schemastring
The schema name of the source table.
- tablestring
The name of the source table.
- remote_host_idinteger
The ID of the database host for the table.
- credential_idinteger
The id of the credentials to be used when performing the enhancement.
- multipart_keylist
The source table primary key.
- scheduledict, optional::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- parent_idinteger, optional
Parent ID that triggers this enhancement.
- notificationsdict, optional::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- destinationdict, optional::
- database_tabledict::
- schemastring
The schema name for the output data.
- tablestring
The table name for the output data.
- column_mappingdict, optional::
- address1string
The first address line.
- address2string
The second address line.
- citystring
The city of an address.
- statestring
The state of an address.
- zipstring
The zip code of an address.
- namestring
The full name of the resident at this address. If needed, separate multiple columns with +, e.g. first_name+last_name
- companystring
The name of the company located at this address.
- use_default_column_mappingboolean, 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_ncoaboolean, optional
Whether to update addresses for records matching the National Change of Address (NCOA) database.
- ncoa_credential_idinteger, optional
Credential to use when performing NCOA updates. Required if ‘performNcoa’ is true.
- output_levelstring, 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_sqlstring, optional
The limiting SQL for the source table. “WHERE” should be omitted (e.g. state=’IL’).
- Returns
civis.response.Response
- idinteger
The ID for the enhancement.
- namestring
The name of the enhancement job.
- typestring
The type of the enhancement (e.g CASS-NCOA)
- created_atstring/time
The time this enhancement was created.
- updated_atstring/time
The time the enhancement was last updated.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- statestring
The status of the enhancement’s last run
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- parent_idinteger
Parent ID that triggers this enhancement.
- notificationsdict::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- running_asdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- sourcedict::
- database_tabledict::
- schemastring
The schema name of the source table.
- tablestring
The name of the source table.
- remote_host_idinteger
The ID of the database host for the table.
- credential_idinteger
The id of the credentials to be used when performing the enhancement.
- multipart_keylist
The source table primary key.
- destinationdict::
- database_tabledict::
- schemastring
The schema name for the output data.
- tablestring
The table name for the output data.
- column_mappingdict::
- address1string
The first address line.
- address2string
The second address line.
- citystring
The city of an address.
- statestring
The state of an address.
- zipstring
The zip code of an address.
- namestring
The full name of the resident at this address. If needed, separate multiple columns with +, e.g. first_name+last_name
- companystring
The name of the company located at this address.
- use_default_column_mappingboolean
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_ncoaboolean
Whether to update addresses for records matching the National Change of Address (NCOA) database.
- ncoa_credential_idinteger
Credential to use when performing NCOA updates. Required if ‘performNcoa’ is true.
- output_levelstring
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_sqlstring
The limiting SQL for the source table. “WHERE” should be omitted (e.g. state=’IL’).
- archivedstring
The archival status of the requested item(s).
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- put_cass_ncoa_archive(id, status)¶
Update the archive status of this object
- Parameters
- idinteger
The ID of the object.
- statusboolean
The desired archived status of the object.
- Returns
civis.response.Response
- idinteger
The ID for the enhancement.
- namestring
The name of the enhancement job.
- typestring
The type of the enhancement (e.g CASS-NCOA)
- created_atstring/time
The time this enhancement was created.
- updated_atstring/time
The time the enhancement was last updated.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- statestring
The status of the enhancement’s last run
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- parent_idinteger
Parent ID that triggers this enhancement.
- notificationsdict::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- running_asdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- sourcedict::
- database_tabledict::
- schemastring
The schema name of the source table.
- tablestring
The name of the source table.
- remote_host_idinteger
The ID of the database host for the table.
- credential_idinteger
The id of the credentials to be used when performing the enhancement.
- multipart_keylist
The source table primary key.
- destinationdict::
- database_tabledict::
- schemastring
The schema name for the output data.
- tablestring
The table name for the output data.
- column_mappingdict::
- address1string
The first address line.
- address2string
The second address line.
- citystring
The city of an address.
- statestring
The state of an address.
- zipstring
The zip code of an address.
- namestring
The full name of the resident at this address. If needed, separate multiple columns with +, e.g. first_name+last_name
- companystring
The name of the company located at this address.
- use_default_column_mappingboolean
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_ncoaboolean
Whether to update addresses for records matching the National Change of Address (NCOA) database.
- ncoa_credential_idinteger
Credential to use when performing NCOA updates. Required if ‘performNcoa’ is true.
- output_levelstring
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_sqlstring
The limiting SQL for the source table. “WHERE” should be omitted (e.g. state=’IL’).
- archivedstring
The archival status of the requested item(s).
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- put_cass_ncoa_projects(id, project_id)¶
Add a CASS/NCOA Enhancement to a project
- Parameters
- idinteger
The ID of the CASS/NCOA Enhancement.
- project_idinteger
The ID of the project.
- Returns
- None
Response code 204: success
Set the permissions groups has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- group_idslist
An array of one or more group IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
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
- idinteger
The ID of the resource that is shared.
- user_idslist
An array of one or more user IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
- put_cass_ncoa_transfer(id, user_id, include_dependencies, *, email_body='DEFAULT', send_email='DEFAULT')¶
Transfer ownership of this object to another user
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger
ID of target user
- include_dependenciesboolean
Whether or not to give manage permissions on all dependencies
- email_bodystring, optional
Custom body text for e-mail sent on transfer.
- send_emailboolean, optional
Send email to the target user of the transfer?
- Returns
civis.response.Response
- dependencieslist::
Dependent objects for this object - object_type : string
Dependent object type
- fco_typestring
Human readable dependent object type
- idinteger
Dependent object ID
- namestring
Dependent object name, or nil if the requesting user cannot read this object
- permission_levelstring
Permission level of target user (not user’s groups) for dependent object, or null if no target user
- sharedboolean
Whether dependent object was successfully shared with target user
- put_civis_data_match(id, name, input_field_mapping, input_table, match_target_id, output_table, *, schedule='DEFAULT', parent_id='DEFAULT', notifications='DEFAULT', max_matches='DEFAULT', threshold='DEFAULT', archived='DEFAULT')¶
Replace all attributes of this Civis Data Match Enhancement
- Parameters
- idinteger
The ID for the enhancement.
- namestring
The name of the enhancement job.
- input_field_mappingdict
The field (i.e., column) mapping for the input table. See https://api.civisanalytics.com/enhancements/field-mapping for a list of valid field types and descriptions. Each field type should be mapped to a string specifying a column name in the input table. For field types that support multiple values (e.g., the “phone” field), a list of column names can be provided (e.g., {“phone”: [“home_phone”, “mobile_phone”], …}).
- input_tabledict::
- database_namestring
The Redshift database name for the table.
- schemastring
The schema name for the table.
- tablestring
The table name.
- match_target_idinteger
The ID of the Civis Data match target. See /match_targets for IDs.
- output_tabledict::
- database_namestring
The Redshift database name for the table.
- schemastring
The schema name for the table.
- tablestring
The table name.
- scheduledict, optional::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- parent_idinteger, optional
Parent ID that triggers this enhancement.
- notificationsdict, optional::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- max_matchesinteger, optional
The maximum number of matches per record in the input table to return. Must be between 0 and 10. 0 returns all matches.
- thresholdnumber/float, optional
The score threshold (between 0 and 1). Matches below this threshold will not be returned. The default value is 0.5.
- archivedboolean, optional
Whether the Civis Data Match Job has been archived.
- Returns
civis.response.Response
- idinteger
The ID for the enhancement.
- namestring
The name of the enhancement job.
- typestring
The type of the enhancement (e.g CASS-NCOA)
- created_atstring/time
The time this enhancement was created.
- updated_atstring/time
The time the enhancement was last updated.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- statestring
The status of the enhancement’s last run
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- parent_idinteger
Parent ID that triggers this enhancement.
- notificationsdict::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- running_asdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- input_field_mappingdict
The field (i.e., column) mapping for the input table. See https://api.civisanalytics.com/enhancements/field-mapping for a list of valid field types and descriptions. Each field type should be mapped to a string specifying a column name in the input table. For field types that support multiple values (e.g., the “phone” field), a list of column names can be provided (e.g., {“phone”: [“home_phone”, “mobile_phone”], …}).
- input_tabledict::
- database_namestring
The Redshift database name for the table.
- schemastring
The schema name for the table.
- tablestring
The table name.
- match_target_idinteger
The ID of the Civis Data match target. See /match_targets for IDs.
- output_tabledict::
- database_namestring
The Redshift database name for the table.
- schemastring
The schema name for the table.
- tablestring
The table name.
- max_matchesinteger
The maximum number of matches per record in the input table to return. Must be between 0 and 10. 0 returns all matches.
- thresholdnumber/float
The score threshold (between 0 and 1). Matches below this threshold will not be returned. The default value is 0.5.
- archivedboolean
Whether the Civis Data Match Job has been archived.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- put_civis_data_match_archive(id, status)¶
Update the archive status of this object
- Parameters
- idinteger
The ID of the object.
- statusboolean
The desired archived status of the object.
- Returns
civis.response.Response
- idinteger
The ID for the enhancement.
- namestring
The name of the enhancement job.
- typestring
The type of the enhancement (e.g CASS-NCOA)
- created_atstring/time
The time this enhancement was created.
- updated_atstring/time
The time the enhancement was last updated.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- statestring
The status of the enhancement’s last run
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- parent_idinteger
Parent ID that triggers this enhancement.
- notificationsdict::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- running_asdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- input_field_mappingdict
The field (i.e., column) mapping for the input table. See https://api.civisanalytics.com/enhancements/field-mapping for a list of valid field types and descriptions. Each field type should be mapped to a string specifying a column name in the input table. For field types that support multiple values (e.g., the “phone” field), a list of column names can be provided (e.g., {“phone”: [“home_phone”, “mobile_phone”], …}).
- input_tabledict::
- database_namestring
The Redshift database name for the table.
- schemastring
The schema name for the table.
- tablestring
The table name.
- match_target_idinteger
The ID of the Civis Data match target. See /match_targets for IDs.
- output_tabledict::
- database_namestring
The Redshift database name for the table.
- schemastring
The schema name for the table.
- tablestring
The table name.
- max_matchesinteger
The maximum number of matches per record in the input table to return. Must be between 0 and 10. 0 returns all matches.
- thresholdnumber/float
The score threshold (between 0 and 1). Matches below this threshold will not be returned. The default value is 0.5.
- archivedboolean
Whether the Civis Data Match Job has been archived.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- put_civis_data_match_projects(id, project_id)¶
Add a Civis Data Match Enhancement to a project
- Parameters
- idinteger
The ID of the Civis Data Match Enhancement.
- project_idinteger
The ID of the project.
- Returns
- None
Response code 204: success
Set the permissions groups has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- group_idslist
An array of one or more group IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
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
- idinteger
The ID of the resource that is shared.
- user_idslist
An array of one or more user IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
- put_civis_data_match_transfer(id, user_id, include_dependencies, *, email_body='DEFAULT', send_email='DEFAULT')¶
Transfer ownership of this object to another user
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger
ID of target user
- include_dependenciesboolean
Whether or not to give manage permissions on all dependencies
- email_bodystring, optional
Custom body text for e-mail sent on transfer.
- send_emailboolean, optional
Send email to the target user of the transfer?
- Returns
civis.response.Response
- dependencieslist::
Dependent objects for this object - object_type : string
Dependent object type
- fco_typestring
Human readable dependent object type
- idinteger
Dependent object ID
- namestring
Dependent object name, or nil if the requesting user cannot read this object
- permission_levelstring
Permission level of target user (not user’s groups) for dependent object, or null if no target user
- sharedboolean
Whether dependent object was successfully shared with target user
- put_geocode(id, name, remote_host_id, credential_id, source_schema_and_table, *, schedule='DEFAULT', parent_id='DEFAULT', notifications='DEFAULT', multipart_key='DEFAULT', limiting_sql='DEFAULT', target_schema='DEFAULT', target_table='DEFAULT', country='DEFAULT', provider='DEFAULT', output_address='DEFAULT')¶
Replace all attributes of this Geocode Enhancement
- Parameters
- idinteger
The ID for the enhancement.
- namestring
The name of the enhancement job.
- remote_host_idinteger
The ID of the remote host.
- credential_idinteger
The ID of the remote host credential.
- source_schema_and_tablestring
The source database schema and table.
- scheduledict, optional::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- parent_idinteger, optional
Parent ID that triggers this enhancement.
- notificationsdict, optional::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- multipart_keylist, optional
The source table primary key.
- limiting_sqlstring, optional
The limiting SQL for the source table. “WHERE” should be omitted (e.g. state=’IL’).
- target_schemastring, optional
The output table schema.
- target_tablestring, optional
The output table name.
- countrystring, optional
The country of the addresses to be geocoded; either ‘us’ or ‘ca’.
- providerstring, optional
The geocoding provider; one of postgis, nominatim, and geocoder_ca.
- output_addressboolean, optional
Whether to output the parsed address. Only guaranteed for the ‘postgis’ provider.
- Returns
civis.response.Response
- idinteger
The ID for the enhancement.
- namestring
The name of the enhancement job.
- typestring
The type of the enhancement (e.g CASS-NCOA)
- created_atstring/time
The time this enhancement was created.
- updated_atstring/time
The time the enhancement was last updated.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- statestring
The status of the enhancement’s last run
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- parent_idinteger
Parent ID that triggers this enhancement.
- notificationsdict::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- running_asdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- remote_host_idinteger
The ID of the remote host.
- credential_idinteger
The ID of the remote host credential.
- source_schema_and_tablestring
The source database schema and table.
- multipart_keylist
The source table primary key.
- limiting_sqlstring
The limiting SQL for the source table. “WHERE” should be omitted (e.g. state=’IL’).
- target_schemastring
The output table schema.
- target_tablestring
The output table name.
- countrystring
The country of the addresses to be geocoded; either ‘us’ or ‘ca’.
- providerstring
The geocoding provider; one of postgis, nominatim, and geocoder_ca.
- output_addressboolean
Whether to output the parsed address. Only guaranteed for the ‘postgis’ provider.
- archivedstring
The archival status of the requested item(s).
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- put_geocode_archive(id, status)¶
Update the archive status of this object
- Parameters
- idinteger
The ID of the object.
- statusboolean
The desired archived status of the object.
- Returns
civis.response.Response
- idinteger
The ID for the enhancement.
- namestring
The name of the enhancement job.
- typestring
The type of the enhancement (e.g CASS-NCOA)
- created_atstring/time
The time this enhancement was created.
- updated_atstring/time
The time the enhancement was last updated.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- statestring
The status of the enhancement’s last run
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- parent_idinteger
Parent ID that triggers this enhancement.
- notificationsdict::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- running_asdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- remote_host_idinteger
The ID of the remote host.
- credential_idinteger
The ID of the remote host credential.
- source_schema_and_tablestring
The source database schema and table.
- multipart_keylist
The source table primary key.
- limiting_sqlstring
The limiting SQL for the source table. “WHERE” should be omitted (e.g. state=’IL’).
- target_schemastring
The output table schema.
- target_tablestring
The output table name.
- countrystring
The country of the addresses to be geocoded; either ‘us’ or ‘ca’.
- providerstring
The geocoding provider; one of postgis, nominatim, and geocoder_ca.
- output_addressboolean
Whether to output the parsed address. Only guaranteed for the ‘postgis’ provider.
- archivedstring
The archival status of the requested item(s).
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- put_geocode_projects(id, project_id)¶
Add a Geocode Enhancement to a project
- Parameters
- idinteger
The ID of the Geocode Enhancement.
- project_idinteger
The ID of the project.
- Returns
- None
Response code 204: success
Set the permissions groups has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- group_idslist
An array of one or more group IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
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
- idinteger
The ID of the resource that is shared.
- user_idslist
An array of one or more user IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
- put_geocode_transfer(id, user_id, include_dependencies, *, email_body='DEFAULT', send_email='DEFAULT')¶
Transfer ownership of this object to another user
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger
ID of target user
- include_dependenciesboolean
Whether or not to give manage permissions on all dependencies
- email_bodystring, optional
Custom body text for e-mail sent on transfer.
- send_emailboolean, optional
Send email to the target user of the transfer?
- Returns
civis.response.Response
- dependencieslist::
Dependent objects for this object - object_type : string
Dependent object type
- fco_typestring
Human readable dependent object type
- idinteger
Dependent object ID
- namestring
Dependent object name, or nil if the requesting user cannot read this object
- permission_levelstring
Permission level of target user (not user’s groups) for dependent object, or null if no target user
- sharedboolean
Whether dependent object was successfully shared with target user
Exports¶
- class Exports(session_kwargs, client, return_type='civis')¶
Examples
>>> import civis >>> client = civis.APIClient() >>> client.exports.list(...)
Methods
delete_files_csv_runs
(id, run_id)Cancel a run
get_files_csv
(id)Get a CSV Export
get_files_csv_runs
(id, run_id)Check status of a run
list
(*[, type, status, author, hidden, ...])List
list_files_csv_runs
(id, *[, limit, ...])List runs for the given csv_export
list_files_csv_runs_logs
(id, run_id, *[, ...])Get the logs for a run
list_files_csv_runs_outputs
(id, run_id, *[, ...])List the outputs for a run
patch_files_csv
(id, *[, name, source, ...])Update some attributes of this CSV Export
post_files_csv
(source, destination, *[, ...])Create a CSV Export
Start a run
put_files_csv
(id, source, destination, *[, ...])Replace all attributes of this CSV Export
put_files_csv_archive
(id, status)Update the archive status of this object
- delete_files_csv_runs(id, run_id)¶
Cancel a run
- Parameters
- idinteger
The ID of the csv_export.
- run_idinteger
The ID of the run.
- Returns
- None
Response code 202: success
- get_files_csv(id)¶
Get a CSV Export
- Parameters
- idinteger
- Returns
civis.response.Response
- idinteger
The ID of this Csv Export job.
- namestring
The name of this Csv Export job.
- sourcedict::
- sqlstring
The SQL query for this Csv Export job
- remote_host_idinteger
The ID of the destination database host.
- credential_idinteger
The ID of the credentials for the destination database.
- destinationdict::
- filename_prefixstring
The prefix of the name of the file returned to the user.
- storage_pathdict::
- file_pathstring
The path within the bucket where the exported file will be saved. E.g. the file_path for “s3://mybucket/files/all/” would be “/files/all/”
- storage_host_idinteger
The ID of the destination storage host.
- credential_idinteger
The ID of the credentials for the destination storage host.
- existing_filesstring
Notifies the job of what to do in the case that the exported file already exists at the provided path.One of: fail, append, overwrite. Default: fail. If “append” is specified,the new file will always be added to the provided path. If “overwrite” is specifiedall existing files at the provided path will be deleted and the new file will be added.By default, or if “fail” is specified, the export will fail if a file exists at the provided path.
- include_headerboolean
A boolean value indicating whether or not the header should be included. Defaults to true.
- compressionstring
The compression of the output file. Valid arguments are “gzip” and “none”. Defaults to “gzip”.
- column_delimiterstring
The column delimiter for the output file. Valid arguments are “comma”, “tab”, and “pipe”. Defaults to “comma”.
- hiddenboolean
A boolean value indicating whether or not this request should be hidden. Defaults to false.
- force_multifileboolean
Whether or not the csv should be split into multiple files. Default: false
- max_file_sizeinteger
The max file size, in MB, created files will be. Only available when force_multifile is true.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- get_files_csv_runs(id, run_id)¶
Check status of a run
- Parameters
- idinteger
The ID of the csv_export.
- run_idinteger
The ID of the run.
- Returns
civis.response.Response
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- output_cached_onstring/time
The time that the output was originally exported, if a cache entry was used by the run.
- list(*, type='DEFAULT', status='DEFAULT', author='DEFAULT', hidden='DEFAULT', archived='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶
List
- Parameters
- typestring, optional
If specified, return exports of these types. It accepts a comma-separated list, possible values are ‘database’ and ‘gdoc’.
- statusstring, optional
If specified, returns export with one of these statuses. It accepts a comma-separated list, possible values are ‘running’, ‘failed’, ‘succeeded’, ‘idle’, ‘scheduled’.
- authorstring, optional
If specified, return items from any of these authors. It accepts a comma- separated list of user IDs.
- hiddenboolean, optional
If specified to be true, returns hidden items. Defaults to false, returning non-hidden items.
- archivedstring, optional
The archival status of the requested item(s).
- limitinteger, optional
Number of results to return. Defaults to 20. Maximum allowed is 50.
- page_numinteger, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstring, 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_dirstring, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iteratorbool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
- Returns
civis.response.PaginatedResponse
- idinteger
The ID for this export.
- namestring
The name of this export.
- typestring
The type of export.
- created_atstring/time
The creation time for this export.
- updated_atstring/time
The last modification time for this export.
state : string
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- list_files_csv_runs(id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶
List runs for the given csv_export
- Parameters
- idinteger
The ID of the csv_export.
- limitinteger, optional
Number of results to return. Defaults to 20. Maximum allowed is 100.
- page_numinteger, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstring, optional
The field on which to order the result set. Defaults to id. Must be one of: id.
- order_dirstring, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iteratorbool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
- Returns
civis.response.PaginatedResponse
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- list_files_csv_runs_logs(id, run_id, *, last_id='DEFAULT', limit='DEFAULT')¶
Get the logs for a run
- Parameters
- idinteger
The ID of the csv_export.
- run_idinteger
The ID of the run.
- last_idinteger, 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.
- limitinteger, optional
The maximum number of log messages to return. Default of 10000.
- Returns
civis.response.Response
- idinteger
The ID of the log.
- created_atstring/date-time
The time the log was created.
- messagestring
The log message.
- levelstring
The level of the log. One of unknown,fatal,error,warn,info,debug.
- list_files_csv_runs_outputs(id, run_id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶
List the outputs for a run
- Parameters
- idinteger
The ID of the csv_export.
- run_idinteger
The ID of the run.
- limitinteger, optional
Number of results to return. Defaults to its maximum of 50.
- page_numinteger, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstring, optional
The field on which to order the result set. Defaults to created_at. Must be one of: created_at, id.
- order_dirstring, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iteratorbool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
- Returns
civis.response.PaginatedResponse
- object_typestring
The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue
- object_idinteger
The ID of the output.
- namestring
The name of the output.
- linkstring
The hypermedia link to the output.
value : string
- patch_files_csv(id, *, name='DEFAULT', source='DEFAULT', destination='DEFAULT', include_header='DEFAULT', compression='DEFAULT', column_delimiter='DEFAULT', hidden='DEFAULT', force_multifile='DEFAULT', max_file_size='DEFAULT')¶
Update some attributes of this CSV Export
- Parameters
- idinteger
The ID of this Csv Export job.
- namestring, optional
The name of this Csv Export job.
- sourcedict, optional::
- sqlstring
The SQL query for this Csv Export job
- remote_host_idinteger
The ID of the destination database host.
- credential_idinteger
The ID of the credentials for the destination database.
- destinationdict, optional::
- filename_prefixstring
The prefix of the name of the file returned to the user.
- storage_pathdict::
- file_pathstring
The path within the bucket where the exported file will be saved. E.g. the file_path for “s3://mybucket/files/all/” would be “/files/all/”
- storage_host_idinteger
The ID of the destination storage host.
- credential_idinteger
The ID of the credentials for the destination storage host.
- existing_filesstring
Notifies the job of what to do in the case that the exported file already exists at the provided path.One of: fail, append, overwrite. Default: fail. If “append” is specified,the new file will always be added to the provided path. If “overwrite” is specifiedall existing files at the provided path will be deleted and the new file will be added.By default, or if “fail” is specified, the export will fail if a file exists at the provided path.
- include_headerboolean, optional
A boolean value indicating whether or not the header should be included. Defaults to true.
- compressionstring, optional
The compression of the output file. Valid arguments are “gzip” and “none”. Defaults to “gzip”.
- column_delimiterstring, optional
The column delimiter for the output file. Valid arguments are “comma”, “tab”, and “pipe”. Defaults to “comma”.
- hiddenboolean, optional
A boolean value indicating whether or not this request should be hidden. Defaults to false.
- force_multifileboolean, optional
Whether or not the csv should be split into multiple files. Default: false
- max_file_sizeinteger, optional
The max file size, in MB, created files will be. Only available when force_multifile is true.
- Returns
civis.response.Response
- idinteger
The ID of this Csv Export job.
- namestring
The name of this Csv Export job.
- sourcedict::
- sqlstring
The SQL query for this Csv Export job
- remote_host_idinteger
The ID of the destination database host.
- credential_idinteger
The ID of the credentials for the destination database.
- destinationdict::
- filename_prefixstring
The prefix of the name of the file returned to the user.
- storage_pathdict::
- file_pathstring
The path within the bucket where the exported file will be saved. E.g. the file_path for “s3://mybucket/files/all/” would be “/files/all/”
- storage_host_idinteger
The ID of the destination storage host.
- credential_idinteger
The ID of the credentials for the destination storage host.
- existing_filesstring
Notifies the job of what to do in the case that the exported file already exists at the provided path.One of: fail, append, overwrite. Default: fail. If “append” is specified,the new file will always be added to the provided path. If “overwrite” is specifiedall existing files at the provided path will be deleted and the new file will be added.By default, or if “fail” is specified, the export will fail if a file exists at the provided path.
- include_headerboolean
A boolean value indicating whether or not the header should be included. Defaults to true.
- compressionstring
The compression of the output file. Valid arguments are “gzip” and “none”. Defaults to “gzip”.
- column_delimiterstring
The column delimiter for the output file. Valid arguments are “comma”, “tab”, and “pipe”. Defaults to “comma”.
- hiddenboolean
A boolean value indicating whether or not this request should be hidden. Defaults to false.
- force_multifileboolean
Whether or not the csv should be split into multiple files. Default: false
- max_file_sizeinteger
The max file size, in MB, created files will be. Only available when force_multifile is true.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- post_files_csv(source, destination, *, name='DEFAULT', include_header='DEFAULT', compression='DEFAULT', column_delimiter='DEFAULT', hidden='DEFAULT', force_multifile='DEFAULT', max_file_size='DEFAULT')¶
Create a CSV Export
- Parameters
- sourcedict::
- sqlstring
The SQL query for this Csv Export job
- remote_host_idinteger
The ID of the destination database host.
- credential_idinteger
The ID of the credentials for the destination database.
- destinationdict::
- filename_prefixstring
The prefix of the name of the file returned to the user.
- storage_pathdict::
- file_pathstring
The path within the bucket where the exported file will be saved. E.g. the file_path for “s3://mybucket/files/all/” would be “/files/all/”
- storage_host_idinteger
The ID of the destination storage host.
- credential_idinteger
The ID of the credentials for the destination storage host.
- existing_filesstring
Notifies the job of what to do in the case that the exported file already exists at the provided path.One of: fail, append, overwrite. Default: fail. If “append” is specified,the new file will always be added to the provided path. If “overwrite” is specifiedall existing files at the provided path will be deleted and the new file will be added.By default, or if “fail” is specified, the export will fail if a file exists at the provided path.
- namestring, optional
The name of this Csv Export job.
- include_headerboolean, optional
A boolean value indicating whether or not the header should be included. Defaults to true.
- compressionstring, optional
The compression of the output file. Valid arguments are “gzip” and “none”. Defaults to “gzip”.
- column_delimiterstring, optional
The column delimiter for the output file. Valid arguments are “comma”, “tab”, and “pipe”. Defaults to “comma”.
- hiddenboolean, optional
A boolean value indicating whether or not this request should be hidden. Defaults to false.
- force_multifileboolean, optional
Whether or not the csv should be split into multiple files. Default: false
- max_file_sizeinteger, optional
The max file size, in MB, created files will be. Only available when force_multifile is true.
- Returns
civis.response.Response
- idinteger
The ID of this Csv Export job.
- namestring
The name of this Csv Export job.
- sourcedict::
- sqlstring
The SQL query for this Csv Export job
- remote_host_idinteger
The ID of the destination database host.
- credential_idinteger
The ID of the credentials for the destination database.
- destinationdict::
- filename_prefixstring
The prefix of the name of the file returned to the user.
- storage_pathdict::
- file_pathstring
The path within the bucket where the exported file will be saved. E.g. the file_path for “s3://mybucket/files/all/” would be “/files/all/”
- storage_host_idinteger
The ID of the destination storage host.
- credential_idinteger
The ID of the credentials for the destination storage host.
- existing_filesstring
Notifies the job of what to do in the case that the exported file already exists at the provided path.One of: fail, append, overwrite. Default: fail. If “append” is specified,the new file will always be added to the provided path. If “overwrite” is specifiedall existing files at the provided path will be deleted and the new file will be added.By default, or if “fail” is specified, the export will fail if a file exists at the provided path.
- include_headerboolean
A boolean value indicating whether or not the header should be included. Defaults to true.
- compressionstring
The compression of the output file. Valid arguments are “gzip” and “none”. Defaults to “gzip”.
- column_delimiterstring
The column delimiter for the output file. Valid arguments are “comma”, “tab”, and “pipe”. Defaults to “comma”.
- hiddenboolean
A boolean value indicating whether or not this request should be hidden. Defaults to false.
- force_multifileboolean
Whether or not the csv should be split into multiple files. Default: false
- max_file_sizeinteger
The max file size, in MB, created files will be. Only available when force_multifile is true.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- post_files_csv_runs(id)¶
Start a run
- Parameters
- idinteger
The ID of the csv_export.
- Returns
civis.response.Response
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- output_cached_onstring/time
The time that the output was originally exported, if a cache entry was used by the run.
- put_files_csv(id, source, destination, *, name='DEFAULT', include_header='DEFAULT', compression='DEFAULT', column_delimiter='DEFAULT', hidden='DEFAULT', force_multifile='DEFAULT', max_file_size='DEFAULT')¶
Replace all attributes of this CSV Export
- Parameters
- idinteger
The ID of this Csv Export job.
- sourcedict::
- sqlstring
The SQL query for this Csv Export job
- remote_host_idinteger
The ID of the destination database host.
- credential_idinteger
The ID of the credentials for the destination database.
- destinationdict::
- filename_prefixstring
The prefix of the name of the file returned to the user.
- storage_pathdict::
- file_pathstring
The path within the bucket where the exported file will be saved. E.g. the file_path for “s3://mybucket/files/all/” would be “/files/all/”
- storage_host_idinteger
The ID of the destination storage host.
- credential_idinteger
The ID of the credentials for the destination storage host.
- existing_filesstring
Notifies the job of what to do in the case that the exported file already exists at the provided path.One of: fail, append, overwrite. Default: fail. If “append” is specified,the new file will always be added to the provided path. If “overwrite” is specifiedall existing files at the provided path will be deleted and the new file will be added.By default, or if “fail” is specified, the export will fail if a file exists at the provided path.
- namestring, optional
The name of this Csv Export job.
- include_headerboolean, optional
A boolean value indicating whether or not the header should be included. Defaults to true.
- compressionstring, optional
The compression of the output file. Valid arguments are “gzip” and “none”. Defaults to “gzip”.
- column_delimiterstring, optional
The column delimiter for the output file. Valid arguments are “comma”, “tab”, and “pipe”. Defaults to “comma”.
- hiddenboolean, optional
A boolean value indicating whether or not this request should be hidden. Defaults to false.
- force_multifileboolean, optional
Whether or not the csv should be split into multiple files. Default: false
- max_file_sizeinteger, optional
The max file size, in MB, created files will be. Only available when force_multifile is true.
- Returns
civis.response.Response
- idinteger
The ID of this Csv Export job.
- namestring
The name of this Csv Export job.
- sourcedict::
- sqlstring
The SQL query for this Csv Export job
- remote_host_idinteger
The ID of the destination database host.
- credential_idinteger
The ID of the credentials for the destination database.
- destinationdict::
- filename_prefixstring
The prefix of the name of the file returned to the user.
- storage_pathdict::
- file_pathstring
The path within the bucket where the exported file will be saved. E.g. the file_path for “s3://mybucket/files/all/” would be “/files/all/”
- storage_host_idinteger
The ID of the destination storage host.
- credential_idinteger
The ID of the credentials for the destination storage host.
- existing_filesstring
Notifies the job of what to do in the case that the exported file already exists at the provided path.One of: fail, append, overwrite. Default: fail. If “append” is specified,the new file will always be added to the provided path. If “overwrite” is specifiedall existing files at the provided path will be deleted and the new file will be added.By default, or if “fail” is specified, the export will fail if a file exists at the provided path.
- include_headerboolean
A boolean value indicating whether or not the header should be included. Defaults to true.
- compressionstring
The compression of the output file. Valid arguments are “gzip” and “none”. Defaults to “gzip”.
- column_delimiterstring
The column delimiter for the output file. Valid arguments are “comma”, “tab”, and “pipe”. Defaults to “comma”.
- hiddenboolean
A boolean value indicating whether or not this request should be hidden. Defaults to false.
- force_multifileboolean
Whether or not the csv should be split into multiple files. Default: false
- max_file_sizeinteger
The max file size, in MB, created files will be. Only available when force_multifile is true.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- put_files_csv_archive(id, status)¶
Update the archive status of this object
- Parameters
- idinteger
The ID of the object.
- statusboolean
The desired archived status of the object.
- Returns
civis.response.Response
- idinteger
The ID of this Csv Export job.
- namestring
The name of this Csv Export job.
- sourcedict::
- sqlstring
The SQL query for this Csv Export job
- remote_host_idinteger
The ID of the destination database host.
- credential_idinteger
The ID of the credentials for the destination database.
- destinationdict::
- filename_prefixstring
The prefix of the name of the file returned to the user.
- storage_pathdict::
- file_pathstring
The path within the bucket where the exported file will be saved. E.g. the file_path for “s3://mybucket/files/all/” would be “/files/all/”
- storage_host_idinteger
The ID of the destination storage host.
- credential_idinteger
The ID of the credentials for the destination storage host.
- existing_filesstring
Notifies the job of what to do in the case that the exported file already exists at the provided path.One of: fail, append, overwrite. Default: fail. If “append” is specified,the new file will always be added to the provided path. If “overwrite” is specifiedall existing files at the provided path will be deleted and the new file will be added.By default, or if “fail” is specified, the export will fail if a file exists at the provided path.
- include_headerboolean
A boolean value indicating whether or not the header should be included. Defaults to true.
- compressionstring
The compression of the output file. Valid arguments are “gzip” and “none”. Defaults to “gzip”.
- column_delimiterstring
The column delimiter for the output file. Valid arguments are “comma”, “tab”, and “pipe”. Defaults to “comma”.
- hiddenboolean
A boolean value indicating whether or not this request should be hidden. Defaults to false.
- force_multifileboolean
Whether or not the csv should be split into multiple files. Default: false
- max_file_sizeinteger
The max file size, in MB, created files will be. Only available when force_multifile is true.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
Files¶
- class Files(session_kwargs, client, return_type='civis')¶
Examples
>>> import civis >>> client = civis.APIClient() >>> client.files.list_projects(...)
Methods
delete_projects
(id, project_id)Remove a File from a project
delete_shares_groups
(id, group_id)Revoke the permissions a group has on this object
delete_shares_users
(id, user_id)Revoke the permissions a user has on this object
get
(id, *[, link_expires_at, inline])Get details about a file
Get a Preprocess CSV
list_dependencies
(id, *[, user_id])List dependent objects for this object
list_projects
(id, *[, hidden])List the projects a File belongs to
list_shares
(id)List users and groups permissioned on this object
patch
(id, *[, name, expires_at])Update details about a file
patch_preprocess_csv
(id, *[, file_id, ...])Update some attributes of this Preprocess CSV
post
(name, *[, expires_at])Initiate an upload of a file into the platform
post_multipart
(name, num_parts, *[, expires_at])Initiate a multipart upload
Complete a multipart upload
post_preprocess_csv
(file_id, *[, in_place, ...])Create a Preprocess CSV
put
(id, name, expires_at)Update details about a file
put_preprocess_csv
(id, file_id, *[, ...])Replace all attributes of this Preprocess CSV
put_preprocess_csv_archive
(id, status)Update the archive status of this object
put_projects
(id, project_id)Add a File to a project
put_shares_groups
(id, group_ids, ...[, ...])Set the permissions groups has on this object
put_shares_users
(id, user_ids, ...[, ...])Set the permissions users have on this object
put_transfer
(id, user_id, ...[, email_body, ...])Transfer ownership of this object to another user
- delete_projects(id, project_id)¶
Remove a File from a project
- Parameters
- idinteger
The ID of the File.
- project_idinteger
The ID of the project.
- Returns
- None
Response code 204: success
Revoke the permissions a group has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- group_idinteger
The ID of the group.
- Returns
- None
Response code 204: success
Revoke the permissions a user has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger
The ID of the user.
- Returns
- None
Response code 204: success
- get(id, *, link_expires_at='DEFAULT', inline='DEFAULT')¶
Get details about a file
- Parameters
- idinteger
The ID of the file.
- link_expires_atstring, 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.
- inlineboolean, optional
If true, will return a url that can be displayed inline in HTML
- Returns
civis.response.Response
- idinteger
The ID of the file.
- namestring
The file name.
- created_atstring/date-time
The date and time the file was created.
- file_sizeinteger
The file size.
- expires_atstring/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.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- download_urlstring
A JSON string containing information about the URL of the file.
- file_urlstring
The URL that may be used to download the file.
- detected_infodict::
- include_headerboolean
A boolean value indicating whether or not the first row of the file is a header row.
- column_delimiterstring
The column delimiter for the file. One of “comma”, “tab”, or “pipe”.
- compressionstring
The type of compression of the file. One of “gzip”, or “none”.
- table_columnslist::
An array of hashes corresponding to the columns in the file. Each hash should have keys for column “name” and “sql_type” - name : string
The column name.
- sql_typestring
The SQL type of the column.
- get_preprocess_csv(id)¶
Get a Preprocess CSV
- Parameters
- idinteger
- Returns
civis.response.Response
- idinteger
The ID of the job created.
- file_idinteger
The ID of the file.
- in_placeboolean
If true, the file is cleaned in place. If false, a new file ID is created. Defaults to true.
- detect_table_columnsboolean
If true, detect the table columns in the file including the sql types. If false, skip table column detection.Defaults to false.
- force_character_set_conversionboolean
If true, the file will always be converted to UTF-8 and any character that cannot be converted will be discarded. If false, the character set conversion will only run if the detected character set is not compatible with UTF-8 (e.g., UTF-8, ASCII).
- include_headerboolean
A boolean value indicating whether or not the first row of the file is a header row. If not provided, will attempt to auto-detect whether a header row is present.
- column_delimiterstring
The column delimiter for the file. One of “comma”, “tab”, or “pipe”. If not provided, the column delimiter will be auto-detected.
- hiddenboolean
The hidden status of the item.
- list_dependencies(id, *, user_id='DEFAULT')¶
List dependent objects for this object
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger, optional
ID of target user
- Returns
civis.response.Response
- object_typestring
Dependent object type
- fco_typestring
Human readable dependent object type
- idinteger
Dependent object ID
- namestring
Dependent object name, or nil if the requesting user cannot read this object
- permission_levelstring
Permission level of target user (not user’s groups) for dependent object, or null if no target user
- shareableboolean
Whether or not the requesting user can share this object.
- list_projects(id, *, hidden='DEFAULT')¶
List the projects a File belongs to
- Parameters
- idinteger
The ID of the File.
- hiddenboolean, optional
If specified to be true, returns hidden items. Defaults to false, returning non-hidden items.
- Returns
civis.response.Response
- idinteger
The ID for this project.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- namestring
The name of this project.
- descriptionstring
A description of the project.
- userslist::
Users who can see the project. - id : integer
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
auto_share : boolean
created_at : string/time
updated_at : string/time
- archivedstring
The archival status of the requested item(s).
List users and groups permissioned on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
- patch(id, *, name='DEFAULT', expires_at='DEFAULT')¶
Update details about a file
- Parameters
- idinteger
The ID of the file.
- namestring, optional
The file name. The extension must match the previous extension.
- expires_atstring/date-time, optional
The date and time the file will expire.
- Returns
civis.response.Response
- idinteger
The ID of the file.
- namestring
The file name.
- created_atstring/date-time
The date and time the file was created.
- file_sizeinteger
The file size.
- expires_atstring/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.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- download_urlstring
A JSON string containing information about the URL of the file.
- file_urlstring
The URL that may be used to download the file.
- detected_infodict::
- include_headerboolean
A boolean value indicating whether or not the first row of the file is a header row.
- column_delimiterstring
The column delimiter for the file. One of “comma”, “tab”, or “pipe”.
- compressionstring
The type of compression of the file. One of “gzip”, or “none”.
- table_columnslist::
An array of hashes corresponding to the columns in the file. Each hash should have keys for column “name” and “sql_type” - name : string
The column name.
- sql_typestring
The SQL type of the column.
- patch_preprocess_csv(id, *, file_id='DEFAULT', in_place='DEFAULT', detect_table_columns='DEFAULT', force_character_set_conversion='DEFAULT', include_header='DEFAULT', column_delimiter='DEFAULT')¶
Update some attributes of this Preprocess CSV
- Parameters
- idinteger
The ID of the job created.
- file_idinteger, optional
The ID of the file.
- in_placeboolean, optional
If true, the file is cleaned in place. If false, a new file ID is created. Defaults to true.
- detect_table_columnsboolean, optional
If true, detect the table columns in the file including the sql types. If false, skip table column detection.Defaults to false.
- force_character_set_conversionboolean, optional
If true, the file will always be converted to UTF-8 and any character that cannot be converted will be discarded. If false, the character set conversion will only run if the detected character set is not compatible with UTF-8 (e.g., UTF-8, ASCII).
- include_headerboolean, optional
A boolean value indicating whether or not the first row of the file is a header row. If not provided, will attempt to auto-detect whether a header row is present.
- column_delimiterstring, optional
The column delimiter for the file. One of “comma”, “tab”, or “pipe”. If not provided, the column delimiter will be auto-detected.
- Returns
civis.response.Response
- idinteger
The ID of the job created.
- file_idinteger
The ID of the file.
- in_placeboolean
If true, the file is cleaned in place. If false, a new file ID is created. Defaults to true.
- detect_table_columnsboolean
If true, detect the table columns in the file including the sql types. If false, skip table column detection.Defaults to false.
- force_character_set_conversionboolean
If true, the file will always be converted to UTF-8 and any character that cannot be converted will be discarded. If false, the character set conversion will only run if the detected character set is not compatible with UTF-8 (e.g., UTF-8, ASCII).
- include_headerboolean
A boolean value indicating whether or not the first row of the file is a header row. If not provided, will attempt to auto-detect whether a header row is present.
- column_delimiterstring
The column delimiter for the file. One of “comma”, “tab”, or “pipe”. If not provided, the column delimiter will be auto-detected.
- hiddenboolean
The hidden status of the item.
- post(name, *, expires_at='DEFAULT')¶
Initiate an upload of a file into the platform
- Parameters
- namestring
The file name.
- expires_atstring/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
civis.response.Response
- idinteger
The ID of the file.
- namestring
The file name.
- created_atstring/date-time
The date and time the file was created.
- file_sizeinteger
The file size.
- expires_atstring/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_urlstring
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_fieldsdict
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
- namestring
The file name.
- num_partsinteger
The number of parts in which the file will be uploaded. This parameter determines the number of presigned URLs that are returned.
- expires_atstring/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
civis.response.Response
- idinteger
The ID of the file.
- namestring
The file name.
- created_atstring/date-time
The date and time the file was created.
- file_sizeinteger
The file size.
- expires_atstring/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_urlslist
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
- idinteger
The ID of the file.
- Returns
- None
Response code 204: success
- post_preprocess_csv(file_id, *, in_place='DEFAULT', detect_table_columns='DEFAULT', force_character_set_conversion='DEFAULT', include_header='DEFAULT', column_delimiter='DEFAULT', hidden='DEFAULT')¶
Create a Preprocess CSV
- Parameters
- file_idinteger
The ID of the file.
- in_placeboolean, optional
If true, the file is cleaned in place. If false, a new file ID is created. Defaults to true.
- detect_table_columnsboolean, optional
If true, detect the table columns in the file including the sql types. If false, skip table column detection.Defaults to false.
- force_character_set_conversionboolean, optional
If true, the file will always be converted to UTF-8 and any character that cannot be converted will be discarded. If false, the character set conversion will only run if the detected character set is not compatible with UTF-8 (e.g., UTF-8, ASCII).
- include_headerboolean, optional
A boolean value indicating whether or not the first row of the file is a header row. If not provided, will attempt to auto-detect whether a header row is present.
- column_delimiterstring, optional
The column delimiter for the file. One of “comma”, “tab”, or “pipe”. If not provided, the column delimiter will be auto-detected.
- hiddenboolean, optional
The hidden status of the item.
- Returns
civis.response.Response
- idinteger
The ID of the job created.
- file_idinteger
The ID of the file.
- in_placeboolean
If true, the file is cleaned in place. If false, a new file ID is created. Defaults to true.
- detect_table_columnsboolean
If true, detect the table columns in the file including the sql types. If false, skip table column detection.Defaults to false.
- force_character_set_conversionboolean
If true, the file will always be converted to UTF-8 and any character that cannot be converted will be discarded. If false, the character set conversion will only run if the detected character set is not compatible with UTF-8 (e.g., UTF-8, ASCII).
- include_headerboolean
A boolean value indicating whether or not the first row of the file is a header row. If not provided, will attempt to auto-detect whether a header row is present.
- column_delimiterstring
The column delimiter for the file. One of “comma”, “tab”, or “pipe”. If not provided, the column delimiter will be auto-detected.
- hiddenboolean
The hidden status of the item.
- put(id, name, expires_at)¶
Update details about a file
- Parameters
- idinteger
The ID of the file.
- namestring
The file name. The extension must match the previous extension.
- expires_atstring/date-time
The date and time the file will expire.
- Returns
civis.response.Response
- idinteger
The ID of the file.
- namestring
The file name.
- created_atstring/date-time
The date and time the file was created.
- file_sizeinteger
The file size.
- expires_atstring/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.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- download_urlstring
A JSON string containing information about the URL of the file.
- file_urlstring
The URL that may be used to download the file.
- detected_infodict::
- include_headerboolean
A boolean value indicating whether or not the first row of the file is a header row.
- column_delimiterstring
The column delimiter for the file. One of “comma”, “tab”, or “pipe”.
- compressionstring
The type of compression of the file. One of “gzip”, or “none”.
- table_columnslist::
An array of hashes corresponding to the columns in the file. Each hash should have keys for column “name” and “sql_type” - name : string
The column name.
- sql_typestring
The SQL type of the column.
- put_preprocess_csv(id, file_id, *, in_place='DEFAULT', detect_table_columns='DEFAULT', force_character_set_conversion='DEFAULT', include_header='DEFAULT', column_delimiter='DEFAULT')¶
Replace all attributes of this Preprocess CSV
- Parameters
- idinteger
The ID of the job created.
- file_idinteger
The ID of the file.
- in_placeboolean, optional
If true, the file is cleaned in place. If false, a new file ID is created. Defaults to true.
- detect_table_columnsboolean, optional
If true, detect the table columns in the file including the sql types. If false, skip table column detection.Defaults to false.
- force_character_set_conversionboolean, optional
If true, the file will always be converted to UTF-8 and any character that cannot be converted will be discarded. If false, the character set conversion will only run if the detected character set is not compatible with UTF-8 (e.g., UTF-8, ASCII).
- include_headerboolean, optional
A boolean value indicating whether or not the first row of the file is a header row. If not provided, will attempt to auto-detect whether a header row is present.
- column_delimiterstring, optional
The column delimiter for the file. One of “comma”, “tab”, or “pipe”. If not provided, the column delimiter will be auto-detected.
- Returns
civis.response.Response
- idinteger
The ID of the job created.
- file_idinteger
The ID of the file.
- in_placeboolean
If true, the file is cleaned in place. If false, a new file ID is created. Defaults to true.
- detect_table_columnsboolean
If true, detect the table columns in the file including the sql types. If false, skip table column detection.Defaults to false.
- force_character_set_conversionboolean
If true, the file will always be converted to UTF-8 and any character that cannot be converted will be discarded. If false, the character set conversion will only run if the detected character set is not compatible with UTF-8 (e.g., UTF-8, ASCII).
- include_headerboolean
A boolean value indicating whether or not the first row of the file is a header row. If not provided, will attempt to auto-detect whether a header row is present.
- column_delimiterstring
The column delimiter for the file. One of “comma”, “tab”, or “pipe”. If not provided, the column delimiter will be auto-detected.
- hiddenboolean
The hidden status of the item.
- put_preprocess_csv_archive(id, status)¶
Update the archive status of this object
- Parameters
- idinteger
The ID of the object.
- statusboolean
The desired archived status of the object.
- Returns
civis.response.Response
- idinteger
The ID of the job created.
- file_idinteger
The ID of the file.
- in_placeboolean
If true, the file is cleaned in place. If false, a new file ID is created. Defaults to true.
- detect_table_columnsboolean
If true, detect the table columns in the file including the sql types. If false, skip table column detection.Defaults to false.
- force_character_set_conversionboolean
If true, the file will always be converted to UTF-8 and any character that cannot be converted will be discarded. If false, the character set conversion will only run if the detected character set is not compatible with UTF-8 (e.g., UTF-8, ASCII).
- include_headerboolean
A boolean value indicating whether or not the first row of the file is a header row. If not provided, will attempt to auto-detect whether a header row is present.
- column_delimiterstring
The column delimiter for the file. One of “comma”, “tab”, or “pipe”. If not provided, the column delimiter will be auto-detected.
- hiddenboolean
The hidden status of the item.
- put_projects(id, project_id)¶
Add a File to a project
- Parameters
- idinteger
The ID of the File.
- project_idinteger
The ID of the project.
- Returns
- None
Response code 204: success
Set the permissions groups has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- group_idslist
An array of one or more group IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
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
- idinteger
The ID of the resource that is shared.
- user_idslist
An array of one or more user IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
- put_transfer(id, user_id, include_dependencies, *, email_body='DEFAULT', send_email='DEFAULT')¶
Transfer ownership of this object to another user
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger
ID of target user
- include_dependenciesboolean
Whether or not to give manage permissions on all dependencies
- email_bodystring, optional
Custom body text for e-mail sent on transfer.
- send_emailboolean, optional
Send email to the target user of the transfer?
- Returns
civis.response.Response
- dependencieslist::
Dependent objects for this object - object_type : string
Dependent object type
- fco_typestring
Human readable dependent object type
- idinteger
Dependent object ID
- namestring
Dependent object name, or nil if the requesting user cannot read this object
- permission_levelstring
Permission level of target user (not user’s groups) for dependent object, or null if no target user
- sharedboolean
Whether dependent object was successfully shared with target user
Git_Repos¶
- class Git_Repos(session_kwargs, client, return_type='civis')¶
Examples
>>> import civis >>> client = civis.APIClient() >>> client.git_repos.list(...)
Methods
delete
(id)Remove the bookmark on a git repository
get
(id)Get a bookmarked git repository
list
(*[, limit, page_num, order, order_dir, ...])List bookmarked git repositories
list_refs
(id)Get all branches and tags of a bookmarked git repository
post
(repo_url)Bookmark a git repository
- delete(id)¶
Remove the bookmark on a git repository
- Parameters
- idinteger
The ID for this git repository.
- Returns
- None
Response code 204: success
- get(id)¶
Get a bookmarked git repository
- Parameters
- idinteger
The ID for this git repository.
- Returns
civis.response.Response
- idinteger
The ID for this git repository.
- repo_urlstring
The URL for this git repository.
created_at : string/time
updated_at : string/time
- list(*, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶
List bookmarked git repositories
- Parameters
- limitinteger, optional
Number of results to return. Defaults to 20. Maximum allowed is 100.
- page_numinteger, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstring, optional
The field on which to order the result set. Defaults to repo_url. Must be one of: repo_url, created_at.
- order_dirstring, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to asc.
- iteratorbool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
- Returns
civis.response.PaginatedResponse
- idinteger
The ID for this git repository.
- repo_urlstring
The URL for this git repository.
created_at : string/time
updated_at : string/time
- list_refs(id)¶
Get all branches and tags of a bookmarked git repository
- Parameters
- idinteger
The ID for this git repository.
- Returns
civis.response.Response
- brancheslist
List of branch names of this git repository.
- tagslist
List of tag names of this git repository.
- post(repo_url)¶
Bookmark a git repository
- Parameters
- repo_urlstring
The URL for this git repository.
- Returns
civis.response.Response
- idinteger
The ID for this git repository.
- repo_urlstring
The URL for this git repository.
created_at : string/time
updated_at : string/time
Groups¶
- class Groups(session_kwargs, client, return_type='civis')¶
Examples
>>> import civis >>> client = civis.APIClient() >>> client.groups.list(...)
Methods
delete_members
(id, user_id)Remove a user from a group
delete_shares_groups
(id, group_id)Revoke the permissions a group has on this object
delete_shares_users
(id, user_id)Revoke the permissions a user has on this object
get
(id)Get a Group
list
(*[, query, permission, ...])List Groups
Get child groups of this group
list_shares
(id)List users and groups permissioned on this object
patch
(id, *[, name, description, slug, ...])Update some attributes of this Group
post
(name, *[, description, slug, ...])Create a Group
put
(id, name, *[, description, slug, ...])Replace all attributes of this Group
put_members
(id, user_id)Add a user to a group
put_shares_groups
(id, group_ids, ...[, ...])Set the permissions groups has on this object
put_shares_users
(id, user_ids, ...[, ...])Set the permissions users have on this object
- delete_members(id, user_id)¶
Remove a user from a group
- Parameters
- idinteger
The ID of the group.
- user_idinteger
The ID of the user.
- Returns
- None
Response code 204: success
Revoke the permissions a group has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- group_idinteger
The ID of the group.
- Returns
- None
Response code 204: success
Revoke the permissions a user has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger
The ID of the user.
- Returns
- None
Response code 204: success
- get(id)¶
Get a Group
- Parameters
- idinteger
- Returns
civis.response.Response
- idinteger
The ID of this group.
- namestring
This group’s name.
- created_atstring/time
The date and time when this group was created.
- updated_atstring/time
The date and time when this group was last updated.
- descriptionstring
The description of the group.
- slugstring
The slug for this group.
- organization_idinteger
The ID of the organization this group belongs to.
- organization_namestring
The name of the organization this group belongs to.
- member_countinteger
The number of active members in this group.
- total_member_countinteger
The total number of members in this group.
- must_agree_to_eulaboolean
Whether or not members of this group must sign the EULA. Deprecated: all users must agree to the EULA, regardless of this attribute.
- default_otp_required_for_loginboolean
The two factor authentication requirement for this group.
- role_idslist
An array of ids of all the roles this group has.
- default_time_zonestring
The default time zone of this group.
- default_jobs_labelstring
The default partition label for jobs of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future.
- default_notebooks_labelstring
The default partition label for notebooks of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future.
- default_services_labelstring
The default partition label for services of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future.
- last_updated_by_idinteger
The ID of the user who last updated this group.
- created_by_idinteger
The ID of the user who created this group.
- memberslist::
The members of this group. - id : integer
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- emailstring
This user’s email address.
- primary_group_idinteger
The ID of the primary group of this user.
- activeboolean
The account status of this user.
- list(*, query='DEFAULT', permission='DEFAULT', include_members='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶
List Groups
- Parameters
- querystring, optional
If specified, it will filter the groups returned. Infix matching is supported (e.g., “query=group” will return “group” and “group of people” and “my group” and “my group of people”).
- permissionstring, optional
A permissions string, one of “read”, “write”, or “manage”. Lists only groups for which the current user has that permission.
- include_membersboolean, optional
Show members of the group.
- limitinteger, optional
Number of results to return. Defaults to 50. Maximum allowed is 1000.
- page_numinteger, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstring, optional
The field on which to order the result set. Defaults to name. Must be one of: name, created_at.
- order_dirstring, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to asc.
- iteratorbool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
- Returns
civis.response.PaginatedResponse
- idinteger
The ID of this group.
- namestring
This group’s name.
- created_atstring/time
The date and time when this group was created.
- updated_atstring/time
The date and time when this group was last updated.
- slugstring
The slug for this group.
- organization_idinteger
The ID of the organization this group belongs to.
- organization_namestring
The name of the organization this group belongs to.
- member_countinteger
The number of active members in this group.
- total_member_countinteger
The total number of members in this group.
- last_updated_by_idinteger
The ID of the user who last updated this group.
- created_by_idinteger
The ID of the user who created this group.
- memberslist::
The members of this group. - id : integer
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- list_child_groups(id)¶
Get child groups of this group
- Parameters
- idinteger
The ID of this group.
- Returns
civis.response.Response
- manageablelist::
id : integer
name : string
- writeablelist::
id : integer
name : string
- readablelist::
id : integer
name : string
List users and groups permissioned on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
- patch(id, *, name='DEFAULT', description='DEFAULT', slug='DEFAULT', organization_id='DEFAULT', must_agree_to_eula='DEFAULT', default_otp_required_for_login='DEFAULT', role_ids='DEFAULT', default_time_zone='DEFAULT', default_jobs_label='DEFAULT', default_notebooks_label='DEFAULT', default_services_label='DEFAULT')¶
Update some attributes of this Group
- Parameters
- idinteger
The ID of this group.
- namestring, optional
This group’s name.
- descriptionstring, optional
The description of the group.
- slugstring, optional
The slug for this group.
- organization_idinteger, optional
The ID of the organization this group belongs to.
- must_agree_to_eulaboolean, optional
Whether or not members of this group must sign the EULA. Deprecated: all users must agree to the EULA, regardless of this attribute.
- default_otp_required_for_loginboolean, optional
The two factor authentication requirement for this group.
- role_idslist, optional
An array of ids of all the roles this group has.
- default_time_zonestring, optional
The default time zone of this group.
- default_jobs_labelstring, optional
The default partition label for jobs of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future.
- default_notebooks_labelstring, optional
The default partition label for notebooks of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future.
- default_services_labelstring, optional
The default partition label for services of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future.
- Returns
civis.response.Response
- idinteger
The ID of this group.
- namestring
This group’s name.
- created_atstring/time
The date and time when this group was created.
- updated_atstring/time
The date and time when this group was last updated.
- descriptionstring
The description of the group.
- slugstring
The slug for this group.
- organization_idinteger
The ID of the organization this group belongs to.
- organization_namestring
The name of the organization this group belongs to.
- member_countinteger
The number of active members in this group.
- total_member_countinteger
The total number of members in this group.
- must_agree_to_eulaboolean
Whether or not members of this group must sign the EULA. Deprecated: all users must agree to the EULA, regardless of this attribute.
- default_otp_required_for_loginboolean
The two factor authentication requirement for this group.
- role_idslist
An array of ids of all the roles this group has.
- default_time_zonestring
The default time zone of this group.
- default_jobs_labelstring
The default partition label for jobs of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future.
- default_notebooks_labelstring
The default partition label for notebooks of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future.
- default_services_labelstring
The default partition label for services of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future.
- last_updated_by_idinteger
The ID of the user who last updated this group.
- created_by_idinteger
The ID of the user who created this group.
- memberslist::
The members of this group. - id : integer
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- emailstring
This user’s email address.
- primary_group_idinteger
The ID of the primary group of this user.
- activeboolean
The account status of this user.
- post(name, *, description='DEFAULT', slug='DEFAULT', organization_id='DEFAULT', must_agree_to_eula='DEFAULT', default_otp_required_for_login='DEFAULT', role_ids='DEFAULT', default_time_zone='DEFAULT', default_jobs_label='DEFAULT', default_notebooks_label='DEFAULT', default_services_label='DEFAULT')¶
Create a Group
- Parameters
- namestring
This group’s name.
- descriptionstring, optional
The description of the group.
- slugstring, optional
The slug for this group.
- organization_idinteger, optional
The ID of the organization this group belongs to.
- must_agree_to_eulaboolean, optional
Whether or not members of this group must sign the EULA. Deprecated: all users must agree to the EULA, regardless of this attribute.
- default_otp_required_for_loginboolean, optional
The two factor authentication requirement for this group.
- role_idslist, optional
An array of ids of all the roles this group has.
- default_time_zonestring, optional
The default time zone of this group.
- default_jobs_labelstring, optional
The default partition label for jobs of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future.
- default_notebooks_labelstring, optional
The default partition label for notebooks of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future.
- default_services_labelstring, optional
The default partition label for services of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future.
- Returns
civis.response.Response
- idinteger
The ID of this group.
- namestring
This group’s name.
- created_atstring/time
The date and time when this group was created.
- updated_atstring/time
The date and time when this group was last updated.
- descriptionstring
The description of the group.
- slugstring
The slug for this group.
- organization_idinteger
The ID of the organization this group belongs to.
- organization_namestring
The name of the organization this group belongs to.
- member_countinteger
The number of active members in this group.
- total_member_countinteger
The total number of members in this group.
- must_agree_to_eulaboolean
Whether or not members of this group must sign the EULA. Deprecated: all users must agree to the EULA, regardless of this attribute.
- default_otp_required_for_loginboolean
The two factor authentication requirement for this group.
- role_idslist
An array of ids of all the roles this group has.
- default_time_zonestring
The default time zone of this group.
- default_jobs_labelstring
The default partition label for jobs of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future.
- default_notebooks_labelstring
The default partition label for notebooks of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future.
- default_services_labelstring
The default partition label for services of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future.
- last_updated_by_idinteger
The ID of the user who last updated this group.
- created_by_idinteger
The ID of the user who created this group.
- memberslist::
The members of this group. - id : integer
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- emailstring
This user’s email address.
- primary_group_idinteger
The ID of the primary group of this user.
- activeboolean
The account status of this user.
- put(id, name, *, description='DEFAULT', slug='DEFAULT', organization_id='DEFAULT', must_agree_to_eula='DEFAULT', default_otp_required_for_login='DEFAULT', role_ids='DEFAULT', default_time_zone='DEFAULT', default_jobs_label='DEFAULT', default_notebooks_label='DEFAULT', default_services_label='DEFAULT')¶
Replace all attributes of this Group
- Parameters
- idinteger
The ID of this group.
- namestring
This group’s name.
- descriptionstring, optional
The description of the group.
- slugstring, optional
The slug for this group.
- organization_idinteger, optional
The ID of the organization this group belongs to.
- must_agree_to_eulaboolean, optional
Whether or not members of this group must sign the EULA. Deprecated: all users must agree to the EULA, regardless of this attribute.
- default_otp_required_for_loginboolean, optional
The two factor authentication requirement for this group.
- role_idslist, optional
An array of ids of all the roles this group has.
- default_time_zonestring, optional
The default time zone of this group.
- default_jobs_labelstring, optional
The default partition label for jobs of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future.
- default_notebooks_labelstring, optional
The default partition label for notebooks of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future.
- default_services_labelstring, optional
The default partition label for services of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future.
- Returns
civis.response.Response
- idinteger
The ID of this group.
- namestring
This group’s name.
- created_atstring/time
The date and time when this group was created.
- updated_atstring/time
The date and time when this group was last updated.
- descriptionstring
The description of the group.
- slugstring
The slug for this group.
- organization_idinteger
The ID of the organization this group belongs to.
- organization_namestring
The name of the organization this group belongs to.
- member_countinteger
The number of active members in this group.
- total_member_countinteger
The total number of members in this group.
- must_agree_to_eulaboolean
Whether or not members of this group must sign the EULA. Deprecated: all users must agree to the EULA, regardless of this attribute.
- default_otp_required_for_loginboolean
The two factor authentication requirement for this group.
- role_idslist
An array of ids of all the roles this group has.
- default_time_zonestring
The default time zone of this group.
- default_jobs_labelstring
The default partition label for jobs of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future.
- default_notebooks_labelstring
The default partition label for notebooks of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future.
- default_services_labelstring
The default partition label for services of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future.
- last_updated_by_idinteger
The ID of the user who last updated this group.
- created_by_idinteger
The ID of the user who created this group.
- memberslist::
The members of this group. - id : integer
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- emailstring
This user’s email address.
- primary_group_idinteger
The ID of the primary group of this user.
- activeboolean
The account status of this user.
- put_members(id, user_id)¶
Add a user to a group
- Parameters
- idinteger
The ID of the group.
- user_idinteger
The ID of the user.
- Returns
civis.response.Response
- idinteger
The ID of this group.
- namestring
This group’s name.
- created_atstring/time
The date and time when this group was created.
- updated_atstring/time
The date and time when this group was last updated.
- descriptionstring
The description of the group.
- slugstring
The slug for this group.
- organization_idinteger
The ID of the organization this group belongs to.
- organization_namestring
The name of the organization this group belongs to.
- member_countinteger
The number of active members in this group.
- total_member_countinteger
The total number of members in this group.
- must_agree_to_eulaboolean
Whether or not members of this group must sign the EULA. Deprecated: all users must agree to the EULA, regardless of this attribute.
- default_otp_required_for_loginboolean
The two factor authentication requirement for this group.
- role_idslist
An array of ids of all the roles this group has.
- default_time_zonestring
The default time zone of this group.
- default_jobs_labelstring
The default partition label for jobs of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future.
- default_notebooks_labelstring
The default partition label for notebooks of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future.
- default_services_labelstring
The default partition label for services of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future.
- last_updated_by_idinteger
The ID of the user who last updated this group.
- created_by_idinteger
The ID of the user who created this group.
- memberslist::
The members of this group. - id : integer
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- emailstring
This user’s email address.
- primary_group_idinteger
The ID of the primary group of this user.
- activeboolean
The account status of this user.
Set the permissions groups has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- group_idslist
An array of one or more group IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
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
- idinteger
The ID of the resource that is shared.
- user_idslist
An array of one or more user IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
Imports¶
- class Imports(session_kwargs, client, return_type='civis')¶
Examples
>>> import civis >>> client = civis.APIClient() >>> client.imports.list_shares(...)
Methods
delete_files_csv_runs
(id, run_id)Cancel a run
delete_files_runs
(id, run_id)Cancel a run
delete_projects
(id, project_id)Remove an Import from a project
delete_shares_groups
(id, group_id)Revoke the permissions a group has on this object
delete_shares_users
(id, user_id)Revoke the permissions a user has on this object
get
(id)Get details about an import
get_batches
(id)Get details about a batch import
get_files_csv
(id)Get a CSV Import
get_files_csv_runs
(id, run_id)Check status of a run
get_files_runs
(id, run_id)Check status of a run
list
(*[, type, destination, source, status, ...])List Imports
list_batches
(*[, hidden, limit, page_num, ...])List batch imports
list_dependencies
(id, *[, user_id])List dependent objects for this object
list_files_csv_runs
(id, *[, limit, ...])List runs for the given csv_import
list_files_csv_runs_logs
(id, run_id, *[, ...])Get the logs for a run
list_files_runs
(id, *[, limit, page_num, ...])List runs for the given import
list_files_runs_logs
(id, run_id, *[, ...])Get the logs for a run
list_projects
(id, *[, hidden])List the projects an Import belongs to
list_runs
(id)Get the run history of this import
list_runs_logs
(id, run_id, *[, last_id, limit])Get the logs for a run
list_shares
(id)List users and groups permissioned on this object
patch_files_csv
(id, *[, name, source, ...])Update some attributes of this CSV Import
post
(name, sync_type, is_outbound, *[, ...])Create a new import configuration
post_batches
(file_ids, schema, table, ...[, ...])Upload multiple files to Civis
post_cancel
(id)Cancel a run
post_files
(schema, name, remote_host_id, ...)Initate an import of a tabular file into the platform
post_files_csv
(source, destination, ...[, ...])Create a CSV Import
Start a run
post_files_runs
(id)Start a run
post_runs
(id)Run an import
post_syncs
(id, source, destination, *[, ...])Create a sync
put
(id, name, sync_type, is_outbound, *[, ...])Update an import
put_archive
(id, status)Update the archive status of this object
put_files_csv
(id, source, destination, ...)Replace all attributes of this CSV Import
put_files_csv_archive
(id, status)Update the archive status of this object
put_projects
(id, project_id)Add an Import to a project
put_shares_groups
(id, group_ids, ...[, ...])Set the permissions groups has on this object
put_shares_users
(id, user_ids, ...[, ...])Set the permissions users have on this object
put_syncs
(id, sync_id, source, destination, *)Update a sync
put_syncs_archive
(id, sync_id, *[, status])Update the archive status of this sync
put_transfer
(id, user_id, ...[, email_body, ...])Transfer ownership of this object to another user
- delete_files_csv_runs(id, run_id)¶
Cancel a run
- Parameters
- idinteger
The ID of the csv_import.
- run_idinteger
The ID of the run.
- Returns
- None
Response code 202: success
- delete_files_runs(id, run_id)¶
Cancel a run
- Parameters
- idinteger
The ID of the import.
- run_idinteger
The ID of the run.
- Returns
- None
Response code 202: success
- delete_projects(id, project_id)¶
Remove an Import from a project
- Parameters
- idinteger
The ID of the Import.
- project_idinteger
The ID of the project.
- Returns
- None
Response code 204: success
Revoke the permissions a group has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- group_idinteger
The ID of the group.
- Returns
- None
Response code 204: success
Revoke the permissions a user has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger
The ID of the user.
- Returns
- None
Response code 204: success
- get(id)¶
Get details about an import
- Parameters
- idinteger
The ID for the import.
- Returns
civis.response.Response
- namestring
The name of the import.
- sync_typestring
The type of sync to perform; one of Dbsync, AutoImport, GdocImport, GdocExport, and Salesforce.
- sourcedict::
remote_host_id : integer
credential_id : integer
- additional_credentialslist
Array that holds additional credentials used for specific imports. For salesforce imports, the first and only element is the client credential id. For DB Syncs, the first element is an SSL private key credential id, and the second element is the corresponding public key credential id.
name : string
- destinationdict::
remote_host_id : integer
credential_id : integer
- additional_credentialslist
Array that holds additional credentials used for specific imports. For salesforce imports, the first and only element is the client credential id. For DB Syncs, the first element is an SSL private key credential id, and the second element is the corresponding public key credential id.
name : string
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- notificationsdict::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- parent_idinteger
Parent id to trigger this import from
- idinteger
The ID for the import.
is_outbound : boolean
- job_typestring
The job type of this import.
- syncslist::
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 - database_table : dict:: - schema : string The database schema name. - table : string The database table name. - use_without_schema : boolean This attribute is no longer available; defaults to false but cannot be used. - file : dict:: - id : integer The file id. - google_worksheet : dict:: - spreadsheet : string The spreadsheet document name. - spreadsheet_id : string The spreadsheet document id. - worksheet : string The worksheet tab name. - worksheet_id : integer The worksheet tab id. - salesforce : dict:: - object_name : string The Salesforce object name.
- destinationdict::
- pathstring
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_tabledict::
- schemastring
The database schema name.
- tablestring
The database table name.
- use_without_schemaboolean
This attribute is no longer available; defaults to false but cannot be used.
- google_worksheetdict::
- spreadsheetstring
The spreadsheet document name.
- spreadsheet_idstring
The spreadsheet document id.
- worksheetstring
The worksheet tab name.
- worksheet_idinteger
The worksheet tab id.
- advanced_optionsdict::
max_errors : integer
existing_table_rows : string
diststyle : string
distkey : string
sortkey1 : string
sortkey2 : string
column_delimiter : string
- column_overridesdict
Hash used for overriding auto-detected names and types, with keys being the index of the column being overridden.
- escapedboolean
If true, escape quotes with a backslash; otherwise, escape quotes by double-quoting. Defaults to false.
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_namestring
This parameter is deprecated
- partition_schema_namestring
This parameter is deprecated
- partition_table_namestring
This parameter is deprecated
- partition_table_partition_column_min_namestring
This parameter is deprecated
- partition_table_partition_column_max_namestring
This parameter is deprecated
last_modified_column : string
- mysql_catalog_matches_schemaboolean
This attribute is no longer available; defaults to true but cannot be used.
- chunking_methodstring
This parameter is deprecated
first_row_is_header : boolean
- export_actionstring
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. Default is set to “newsprsht”
- sql_querystring
If you are doing a Google Sheet export, this is your SQL query.
contact_lists : string
soql_query : string
include_deleted_records : boolean
state : string
created_at : string/date-time
updated_at : string/date-time
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- userdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- running_asdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- next_run_atstring/time
The time of the next scheduled run.
- time_zonestring
The time zone of this import.
- hiddenboolean
The hidden status of the item.
- archivedstring
The archival status of the requested item(s).
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- get_batches(id)¶
Get details about a batch import
- Parameters
- idinteger
The ID for the import.
- Returns
civis.response.Response
- idinteger
The ID for the import.
- schemastring
The destination schema name. This schema must already exist in Redshift.
- tablestring
The destination table name, without the schema prefix. This table must already exist in Redshift.
- remote_host_idinteger
The ID of the destination database host.
- statestring
The state of the run; one of “queued”, “running”, “succeeded”, “failed”, or “cancelled”.
- started_atstring/time
The time the last run started at.
- finished_atstring/time
The time the last run completed.
- errorstring
The error returned by the run, if any.
- hiddenboolean
The hidden status of the item.
- get_files_csv(id)¶
Get a CSV Import
- Parameters
- idinteger
- Returns
civis.response.Response
- idinteger
The ID for the import.
- namestring
The name of the import.
- sourcedict::
- file_idslist
The file ID(s) to import, if importing Civis file(s).
- storage_pathdict::
- storage_host_idinteger
The ID of the source storage host.
- credential_idinteger
The ID of the credentials for the source storage host.
- file_pathslist
The file or directory path(s) within the bucket from which to import. E.g. the file_path for “s3://mybucket/files/all/” would be “/files/all/”If specifying a directory path, the job will import every file found under that path. All files must have the same column layout and file format (e.g., compression, columnDelimiter, etc.).
- destinationdict::
- schemastring
The destination schema name.
- tablestring
The destination table name.
- remote_host_idinteger
The ID of the destination database host.
- credential_idinteger
The ID of the credentials for the destination database.
- primary_keyslist
A list of column(s) which together uniquely identify a row in the destination table.These columns must not contain NULL values. If the import mode is “upsert”, this field is required;see the Civis Helpdesk article on “Advanced CSV Imports via the Civis API” for more information.
- last_modified_keyslist
A list of the columns indicating a record has been updated.If the destination table does not exist, and the import mode is “upsert”, this field is required.
- first_row_is_headerboolean
A boolean value indicating whether or not the first row of the source file is a header row.
- column_delimiterstring
The column delimiter for the file. Valid arguments are “comma”, “tab”, and “pipe”. Defaults to “comma”.
- escapedboolean
A boolean value indicating whether or not the source file has quotes escaped with a backslash.Defaults to false.
- compressionstring
The type of compression of the source file. Valid arguments are “gzip” and “none”. Defaults to “none”.
- existing_table_rowsstring
The behavior if a destination table with the requested name already exists. One of “fail”, “truncate”, “append”, “drop”, or “upsert”.Defaults to “fail”.
- max_errorsinteger
The maximum number of rows with errors to ignore before failing. This option is not supported for Postgres databases.
- table_columnslist::
An array of hashes corresponding to the columns in the order they appear in the source file. Each hash should have keys for database column “name” and “sqlType”.This parameter is required if the table does not exist, the table is being dropped, or the columns in the source file do not appear in the same order as in the destination table.The “sqlType” key is not required when appending to an existing table. - name : string
The column name.
- sql_typestring
The SQL type of the column.
- loosen_typesboolean
If true, SQL types with precisions/lengths will have these values increased to accommodate data growth in future loads. Type loosening only occurs on table creation. Defaults to false.
- executionstring
In upsert mode, controls the movement of data in upsert mode. If set to “delayed”, the data will be moved after a brief delay. If set to “immediate”, the data will be moved immediately. In non-upsert modes, controls the speed at which detailed column stats appear in the data catalogue. Defaults to “delayed”, to accommodate concurrent upserts to the same table and speedier non-upsert imports.
- redshift_destination_optionsdict::
- diststylestring
The diststyle to use for the table. One of “even”, “all”, or “key”.
- distkeystring
Distkey for this table in Redshift
- sortkeyslist
Sortkeys for this table in Redshift. Please provide a maximum of two.
- hiddenboolean
The hidden status of the item.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- get_files_csv_runs(id, run_id)¶
Check status of a run
- Parameters
- idinteger
The ID of the csv_import.
- run_idinteger
The ID of the run.
- Returns
civis.response.Response
- idinteger
The ID of the run.
- csv_import_idinteger
The ID of the csv_import.
- statestring
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- is_cancel_requestedboolean
True if run cancel requested, else false.
- started_atstring/time
The time the last run started at.
- finished_atstring/time
The time the last run completed.
- errorstring
The error, if any, returned by the run.
- get_files_runs(id, run_id)¶
Check status of a run
- Parameters
- idinteger
The ID of the import.
- run_idinteger
The ID of the run.
- Returns
civis.response.Response
- idinteger
The ID of the run.
- import_idinteger
The ID of the import.
- statestring
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- is_cancel_requestedboolean
True if run cancel requested, else false.
- started_atstring/time
The time the last run started at.
- finished_atstring/time
The time the last run completed.
- errorstring
The error, if any, returned by the run.
- list(*, type='DEFAULT', destination='DEFAULT', source='DEFAULT', status='DEFAULT', author='DEFAULT', hidden='DEFAULT', archived='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶
List Imports
- Parameters
- typestring, optional
If specified, return imports of these types. It accepts a comma-separated list, possible values are ‘AutoImport’, ‘DbSync’, ‘Salesforce’, ‘GdocImport’.
- destinationstring, optional
If specified, returns imports with one of these destinations. It accepts a comma-separated list of remote host ids.
- sourcestring, optional
If specified, returns imports with one of these sources. It accepts a comma-separated list of remote host ids. ‘DbSync’ must be specified for ‘type’.
- statusstring, optional
If specified, returns imports with one of these statuses. It accepts a comma-separated list, possible values are ‘running’, ‘failed’, ‘succeeded’, ‘idle’, ‘scheduled’.
- authorstring, optional
If specified, return items from any of these authors. It accepts a comma- separated list of user IDs.
- hiddenboolean, optional
If specified to be true, returns hidden items. Defaults to false, returning non-hidden items.
- archivedstring, optional
The archival status of the requested item(s).
- limitinteger, optional
Number of results to return. Defaults to 20. Maximum allowed is 50.
- page_numinteger, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstring, 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_dirstring, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iteratorbool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
- Returns
civis.response.PaginatedResponse
- namestring
The name of the import.
- sync_typestring
The type of sync to perform; one of Dbsync, AutoImport, GdocImport, GdocExport, and Salesforce.
- sourcedict::
remote_host_id : integer
credential_id : integer
- additional_credentialslist
Array that holds additional credentials used for specific imports. For salesforce imports, the first and only element is the client credential id. For DB Syncs, the first element is an SSL private key credential id, and the second element is the corresponding public key credential id.
name : string
- destinationdict::
remote_host_id : integer
credential_id : integer
- additional_credentialslist
Array that holds additional credentials used for specific imports. For salesforce imports, the first and only element is the client credential id. For DB Syncs, the first element is an SSL private key credential id, and the second element is the corresponding public key credential id.
name : string
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- idinteger
The ID for the import.
is_outbound : boolean
- job_typestring
The job type of this import.
state : string
created_at : string/date-time
updated_at : string/date-time
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- userdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- time_zonestring
The time zone of this import.
- archivedstring
The archival status of the requested item(s).
- list_batches(*, hidden='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶
List batch imports
- Parameters
- hiddenboolean, optional
If specified to be true, returns hidden items. Defaults to false, returning non-hidden items.
- limitinteger, optional
Number of results to return. Defaults to 20. Maximum allowed is 50.
- page_numinteger, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstring, optional
The field on which to order the result set. Defaults to updated_at. Must be one of: updated_at, created_at.
- order_dirstring, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iteratorbool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
- Returns
civis.response.PaginatedResponse
- idinteger
The ID for the import.
- schemastring
The destination schema name. This schema must already exist in Redshift.
- tablestring
The destination table name, without the schema prefix. This table must already exist in Redshift.
- remote_host_idinteger
The ID of the destination database host.
- statestring
The state of the run; one of “queued”, “running”, “succeeded”, “failed”, or “cancelled”.
- started_atstring/time
The time the last run started at.
- finished_atstring/time
The time the last run completed.
- errorstring
The error returned by the run, if any.
- list_dependencies(id, *, user_id='DEFAULT')¶
List dependent objects for this object
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger, optional
ID of target user
- Returns
civis.response.Response
- object_typestring
Dependent object type
- fco_typestring
Human readable dependent object type
- idinteger
Dependent object ID
- namestring
Dependent object name, or nil if the requesting user cannot read this object
- permission_levelstring
Permission level of target user (not user’s groups) for dependent object, or null if no target user
- shareableboolean
Whether or not the requesting user can share this object.
- list_files_csv_runs(id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶
List runs for the given csv_import
- Parameters
- idinteger
The ID of the csv_import.
- limitinteger, optional
Number of results to return. Defaults to 20. Maximum allowed is 100.
- page_numinteger, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstring, optional
The field on which to order the result set. Defaults to id. Must be one of: id.
- order_dirstring, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iteratorbool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
- Returns
civis.response.PaginatedResponse
- idinteger
The ID of the run.
- csv_import_idinteger
The ID of the csv_import.
- statestring
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- is_cancel_requestedboolean
True if run cancel requested, else false.
- started_atstring/time
The time the last run started at.
- finished_atstring/time
The time the last run completed.
- errorstring
The error, if any, returned by the run.
- list_files_csv_runs_logs(id, run_id, *, last_id='DEFAULT', limit='DEFAULT')¶
Get the logs for a run
- Parameters
- idinteger
The ID of the csv_import.
- run_idinteger
The ID of the run.
- last_idinteger, 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.
- limitinteger, optional
The maximum number of log messages to return. Default of 10000.
- Returns
civis.response.Response
- idinteger
The ID of the log.
- created_atstring/date-time
The time the log was created.
- messagestring
The log message.
- levelstring
The level of the log. One of unknown,fatal,error,warn,info,debug.
- list_files_runs(id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶
List runs for the given import
- Parameters
- idinteger
The ID of the import.
- limitinteger, optional
Number of results to return. Defaults to 20. Maximum allowed is 100.
- page_numinteger, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstring, optional
The field on which to order the result set. Defaults to id. Must be one of: id.
- order_dirstring, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iteratorbool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
- Returns
civis.response.PaginatedResponse
- idinteger
The ID of the run.
- import_idinteger
The ID of the import.
- statestring
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- is_cancel_requestedboolean
True if run cancel requested, else false.
- started_atstring/time
The time the last run started at.
- finished_atstring/time
The time the last run completed.
- errorstring
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
- idinteger
The ID of the import.
- run_idinteger
The ID of the run.
- last_idinteger, 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.
- limitinteger, optional
The maximum number of log messages to return. Default of 10000.
- Returns
civis.response.Response
- idinteger
The ID of the log.
- created_atstring/date-time
The time the log was created.
- messagestring
The log message.
- levelstring
The level of the log. One of unknown,fatal,error,warn,info,debug.
- list_projects(id, *, hidden='DEFAULT')¶
List the projects an Import belongs to
- Parameters
- idinteger
The ID of the Import.
- hiddenboolean, optional
If specified to be true, returns hidden items. Defaults to false, returning non-hidden items.
- Returns
civis.response.Response
- idinteger
The ID for this project.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- namestring
The name of this project.
- descriptionstring
A description of the project.
- userslist::
Users who can see the project. - id : integer
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
auto_share : boolean
created_at : string/time
updated_at : string/time
- archivedstring
The archival status of the requested item(s).
- list_runs(id)¶
Get the run history of this import
- Parameters
- idinteger
- Returns
civis.response.Response
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
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
- idinteger
The ID of the import.
- run_idinteger
The ID of the run.
- last_idinteger, 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.
- limitinteger, optional
The maximum number of log messages to return. Default of 10000.
- Returns
civis.response.Response
- idinteger
The ID of the log.
- created_atstring/date-time
The time the log was created.
- messagestring
The log message.
- levelstring
The level of the log. One of unknown,fatal,error,warn,info,debug.
List users and groups permissioned on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
- patch_files_csv(id, *, name='DEFAULT', source='DEFAULT', destination='DEFAULT', first_row_is_header='DEFAULT', column_delimiter='DEFAULT', escaped='DEFAULT', compression='DEFAULT', existing_table_rows='DEFAULT', max_errors='DEFAULT', table_columns='DEFAULT', loosen_types='DEFAULT', execution='DEFAULT', redshift_destination_options='DEFAULT')¶
Update some attributes of this CSV Import
- Parameters
- idinteger
The ID for the import.
- namestring, optional
The name of the import.
- sourcedict, optional::
- file_idslist
The file ID(s) to import, if importing Civis file(s).
- storage_pathdict::
- storage_host_idinteger
The ID of the source storage host.
- credential_idinteger
The ID of the credentials for the source storage host.
- file_pathslist
The file or directory path(s) within the bucket from which to import. E.g. the file_path for “s3://mybucket/files/all/” would be “/files/all/”If specifying a directory path, the job will import every file found under that path. All files must have the same column layout and file format (e.g., compression, columnDelimiter, etc.).
- destinationdict, optional::
- schemastring
The destination schema name.
- tablestring
The destination table name.
- remote_host_idinteger
The ID of the destination database host.
- credential_idinteger
The ID of the credentials for the destination database.
- primary_keyslist
A list of column(s) which together uniquely identify a row in the destination table.These columns must not contain NULL values. If the import mode is “upsert”, this field is required;see the Civis Helpdesk article on “Advanced CSV Imports via the Civis API” for more information.
- last_modified_keyslist
A list of the columns indicating a record has been updated.If the destination table does not exist, and the import mode is “upsert”, this field is required.
- first_row_is_headerboolean, optional
A boolean value indicating whether or not the first row of the source file is a header row.
- column_delimiterstring, optional
The column delimiter for the file. Valid arguments are “comma”, “tab”, and “pipe”. Defaults to “comma”.
- escapedboolean, optional
A boolean value indicating whether or not the source file has quotes escaped with a backslash.Defaults to false.
- compressionstring, optional
The type of compression of the source file. Valid arguments are “gzip” and “none”. Defaults to “none”.
- existing_table_rowsstring, optional
The behavior if a destination table with the requested name already exists. One of “fail”, “truncate”, “append”, “drop”, or “upsert”.Defaults to “fail”.
- max_errorsinteger, optional
The maximum number of rows with errors to ignore before failing. This option is not supported for Postgres databases.
- table_columnslist, optional::
An array of hashes corresponding to the columns in the order they appear in the source file. Each hash should have keys for database column “name” and “sqlType”.This parameter is required if the table does not exist, the table is being dropped, or the columns in the source file do not appear in the same order as in the destination table.The “sqlType” key is not required when appending to an existing table. - name : string
The column name.
- sql_typestring
The SQL type of the column.
- loosen_typesboolean, optional
If true, SQL types with precisions/lengths will have these values increased to accommodate data growth in future loads. Type loosening only occurs on table creation. Defaults to false.
- executionstring, optional
In upsert mode, controls the movement of data in upsert mode. If set to “delayed”, the data will be moved after a brief delay. If set to “immediate”, the data will be moved immediately. In non-upsert modes, controls the speed at which detailed column stats appear in the data catalogue. Defaults to “delayed”, to accommodate concurrent upserts to the same table and speedier non-upsert imports.
- redshift_destination_optionsdict, optional::
- diststylestring
The diststyle to use for the table. One of “even”, “all”, or “key”.
- distkeystring
Distkey for this table in Redshift
- sortkeyslist
Sortkeys for this table in Redshift. Please provide a maximum of two.
- Returns
civis.response.Response
- idinteger
The ID for the import.
- namestring
The name of the import.
- sourcedict::
- file_idslist
The file ID(s) to import, if importing Civis file(s).
- storage_pathdict::
- storage_host_idinteger
The ID of the source storage host.
- credential_idinteger
The ID of the credentials for the source storage host.
- file_pathslist
The file or directory path(s) within the bucket from which to import. E.g. the file_path for “s3://mybucket/files/all/” would be “/files/all/”If specifying a directory path, the job will import every file found under that path. All files must have the same column layout and file format (e.g., compression, columnDelimiter, etc.).
- destinationdict::
- schemastring
The destination schema name.
- tablestring
The destination table name.
- remote_host_idinteger
The ID of the destination database host.
- credential_idinteger
The ID of the credentials for the destination database.
- primary_keyslist
A list of column(s) which together uniquely identify a row in the destination table.These columns must not contain NULL values. If the import mode is “upsert”, this field is required;see the Civis Helpdesk article on “Advanced CSV Imports via the Civis API” for more information.
- last_modified_keyslist
A list of the columns indicating a record has been updated.If the destination table does not exist, and the import mode is “upsert”, this field is required.
- first_row_is_headerboolean
A boolean value indicating whether or not the first row of the source file is a header row.
- column_delimiterstring
The column delimiter for the file. Valid arguments are “comma”, “tab”, and “pipe”. Defaults to “comma”.
- escapedboolean
A boolean value indicating whether or not the source file has quotes escaped with a backslash.Defaults to false.
- compressionstring
The type of compression of the source file. Valid arguments are “gzip” and “none”. Defaults to “none”.
- existing_table_rowsstring
The behavior if a destination table with the requested name already exists. One of “fail”, “truncate”, “append”, “drop”, or “upsert”.Defaults to “fail”.
- max_errorsinteger
The maximum number of rows with errors to ignore before failing. This option is not supported for Postgres databases.
- table_columnslist::
An array of hashes corresponding to the columns in the order they appear in the source file. Each hash should have keys for database column “name” and “sqlType”.This parameter is required if the table does not exist, the table is being dropped, or the columns in the source file do not appear in the same order as in the destination table.The “sqlType” key is not required when appending to an existing table. - name : string
The column name.
- sql_typestring
The SQL type of the column.
- loosen_typesboolean
If true, SQL types with precisions/lengths will have these values increased to accommodate data growth in future loads. Type loosening only occurs on table creation. Defaults to false.
- executionstring
In upsert mode, controls the movement of data in upsert mode. If set to “delayed”, the data will be moved after a brief delay. If set to “immediate”, the data will be moved immediately. In non-upsert modes, controls the speed at which detailed column stats appear in the data catalogue. Defaults to “delayed”, to accommodate concurrent upserts to the same table and speedier non-upsert imports.
- redshift_destination_optionsdict::
- diststylestring
The diststyle to use for the table. One of “even”, “all”, or “key”.
- distkeystring
Distkey for this table in Redshift
- sortkeyslist
Sortkeys for this table in Redshift. Please provide a maximum of two.
- hiddenboolean
The hidden status of the item.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- 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
- namestring
The name of the import.
- sync_typestring
The type of sync to perform; one of Dbsync, AutoImport, GdocImport, GdocExport, and Salesforce.
- is_outboundboolean
- sourcedict, optional::
remote_host_id : integer
credential_id : integer
- additional_credentialslist
Array that holds additional credentials used for specific imports. For salesforce imports, the first and only element is the client credential id. For DB Syncs, the first element is an SSL private key credential id, and the second element is the corresponding public key credential id.
- destinationdict, optional::
remote_host_id : integer
credential_id : integer
- additional_credentialslist
Array that holds additional credentials used for specific imports. For salesforce imports, the first and only element is the client credential id. For DB Syncs, the first element is an SSL private key credential id, and the second element is the corresponding public key credential id.
- scheduledict, optional::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- notificationsdict, optional::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- parent_idinteger, optional
Parent id to trigger this import from
- next_run_atstring/time, optional
The time of the next scheduled run.
- time_zonestring, optional
The time zone of this import.
- hiddenboolean, optional
The hidden status of the item.
- Returns
civis.response.Response
- namestring
The name of the import.
- sync_typestring
The type of sync to perform; one of Dbsync, AutoImport, GdocImport, GdocExport, and Salesforce.
- sourcedict::
remote_host_id : integer
credential_id : integer
- additional_credentialslist
Array that holds additional credentials used for specific imports. For salesforce imports, the first and only element is the client credential id. For DB Syncs, the first element is an SSL private key credential id, and the second element is the corresponding public key credential id.
name : string
- destinationdict::
remote_host_id : integer
credential_id : integer
- additional_credentialslist
Array that holds additional credentials used for specific imports. For salesforce imports, the first and only element is the client credential id. For DB Syncs, the first element is an SSL private key credential id, and the second element is the corresponding public key credential id.
name : string
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- notificationsdict::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- parent_idinteger
Parent id to trigger this import from
- idinteger
The ID for the import.
is_outbound : boolean
- job_typestring
The job type of this import.
- syncslist::
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 - database_table : dict:: - schema : string The database schema name. - table : string The database table name. - use_without_schema : boolean This attribute is no longer available; defaults to false but cannot be used. - file : dict:: - id : integer The file id. - google_worksheet : dict:: - spreadsheet : string The spreadsheet document name. - spreadsheet_id : string The spreadsheet document id. - worksheet : string The worksheet tab name. - worksheet_id : integer The worksheet tab id. - salesforce : dict:: - object_name : string The Salesforce object name.
- destinationdict::
- pathstring
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_tabledict::
- schemastring
The database schema name.
- tablestring
The database table name.
- use_without_schemaboolean
This attribute is no longer available; defaults to false but cannot be used.
- google_worksheetdict::
- spreadsheetstring
The spreadsheet document name.
- spreadsheet_idstring
The spreadsheet document id.
- worksheetstring
The worksheet tab name.
- worksheet_idinteger
The worksheet tab id.
- advanced_optionsdict::
max_errors : integer
existing_table_rows : string
diststyle : string
distkey : string
sortkey1 : string
sortkey2 : string
column_delimiter : string
- column_overridesdict
Hash used for overriding auto-detected names and types, with keys being the index of the column being overridden.
- escapedboolean
If true, escape quotes with a backslash; otherwise, escape quotes by double-quoting. Defaults to false.
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_namestring
This parameter is deprecated
- partition_schema_namestring
This parameter is deprecated
- partition_table_namestring
This parameter is deprecated
- partition_table_partition_column_min_namestring
This parameter is deprecated
- partition_table_partition_column_max_namestring
This parameter is deprecated
last_modified_column : string
- mysql_catalog_matches_schemaboolean
This attribute is no longer available; defaults to true but cannot be used.
- chunking_methodstring
This parameter is deprecated
first_row_is_header : boolean
- export_actionstring
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. Default is set to “newsprsht”
- sql_querystring
If you are doing a Google Sheet export, this is your SQL query.
contact_lists : string
soql_query : string
include_deleted_records : boolean
state : string
created_at : string/date-time
updated_at : string/date-time
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- userdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- running_asdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- next_run_atstring/time
The time of the next scheduled run.
- time_zonestring
The time zone of this import.
- hiddenboolean
The hidden status of the item.
- archivedstring
The archival status of the requested item(s).
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- 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 Civis
- Parameters
- file_idslist
The file IDs for the import.
- schemastring
The destination schema name. This schema must already exist in Redshift.
- tablestring
The destination table name, without the schema prefix. This table must already exist in Redshift.
- remote_host_idinteger
The ID of the destination database host.
- credential_idinteger
The ID of the credentials to be used when performing the database import.
- column_delimiterstring, optional
The column delimiter for the file. Valid arguments are “comma”, “tab”, and “pipe”. If unspecified, defaults to “comma”.
- first_row_is_headerboolean, optional
A boolean value indicating whether or not the first row is a header row. If unspecified, defaults to false.
- compressionstring, optional
The type of compression. Valid arguments are “gzip”, “zip”, and “none”. If unspecified, defaults to “gzip”.
- hiddenboolean, optional
The hidden status of the item.
- Returns
civis.response.Response
- idinteger
The ID for the import.
- schemastring
The destination schema name. This schema must already exist in Redshift.
- tablestring
The destination table name, without the schema prefix. This table must already exist in Redshift.
- remote_host_idinteger
The ID of the destination database host.
- statestring
The state of the run; one of “queued”, “running”, “succeeded”, “failed”, or “cancelled”.
- started_atstring/time
The time the last run started at.
- finished_atstring/time
The time the last run completed.
- errorstring
The error returned by the run, if any.
- hiddenboolean
The hidden status of the item.
- post_cancel(id)¶
Cancel a run
- Parameters
- idinteger
The ID of the job.
- Returns
civis.response.Response
- idinteger
The ID of the run.
- statestring
The state of the run, one of ‘queued’, ‘running’ or ‘cancelled’.
- is_cancel_requestedboolean
True if run cancel requested, else false.
- post_files(schema, name, remote_host_id, credential_id, *, max_errors='DEFAULT', existing_table_rows='DEFAULT', diststyle='DEFAULT', distkey='DEFAULT', sortkey1='DEFAULT', sortkey2='DEFAULT', column_delimiter='DEFAULT', first_row_is_header='DEFAULT', multipart='DEFAULT', escaped='DEFAULT', hidden='DEFAULT')¶
Initate an import of a tabular file into the platform
- Parameters
- schemastring
The schema of the destination table.
- namestring
The name of the destination table.
- remote_host_idinteger
The id of the destination database host.
- credential_idinteger
The id of the credentials to be used when performing the database import.
- max_errorsinteger, optional
The maximum number of rows with errors to remove from the import before failing.
- existing_table_rowsstring, optional
The behaviour if a table with the requested name already exists. One of “fail”, “truncate”, “append”, or “drop”.Defaults to “fail”.
- diststylestring, optional
The diststyle to use for the table. One of “even”, “all”, or “key”.
- distkeystring, optional
The column to use as the distkey for the table.
- sortkey1string, optional
The column to use as the sort key for the table.
- sortkey2string, optional
The second column in a compound sortkey for the table.
- column_delimiterstring, 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_headerboolean, 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.
- multipartboolean, optional
If true, the upload URI will require a multipart/form-data POST request. Defaults to false.
- escapedboolean, optional
If true, escape quotes with a backslash; otherwise, escape quotes by double-quoting. Defaults to false.
- hiddenboolean, optional
The hidden status of the item.
- Returns
civis.response.Response
- idinteger
The id of the import.
- upload_uristring
The URI which may be used to upload a tabular file for import. You must use this URI to upload the file you wish imported and then inform the Civis API when your upload is complete using the URI given by the runUri field of this response.
- run_uristring
The URI to POST to once the file upload is complete. After uploading the file using the URI given in the uploadUri attribute of the response, POST to this URI to initiate the import of your uploaded file into the platform.
- upload_fieldsdict
If multipart was set to true, these fields should be included in the multipart upload.
- post_files_csv(source, destination, first_row_is_header, *, name='DEFAULT', column_delimiter='DEFAULT', escaped='DEFAULT', compression='DEFAULT', existing_table_rows='DEFAULT', max_errors='DEFAULT', table_columns='DEFAULT', loosen_types='DEFAULT', execution='DEFAULT', redshift_destination_options='DEFAULT', hidden='DEFAULT')¶
Create a CSV Import
- Parameters
- sourcedict::
- file_idslist
The file ID(s) to import, if importing Civis file(s).
- storage_pathdict::
- storage_host_idinteger
The ID of the source storage host.
- credential_idinteger
The ID of the credentials for the source storage host.
- file_pathslist
The file or directory path(s) within the bucket from which to import. E.g. the file_path for “s3://mybucket/files/all/” would be “/files/all/”If specifying a directory path, the job will import every file found under that path. All files must have the same column layout and file format (e.g., compression, columnDelimiter, etc.).
- destinationdict::
- schemastring
The destination schema name.
- tablestring
The destination table name.
- remote_host_idinteger
The ID of the destination database host.
- credential_idinteger
The ID of the credentials for the destination database.
- primary_keyslist
A list of column(s) which together uniquely identify a row in the destination table.These columns must not contain NULL values. If the import mode is “upsert”, this field is required;see the Civis Helpdesk article on “Advanced CSV Imports via the Civis API” for more information.
- last_modified_keyslist
A list of the columns indicating a record has been updated.If the destination table does not exist, and the import mode is “upsert”, this field is required.
- first_row_is_headerboolean
A boolean value indicating whether or not the first row of the source file is a header row.
- namestring, optional
The name of the import.
- column_delimiterstring, optional
The column delimiter for the file. Valid arguments are “comma”, “tab”, and “pipe”. Defaults to “comma”.
- escapedboolean, optional
A boolean value indicating whether or not the source file has quotes escaped with a backslash.Defaults to false.
- compressionstring, optional
The type of compression of the source file. Valid arguments are “gzip” and “none”. Defaults to “none”.
- existing_table_rowsstring, optional
The behavior if a destination table with the requested name already exists. One of “fail”, “truncate”, “append”, “drop”, or “upsert”.Defaults to “fail”.
- max_errorsinteger, optional
The maximum number of rows with errors to ignore before failing. This option is not supported for Postgres databases.
- table_columnslist, optional::
An array of hashes corresponding to the columns in the order they appear in the source file. Each hash should have keys for database column “name” and “sqlType”.This parameter is required if the table does not exist, the table is being dropped, or the columns in the source file do not appear in the same order as in the destination table.The “sqlType” key is not required when appending to an existing table. - name : string
The column name.
- sql_typestring
The SQL type of the column.
- loosen_typesboolean, optional
If true, SQL types with precisions/lengths will have these values increased to accommodate data growth in future loads. Type loosening only occurs on table creation. Defaults to false.
- executionstring, optional
In upsert mode, controls the movement of data in upsert mode. If set to “delayed”, the data will be moved after a brief delay. If set to “immediate”, the data will be moved immediately. In non-upsert modes, controls the speed at which detailed column stats appear in the data catalogue. Defaults to “delayed”, to accommodate concurrent upserts to the same table and speedier non-upsert imports.
- redshift_destination_optionsdict, optional::
- diststylestring
The diststyle to use for the table. One of “even”, “all”, or “key”.
- distkeystring
Distkey for this table in Redshift
- sortkeyslist
Sortkeys for this table in Redshift. Please provide a maximum of two.
- hiddenboolean, optional
The hidden status of the item.
- Returns
civis.response.Response
- idinteger
The ID for the import.
- namestring
The name of the import.
- sourcedict::
- file_idslist
The file ID(s) to import, if importing Civis file(s).
- storage_pathdict::
- storage_host_idinteger
The ID of the source storage host.
- credential_idinteger
The ID of the credentials for the source storage host.
- file_pathslist
The file or directory path(s) within the bucket from which to import. E.g. the file_path for “s3://mybucket/files/all/” would be “/files/all/”If specifying a directory path, the job will import every file found under that path. All files must have the same column layout and file format (e.g., compression, columnDelimiter, etc.).
- destinationdict::
- schemastring
The destination schema name.
- tablestring
The destination table name.
- remote_host_idinteger
The ID of the destination database host.
- credential_idinteger
The ID of the credentials for the destination database.
- primary_keyslist
A list of column(s) which together uniquely identify a row in the destination table.These columns must not contain NULL values. If the import mode is “upsert”, this field is required;see the Civis Helpdesk article on “Advanced CSV Imports via the Civis API” for more information.
- last_modified_keyslist
A list of the columns indicating a record has been updated.If the destination table does not exist, and the import mode is “upsert”, this field is required.
- first_row_is_headerboolean
A boolean value indicating whether or not the first row of the source file is a header row.
- column_delimiterstring
The column delimiter for the file. Valid arguments are “comma”, “tab”, and “pipe”. Defaults to “comma”.
- escapedboolean
A boolean value indicating whether or not the source file has quotes escaped with a backslash.Defaults to false.
- compressionstring
The type of compression of the source file. Valid arguments are “gzip” and “none”. Defaults to “none”.
- existing_table_rowsstring
The behavior if a destination table with the requested name already exists. One of “fail”, “truncate”, “append”, “drop”, or “upsert”.Defaults to “fail”.
- max_errorsinteger
The maximum number of rows with errors to ignore before failing. This option is not supported for Postgres databases.
- table_columnslist::
An array of hashes corresponding to the columns in the order they appear in the source file. Each hash should have keys for database column “name” and “sqlType”.This parameter is required if the table does not exist, the table is being dropped, or the columns in the source file do not appear in the same order as in the destination table.The “sqlType” key is not required when appending to an existing table. - name : string
The column name.
- sql_typestring
The SQL type of the column.
- loosen_typesboolean
If true, SQL types with precisions/lengths will have these values increased to accommodate data growth in future loads. Type loosening only occurs on table creation. Defaults to false.
- executionstring
In upsert mode, controls the movement of data in upsert mode. If set to “delayed”, the data will be moved after a brief delay. If set to “immediate”, the data will be moved immediately. In non-upsert modes, controls the speed at which detailed column stats appear in the data catalogue. Defaults to “delayed”, to accommodate concurrent upserts to the same table and speedier non-upsert imports.
- redshift_destination_optionsdict::
- diststylestring
The diststyle to use for the table. One of “even”, “all”, or “key”.
- distkeystring
Distkey for this table in Redshift
- sortkeyslist
Sortkeys for this table in Redshift. Please provide a maximum of two.
- hiddenboolean
The hidden status of the item.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- post_files_csv_runs(id)¶
Start a run
- Parameters
- idinteger
The ID of the csv_import.
- Returns
civis.response.Response
- idinteger
The ID of the run.
- csv_import_idinteger
The ID of the csv_import.
- statestring
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- is_cancel_requestedboolean
True if run cancel requested, else false.
- started_atstring/time
The time the last run started at.
- finished_atstring/time
The time the last run completed.
- errorstring
The error, if any, returned by the run.
- post_files_runs(id)¶
Start a run
- Parameters
- idinteger
The ID of the import.
- Returns
civis.response.Response
- idinteger
The ID of the run.
- import_idinteger
The ID of the import.
- statestring
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- is_cancel_requestedboolean
True if run cancel requested, else false.
- started_atstring/time
The time the last run started at.
- finished_atstring/time
The time the last run completed.
- errorstring
The error, if any, returned by the run.
- post_runs(id)¶
Run an import
- Parameters
- idinteger
The ID of the import to run.
- Returns
civis.response.Response
- run_idinteger
The ID of the new run triggered.
- post_syncs(id, source, destination, *, advanced_options='DEFAULT')¶
Create a sync
- Parameters
- idinteger
- sourcedict::
- pathstring
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
- database_tabledict::
- schemastring
The database schema name.
- tablestring
The database table name.
- use_without_schemaboolean
This attribute is no longer available; defaults to false but cannot be used.
file : dict
- google_worksheetdict::
- spreadsheetstring
The spreadsheet document name.
- spreadsheet_idstring
The spreadsheet document id.
- worksheetstring
The worksheet tab name.
- worksheet_idinteger
The worksheet tab id.
- salesforcedict::
- object_namestring
The Salesforce object name.
- destinationdict::
- pathstring
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_tabledict::
- schemastring
The database schema name.
- tablestring
The database table name.
- use_without_schemaboolean
This attribute is no longer available; defaults to false but cannot be used.
- google_worksheetdict::
- spreadsheetstring
The spreadsheet document name.
- spreadsheet_idstring
The spreadsheet document id.
- worksheetstring
The worksheet tab name.
- worksheet_idinteger
The worksheet tab id.
- advanced_optionsdict, optional::
max_errors : integer
existing_table_rows : string
diststyle : string
distkey : string
sortkey1 : string
sortkey2 : string
column_delimiter : string
- column_overridesdict
Hash used for overriding auto-detected names and types, with keys being the index of the column being overridden.
- escapedboolean
If true, escape quotes with a backslash; otherwise, escape quotes by double-quoting. Defaults to false.
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_namestring
This parameter is deprecated
- partition_schema_namestring
This parameter is deprecated
- partition_table_namestring
This parameter is deprecated
- partition_table_partition_column_min_namestring
This parameter is deprecated
- partition_table_partition_column_max_namestring
This parameter is deprecated
last_modified_column : string
- mysql_catalog_matches_schemaboolean
This attribute is no longer available; defaults to true but cannot be used.
- chunking_methodstring
This parameter is deprecated
first_row_is_header : boolean
- export_actionstring
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. Default is set to “newsprsht”
- sql_querystring
If you are doing a Google Sheet export, this is your SQL query.
contact_lists : string
soql_query : string
include_deleted_records : boolean
- Returns
civis.response.Response
id : integer
- sourcedict::
- idinteger
The ID of the table or file, if available.
- pathstring
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
- database_tabledict::
- schemastring
The database schema name.
- tablestring
The database table name.
- use_without_schemaboolean
This attribute is no longer available; defaults to false but cannot be used.
- filedict::
- idinteger
The file id.
- google_worksheetdict::
- spreadsheetstring
The spreadsheet document name.
- spreadsheet_idstring
The spreadsheet document id.
- worksheetstring
The worksheet tab name.
- worksheet_idinteger
The worksheet tab id.
- salesforcedict::
- object_namestring
The Salesforce object name.
- destinationdict::
- pathstring
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_tabledict::
- schemastring
The database schema name.
- tablestring
The database table name.
- use_without_schemaboolean
This attribute is no longer available; defaults to false but cannot be used.
- google_worksheetdict::
- spreadsheetstring
The spreadsheet document name.
- spreadsheet_idstring
The spreadsheet document id.
- worksheetstring
The worksheet tab name.
- worksheet_idinteger
The worksheet tab id.
- advanced_optionsdict::
max_errors : integer
existing_table_rows : string
diststyle : string
distkey : string
sortkey1 : string
sortkey2 : string
column_delimiter : string
- column_overridesdict
Hash used for overriding auto-detected names and types, with keys being the index of the column being overridden.
- escapedboolean
If true, escape quotes with a backslash; otherwise, escape quotes by double-quoting. Defaults to false.
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_namestring
This parameter is deprecated
- partition_schema_namestring
This parameter is deprecated
- partition_table_namestring
This parameter is deprecated
- partition_table_partition_column_min_namestring
This parameter is deprecated
- partition_table_partition_column_max_namestring
This parameter is deprecated
last_modified_column : string
- mysql_catalog_matches_schemaboolean
This attribute is no longer available; defaults to true but cannot be used.
- chunking_methodstring
This parameter is deprecated
first_row_is_header : boolean
- export_actionstring
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. Default is set to “newsprsht”
- sql_querystring
If you are doing a Google Sheet export, this is your SQL query.
contact_lists : string
soql_query : string
include_deleted_records : boolean
- 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
- idinteger
The ID for the import.
- namestring
The name of the import.
- sync_typestring
The type of sync to perform; one of Dbsync, AutoImport, GdocImport, GdocExport, and Salesforce.
- is_outboundboolean
- sourcedict, optional::
remote_host_id : integer
credential_id : integer
- additional_credentialslist
Array that holds additional credentials used for specific imports. For salesforce imports, the first and only element is the client credential id. For DB Syncs, the first element is an SSL private key credential id, and the second element is the corresponding public key credential id.
- destinationdict, optional::
remote_host_id : integer
credential_id : integer
- additional_credentialslist
Array that holds additional credentials used for specific imports. For salesforce imports, the first and only element is the client credential id. For DB Syncs, the first element is an SSL private key credential id, and the second element is the corresponding public key credential id.
- scheduledict, optional::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- notificationsdict, optional::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- parent_idinteger, optional
Parent id to trigger this import from
- next_run_atstring/time, optional
The time of the next scheduled run.
- time_zonestring, optional
The time zone of this import.
- Returns
civis.response.Response
- namestring
The name of the import.
- sync_typestring
The type of sync to perform; one of Dbsync, AutoImport, GdocImport, GdocExport, and Salesforce.
- sourcedict::
remote_host_id : integer
credential_id : integer
- additional_credentialslist
Array that holds additional credentials used for specific imports. For salesforce imports, the first and only element is the client credential id. For DB Syncs, the first element is an SSL private key credential id, and the second element is the corresponding public key credential id.
name : string
- destinationdict::
remote_host_id : integer
credential_id : integer
- additional_credentialslist
Array that holds additional credentials used for specific imports. For salesforce imports, the first and only element is the client credential id. For DB Syncs, the first element is an SSL private key credential id, and the second element is the corresponding public key credential id.
name : string
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- notificationsdict::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- parent_idinteger
Parent id to trigger this import from
- idinteger
The ID for the import.
is_outbound : boolean
- job_typestring
The job type of this import.
- syncslist::
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 - database_table : dict:: - schema : string The database schema name. - table : string The database table name. - use_without_schema : boolean This attribute is no longer available; defaults to false but cannot be used. - file : dict:: - id : integer The file id. - google_worksheet : dict:: - spreadsheet : string The spreadsheet document name. - spreadsheet_id : string The spreadsheet document id. - worksheet : string The worksheet tab name. - worksheet_id : integer The worksheet tab id. - salesforce : dict:: - object_name : string The Salesforce object name.
- destinationdict::
- pathstring
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_tabledict::
- schemastring
The database schema name.
- tablestring
The database table name.
- use_without_schemaboolean
This attribute is no longer available; defaults to false but cannot be used.
- google_worksheetdict::
- spreadsheetstring
The spreadsheet document name.
- spreadsheet_idstring
The spreadsheet document id.
- worksheetstring
The worksheet tab name.
- worksheet_idinteger
The worksheet tab id.
- advanced_optionsdict::
max_errors : integer
existing_table_rows : string
diststyle : string
distkey : string
sortkey1 : string
sortkey2 : string
column_delimiter : string
- column_overridesdict
Hash used for overriding auto-detected names and types, with keys being the index of the column being overridden.
- escapedboolean
If true, escape quotes with a backslash; otherwise, escape quotes by double-quoting. Defaults to false.
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_namestring
This parameter is deprecated
- partition_schema_namestring
This parameter is deprecated
- partition_table_namestring
This parameter is deprecated
- partition_table_partition_column_min_namestring
This parameter is deprecated
- partition_table_partition_column_max_namestring
This parameter is deprecated
last_modified_column : string
- mysql_catalog_matches_schemaboolean
This attribute is no longer available; defaults to true but cannot be used.
- chunking_methodstring
This parameter is deprecated
first_row_is_header : boolean
- export_actionstring
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. Default is set to “newsprsht”
- sql_querystring
If you are doing a Google Sheet export, this is your SQL query.
contact_lists : string
soql_query : string
include_deleted_records : boolean
state : string
created_at : string/date-time
updated_at : string/date-time
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- userdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- running_asdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- next_run_atstring/time
The time of the next scheduled run.
- time_zonestring
The time zone of this import.
- hiddenboolean
The hidden status of the item.
- archivedstring
The archival status of the requested item(s).
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- put_archive(id, status)¶
Update the archive status of this object
- Parameters
- idinteger
The ID of the object.
- statusboolean
The desired archived status of the object.
- Returns
civis.response.Response
- namestring
The name of the import.
- sync_typestring
The type of sync to perform; one of Dbsync, AutoImport, GdocImport, GdocExport, and Salesforce.
- sourcedict::
remote_host_id : integer
credential_id : integer
- additional_credentialslist
Array that holds additional credentials used for specific imports. For salesforce imports, the first and only element is the client credential id. For DB Syncs, the first element is an SSL private key credential id, and the second element is the corresponding public key credential id.
name : string
- destinationdict::
remote_host_id : integer
credential_id : integer
- additional_credentialslist
Array that holds additional credentials used for specific imports. For salesforce imports, the first and only element is the client credential id. For DB Syncs, the first element is an SSL private key credential id, and the second element is the corresponding public key credential id.
name : string
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- notificationsdict::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- parent_idinteger
Parent id to trigger this import from
- idinteger
The ID for the import.
is_outbound : boolean
- job_typestring
The job type of this import.
- syncslist::
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 - database_table : dict:: - schema : string The database schema name. - table : string The database table name. - use_without_schema : boolean This attribute is no longer available; defaults to false but cannot be used. - file : dict:: - id : integer The file id. - google_worksheet : dict:: - spreadsheet : string The spreadsheet document name. - spreadsheet_id : string The spreadsheet document id. - worksheet : string The worksheet tab name. - worksheet_id : integer The worksheet tab id. - salesforce : dict:: - object_name : string The Salesforce object name.
- destinationdict::
- pathstring
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_tabledict::
- schemastring
The database schema name.
- tablestring
The database table name.
- use_without_schemaboolean
This attribute is no longer available; defaults to false but cannot be used.
- google_worksheetdict::
- spreadsheetstring
The spreadsheet document name.
- spreadsheet_idstring
The spreadsheet document id.
- worksheetstring
The worksheet tab name.
- worksheet_idinteger
The worksheet tab id.
- advanced_optionsdict::
max_errors : integer
existing_table_rows : string
diststyle : string
distkey : string
sortkey1 : string
sortkey2 : string
column_delimiter : string
- column_overridesdict
Hash used for overriding auto-detected names and types, with keys being the index of the column being overridden.
- escapedboolean
If true, escape quotes with a backslash; otherwise, escape quotes by double-quoting. Defaults to false.
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_namestring
This parameter is deprecated
- partition_schema_namestring
This parameter is deprecated
- partition_table_namestring
This parameter is deprecated
- partition_table_partition_column_min_namestring
This parameter is deprecated
- partition_table_partition_column_max_namestring
This parameter is deprecated
last_modified_column : string
- mysql_catalog_matches_schemaboolean
This attribute is no longer available; defaults to true but cannot be used.
- chunking_methodstring
This parameter is deprecated
first_row_is_header : boolean
- export_actionstring
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. Default is set to “newsprsht”
- sql_querystring
If you are doing a Google Sheet export, this is your SQL query.
contact_lists : string
soql_query : string
include_deleted_records : boolean
state : string
created_at : string/date-time
updated_at : string/date-time
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- userdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- running_asdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- next_run_atstring/time
The time of the next scheduled run.
- time_zonestring
The time zone of this import.
- hiddenboolean
The hidden status of the item.
- archivedstring
The archival status of the requested item(s).
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- put_files_csv(id, source, destination, first_row_is_header, *, name='DEFAULT', column_delimiter='DEFAULT', escaped='DEFAULT', compression='DEFAULT', existing_table_rows='DEFAULT', max_errors='DEFAULT', table_columns='DEFAULT', loosen_types='DEFAULT', execution='DEFAULT', redshift_destination_options='DEFAULT')¶
Replace all attributes of this CSV Import
- Parameters
- idinteger
The ID for the import.
- sourcedict::
- file_idslist
The file ID(s) to import, if importing Civis file(s).
- storage_pathdict::
- storage_host_idinteger
The ID of the source storage host.
- credential_idinteger
The ID of the credentials for the source storage host.
- file_pathslist
The file or directory path(s) within the bucket from which to import. E.g. the file_path for “s3://mybucket/files/all/” would be “/files/all/”If specifying a directory path, the job will import every file found under that path. All files must have the same column layout and file format (e.g., compression, columnDelimiter, etc.).
- destinationdict::
- schemastring
The destination schema name.
- tablestring
The destination table name.
- remote_host_idinteger
The ID of the destination database host.
- credential_idinteger
The ID of the credentials for the destination database.
- primary_keyslist
A list of column(s) which together uniquely identify a row in the destination table.These columns must not contain NULL values. If the import mode is “upsert”, this field is required;see the Civis Helpdesk article on “Advanced CSV Imports via the Civis API” for more information.
- last_modified_keyslist
A list of the columns indicating a record has been updated.If the destination table does not exist, and the import mode is “upsert”, this field is required.
- first_row_is_headerboolean
A boolean value indicating whether or not the first row of the source file is a header row.
- namestring, optional
The name of the import.
- column_delimiterstring, optional
The column delimiter for the file. Valid arguments are “comma”, “tab”, and “pipe”. Defaults to “comma”.
- escapedboolean, optional
A boolean value indicating whether or not the source file has quotes escaped with a backslash.Defaults to false.
- compressionstring, optional
The type of compression of the source file. Valid arguments are “gzip” and “none”. Defaults to “none”.
- existing_table_rowsstring, optional
The behavior if a destination table with the requested name already exists. One of “fail”, “truncate”, “append”, “drop”, or “upsert”.Defaults to “fail”.
- max_errorsinteger, optional
The maximum number of rows with errors to ignore before failing. This option is not supported for Postgres databases.
- table_columnslist, optional::
An array of hashes corresponding to the columns in the order they appear in the source file. Each hash should have keys for database column “name” and “sqlType”.This parameter is required if the table does not exist, the table is being dropped, or the columns in the source file do not appear in the same order as in the destination table.The “sqlType” key is not required when appending to an existing table. - name : string
The column name.
- sql_typestring
The SQL type of the column.
- loosen_typesboolean, optional
If true, SQL types with precisions/lengths will have these values increased to accommodate data growth in future loads. Type loosening only occurs on table creation. Defaults to false.
- executionstring, optional
In upsert mode, controls the movement of data in upsert mode. If set to “delayed”, the data will be moved after a brief delay. If set to “immediate”, the data will be moved immediately. In non-upsert modes, controls the speed at which detailed column stats appear in the data catalogue. Defaults to “delayed”, to accommodate concurrent upserts to the same table and speedier non-upsert imports.
- redshift_destination_optionsdict, optional::
- diststylestring
The diststyle to use for the table. One of “even”, “all”, or “key”.
- distkeystring
Distkey for this table in Redshift
- sortkeyslist
Sortkeys for this table in Redshift. Please provide a maximum of two.
- Returns
civis.response.Response
- idinteger
The ID for the import.
- namestring
The name of the import.
- sourcedict::
- file_idslist
The file ID(s) to import, if importing Civis file(s).
- storage_pathdict::
- storage_host_idinteger
The ID of the source storage host.
- credential_idinteger
The ID of the credentials for the source storage host.
- file_pathslist
The file or directory path(s) within the bucket from which to import. E.g. the file_path for “s3://mybucket/files/all/” would be “/files/all/”If specifying a directory path, the job will import every file found under that path. All files must have the same column layout and file format (e.g., compression, columnDelimiter, etc.).
- destinationdict::
- schemastring
The destination schema name.
- tablestring
The destination table name.
- remote_host_idinteger
The ID of the destination database host.
- credential_idinteger
The ID of the credentials for the destination database.
- primary_keyslist
A list of column(s) which together uniquely identify a row in the destination table.These columns must not contain NULL values. If the import mode is “upsert”, this field is required;see the Civis Helpdesk article on “Advanced CSV Imports via the Civis API” for more information.
- last_modified_keyslist
A list of the columns indicating a record has been updated.If the destination table does not exist, and the import mode is “upsert”, this field is required.
- first_row_is_headerboolean
A boolean value indicating whether or not the first row of the source file is a header row.
- column_delimiterstring
The column delimiter for the file. Valid arguments are “comma”, “tab”, and “pipe”. Defaults to “comma”.
- escapedboolean
A boolean value indicating whether or not the source file has quotes escaped with a backslash.Defaults to false.
- compressionstring
The type of compression of the source file. Valid arguments are “gzip” and “none”. Defaults to “none”.
- existing_table_rowsstring
The behavior if a destination table with the requested name already exists. One of “fail”, “truncate”, “append”, “drop”, or “upsert”.Defaults to “fail”.
- max_errorsinteger
The maximum number of rows with errors to ignore before failing. This option is not supported for Postgres databases.
- table_columnslist::
An array of hashes corresponding to the columns in the order they appear in the source file. Each hash should have keys for database column “name” and “sqlType”.This parameter is required if the table does not exist, the table is being dropped, or the columns in the source file do not appear in the same order as in the destination table.The “sqlType” key is not required when appending to an existing table. - name : string
The column name.
- sql_typestring
The SQL type of the column.
- loosen_typesboolean
If true, SQL types with precisions/lengths will have these values increased to accommodate data growth in future loads. Type loosening only occurs on table creation. Defaults to false.
- executionstring
In upsert mode, controls the movement of data in upsert mode. If set to “delayed”, the data will be moved after a brief delay. If set to “immediate”, the data will be moved immediately. In non-upsert modes, controls the speed at which detailed column stats appear in the data catalogue. Defaults to “delayed”, to accommodate concurrent upserts to the same table and speedier non-upsert imports.
- redshift_destination_optionsdict::
- diststylestring
The diststyle to use for the table. One of “even”, “all”, or “key”.
- distkeystring
Distkey for this table in Redshift
- sortkeyslist
Sortkeys for this table in Redshift. Please provide a maximum of two.
- hiddenboolean
The hidden status of the item.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- put_files_csv_archive(id, status)¶
Update the archive status of this object
- Parameters
- idinteger
The ID of the object.
- statusboolean
The desired archived status of the object.
- Returns
civis.response.Response
- idinteger
The ID for the import.
- namestring
The name of the import.
- sourcedict::
- file_idslist
The file ID(s) to import, if importing Civis file(s).
- storage_pathdict::
- storage_host_idinteger
The ID of the source storage host.
- credential_idinteger
The ID of the credentials for the source storage host.
- file_pathslist
The file or directory path(s) within the bucket from which to import. E.g. the file_path for “s3://mybucket/files/all/” would be “/files/all/”If specifying a directory path, the job will import every file found under that path. All files must have the same column layout and file format (e.g., compression, columnDelimiter, etc.).
- destinationdict::
- schemastring
The destination schema name.
- tablestring
The destination table name.
- remote_host_idinteger
The ID of the destination database host.
- credential_idinteger
The ID of the credentials for the destination database.
- primary_keyslist
A list of column(s) which together uniquely identify a row in the destination table.These columns must not contain NULL values. If the import mode is “upsert”, this field is required;see the Civis Helpdesk article on “Advanced CSV Imports via the Civis API” for more information.
- last_modified_keyslist
A list of the columns indicating a record has been updated.If the destination table does not exist, and the import mode is “upsert”, this field is required.
- first_row_is_headerboolean
A boolean value indicating whether or not the first row of the source file is a header row.
- column_delimiterstring
The column delimiter for the file. Valid arguments are “comma”, “tab”, and “pipe”. Defaults to “comma”.
- escapedboolean
A boolean value indicating whether or not the source file has quotes escaped with a backslash.Defaults to false.
- compressionstring
The type of compression of the source file. Valid arguments are “gzip” and “none”. Defaults to “none”.
- existing_table_rowsstring
The behavior if a destination table with the requested name already exists. One of “fail”, “truncate”, “append”, “drop”, or “upsert”.Defaults to “fail”.
- max_errorsinteger
The maximum number of rows with errors to ignore before failing. This option is not supported for Postgres databases.
- table_columnslist::
An array of hashes corresponding to the columns in the order they appear in the source file. Each hash should have keys for database column “name” and “sqlType”.This parameter is required if the table does not exist, the table is being dropped, or the columns in the source file do not appear in the same order as in the destination table.The “sqlType” key is not required when appending to an existing table. - name : string
The column name.
- sql_typestring
The SQL type of the column.
- loosen_typesboolean
If true, SQL types with precisions/lengths will have these values increased to accommodate data growth in future loads. Type loosening only occurs on table creation. Defaults to false.
- executionstring
In upsert mode, controls the movement of data in upsert mode. If set to “delayed”, the data will be moved after a brief delay. If set to “immediate”, the data will be moved immediately. In non-upsert modes, controls the speed at which detailed column stats appear in the data catalogue. Defaults to “delayed”, to accommodate concurrent upserts to the same table and speedier non-upsert imports.
- redshift_destination_optionsdict::
- diststylestring
The diststyle to use for the table. One of “even”, “all”, or “key”.
- distkeystring
Distkey for this table in Redshift
- sortkeyslist
Sortkeys for this table in Redshift. Please provide a maximum of two.
- hiddenboolean
The hidden status of the item.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- put_projects(id, project_id)¶
Add an Import to a project
- Parameters
- idinteger
The ID of the Import.
- project_idinteger
The ID of the project.
- Returns
- None
Response code 204: success
Set the permissions groups has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- group_idslist
An array of one or more group IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
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
- idinteger
The ID of the resource that is shared.
- user_idslist
An array of one or more user IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
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
- idinteger
The ID of the import to fetch.
- sync_idinteger
The ID of the sync to fetch.
- sourcedict::
- pathstring
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
- database_tabledict::
- schemastring
The database schema name.
- tablestring
The database table name.
- use_without_schemaboolean
This attribute is no longer available; defaults to false but cannot be used.
file : dict
- google_worksheetdict::
- spreadsheetstring
The spreadsheet document name.
- spreadsheet_idstring
The spreadsheet document id.
- worksheetstring
The worksheet tab name.
- worksheet_idinteger
The worksheet tab id.
- salesforcedict::
- object_namestring
The Salesforce object name.
- destinationdict::
- pathstring
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_tabledict::
- schemastring
The database schema name.
- tablestring
The database table name.
- use_without_schemaboolean
This attribute is no longer available; defaults to false but cannot be used.
- google_worksheetdict::
- spreadsheetstring
The spreadsheet document name.
- spreadsheet_idstring
The spreadsheet document id.
- worksheetstring
The worksheet tab name.
- worksheet_idinteger
The worksheet tab id.
- advanced_optionsdict, optional::
max_errors : integer
existing_table_rows : string
diststyle : string
distkey : string
sortkey1 : string
sortkey2 : string
column_delimiter : string
- column_overridesdict
Hash used for overriding auto-detected names and types, with keys being the index of the column being overridden.
- escapedboolean
If true, escape quotes with a backslash; otherwise, escape quotes by double-quoting. Defaults to false.
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_namestring
This parameter is deprecated
- partition_schema_namestring
This parameter is deprecated
- partition_table_namestring
This parameter is deprecated
- partition_table_partition_column_min_namestring
This parameter is deprecated
- partition_table_partition_column_max_namestring
This parameter is deprecated
last_modified_column : string
- mysql_catalog_matches_schemaboolean
This attribute is no longer available; defaults to true but cannot be used.
- chunking_methodstring
This parameter is deprecated
first_row_is_header : boolean
- export_actionstring
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. Default is set to “newsprsht”
- sql_querystring
If you are doing a Google Sheet export, this is your SQL query.
contact_lists : string
soql_query : string
include_deleted_records : boolean
- Returns
civis.response.Response
id : integer
- sourcedict::
- idinteger
The ID of the table or file, if available.
- pathstring
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
- database_tabledict::
- schemastring
The database schema name.
- tablestring
The database table name.
- use_without_schemaboolean
This attribute is no longer available; defaults to false but cannot be used.
- filedict::
- idinteger
The file id.
- google_worksheetdict::
- spreadsheetstring
The spreadsheet document name.
- spreadsheet_idstring
The spreadsheet document id.
- worksheetstring
The worksheet tab name.
- worksheet_idinteger
The worksheet tab id.
- salesforcedict::
- object_namestring
The Salesforce object name.
- destinationdict::
- pathstring
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_tabledict::
- schemastring
The database schema name.
- tablestring
The database table name.
- use_without_schemaboolean
This attribute is no longer available; defaults to false but cannot be used.
- google_worksheetdict::
- spreadsheetstring
The spreadsheet document name.
- spreadsheet_idstring
The spreadsheet document id.
- worksheetstring
The worksheet tab name.
- worksheet_idinteger
The worksheet tab id.
- advanced_optionsdict::
max_errors : integer
existing_table_rows : string
diststyle : string
distkey : string
sortkey1 : string
sortkey2 : string
column_delimiter : string
- column_overridesdict
Hash used for overriding auto-detected names and types, with keys being the index of the column being overridden.
- escapedboolean
If true, escape quotes with a backslash; otherwise, escape quotes by double-quoting. Defaults to false.
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_namestring
This parameter is deprecated
- partition_schema_namestring
This parameter is deprecated
- partition_table_namestring
This parameter is deprecated
- partition_table_partition_column_min_namestring
This parameter is deprecated
- partition_table_partition_column_max_namestring
This parameter is deprecated
last_modified_column : string
- mysql_catalog_matches_schemaboolean
This attribute is no longer available; defaults to true but cannot be used.
- chunking_methodstring
This parameter is deprecated
first_row_is_header : boolean
- export_actionstring
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. Default is set to “newsprsht”
- sql_querystring
If you are doing a Google Sheet export, this is your SQL query.
contact_lists : string
soql_query : string
include_deleted_records : boolean
- put_syncs_archive(id, sync_id, *, status='DEFAULT')¶
Update the archive status of this sync
- Parameters
- idinteger
The ID of the import to fetch.
- sync_idinteger
The ID of the sync to fetch.
- statusboolean, optional
The desired archived status of the sync.
- Returns
civis.response.Response
id : integer
- sourcedict::
- idinteger
The ID of the table or file, if available.
- pathstring
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
- database_tabledict::
- schemastring
The database schema name.
- tablestring
The database table name.
- use_without_schemaboolean
This attribute is no longer available; defaults to false but cannot be used.
- filedict::
- idinteger
The file id.
- google_worksheetdict::
- spreadsheetstring
The spreadsheet document name.
- spreadsheet_idstring
The spreadsheet document id.
- worksheetstring
The worksheet tab name.
- worksheet_idinteger
The worksheet tab id.
- salesforcedict::
- object_namestring
The Salesforce object name.
- destinationdict::
- pathstring
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_tabledict::
- schemastring
The database schema name.
- tablestring
The database table name.
- use_without_schemaboolean
This attribute is no longer available; defaults to false but cannot be used.
- google_worksheetdict::
- spreadsheetstring
The spreadsheet document name.
- spreadsheet_idstring
The spreadsheet document id.
- worksheetstring
The worksheet tab name.
- worksheet_idinteger
The worksheet tab id.
- advanced_optionsdict::
max_errors : integer
existing_table_rows : string
diststyle : string
distkey : string
sortkey1 : string
sortkey2 : string
column_delimiter : string
- column_overridesdict
Hash used for overriding auto-detected names and types, with keys being the index of the column being overridden.
- escapedboolean
If true, escape quotes with a backslash; otherwise, escape quotes by double-quoting. Defaults to false.
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_namestring
This parameter is deprecated
- partition_schema_namestring
This parameter is deprecated
- partition_table_namestring
This parameter is deprecated
- partition_table_partition_column_min_namestring
This parameter is deprecated
- partition_table_partition_column_max_namestring
This parameter is deprecated
last_modified_column : string
- mysql_catalog_matches_schemaboolean
This attribute is no longer available; defaults to true but cannot be used.
- chunking_methodstring
This parameter is deprecated
first_row_is_header : boolean
- export_actionstring
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. Default is set to “newsprsht”
- sql_querystring
If you are doing a Google Sheet export, this is your SQL query.
contact_lists : string
soql_query : string
include_deleted_records : boolean
- put_transfer(id, user_id, include_dependencies, *, email_body='DEFAULT', send_email='DEFAULT')¶
Transfer ownership of this object to another user
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger
ID of target user
- include_dependenciesboolean
Whether or not to give manage permissions on all dependencies
- email_bodystring, optional
Custom body text for e-mail sent on transfer.
- send_emailboolean, optional
Send email to the target user of the transfer?
- Returns
civis.response.Response
- dependencieslist::
Dependent objects for this object - object_type : string
Dependent object type
- fco_typestring
Human readable dependent object type
- idinteger
Dependent object ID
- namestring
Dependent object name, or nil if the requesting user cannot read this object
- permission_levelstring
Permission level of target user (not user’s groups) for dependent object, or null if no target user
- sharedboolean
Whether dependent object was successfully shared with target user
Jobs¶
- class Jobs(session_kwargs, client, return_type='civis')¶
Examples
>>> import civis >>> client = civis.APIClient() >>> client.jobs.list(...)
Methods
delete_projects
(id, project_id)Remove a Job from a project
delete_runs
(id, run_id)Cancel a run
delete_shares_groups
(id, group_id)Revoke the permissions a group has on this object
delete_shares_users
(id, user_id)Revoke the permissions a user has on this object
get
(id)Show basic job info
get_runs
(id, run_id)Check status of a job
list
(*[, state, type, q, permission, ...])List Jobs
list_children
(id)Show nested tree of children that this job triggers
list_dependencies
(id, *[, user_id])List dependent objects for this object
list_parents
(id)Show chain of parents as a list that this job triggers from
list_projects
(id, *[, hidden])List the projects a Job belongs to
list_runs
(id, *[, limit, page_num, order, ...])List runs for the given job
list_runs_logs
(id, run_id, *[, last_id, limit])Get the logs for a run
list_runs_outputs
(id, run_id, *[, limit, ...])List the outputs for a run
list_shares
(id)List users and groups permissioned on this object
list_workflows
(id, *[, archived])List the workflows a job belongs to
post_runs
(id)Run a job
Generate and retrieve trigger email address
put_archive
(id, status)Update the archive status of this object
put_projects
(id, project_id)Add a Job to a project
put_shares_groups
(id, group_ids, ...[, ...])Set the permissions groups has on this object
put_shares_users
(id, user_ids, ...[, ...])Set the permissions users have on this object
put_transfer
(id, user_id, ...[, email_body, ...])Transfer ownership of this object to another user
- delete_projects(id, project_id)¶
Remove a Job from a project
- Parameters
- idinteger
The ID of the Job.
- project_idinteger
The ID of the project.
- Returns
- None
Response code 204: success
- delete_runs(id, run_id)¶
Cancel a run
- Parameters
- idinteger
The ID of the Job.
- run_idinteger
The ID of the Run.
- Returns
- None
Response code 202: success
Revoke the permissions a group has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- group_idinteger
The ID of the group.
- Returns
- None
Response code 204: success
Revoke the permissions a user has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger
The ID of the user.
- Returns
- None
Response code 204: success
- get(id)¶
Show basic job info
- Parameters
- idinteger
The ID for this job.
- Returns
civis.response.Response
id : integer
name : string
type : string
from_template_id : integer
- statestring
Whether the job is idle, queued, running, cancelled, or failed.
created_at : string/date-time
updated_at : string/date-time
- runslist::
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_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- hiddenboolean
The hidden status of the item.
- archivedstring
The archival status of the requested item(s).
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
success_email_subject : string
success_email_body : string
running_as_user : string
run_by_user : string
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- get_runs(id, run_id)¶
Check status of a job
- Parameters
- idinteger
The ID of the Job.
- run_idinteger
The ID of the Run.
- Returns
civis.response.Response
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- list(*, state='DEFAULT', type='DEFAULT', q='DEFAULT', permission='DEFAULT', scheduled='DEFAULT', hidden='DEFAULT', archived='DEFAULT', author='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶
List Jobs
- Parameters
- statestring, 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”).
- typestring, optional
The job’s type. Specify multiple values as a comma-separated list (e.g., “A,B”).
- qstring, optional
Query string to search on the id, name, and job type.
- permissionstring, optional
A permissions string, one of “read”, “write”, or “manage”. Lists only jobs for which the current user has that permission.
- scheduledboolean, optional
If the item is scheduled.
- hiddenboolean, optional
If specified to be true, returns hidden items. Defaults to false, returning non-hidden items.
- archivedstring, optional
The archival status of the requested item(s).
- authorstring, optional
If specified, return items from any of these authors. It accepts a comma- separated list of user IDs.
- limitinteger, optional
Number of results to return. Defaults to its maximum of 50.
- page_numinteger, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstring, optional
The field on which to order the result set. Defaults to updated_at. Must be one of: updated_at.
- order_dirstring, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iteratorbool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
- Returns
civis.response.PaginatedResponse
id : integer
name : string
type : string
from_template_id : integer
- statestring
Whether the job is idle, queued, running, cancelled, or failed.
created_at : string/date-time
updated_at : string/date-time
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- archivedstring
The archival status of the requested item(s).
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- list_children(id)¶
Show nested tree of children that this job triggers
- Parameters
- idinteger
The ID for this job.
- Returns
civis.response.Response
id : integer
name : string
type : string
from_template_id : integer
state : string
created_at : string/date-time
updated_at : string/date-time
- runslist::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
children : list
- list_dependencies(id, *, user_id='DEFAULT')¶
List dependent objects for this object
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger, optional
ID of target user
- Returns
civis.response.Response
- object_typestring
Dependent object type
- fco_typestring
Human readable dependent object type
- idinteger
Dependent object ID
- namestring
Dependent object name, or nil if the requesting user cannot read this object
- permission_levelstring
Permission level of target user (not user’s groups) for dependent object, or null if no target user
- shareableboolean
Whether or not the requesting user can share this object.
- list_parents(id)¶
Show chain of parents as a list that this job triggers from
- Parameters
- idinteger
The ID for this job.
- Returns
civis.response.Response
id : integer
name : string
type : string
from_template_id : integer
- statestring
Whether the job is idle, queued, running, cancelled, or failed.
created_at : string/date-time
updated_at : string/date-time
- runslist::
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_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- hiddenboolean
The hidden status of the item.
- archivedstring
The archival status of the requested item(s).
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
success_email_subject : string
success_email_body : string
running_as_user : string
run_by_user : string
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- list_projects(id, *, hidden='DEFAULT')¶
List the projects a Job belongs to
- Parameters
- idinteger
The ID of the Job.
- hiddenboolean, optional
If specified to be true, returns hidden items. Defaults to false, returning non-hidden items.
- Returns
civis.response.Response
- idinteger
The ID for this project.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- namestring
The name of this project.
- descriptionstring
A description of the project.
- userslist::
Users who can see the project. - id : integer
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
auto_share : boolean
created_at : string/time
updated_at : string/time
- archivedstring
The archival status of the requested item(s).
- list_runs(id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶
List runs for the given job
- Parameters
- idinteger
The ID for this job.
- limitinteger, optional
Number of results to return. Defaults to 20. Maximum allowed is 100.
- page_numinteger, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstring, optional
The field on which to order the result set. Defaults to id. Must be one of: id.
- order_dirstring, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iteratorbool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
- Returns
civis.response.PaginatedResponse
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
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
- idinteger
The ID of the job.
- run_idinteger
The ID of the run.
- last_idinteger, 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.
- limitinteger, optional
The maximum number of log messages to return. Default of 10000.
- Returns
civis.response.Response
- idinteger
The ID of the log.
- created_atstring/date-time
The time the log was created.
- messagestring
The log message.
- levelstring
The level of the log. One of unknown,fatal,error,warn,info,debug.
- list_runs_outputs(id, run_id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶
List the outputs for a run
- Parameters
- idinteger
The ID of the job.
- run_idinteger
The ID of the run.
- limitinteger, optional
Number of results to return. Defaults to its maximum of 50.
- page_numinteger, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstring, optional
The field on which to order the result set. Defaults to created_at. Must be one of: created_at, id.
- order_dirstring, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iteratorbool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
- Returns
civis.response.PaginatedResponse
- object_typestring
The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue
- object_idinteger
The ID of the output.
- namestring
The name of the output.
- linkstring
The hypermedia link to the output.
value : string
List users and groups permissioned on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
- list_workflows(id, *, archived='DEFAULT')¶
List the workflows a job belongs to
- Parameters
- idinteger
- archivedstring, optional
The archival status of the requested item(s).
- Returns
civis.response.Response
- idinteger
The ID for this workflow.
- namestring
The name of this workflow.
- descriptionstring
A description of the workflow.
- validboolean
The validity of the workflow definition.
- file_idstring
The file id for the s3 file containing the workflow configuration.
- userdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- statestring
The state of the workflow. State is “running” if any execution is running, otherwise reflects most recent execution state.
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- allow_concurrent_executionsboolean
Whether the workflow can execute when already running.
- time_zonestring
The time zone of this workflow.
- next_execution_atstring/time
The time of the next scheduled execution.
- archivedstring
The archival status of the requested item(s).
created_at : string/time
updated_at : string/time
- post_runs(id)¶
Run a job
- Parameters
- idinteger
The ID for this job.
- Returns
civis.response.Response
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- post_trigger_email(id)¶
Generate and retrieve trigger email address
- Parameters
- idinteger
The ID for this job.
- Returns
civis.response.Response
- trigger_emailstring
Email address which may be used to trigger this job to run.
- put_archive(id, status)¶
Update the archive status of this object
- Parameters
- idinteger
The ID of the object.
- statusboolean
The desired archived status of the object.
- Returns
civis.response.Response
id : integer
name : string
type : string
from_template_id : integer
- statestring
Whether the job is idle, queued, running, cancelled, or failed.
created_at : string/date-time
updated_at : string/date-time
- runslist::
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_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- hiddenboolean
The hidden status of the item.
- archivedstring
The archival status of the requested item(s).
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
success_email_subject : string
success_email_body : string
running_as_user : string
run_by_user : string
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- put_projects(id, project_id)¶
Add a Job to a project
- Parameters
- idinteger
The ID of the Job.
- project_idinteger
The ID of the project.
- Returns
- None
Response code 204: success
Set the permissions groups has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- group_idslist
An array of one or more group IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
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
- idinteger
The ID of the resource that is shared.
- user_idslist
An array of one or more user IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
- put_transfer(id, user_id, include_dependencies, *, email_body='DEFAULT', send_email='DEFAULT')¶
Transfer ownership of this object to another user
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger
ID of target user
- include_dependenciesboolean
Whether or not to give manage permissions on all dependencies
- email_bodystring, optional
Custom body text for e-mail sent on transfer.
- send_emailboolean, optional
Send email to the target user of the transfer?
- Returns
civis.response.Response
- dependencieslist::
Dependent objects for this object - object_type : string
Dependent object type
- fco_typestring
Human readable dependent object type
- idinteger
Dependent object ID
- namestring
Dependent object name, or nil if the requesting user cannot read this object
- permission_levelstring
Permission level of target user (not user’s groups) for dependent object, or null if no target user
- sharedboolean
Whether dependent object was successfully shared with target user
Json_Values¶
- class Json_Values(session_kwargs, client, return_type='civis')¶
Examples
>>> import civis >>> client = civis.APIClient() >>> client.json_values.post(...)
Methods
delete_shares_groups
(id, group_id)Revoke the permissions a group has on this object
delete_shares_users
(id, user_id)Revoke the permissions a user has on this object
get
(id)Get details about a JSON Value
list_dependencies
(id, *[, user_id])List dependent objects for this object
list_shares
(id)List users and groups permissioned on this object
patch
(id, *[, name, value_str])Update some attributes of this JSON Value
post
(value_str, *[, name])Create a JSON Value
put_shares_groups
(id, group_ids, ...[, ...])Set the permissions groups has on this object
put_shares_users
(id, user_ids, ...[, ...])Set the permissions users have on this object
put_transfer
(id, user_id, ...[, email_body, ...])Transfer ownership of this object to another user
Revoke the permissions a group has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- group_idinteger
The ID of the group.
- Returns
- None
Response code 204: success
Revoke the permissions a user has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger
The ID of the user.
- Returns
- None
Response code 204: success
- get(id)¶
Get details about a JSON Value
- Parameters
- idinteger
The ID of the JSON Value.
- Returns
civis.response.Response
- idinteger
The ID of the JSON Value.
- namestring
The name of the JSON Value.
- valuestring
The deserialized JSON value.
- list_dependencies(id, *, user_id='DEFAULT')¶
List dependent objects for this object
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger, optional
ID of target user
- Returns
civis.response.Response
- object_typestring
Dependent object type
- fco_typestring
Human readable dependent object type
- idinteger
Dependent object ID
- namestring
Dependent object name, or nil if the requesting user cannot read this object
- permission_levelstring
Permission level of target user (not user’s groups) for dependent object, or null if no target user
- shareableboolean
Whether or not the requesting user can share this object.
List users and groups permissioned on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
- patch(id, *, name='DEFAULT', value_str='DEFAULT')¶
Update some attributes of this JSON Value
- Parameters
- idinteger
The ID of the JSON Value.
- namestring, optional
The name of the JSON Value.
- value_strstring, optional
The JSON value to store. Should be a serialized JSON string. Limited to 1000000 bytes.
- Returns
civis.response.Response
- idinteger
The ID of the JSON Value.
- namestring
The name of the JSON Value.
- valuestring
The deserialized JSON value.
- post(value_str, *, name='DEFAULT')¶
Create a JSON Value
- Parameters
- value_strstring
The JSON value to store. Should be a serialized JSON string. Limited to 1000000 bytes.
- namestring, optional
The name of the JSON Value.
- Returns
civis.response.Response
- idinteger
The ID of the JSON Value.
- namestring
The name of the JSON Value.
- valuestring
The deserialized JSON value.
Set the permissions groups has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- group_idslist
An array of one or more group IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
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
- idinteger
The ID of the resource that is shared.
- user_idslist
An array of one or more user IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
- put_transfer(id, user_id, include_dependencies, *, email_body='DEFAULT', send_email='DEFAULT')¶
Transfer ownership of this object to another user
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger
ID of target user
- include_dependenciesboolean
Whether or not to give manage permissions on all dependencies
- email_bodystring, optional
Custom body text for e-mail sent on transfer.
- send_emailboolean, optional
Send email to the target user of the transfer?
- Returns
civis.response.Response
- dependencieslist::
Dependent objects for this object - object_type : string
Dependent object type
- fco_typestring
Human readable dependent object type
- idinteger
Dependent object ID
- namestring
Dependent object name, or nil if the requesting user cannot read this object
- permission_levelstring
Permission level of target user (not user’s groups) for dependent object, or null if no target user
- sharedboolean
Whether dependent object was successfully shared with target user
Match_Targets¶
- class Match_Targets(session_kwargs, client, return_type='civis')¶
Examples
>>> import civis >>> client = civis.APIClient() >>> client.match_targets.list_shares(...)
Methods
delete_shares_groups
(id, group_id)Revoke the permissions a group has on this object
delete_shares_users
(id, user_id)Revoke the permissions a user has on this object
get
(id)Show Match Target info
list
()List match targets
list_shares
(id)List users and groups permissioned on this object
patch
(id, *[, name, target_file_name, archived])Update a match target
post
(name, *[, target_file_name, archived])Create a new match target
put_archive
(id, status)Update the archive status of this object
put_shares_groups
(id, group_ids, ...[, ...])Set the permissions groups has on this object
put_shares_users
(id, user_ids, ...[, ...])Set the permissions users have on this object
Revoke the permissions a group has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- group_idinteger
The ID of the group.
- Returns
- None
Response code 204: success
Revoke the permissions a user has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger
The ID of the user.
- Returns
- None
Response code 204: success
- get(id)¶
Show Match Target info
- Parameters
- idinteger
The ID of the match target
- Returns
civis.response.Response
- idinteger
The ID of the match target
- namestring
The name of the match target
- target_file_namestring
The name of the target file
created_at : string/time
updated_at : string/time
- archivedboolean
Whether the match target has been archived.
- list()¶
List match targets
- Returns
civis.response.Response
- idinteger
The ID of the match target
- namestring
The name of the match target
- target_file_namestring
The name of the target file
created_at : string/time
updated_at : string/time
- archivedboolean
Whether the match target has been archived.
List users and groups permissioned on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
- patch(id, *, name='DEFAULT', target_file_name='DEFAULT', archived='DEFAULT')¶
Update a match target
- Parameters
- idinteger
The ID of the match target
- namestring, optional
The name of the match target
- target_file_namestring, optional
The name of the target file
- archivedboolean, optional
Whether the match target has been archived.
- Returns
civis.response.Response
- idinteger
The ID of the match target
- namestring
The name of the match target
- target_file_namestring
The name of the target file
created_at : string/time
updated_at : string/time
- archivedboolean
Whether the match target has been archived.
- post(name, *, target_file_name='DEFAULT', archived='DEFAULT')¶
Create a new match target
- Parameters
- namestring
The name of the match target
- target_file_namestring, optional
The name of the target file
- archivedboolean, optional
Whether the match target has been archived.
- Returns
civis.response.Response
- idinteger
The ID of the match target
- namestring
The name of the match target
- target_file_namestring
The name of the target file
created_at : string/time
updated_at : string/time
- archivedboolean
Whether the match target has been archived.
- put_archive(id, status)¶
Update the archive status of this object
- Parameters
- idinteger
The ID of the object.
- statusboolean
The desired archived status of the object.
- Returns
civis.response.Response
- idinteger
The ID of the match target
- namestring
The name of the match target
- target_file_namestring
The name of the target file
created_at : string/time
updated_at : string/time
- archivedboolean
Whether the match target has been archived.
Set the permissions groups has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- group_idslist
An array of one or more group IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
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
- idinteger
The ID of the resource that is shared.
- user_idslist
An array of one or more user IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
Media¶
- class Media(session_kwargs, client, return_type='civis')¶
Examples
>>> import civis >>> client = civis.APIClient() >>> client.media.list_spot_orders_shares(...)
Methods
delete_optimizations_runs
(id, run_id)Cancel a run
delete_optimizations_shares_groups
(id, group_id)Revoke the permissions a group has on this object
delete_optimizations_shares_users
(id, user_id)Revoke the permissions a user has on this object
delete_ratecards_shares_groups
(id, group_id)Revoke the permissions a group has on this object
delete_ratecards_shares_users
(id, user_id)Revoke the permissions a user has on this object
delete_spot_orders_shares_groups
(id, group_id)Revoke the permissions a group has on this object
delete_spot_orders_shares_users
(id, user_id)Revoke the permissions a user has on this object
Show a single optimization
get_optimizations_runs
(id, run_id)Check status of a run
get_ratecards
(id)Get a Ratecard
get_spot_orders
(id)Show a single spot order
list_dmas
(*[, name, number])List all Designated Market Areas
list_optimizations
(*[, archived, limit, ...])List all optimizations
list_optimizations_runs
(id, *[, limit, ...])List runs for the given optimization
list_optimizations_runs_logs
(id, run_id, *)Get the logs for a run
List users and groups permissioned on this object
list_ratecards
(*[, archived, filename, ...])List all ratecards
List users and groups permissioned on this object
list_spot_orders
(*[, id, archived])List all spot orders
List users and groups permissioned on this object
list_targets
(*[, name, identifier, data_source])List all Media Targets
patch_optimizations
(id, *[, name, runs, ...])Edit an existing optimization
patch_ratecards
(id, *[, filename, start_on, ...])Update some attributes of this Ratecard
post_optimizations
(runs, *[, name, ...])Create a new optimization
Clone an existing optimization
Start a run
post_ratecards
(filename, start_on, end_on, ...)Create a Ratecard
post_spot_orders
(*[, body])Create a spot order
put_optimizations_archive
(id, status)Update the archive status of this object
put_optimizations_shares_groups
(id, ...[, ...])Set the permissions groups has on this object
put_optimizations_shares_users
(id, user_ids, ...)Set the permissions users have on this object
put_ratecards
(id, filename, start_on, ...)Replace all attributes of this Ratecard
put_ratecards_archive
(id, status)Update the archive status of this object
put_ratecards_shares_groups
(id, group_ids, ...)Set the permissions groups has on this object
put_ratecards_shares_users
(id, user_ids, ...)Set the permissions users have on this object
put_spot_orders
(id, *[, body])Edit the specified spot order
put_spot_orders_archive
(id, status)Update the archive status of this object
put_spot_orders_shares_groups
(id, group_ids, ...)Set the permissions groups has on this object
put_spot_orders_shares_users
(id, user_ids, ...)Set the permissions users have on this object
- delete_optimizations_runs(id, run_id)¶
Cancel a run
- Parameters
- idinteger
The ID of the optimization.
- run_idinteger
The ID of the run.
- Returns
- None
Response code 202: success
Revoke the permissions a group has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- group_idinteger
The ID of the group.
- Returns
- None
Response code 204: success
Revoke the permissions a user has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger
The ID of the user.
- Returns
- None
Response code 204: success
Revoke the permissions a group has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- group_idinteger
The ID of the group.
- Returns
- None
Response code 204: success
Revoke the permissions a user has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger
The ID of the user.
- Returns
- None
Response code 204: success
Revoke the permissions a group has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- group_idinteger
The ID of the group.
- Returns
- None
Response code 204: success
Revoke the permissions a user has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger
The ID of the user.
- Returns
- None
Response code 204: success
- get_optimizations(id)¶
Show a single optimization
- Parameters
- idinteger
The optimization ID.
- Returns
civis.response.Response
- idinteger
The optimization ID.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- namestring
The name of the optimization.
created_at : string/time
updated_at : string/time
- finished_atstring/date-time
The end time of the last run.
- statestring
The state of the last run.
- last_run_idinteger
The ID of the last run.
- spot_order_idinteger
The ID for the spot order produced by the optimization.
- archivedstring
The archival status of the requested item(s).
- report_linkstring
A link to the visual report for the optimization.
- spot_order_linkstring
A link to the json version of the spot order.
- file_linkslist
Links to the csv and xml versions of the spot order.
- runslist::
The runs of the optimization. - market_id : integer
The market ID.
- start_datestring/date
The start date for the media run.
- end_datestring/date
The end date for the media run.
- force_cpmboolean
Whether to force optimization to use CPM data even if partition data is available.
- reach_alphanumber/float
A tuning parameter used to adjust RF.
- syscodeslist
The syscodes for the media run.
- rate_cardslist
The ratecards for the media run.
- constraintslist::
The constraints for the media run. - targets : list
The targets to constrain.
- budgetnumber/float
The maximum budget for these targets.
- frequencynumber/float
The maximum frequency for these targets.
- programslist
An array of programs that the Civis Media Optimizer either exclude or limit to.An error will be thrown if exclude_programs is not also set.
- networkslist
An array of networks that the Civis Media Optimizer either exclude or limit to.An error will be thrown if exclude_networks is not also set.
- exclude_programsboolean
If Civis Media Optimizer should exclude the programs in the programs parameter.If this value is set to false, it will make the optimization limit itself to the programs supplied through the programs parameter.An error will be thrown if programs is not also set.
- exclude_networksboolean
If Civis Media Optimizer should exclude the networks in the networks parameter.If this value is set to false, it will make the optimization limit itself to the networks supplied through the networks.An error will be thrown if networks is not also set.
- time_slot_percentagesdict
The maximum amount of the budget spent on that particular day of the week, daypart, or specific time slot for broadcast and cable.
- get_optimizations_runs(id, run_id)¶
Check status of a run
- Parameters
- idinteger
The ID of the optimization.
- run_idinteger
The ID of the run.
- Returns
civis.response.Response
- idinteger
The ID of the run.
- optimization_idinteger
The ID of the optimization.
- statestring
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- is_cancel_requestedboolean
True if run cancel requested, else false.
- started_atstring/time
The time the last run started at.
- finished_atstring/time
The time the last run completed.
- errorstring
The error, if any, returned by the run.
- get_ratecards(id)¶
Get a Ratecard
- Parameters
- idinteger
- Returns
civis.response.Response
- idinteger
The ratecard ID.
- filenamestring
Name of the ratecard file.
- start_onstring/date
First day to which the ratecard applies.
- end_onstring/date
Last day to which the ratecard applies.
- dma_numberinteger
Number of the DMA associated with the ratecard.
- archivedstring
The archival status of the requested item(s).
- get_spot_orders(id)¶
Show a single spot order
- Parameters
- idinteger
The ID for the spot order.
- Returns
civis.response.Response
- idinteger
The ID for the spot order.
- archivedstring
The archival status of the requested item(s).
- csv_s3_uristring
S3 URI for the spot order CSV file.
- json_s3_uristring
S3 URI for the spot order JSON file.
- xml_archive_s3_uristring
S3 URI for the spot order XML archive.
- last_transform_job_idinteger
ID of the spot order transformation job.
- list_dmas(*, name='DEFAULT', number='DEFAULT')¶
List all Designated Market Areas
- Parameters
- namestring, 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”).
- numberinteger, optional
If specified, will be used to filter the DMAS by number.
- Returns
civis.response.Response
- namestring
Name for the DMA region.
- numberinteger
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
- archivedstring, optional
The archival status of the requested item(s).
- limitinteger, optional
Number of results to return. Defaults to 20. Maximum allowed is 50.
- page_numinteger, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstring, optional
The field on which to order the result set. Defaults to created_at. Must be one of: created_at, author, name.
- order_dirstring, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iteratorbool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
- Returns
civis.response.PaginatedResponse
- idinteger
The optimization ID.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- namestring
The name of the optimization.
created_at : string/time
updated_at : string/time
- finished_atstring/date-time
The end time of the last run.
- statestring
The state of the last run.
- last_run_idinteger
The ID of the last run.
- spot_order_idinteger
The ID for the spot order produced by the optimization.
- archivedstring
The archival status of the requested item(s).
- list_optimizations_runs(id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶
List runs for the given optimization
- Parameters
- idinteger
The ID of the optimization.
- limitinteger, optional
Number of results to return. Defaults to 20. Maximum allowed is 100.
- page_numinteger, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstring, optional
The field on which to order the result set. Defaults to id. Must be one of: id.
- order_dirstring, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iteratorbool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
- Returns
civis.response.PaginatedResponse
- idinteger
The ID of the run.
- optimization_idinteger
The ID of the optimization.
- statestring
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- is_cancel_requestedboolean
True if run cancel requested, else false.
- started_atstring/time
The time the last run started at.
- finished_atstring/time
The time the last run completed.
- errorstring
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
- idinteger
The ID of the optimization.
- run_idinteger
The ID of the run.
- last_idinteger, 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.
- limitinteger, optional
The maximum number of log messages to return. Default of 10000.
- Returns
civis.response.Response
- idinteger
The ID of the log.
- created_atstring/date-time
The time the log was created.
- messagestring
The log message.
- levelstring
The level of the log. One of unknown,fatal,error,warn,info,debug.
List users and groups permissioned on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
- list_ratecards(*, archived='DEFAULT', filename='DEFAULT', dma_number='DEFAULT')¶
List all ratecards
- Parameters
- archivedstring, optional
The archival status of the requested item(s).
- filenamestring, 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_numberinteger, optional
If specified, will be used to filter the ratecards by DMA.
- Returns
civis.response.Response
- idinteger
The ratecard ID.
- filenamestring
Name of the ratecard file.
- start_onstring/date
First day to which the ratecard applies.
- end_onstring/date
Last day to which the ratecard applies.
- dma_numberinteger
Number of the DMA associated with the ratecard.
- archivedstring
The archival status of the requested item(s).
List users and groups permissioned on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
- list_spot_orders(*, id='DEFAULT', archived='DEFAULT')¶
List all spot orders
- Parameters
- idinteger, optional
The ID for the spot order.
- archivedstring, optional
The archival status of the requested item(s).
- Returns
civis.response.Response
- idinteger
The ID for the spot order.
- archivedstring
The archival status of the requested item(s).
List users and groups permissioned on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
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
- namestring, optional
The name of the target.
- identifierstring, optional
A unique identifier for this target.
- data_sourcestring, optional
The source of viewership data for this target.
- Returns
civis.response.Response
- namestring
The name of the target.
- identifierstring
A unique identifier for this target.
- data_sourcestring
The source of viewership data for this target.
- patch_optimizations(id, *, name='DEFAULT', runs='DEFAULT', programs='DEFAULT', networks='DEFAULT', exclude_programs='DEFAULT', exclude_networks='DEFAULT', time_slot_percentages='DEFAULT')¶
Edit an existing optimization
- Parameters
- idinteger
The optimization ID.
- namestring, optional
The name of the optimization.
- runslist, optional::
The runs of the optimization. - market_id : integer
The market ID.
- start_datestring/date
The start date for the media run.
- end_datestring/date
The end date for the media run.
- force_cpmboolean
Whether to force optimization to use CPM data even if partition data is available.
- reach_alphanumber/float
A tuning parameter used to adjust RF.
- syscodeslist
The syscodes for the media run.
- rate_cardslist
The ratecards for the media run.
- constraintslist::
The constraints for the media run. - targets : list
The targets to constrain.
- budgetnumber/float
The maximum budget for these targets.
- frequencynumber/float
The maximum frequency for these targets.
- programslist, optional
An array of programs that the Civis Media Optimizer either exclude or limit to.An error will be thrown if exclude_programs is not also set.
- networkslist, optional
An array of networks that the Civis Media Optimizer either exclude or limit to.An error will be thrown if exclude_networks is not also set.
- exclude_programsboolean, optional
If Civis Media Optimizer should exclude the programs in the programs parameter.If this value is set to false, it will make the optimization limit itself to the programs supplied through the programs parameter.An error will be thrown if programs is not also set.
- exclude_networksboolean, optional
If Civis Media Optimizer should exclude the networks in the networks parameter.If this value is set to false, it will make the optimization limit itself to the networks supplied through the networks.An error will be thrown if networks is not also set.
- time_slot_percentagesdict, optional
The maximum amount of the budget spent on that particular day of the week, daypart, or specific time slot for broadcast and cable.
- Returns
civis.response.Response
- idinteger
The optimization ID.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- namestring
The name of the optimization.
created_at : string/time
updated_at : string/time
- finished_atstring/date-time
The end time of the last run.
- statestring
The state of the last run.
- last_run_idinteger
The ID of the last run.
- spot_order_idinteger
The ID for the spot order produced by the optimization.
- archivedstring
The archival status of the requested item(s).
- report_linkstring
A link to the visual report for the optimization.
- spot_order_linkstring
A link to the json version of the spot order.
- file_linkslist
Links to the csv and xml versions of the spot order.
- runslist::
The runs of the optimization. - market_id : integer
The market ID.
- start_datestring/date
The start date for the media run.
- end_datestring/date
The end date for the media run.
- force_cpmboolean
Whether to force optimization to use CPM data even if partition data is available.
- reach_alphanumber/float
A tuning parameter used to adjust RF.
- syscodeslist
The syscodes for the media run.
- rate_cardslist
The ratecards for the media run.
- constraintslist::
The constraints for the media run. - targets : list
The targets to constrain.
- budgetnumber/float
The maximum budget for these targets.
- frequencynumber/float
The maximum frequency for these targets.
- programslist
An array of programs that the Civis Media Optimizer either exclude or limit to.An error will be thrown if exclude_programs is not also set.
- networkslist
An array of networks that the Civis Media Optimizer either exclude or limit to.An error will be thrown if exclude_networks is not also set.
- exclude_programsboolean
If Civis Media Optimizer should exclude the programs in the programs parameter.If this value is set to false, it will make the optimization limit itself to the programs supplied through the programs parameter.An error will be thrown if programs is not also set.
- exclude_networksboolean
If Civis Media Optimizer should exclude the networks in the networks parameter.If this value is set to false, it will make the optimization limit itself to the networks supplied through the networks.An error will be thrown if networks is not also set.
- time_slot_percentagesdict
The maximum amount of the budget spent on that particular day of the week, daypart, or specific time slot for broadcast and cable.
- patch_ratecards(id, *, filename='DEFAULT', start_on='DEFAULT', end_on='DEFAULT', dma_number='DEFAULT')¶
Update some attributes of this Ratecard
- Parameters
- idinteger
The ratecard ID.
- filenamestring, optional
Name of the ratecard file.
- start_onstring/date, optional
First day to which the ratecard applies.
- end_onstring/date, optional
Last day to which the ratecard applies.
- dma_numberinteger, optional
Number of the DMA associated with the ratecard.
- Returns
civis.response.Response
- idinteger
The ratecard ID.
- filenamestring
Name of the ratecard file.
- start_onstring/date
First day to which the ratecard applies.
- end_onstring/date
Last day to which the ratecard applies.
- dma_numberinteger
Number of the DMA associated with the ratecard.
- archivedstring
The archival status of the requested item(s).
- post_optimizations(runs, *, name='DEFAULT', programs='DEFAULT', networks='DEFAULT', exclude_programs='DEFAULT', exclude_networks='DEFAULT', time_slot_percentages='DEFAULT')¶
Create a new optimization
- Parameters
- runslist::
The runs of the optimization. - market_id : integer
The market ID.
- start_datestring/date
The start date for the media run.
- end_datestring/date
The end date for the media run.
- force_cpmboolean
Whether to force optimization to use CPM data even if partition data is available.
- reach_alphanumber/float
A tuning parameter used to adjust RF.
- syscodeslist
The syscodes for the media run.
- rate_cardslist
The ratecards for the media run.
- constraintslist::
The constraints for the media run. - targets : list
The targets to constrain.
- budgetnumber/float
The maximum budget for these targets.
- frequencynumber/float
The maximum frequency for these targets.
- namestring, optional
The name of the optimization.
- programslist, optional
An array of programs that the Civis Media Optimizer either exclude or limit to.An error will be thrown if exclude_programs is not also set.
- networkslist, optional
An array of networks that the Civis Media Optimizer either exclude or limit to.An error will be thrown if exclude_networks is not also set.
- exclude_programsboolean, optional
If Civis Media Optimizer should exclude the programs in the programs parameter.If this value is set to false, it will make the optimization limit itself to the programs supplied through the programs parameter.An error will be thrown if programs is not also set.
- exclude_networksboolean, optional
If Civis Media Optimizer should exclude the networks in the networks parameter.If this value is set to false, it will make the optimization limit itself to the networks supplied through the networks.An error will be thrown if networks is not also set.
- time_slot_percentagesdict, optional
The maximum amount of the budget spent on that particular day of the week, daypart, or specific time slot for broadcast and cable.
- Returns
civis.response.Response
- idinteger
The optimization ID.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- namestring
The name of the optimization.
created_at : string/time
updated_at : string/time
- finished_atstring/date-time
The end time of the last run.
- statestring
The state of the last run.
- last_run_idinteger
The ID of the last run.
- spot_order_idinteger
The ID for the spot order produced by the optimization.
- archivedstring
The archival status of the requested item(s).
- report_linkstring
A link to the visual report for the optimization.
- spot_order_linkstring
A link to the json version of the spot order.
- file_linkslist
Links to the csv and xml versions of the spot order.
- runslist::
The runs of the optimization. - market_id : integer
The market ID.
- start_datestring/date
The start date for the media run.
- end_datestring/date
The end date for the media run.
- force_cpmboolean
Whether to force optimization to use CPM data even if partition data is available.
- reach_alphanumber/float
A tuning parameter used to adjust RF.
- syscodeslist
The syscodes for the media run.
- rate_cardslist
The ratecards for the media run.
- constraintslist::
The constraints for the media run. - targets : list
The targets to constrain.
- budgetnumber/float
The maximum budget for these targets.
- frequencynumber/float
The maximum frequency for these targets.
- programslist
An array of programs that the Civis Media Optimizer either exclude or limit to.An error will be thrown if exclude_programs is not also set.
- networkslist
An array of networks that the Civis Media Optimizer either exclude or limit to.An error will be thrown if exclude_networks is not also set.
- exclude_programsboolean
If Civis Media Optimizer should exclude the programs in the programs parameter.If this value is set to false, it will make the optimization limit itself to the programs supplied through the programs parameter.An error will be thrown if programs is not also set.
- exclude_networksboolean
If Civis Media Optimizer should exclude the networks in the networks parameter.If this value is set to false, it will make the optimization limit itself to the networks supplied through the networks.An error will be thrown if networks is not also set.
- time_slot_percentagesdict
The maximum amount of the budget spent on that particular day of the week, daypart, or specific time slot for broadcast and cable.
- post_optimizations_clone(id)¶
Clone an existing optimization
- Parameters
- idinteger
The optimization ID.
- Returns
civis.response.Response
- idinteger
The optimization ID.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- namestring
The name of the optimization.
created_at : string/time
updated_at : string/time
- finished_atstring/date-time
The end time of the last run.
- statestring
The state of the last run.
- last_run_idinteger
The ID of the last run.
- spot_order_idinteger
The ID for the spot order produced by the optimization.
- archivedstring
The archival status of the requested item(s).
- report_linkstring
A link to the visual report for the optimization.
- spot_order_linkstring
A link to the json version of the spot order.
- file_linkslist
Links to the csv and xml versions of the spot order.
- runslist::
The runs of the optimization. - market_id : integer
The market ID.
- start_datestring/date
The start date for the media run.
- end_datestring/date
The end date for the media run.
- force_cpmboolean
Whether to force optimization to use CPM data even if partition data is available.
- reach_alphanumber/float
A tuning parameter used to adjust RF.
- syscodeslist
The syscodes for the media run.
- rate_cardslist
The ratecards for the media run.
- constraintslist::
The constraints for the media run. - targets : list
The targets to constrain.
- budgetnumber/float
The maximum budget for these targets.
- frequencynumber/float
The maximum frequency for these targets.
- programslist
An array of programs that the Civis Media Optimizer either exclude or limit to.An error will be thrown if exclude_programs is not also set.
- networkslist
An array of networks that the Civis Media Optimizer either exclude or limit to.An error will be thrown if exclude_networks is not also set.
- exclude_programsboolean
If Civis Media Optimizer should exclude the programs in the programs parameter.If this value is set to false, it will make the optimization limit itself to the programs supplied through the programs parameter.An error will be thrown if programs is not also set.
- exclude_networksboolean
If Civis Media Optimizer should exclude the networks in the networks parameter.If this value is set to false, it will make the optimization limit itself to the networks supplied through the networks.An error will be thrown if networks is not also set.
- time_slot_percentagesdict
The maximum amount of the budget spent on that particular day of the week, daypart, or specific time slot for broadcast and cable.
- post_optimizations_runs(id)¶
Start a run
- Parameters
- idinteger
The ID of the optimization.
- Returns
civis.response.Response
- idinteger
The ID of the run.
- optimization_idinteger
The ID of the optimization.
- statestring
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- is_cancel_requestedboolean
True if run cancel requested, else false.
- started_atstring/time
The time the last run started at.
- finished_atstring/time
The time the last run completed.
- errorstring
The error, if any, returned by the run.
- post_ratecards(filename, start_on, end_on, dma_number)¶
Create a Ratecard
- Parameters
- filenamestring
Name of the ratecard file.
- start_onstring/date
First day to which the ratecard applies.
- end_onstring/date
Last day to which the ratecard applies.
- dma_numberinteger
Number of the DMA associated with the ratecard.
- Returns
civis.response.Response
- idinteger
The ratecard ID.
- filenamestring
Name of the ratecard file.
- start_onstring/date
First day to which the ratecard applies.
- end_onstring/date
Last day to which the ratecard applies.
- dma_numberinteger
Number of the DMA associated with the ratecard.
- archivedstring
The archival status of the requested item(s).
- post_spot_orders(*, body='DEFAULT')¶
Create a spot order
- Parameters
- bodystring, optional
CSV body of a spot order.
- Returns
civis.response.Response
- idinteger
The ID for the spot order.
- archivedstring
The archival status of the requested item(s).
- csv_s3_uristring
S3 URI for the spot order CSV file.
- json_s3_uristring
S3 URI for the spot order JSON file.
- xml_archive_s3_uristring
S3 URI for the spot order XML archive.
- last_transform_job_idinteger
ID of the spot order transformation job.
- put_optimizations_archive(id, status)¶
Update the archive status of this object
- Parameters
- idinteger
The ID of the object.
- statusboolean
The desired archived status of the object.
- Returns
civis.response.Response
- idinteger
The optimization ID.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- namestring
The name of the optimization.
created_at : string/time
updated_at : string/time
- finished_atstring/date-time
The end time of the last run.
- statestring
The state of the last run.
- last_run_idinteger
The ID of the last run.
- spot_order_idinteger
The ID for the spot order produced by the optimization.
- archivedstring
The archival status of the requested item(s).
- report_linkstring
A link to the visual report for the optimization.
- spot_order_linkstring
A link to the json version of the spot order.
- file_linkslist
Links to the csv and xml versions of the spot order.
- runslist::
The runs of the optimization. - market_id : integer
The market ID.
- start_datestring/date
The start date for the media run.
- end_datestring/date
The end date for the media run.
- force_cpmboolean
Whether to force optimization to use CPM data even if partition data is available.
- reach_alphanumber/float
A tuning parameter used to adjust RF.
- syscodeslist
The syscodes for the media run.
- rate_cardslist
The ratecards for the media run.
- constraintslist::
The constraints for the media run. - targets : list
The targets to constrain.
- budgetnumber/float
The maximum budget for these targets.
- frequencynumber/float
The maximum frequency for these targets.
- programslist
An array of programs that the Civis Media Optimizer either exclude or limit to.An error will be thrown if exclude_programs is not also set.
- networkslist
An array of networks that the Civis Media Optimizer either exclude or limit to.An error will be thrown if exclude_networks is not also set.
- exclude_programsboolean
If Civis Media Optimizer should exclude the programs in the programs parameter.If this value is set to false, it will make the optimization limit itself to the programs supplied through the programs parameter.An error will be thrown if programs is not also set.
- exclude_networksboolean
If Civis Media Optimizer should exclude the networks in the networks parameter.If this value is set to false, it will make the optimization limit itself to the networks supplied through the networks.An error will be thrown if networks is not also set.
- time_slot_percentagesdict
The maximum amount of the budget spent on that particular day of the week, daypart, or specific time slot for broadcast and cable.
Set the permissions groups has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- group_idslist
An array of one or more group IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
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
- idinteger
The ID of the resource that is shared.
- user_idslist
An array of one or more user IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
- put_ratecards(id, filename, start_on, end_on, dma_number)¶
Replace all attributes of this Ratecard
- Parameters
- idinteger
The ratecard ID.
- filenamestring
Name of the ratecard file.
- start_onstring/date
First day to which the ratecard applies.
- end_onstring/date
Last day to which the ratecard applies.
- dma_numberinteger
Number of the DMA associated with the ratecard.
- Returns
civis.response.Response
- idinteger
The ratecard ID.
- filenamestring
Name of the ratecard file.
- start_onstring/date
First day to which the ratecard applies.
- end_onstring/date
Last day to which the ratecard applies.
- dma_numberinteger
Number of the DMA associated with the ratecard.
- archivedstring
The archival status of the requested item(s).
- put_ratecards_archive(id, status)¶
Update the archive status of this object
- Parameters
- idinteger
The ID of the object.
- statusboolean
The desired archived status of the object.
- Returns
civis.response.Response
- idinteger
The ratecard ID.
- filenamestring
Name of the ratecard file.
- start_onstring/date
First day to which the ratecard applies.
- end_onstring/date
Last day to which the ratecard applies.
- dma_numberinteger
Number of the DMA associated with the ratecard.
- archivedstring
The archival status of the requested item(s).
Set the permissions groups has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- group_idslist
An array of one or more group IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
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
- idinteger
The ID of the resource that is shared.
- user_idslist
An array of one or more user IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
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
- idinteger
The ID for the spot order.
- bodystring, optional
CSV body of a spot order.
- Returns
civis.response.Response
- idinteger
The ID for the spot order.
- archivedstring
The archival status of the requested item(s).
- csv_s3_uristring
S3 URI for the spot order CSV file.
- json_s3_uristring
S3 URI for the spot order JSON file.
- xml_archive_s3_uristring
S3 URI for the spot order XML archive.
- last_transform_job_idinteger
ID of the spot order transformation job.
- put_spot_orders_archive(id, status)¶
Update the archive status of this object
- Parameters
- idinteger
The ID of the object.
- statusboolean
The desired archived status of the object.
- Returns
civis.response.Response
- idinteger
The ID for the spot order.
- archivedstring
The archival status of the requested item(s).
- csv_s3_uristring
S3 URI for the spot order CSV file.
- json_s3_uristring
S3 URI for the spot order JSON file.
- xml_archive_s3_uristring
S3 URI for the spot order XML archive.
- last_transform_job_idinteger
ID of the spot order transformation job.
Set the permissions groups has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- group_idslist
An array of one or more group IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
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
- idinteger
The ID of the resource that is shared.
- user_idslist
An array of one or more user IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
Models¶
- class Models(session_kwargs, client, return_type='civis')¶
Examples
>>> import civis >>> client = civis.APIClient() >>> client.models.list_types(...)
Methods
delete_builds
(id, build_id)Cancel a build
delete_projects
(id, project_id)Remove a Model from a project
delete_shares_groups
(id, group_id)Revoke the permissions a group has on this object
delete_shares_users
(id, user_id)Revoke the permissions a user has on this object
get
(id)Retrieve model configuration
get_builds
(id, build_id)Check status of a build
list
(*[, model_name, training_table_name, ...])List
list_builds
(id, *[, limit, page_num, order, ...])List builds for the given model
list_builds_logs
(id, build_id, *[, last_id, ...])Get the logs for a build
list_dependencies
(id, *[, user_id])List dependent objects for this object
list_projects
(id, *[, hidden])List the projects a Model belongs to
list_schedules
(id)Show the model build schedule
list_shares
(id)List users and groups permissioned on this object
List all available model types
put_archive
(id, status)Update the archive status of this object
put_projects
(id, project_id)Add a Model to a project
put_shares_groups
(id, group_ids, ...[, ...])Set the permissions groups has on this object
put_shares_users
(id, user_ids, ...[, ...])Set the permissions users have on this object
put_transfer
(id, user_id, ...[, email_body, ...])Transfer ownership of this object to another user
- delete_builds(id, build_id)¶
Cancel a build
- Parameters
- idinteger
The ID of the model.
- build_idinteger
The ID of the build.
- Returns
- None
Response code 202: success
- delete_projects(id, project_id)¶
Remove a Model from a project
- Parameters
- idinteger
The ID of the Model.
- project_idinteger
The ID of the project.
- Returns
- None
Response code 204: success
Revoke the permissions a group has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- group_idinteger
The ID of the group.
- Returns
- None
Response code 204: success
Revoke the permissions a user has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger
The ID of the user.
- Returns
- None
Response code 204: success
- get(id)¶
Retrieve model configuration
- Parameters
- idinteger
The ID of the model.
- Returns
civis.response.Response
- idinteger
The ID of the model.
- table_namestring
The qualified name of the table containing the training set from which to build the model.
- database_idinteger
The ID of the database holding the training set table used to build the model.
- credential_idinteger
The ID of the credential used to read the target table. Defaults to the user’s default credential.
- model_namestring
The name of the model.
- descriptionstring
A description of the model.
- interaction_termsboolean
Whether to search for interaction terms.
- box_cox_transformationboolean
Whether to transform data so that it assumes a normal distribution. Valid only with continuous models.
- model_type_idinteger
The ID of the model’s type.
- primary_keystring
The unique ID (primary key) of the training dataset.
- dependent_variablestring
The dependent variable of the training dataset.
- dependent_variable_orderlist
The order of dependent variables, especially useful for Ordinal Modeling.
- excluded_columnslist
A list of columns which will be considered ineligible to be independent variables.
- limiting_sqlstring
A custom SQL WHERE clause used to filter the rows used to build the model. (e.g., “id > 105”).
- active_build_idinteger
The ID of the current active build, the build used to score predictions.
- cross_validation_parametersdict
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_foldsinteger
Number of folds for cross validation. Default value is 5.
- notificationsdict::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- parent_idinteger
The ID of the parent job that will trigger this model.
- running_asdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- time_zonestring
The time zone of this model.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- hiddenboolean
The hidden status of the item.
- userdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- created_atstring/date-time
The time the model was created.
- updated_atstring/date-time
The time the model was updated.
- current_build_statestring
The status of the current model build. One of “succeeded”, “failed”, “queued”, or “running,”or “idle”, if no build has been attempted.
- current_build_exceptionstring
Exception message, if applicable, of the current model build.
- buildslist::
A list of trained models available for making predictions. - id : integer
The ID of the model build.
- namestring
The name of the model build.
- created_atstring
The time the model build was created.
- descriptionstring
A description of the model build.
- root_mean_squared_errornumber/float
A key metric for continuous models. Nil for other model types.
- r_squared_errornumber/float
A key metric for continuous models. Nil for other model types.
- roc_aucnumber/float
A key metric for binary, multinomial, and ordinal models. Nil for other model types.
- predictionslist::
The tables upon which the model will be applied. - id : integer
The ID of the model to which to apply the prediction.
- table_namestring
The qualified name of the table on which to apply the predictive model.
- primary_keylist
The primary key or composite keys of the table being predicted.
- limiting_sqlstring
A SQL WHERE clause used to scope the rows to be predicted.
- output_tablestring
The qualified name of the table to be created which will contain the model’s predictions.
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- statestring
The status of the prediction. One of: “succeeded”, “failed”, “queued”, or “running,”or “idle”, if no build has been attempted.
- last_output_locationstring
The output JSON for the last build.
- archivedstring
The archival status of the requested item(s).
- get_builds(id, build_id)¶
Check status of a build
- Parameters
- idinteger
The ID of the model.
- build_idinteger
The ID of the build.
- Returns
civis.response.Response
- idinteger
The ID of the model build.
- statestring
The state of the model build.one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- errorstring
The error, if any, returned by the build.
- namestring
The name of the model build.
- created_atstring
The time the model build was created.
- descriptionstring
A description of the model build.
- root_mean_squared_errornumber/float
A key metric for continuous models. Nil for other model types.
- r_squared_errornumber/float
A key metric for continuous models. Nil for other model types.
- roc_aucnumber/float
A key metric for binary, multinomial, and ordinal models. Nil for other model types.
- transformation_metadatastring
A string representing the full JSON output of the metadata for transformation of column names
- outputstring
A string representing the JSON output for the specified build. Only present when smaller than 10KB in size.
- output_locationstring
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', status='DEFAULT', author='DEFAULT', hidden='DEFAULT', archived='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶
List
- Parameters
- model_namestring, 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_namestring, 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_variablestring, 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”).
- statusstring, optional
If specified, returns models with one of these statuses. It accepts a comma-separated list, possible values are ‘running’, ‘failed’, ‘succeeded’, ‘idle’, ‘scheduled’.
- authorstring, optional
If specified, return items from any of these authors. It accepts a comma- separated list of user IDs.
- hiddenboolean, optional
If specified to be true, returns hidden items. Defaults to false, returning non-hidden items.
- archivedstring, optional
The archival status of the requested item(s).
- limitinteger, optional
Number of results to return. Defaults to its maximum of 50.
- page_numinteger, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstring, 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_dirstring, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iteratorbool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
- Returns
civis.response.PaginatedResponse
- idinteger
The ID of the model.
- table_namestring
The qualified name of the table containing the training set from which to build the model.
- database_idinteger
The ID of the database holding the training set table used to build the model.
- credential_idinteger
The ID of the credential used to read the target table. Defaults to the user’s default credential.
- model_namestring
The name of the model.
- descriptionstring
A description of the model.
- interaction_termsboolean
Whether to search for interaction terms.
- box_cox_transformationboolean
Whether to transform data so that it assumes a normal distribution. Valid only with continuous models.
- model_type_idinteger
The ID of the model’s type.
- primary_keystring
The unique ID (primary key) of the training dataset.
- dependent_variablestring
The dependent variable of the training dataset.
- dependent_variable_orderlist
The order of dependent variables, especially useful for Ordinal Modeling.
- excluded_columnslist
A list of columns which will be considered ineligible to be independent variables.
- limiting_sqlstring
A custom SQL WHERE clause used to filter the rows used to build the model. (e.g., “id > 105”).
- cross_validation_parametersdict
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_foldsinteger
Number of folds for cross validation. Default value is 5.
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- parent_idinteger
The ID of the parent job that will trigger this model.
- time_zonestring
The time zone of this model.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- userdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- created_atstring/date-time
The time the model was created.
- updated_atstring/date-time
The time the model was updated.
- current_build_statestring
The status of the current model build. One of “succeeded”, “failed”, “queued”, or “running,”or “idle”, if no build has been attempted.
- current_build_exceptionstring
Exception message, if applicable, of the current model build.
- buildslist::
A list of trained models available for making predictions. - id : integer
The ID of the model build.
- namestring
The name of the model build.
- created_atstring
The time the model build was created.
- descriptionstring
A description of the model build.
- root_mean_squared_errornumber/float
A key metric for continuous models. Nil for other model types.
- r_squared_errornumber/float
A key metric for continuous models. Nil for other model types.
- roc_aucnumber/float
A key metric for binary, multinomial, and ordinal models. Nil for other model types.
- predictionslist::
The tables upon which the model will be applied. - id : integer
The ID of the model to which to apply the prediction.
- table_namestring
The qualified name of the table on which to apply the predictive model.
- primary_keylist
The primary key or composite keys of the table being predicted.
- limiting_sqlstring
A SQL WHERE clause used to scope the rows to be predicted.
- output_tablestring
The qualified name of the table to be created which will contain the model’s predictions.
- statestring
The status of the prediction. One of: “succeeded”, “failed”, “queued”, or “running,”or “idle”, if no build has been attempted.
- last_output_locationstring
The output JSON for the last build.
- archivedstring
The archival status of the requested item(s).
- list_builds(id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶
List builds for the given model
- Parameters
- idinteger
The ID of the model.
- limitinteger, optional
Number of results to return. Defaults to 20. Maximum allowed is 100.
- page_numinteger, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstring, optional
The field on which to order the result set. Defaults to id. Must be one of: id.
- order_dirstring, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iteratorbool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
- Returns
civis.response.PaginatedResponse
- idinteger
The ID of the model build.
- statestring
The state of the model build.one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- errorstring
The error, if any, returned by the build.
- namestring
The name of the model build.
- created_atstring
The time the model build was created.
- descriptionstring
A description of the model build.
- root_mean_squared_errornumber/float
A key metric for continuous models. Nil for other model types.
- r_squared_errornumber/float
A key metric for continuous models. Nil for other model types.
- roc_aucnumber/float
A key metric for binary, multinomial, and ordinal models. Nil for other model types.
- transformation_metadatastring
A string representing the full JSON output of the metadata for transformation of column names
- outputstring
A string representing the JSON output for the specified build. Only present when smaller than 10KB in size.
- output_locationstring
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
- idinteger
The ID of the model.
- build_idinteger
The ID of the build.
- last_idinteger, 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.
- limitinteger, optional
The maximum number of log messages to return. Default of 10000.
- Returns
civis.response.Response
- idinteger
The ID of the log.
- created_atstring/date-time
The time the log was created.
- messagestring
The log message.
- levelstring
The level of the log. One of unknown,fatal,error,warn,info,debug.
- list_dependencies(id, *, user_id='DEFAULT')¶
List dependent objects for this object
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger, optional
ID of target user
- Returns
civis.response.Response
- object_typestring
Dependent object type
- fco_typestring
Human readable dependent object type
- idinteger
Dependent object ID
- namestring
Dependent object name, or nil if the requesting user cannot read this object
- permission_levelstring
Permission level of target user (not user’s groups) for dependent object, or null if no target user
- shareableboolean
Whether or not the requesting user can share this object.
- list_projects(id, *, hidden='DEFAULT')¶
List the projects a Model belongs to
- Parameters
- idinteger
The ID of the Model.
- hiddenboolean, optional
If specified to be true, returns hidden items. Defaults to false, returning non-hidden items.
- Returns
civis.response.Response
- idinteger
The ID for this project.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- namestring
The name of this project.
- descriptionstring
A description of the project.
- userslist::
Users who can see the project. - id : integer
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
auto_share : boolean
created_at : string/time
updated_at : string/time
- archivedstring
The archival status of the requested item(s).
- list_schedules(id)¶
Show the model build schedule
- Parameters
- idinteger
The ID of the model associated with this schedule.
- Returns
civis.response.Response
- idinteger
The ID of the model associated with this schedule.
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
List users and groups permissioned on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
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
civis.response.Response
- idinteger
The ID of the model type.
- algorithmstring
The name of the algorithm used to train the model.
- dv_typestring
The type of dependent variable predicted by the model.
- fint_allowedboolean
Whether this model type supports searching for interaction terms.
- put_archive(id, status)¶
Update the archive status of this object
- Parameters
- idinteger
The ID of the object.
- statusboolean
The desired archived status of the object.
- Returns
civis.response.Response
- idinteger
The ID of the model.
- table_namestring
The qualified name of the table containing the training set from which to build the model.
- database_idinteger
The ID of the database holding the training set table used to build the model.
- credential_idinteger
The ID of the credential used to read the target table. Defaults to the user’s default credential.
- model_namestring
The name of the model.
- descriptionstring
A description of the model.
- interaction_termsboolean
Whether to search for interaction terms.
- box_cox_transformationboolean
Whether to transform data so that it assumes a normal distribution. Valid only with continuous models.
- model_type_idinteger
The ID of the model’s type.
- primary_keystring
The unique ID (primary key) of the training dataset.
- dependent_variablestring
The dependent variable of the training dataset.
- dependent_variable_orderlist
The order of dependent variables, especially useful for Ordinal Modeling.
- excluded_columnslist
A list of columns which will be considered ineligible to be independent variables.
- limiting_sqlstring
A custom SQL WHERE clause used to filter the rows used to build the model. (e.g., “id > 105”).
- active_build_idinteger
The ID of the current active build, the build used to score predictions.
- cross_validation_parametersdict
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_foldsinteger
Number of folds for cross validation. Default value is 5.
- notificationsdict::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- parent_idinteger
The ID of the parent job that will trigger this model.
- running_asdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- time_zonestring
The time zone of this model.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- hiddenboolean
The hidden status of the item.
- userdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- created_atstring/date-time
The time the model was created.
- updated_atstring/date-time
The time the model was updated.
- current_build_statestring
The status of the current model build. One of “succeeded”, “failed”, “queued”, or “running,”or “idle”, if no build has been attempted.
- current_build_exceptionstring
Exception message, if applicable, of the current model build.
- buildslist::
A list of trained models available for making predictions. - id : integer
The ID of the model build.
- namestring
The name of the model build.
- created_atstring
The time the model build was created.
- descriptionstring
A description of the model build.
- root_mean_squared_errornumber/float
A key metric for continuous models. Nil for other model types.
- r_squared_errornumber/float
A key metric for continuous models. Nil for other model types.
- roc_aucnumber/float
A key metric for binary, multinomial, and ordinal models. Nil for other model types.
- predictionslist::
The tables upon which the model will be applied. - id : integer
The ID of the model to which to apply the prediction.
- table_namestring
The qualified name of the table on which to apply the predictive model.
- primary_keylist
The primary key or composite keys of the table being predicted.
- limiting_sqlstring
A SQL WHERE clause used to scope the rows to be predicted.
- output_tablestring
The qualified name of the table to be created which will contain the model’s predictions.
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- statestring
The status of the prediction. One of: “succeeded”, “failed”, “queued”, or “running,”or “idle”, if no build has been attempted.
- last_output_locationstring
The output JSON for the last build.
- archivedstring
The archival status of the requested item(s).
- put_projects(id, project_id)¶
Add a Model to a project
- Parameters
- idinteger
The ID of the Model.
- project_idinteger
The ID of the project.
- Returns
- None
Response code 204: success
Set the permissions groups has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- group_idslist
An array of one or more group IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
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
- idinteger
The ID of the resource that is shared.
- user_idslist
An array of one or more user IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
- put_transfer(id, user_id, include_dependencies, *, email_body='DEFAULT', send_email='DEFAULT')¶
Transfer ownership of this object to another user
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger
ID of target user
- include_dependenciesboolean
Whether or not to give manage permissions on all dependencies
- email_bodystring, optional
Custom body text for e-mail sent on transfer.
- send_emailboolean, optional
Send email to the target user of the transfer?
- Returns
civis.response.Response
- dependencieslist::
Dependent objects for this object - object_type : string
Dependent object type
- fco_typestring
Human readable dependent object type
- idinteger
Dependent object ID
- namestring
Dependent object name, or nil if the requesting user cannot read this object
- permission_levelstring
Permission level of target user (not user’s groups) for dependent object, or null if no target user
- sharedboolean
Whether dependent object was successfully shared with target user
Notebooks¶
- class Notebooks(session_kwargs, client, return_type='civis')¶
Examples
>>> import civis >>> client = civis.APIClient() >>> client.notebooks.list(...)
Methods
delete_deployments
(notebook_id, deployment_id)Delete a Notebook deployment
delete_projects
(id, project_id)Remove a Notebook from a project
delete_shares_groups
(id, group_id)Revoke the permissions a group has on this object
delete_shares_users
(id, user_id)Revoke the permissions a user has on this object
get
(id)Get a Notebook
get_deployments
(notebook_id, deployment_id)Get details about a Notebook deployment
get_git_commits
(id, commit_hash)Get file contents at git ref
list
(*[, hidden, archived, author, status, ...])List Notebooks
list_dependencies
(id, *[, user_id])List dependent objects for this object
list_deployments
(notebook_id, *[, ...])List deployments for a Notebook
list_deployments_logs
(id, deployment_id, *)Get the logs for a Notebook deployment
list_git
(id)Get the git metadata attached to an item
list_git_commits
(id)Get the git commits for an item on the current branch
list_projects
(id, *[, hidden])List the projects a Notebook belongs to
list_shares
(id)List users and groups permissioned on this object
Get URLs to update notebook
patch
(id, *[, name, language, description, ...])Update some attributes of this Notebook
patch_git
(id, *[, git_ref, git_branch, ...])Update an attached git file
post
(*[, name, language, description, ...])Create a Notebook
post_clone
(id)Clone this Notebook
post_deployments
(notebook_id, *[, deployment_id])Deploy a Notebook
Checkout content that the existing git_ref points to and save to the object
Checkout latest commit on the current branch of a script or workflow
post_git_commits
(id, content, message, file_hash)Commit and push a new version of the file
put
(id, *[, name, language, description, ...])Replace all attributes of this Notebook
put_archive
(id, status)Update the archive status of this object
put_git
(id, *[, git_ref, git_branch, ...])Attach an item to a file in a git repo
put_projects
(id, project_id)Add a Notebook to a project
put_shares_groups
(id, group_ids, ...[, ...])Set the permissions groups has on this object
put_shares_users
(id, user_ids, ...[, ...])Set the permissions users have on this object
put_transfer
(id, user_id, ...[, email_body, ...])Transfer ownership of this object to another user
- delete_deployments(notebook_id, deployment_id)¶
Delete a Notebook deployment
- Parameters
- notebook_idinteger
The ID of the owning Notebook
- deployment_idinteger
The ID for this deployment
- Returns
- None
Response code 204: success
- delete_projects(id, project_id)¶
Remove a Notebook from a project
- Parameters
- idinteger
The ID of the Notebook.
- project_idinteger
The ID of the project.
- Returns
- None
Response code 204: success
Revoke the permissions a group has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- group_idinteger
The ID of the group.
- Returns
- None
Response code 204: success
Revoke the permissions a user has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger
The ID of the user.
- Returns
- None
Response code 204: success
- get(id)¶
Get a Notebook
- Parameters
- idinteger
- Returns
civis.response.Response
- idinteger
The ID for this notebook.
- namestring
The name of this notebook.
- languagestring
The kernel language of this notebook.
- descriptionstring
The description of this notebook.
- notebook_urlstring
Time-limited URL to get the .ipynb file for this notebook.
- notebook_preview_urlstring
Time-limited URL to get the .htm preview file for this notebook.
- requirements_urlstring
Time-limited URL to get the requirements.txt file for this notebook.
- file_idstring
The file ID for the S3 file containing the .ipynb file.
- requirements_file_idstring
The file ID for the S3 file containing the requirements.txt file.
- userdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- docker_image_namestring
The name of the docker image to pull from DockerHub.
- docker_image_tagstring
The tag of the docker image to pull from DockerHub (default: latest).
- instance_typestring
The EC2 instance type to deploy to.
- memoryinteger
The amount of memory allocated to the notebook.
- cpuinteger
The amount of cpu allocated to the the notebook.
created_at : string/time
updated_at : string/time
- most_recent_deploymentdict::
- deployment_idinteger
The ID for this deployment.
- user_idinteger
The ID of the owner.
- hoststring
Domain of the deployment.
- namestring
Name of the deployment.
- docker_image_namestring
The name of the docker image to pull from DockerHub.
- docker_image_tagstring
The tag of the docker image to pull from DockerHub (default: latest).
- display_urlstring
A signed URL for viewing the deployed item.
- instance_typestring
The EC2 instance type requested for the deployment.
- memoryinteger
The memory allocated to the deployment, in MB.
- cpuinteger
The cpu allocated to the deployment, in millicores.
- statestring
The state of the deployment.
- state_messagestring
A detailed description of the state.
- max_memory_usagenumber/float
If the deployment has finished, the maximum amount of memory used during the deployment, in MB.
- max_cpu_usagenumber/float
If the deployment has finished, the maximum amount of cpu used during the deployment, in millicores.
created_at : string/time
updated_at : string/time
- notebook_idinteger
The ID of owning Notebook
- credentialslist
A list of credential IDs to pass to the notebook.
- environment_variablesdict
Environment variables to be passed into the Notebook.
- idle_timeoutinteger
How long the notebook will stay alive without any kernel activity.
- partition_labelstring
The partition label used to run this object. Only settable with custom_partitions feature flag. Beware attribute may break or change in the future.
- git_repo_idinteger
The ID of the git repository.
- git_repo_urlstring
The url of the git repository
- git_refstring
The git reference if git repo is specified
- git_pathstring
The path to the .ipynb file in the git repo that will be started up on notebook launch
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- archivedstring
The archival status of the requested item(s).
- hiddenboolean
The hidden status of the item.
- get_deployments(notebook_id, deployment_id)¶
Get details about a Notebook deployment
- Parameters
- notebook_idinteger
The ID of the owning Notebook
- deployment_idinteger
The ID for this deployment
- Returns
civis.response.Response
- deployment_idinteger
The ID for this deployment.
- user_idinteger
The ID of the owner.
- hoststring
Domain of the deployment.
- namestring
Name of the deployment.
- docker_image_namestring
The name of the docker image to pull from DockerHub.
- docker_image_tagstring
The tag of the docker image to pull from DockerHub (default: latest).
- display_urlstring
A signed URL for viewing the deployed item.
- instance_typestring
The EC2 instance type requested for the deployment.
- memoryinteger
The memory allocated to the deployment, in MB.
- cpuinteger
The cpu allocated to the deployment, in millicores.
- statestring
The state of the deployment.
- state_messagestring
A detailed description of the state.
- max_memory_usagenumber/float
If the deployment has finished, the maximum amount of memory used during the deployment, in MB.
- max_cpu_usagenumber/float
If the deployment has finished, the maximum amount of cpu used during the deployment, in millicores.
created_at : string/time
updated_at : string/time
- notebook_idinteger
The ID of owning Notebook
- get_git_commits(id, commit_hash)¶
Get file contents at git ref
- Parameters
- idinteger
The ID of the file.
- commit_hashstring
The SHA (full or shortened) of the desired git commit.
- Returns
civis.response.Response
- contentstring
The file’s contents.
- typestring
The file’s type.
- sizeinteger
The file’s size.
- file_hashstring
The SHA of the file.
- list(*, hidden='DEFAULT', archived='DEFAULT', author='DEFAULT', status='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶
List Notebooks
- Parameters
- hiddenboolean, optional
If specified to be true, returns hidden items. Defaults to false, returning non-hidden items.
- archivedstring, optional
The archival status of the requested item(s).
- authorstring, optional
If specified, return items from any of these authors. It accepts a comma- separated list of user IDs.
- statusstring, optional
If specified, returns notebooks with one of these statuses. It accepts a comma-separated list, possible values are ‘running’, ‘pending’, ‘idle’.
- limitinteger, optional
Number of results to return. Defaults to 20. Maximum allowed is 50.
- page_numinteger, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstring, optional
The field on which to order the result set. Defaults to updated_at. Must be one of: updated_at, name, created_at.
- order_dirstring, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iteratorbool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
- Returns
civis.response.PaginatedResponse
- idinteger
The ID for this notebook.
- namestring
The name of this notebook.
- languagestring
The kernel language of this notebook.
- descriptionstring
The description of this notebook.
- userdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
created_at : string/time
updated_at : string/time
- most_recent_deploymentdict::
- deployment_idinteger
The ID for this deployment.
- user_idinteger
The ID of the owner.
- hoststring
Domain of the deployment.
- namestring
Name of the deployment.
- docker_image_namestring
The name of the docker image to pull from DockerHub.
- docker_image_tagstring
The tag of the docker image to pull from DockerHub (default: latest).
- instance_typestring
The EC2 instance type requested for the deployment.
- memoryinteger
The memory allocated to the deployment, in MB.
- cpuinteger
The cpu allocated to the deployment, in millicores.
- statestring
The state of the deployment.
- state_messagestring
A detailed description of the state.
- max_memory_usagenumber/float
If the deployment has finished, the maximum amount of memory used during the deployment, in MB.
- max_cpu_usagenumber/float
If the deployment has finished, the maximum amount of cpu used during the deployment, in millicores.
created_at : string/time
updated_at : string/time
- notebook_idinteger
The ID of owning Notebook
- archivedstring
The archival status of the requested item(s).
- list_dependencies(id, *, user_id='DEFAULT')¶
List dependent objects for this object
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger, optional
ID of target user
- Returns
civis.response.Response
- object_typestring
Dependent object type
- fco_typestring
Human readable dependent object type
- idinteger
Dependent object ID
- namestring
Dependent object name, or nil if the requesting user cannot read this object
- permission_levelstring
Permission level of target user (not user’s groups) for dependent object, or null if no target user
- shareableboolean
Whether or not the requesting user can share this object.
- 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_idinteger
The ID of the owning Notebook
- deployment_idinteger, optional
The ID for this deployment
- limitinteger, optional
Number of results to return. Defaults to 20. Maximum allowed is 50.
- page_numinteger, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstring, optional
The field on which to order the result set. Defaults to created_at. Must be one of: created_at.
- order_dirstring, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iteratorbool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
- Returns
civis.response.PaginatedResponse
- deployment_idinteger
The ID for this deployment.
- user_idinteger
The ID of the owner.
- hoststring
Domain of the deployment.
- namestring
Name of the deployment.
- docker_image_namestring
The name of the docker image to pull from DockerHub.
- docker_image_tagstring
The tag of the docker image to pull from DockerHub (default: latest).
- instance_typestring
The EC2 instance type requested for the deployment.
- memoryinteger
The memory allocated to the deployment, in MB.
- cpuinteger
The cpu allocated to the deployment, in millicores.
- statestring
The state of the deployment.
- state_messagestring
A detailed description of the state.
- max_memory_usagenumber/float
If the deployment has finished, the maximum amount of memory used during the deployment, in MB.
- max_cpu_usagenumber/float
If the deployment has finished, the maximum amount of cpu used during the deployment, in millicores.
created_at : string/time
updated_at : string/time
- notebook_idinteger
The ID of owning Notebook
- list_deployments_logs(id, deployment_id, *, start_at='DEFAULT', end_at='DEFAULT', limit='DEFAULT')¶
Get the logs for a Notebook deployment
- Parameters
- idinteger
The ID of the owning Notebook.
- deployment_idinteger
The ID for this deployment.
- start_atstring, optional
Log entries with a lower timestamp will be omitted.
- end_atstring, optional
Log entries with a higher timestamp will be omitted.
- limitinteger, optional
The maximum number of log messages to return. Default of 10000.
- Returns
civis.response.Response
- messagestring
The log message.
- streamstring
The stream of the log. One of “stdout”, “stderr”.
- created_atstring/date-time
The time the log was created.
- sourcestring
The source of the log. One of “system”, “user”.
- list_git(id)¶
Get the git metadata attached to an item
- Parameters
- idinteger
The ID of the file.
- Returns
civis.response.Response
- git_refstring
A git reference specifying an unambiguous version of the file. Can be a branch name, tag or the full or shortened SHA of a commit.
- git_branchstring
The git branch that the file is on.
- git_pathstring
The path of the file in the repository.
- git_repodict::
- idinteger
The ID for this git repository.
- repo_urlstring
The URL for this git repository.
created_at : string/time
updated_at : string/time
- git_ref_typestring
Specifies if the file is versioned by branch or tag.
- pull_from_gitboolean
Automatically pull latest commit from git. Only works for scripts and workflows (assuming you have the feature enabled)
- list_git_commits(id)¶
Get the git commits for an item on the current branch
- Parameters
- idinteger
The ID of the file.
- Returns
civis.response.Response
- commit_hashstring
The SHA of the commit.
- author_namestring
The name of the commit’s author.
- datestring/time
The commit’s timestamp.
- messagestring
The commit message.
- list_projects(id, *, hidden='DEFAULT')¶
List the projects a Notebook belongs to
- Parameters
- idinteger
The ID of the Notebook.
- hiddenboolean, optional
If specified to be true, returns hidden items. Defaults to false, returning non-hidden items.
- Returns
civis.response.Response
- idinteger
The ID for this project.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- namestring
The name of this project.
- descriptionstring
A description of the project.
- userslist::
Users who can see the project. - id : integer
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
auto_share : boolean
created_at : string/time
updated_at : string/time
- archivedstring
The archival status of the requested item(s).
List users and groups permissioned on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
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
- idinteger
- Returns
civis.response.Response
- update_urlstring
Time-limited URL to PUT new contents of the .ipynb file for this notebook.
- update_preview_urlstring
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', instance_type='DEFAULT', memory='DEFAULT', cpu='DEFAULT', credentials='DEFAULT', environment_variables='DEFAULT', idle_timeout='DEFAULT', partition_label='DEFAULT', git_repo_url='DEFAULT', git_ref='DEFAULT', git_path='DEFAULT')¶
Update some attributes of this Notebook
- Parameters
- idinteger
The ID for this notebook.
- namestring, optional
The name of this notebook.
- languagestring, optional
The kernel language of this notebook.
- descriptionstring, optional
The description of this notebook.
- file_idstring, optional
The file ID for the S3 file containing the .ipynb file.
- requirements_file_idstring, optional
The file ID for the S3 file containing the requirements.txt file.
- requirementsstring, optional
The requirements txt file.
- docker_image_namestring, optional
The name of the docker image to pull from DockerHub.
- docker_image_tagstring, optional
The tag of the docker image to pull from DockerHub (default: latest).
- instance_typestring, optional
The EC2 instance type to deploy to.
- memoryinteger, optional
The amount of memory allocated to the notebook.
- cpuinteger, optional
The amount of cpu allocated to the the notebook.
- credentialslist, optional
A list of credential IDs to pass to the notebook.
- environment_variablesdict, optional
Environment variables to be passed into the Notebook.
- idle_timeoutinteger, optional
How long the notebook will stay alive without any kernel activity.
- partition_labelstring, optional
The partition label used to run this object. Only settable with custom_partitions feature flag. Beware attribute may break or change in the future.
- git_repo_urlstring, optional
The url of the git repository
- git_refstring, optional
The git reference if git repo is specified
- git_pathstring, optional
The path to the .ipynb file in the git repo that will be started up on notebook launch
- Returns
civis.response.Response
- idinteger
The ID for this notebook.
- namestring
The name of this notebook.
- languagestring
The kernel language of this notebook.
- descriptionstring
The description of this notebook.
- notebook_urlstring
Time-limited URL to get the .ipynb file for this notebook.
- notebook_preview_urlstring
Time-limited URL to get the .htm preview file for this notebook.
- requirements_urlstring
Time-limited URL to get the requirements.txt file for this notebook.
- file_idstring
The file ID for the S3 file containing the .ipynb file.
- requirements_file_idstring
The file ID for the S3 file containing the requirements.txt file.
- userdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- docker_image_namestring
The name of the docker image to pull from DockerHub.
- docker_image_tagstring
The tag of the docker image to pull from DockerHub (default: latest).
- instance_typestring
The EC2 instance type to deploy to.
- memoryinteger
The amount of memory allocated to the notebook.
- cpuinteger
The amount of cpu allocated to the the notebook.
created_at : string/time
updated_at : string/time
- most_recent_deploymentdict::
- deployment_idinteger
The ID for this deployment.
- user_idinteger
The ID of the owner.
- hoststring
Domain of the deployment.
- namestring
Name of the deployment.
- docker_image_namestring
The name of the docker image to pull from DockerHub.
- docker_image_tagstring
The tag of the docker image to pull from DockerHub (default: latest).
- display_urlstring
A signed URL for viewing the deployed item.
- instance_typestring
The EC2 instance type requested for the deployment.
- memoryinteger
The memory allocated to the deployment, in MB.
- cpuinteger
The cpu allocated to the deployment, in millicores.
- statestring
The state of the deployment.
- state_messagestring
A detailed description of the state.
- max_memory_usagenumber/float
If the deployment has finished, the maximum amount of memory used during the deployment, in MB.
- max_cpu_usagenumber/float
If the deployment has finished, the maximum amount of cpu used during the deployment, in millicores.
created_at : string/time
updated_at : string/time
- notebook_idinteger
The ID of owning Notebook
- credentialslist
A list of credential IDs to pass to the notebook.
- environment_variablesdict
Environment variables to be passed into the Notebook.
- idle_timeoutinteger
How long the notebook will stay alive without any kernel activity.
- partition_labelstring
The partition label used to run this object. Only settable with custom_partitions feature flag. Beware attribute may break or change in the future.
- git_repo_idinteger
The ID of the git repository.
- git_repo_urlstring
The url of the git repository
- git_refstring
The git reference if git repo is specified
- git_pathstring
The path to the .ipynb file in the git repo that will be started up on notebook launch
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- archivedstring
The archival status of the requested item(s).
- hiddenboolean
The hidden status of the item.
- patch_git(id, *, git_ref='DEFAULT', git_branch='DEFAULT', git_path='DEFAULT', git_repo_url='DEFAULT', git_ref_type='DEFAULT', pull_from_git='DEFAULT')¶
Update an attached git file
- Parameters
- idinteger
The ID of the file.
- git_refstring, optional
A git reference specifying an unambiguous version of the file. Can be a branch name, or the full or shortened SHA of a commit.
- git_branchstring, optional
The git branch that the file is on.
- git_pathstring, optional
The path of the file in the repository.
- git_repo_urlstring, optional
The URL of the git repository.
- git_ref_typestring, optional
Specifies if the file is versioned by branch or tag.
- pull_from_gitboolean, optional
Automatically pull latest commit from git. Only works for scripts.
- Returns
civis.response.Response
- git_refstring
A git reference specifying an unambiguous version of the file. Can be a branch name, tag or the full or shortened SHA of a commit.
- git_branchstring
The git branch that the file is on.
- git_pathstring
The path of the file in the repository.
- git_repodict::
- idinteger
The ID for this git repository.
- repo_urlstring
The URL for this git repository.
created_at : string/time
updated_at : string/time
- git_ref_typestring
Specifies if the file is versioned by branch or tag.
- pull_from_gitboolean
Automatically pull latest commit from git. Only works for scripts and workflows (assuming you have the feature enabled)
- post(*, name='DEFAULT', language='DEFAULT', description='DEFAULT', file_id='DEFAULT', requirements_file_id='DEFAULT', requirements='DEFAULT', docker_image_name='DEFAULT', docker_image_tag='DEFAULT', instance_type='DEFAULT', memory='DEFAULT', cpu='DEFAULT', credentials='DEFAULT', environment_variables='DEFAULT', idle_timeout='DEFAULT', partition_label='DEFAULT', git_repo_url='DEFAULT', git_ref='DEFAULT', git_path='DEFAULT', hidden='DEFAULT')¶
Create a Notebook
- Parameters
- namestring, optional
The name of this notebook.
- languagestring, optional
The kernel language of this notebook.
- descriptionstring, optional
The description of this notebook.
- file_idstring, optional
The file ID for the S3 file containing the .ipynb file.
- requirements_file_idstring, optional
The file ID for the S3 file containing the requirements.txt file.
- requirementsstring, optional
The requirements txt file.
- docker_image_namestring, optional
The name of the docker image to pull from DockerHub.
- docker_image_tagstring, optional
The tag of the docker image to pull from DockerHub (default: latest).
- instance_typestring, optional
The EC2 instance type to deploy to.
- memoryinteger, optional
The amount of memory allocated to the notebook.
- cpuinteger, optional
The amount of cpu allocated to the the notebook.
- credentialslist, optional
A list of credential IDs to pass to the notebook.
- environment_variablesdict, optional
Environment variables to be passed into the Notebook.
- idle_timeoutinteger, optional
How long the notebook will stay alive without any kernel activity.
- partition_labelstring, optional
The partition label used to run this object. Only settable with custom_partitions feature flag. Beware attribute may break or change in the future.
- git_repo_urlstring, optional
The url of the git repository
- git_refstring, optional
The git reference if git repo is specified
- git_pathstring, optional
The path to the .ipynb file in the git repo that will be started up on notebook launch
- hiddenboolean, optional
The hidden status of the item.
- Returns
civis.response.Response
- idinteger
The ID for this notebook.
- namestring
The name of this notebook.
- languagestring
The kernel language of this notebook.
- descriptionstring
The description of this notebook.
- notebook_urlstring
Time-limited URL to get the .ipynb file for this notebook.
- notebook_preview_urlstring
Time-limited URL to get the .htm preview file for this notebook.
- requirements_urlstring
Time-limited URL to get the requirements.txt file for this notebook.
- file_idstring
The file ID for the S3 file containing the .ipynb file.
- requirements_file_idstring
The file ID for the S3 file containing the requirements.txt file.
- userdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- docker_image_namestring
The name of the docker image to pull from DockerHub.
- docker_image_tagstring
The tag of the docker image to pull from DockerHub (default: latest).
- instance_typestring
The EC2 instance type to deploy to.
- memoryinteger
The amount of memory allocated to the notebook.
- cpuinteger
The amount of cpu allocated to the the notebook.
created_at : string/time
updated_at : string/time
- most_recent_deploymentdict::
- deployment_idinteger
The ID for this deployment.
- user_idinteger
The ID of the owner.
- hoststring
Domain of the deployment.
- namestring
Name of the deployment.
- docker_image_namestring
The name of the docker image to pull from DockerHub.
- docker_image_tagstring
The tag of the docker image to pull from DockerHub (default: latest).
- display_urlstring
A signed URL for viewing the deployed item.
- instance_typestring
The EC2 instance type requested for the deployment.
- memoryinteger
The memory allocated to the deployment, in MB.
- cpuinteger
The cpu allocated to the deployment, in millicores.
- statestring
The state of the deployment.
- state_messagestring
A detailed description of the state.
- max_memory_usagenumber/float
If the deployment has finished, the maximum amount of memory used during the deployment, in MB.
- max_cpu_usagenumber/float
If the deployment has finished, the maximum amount of cpu used during the deployment, in millicores.
created_at : string/time
updated_at : string/time
- notebook_idinteger
The ID of owning Notebook
- credentialslist
A list of credential IDs to pass to the notebook.
- environment_variablesdict
Environment variables to be passed into the Notebook.
- idle_timeoutinteger
How long the notebook will stay alive without any kernel activity.
- partition_labelstring
The partition label used to run this object. Only settable with custom_partitions feature flag. Beware attribute may break or change in the future.
- git_repo_idinteger
The ID of the git repository.
- git_repo_urlstring
The url of the git repository
- git_refstring
The git reference if git repo is specified
- git_pathstring
The path to the .ipynb file in the git repo that will be started up on notebook launch
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- archivedstring
The archival status of the requested item(s).
- hiddenboolean
The hidden status of the item.
- post_clone(id)¶
Clone this Notebook
- Parameters
- idinteger
- Returns
civis.response.Response
- idinteger
The ID for this notebook.
- namestring
The name of this notebook.
- languagestring
The kernel language of this notebook.
- descriptionstring
The description of this notebook.
- notebook_urlstring
Time-limited URL to get the .ipynb file for this notebook.
- notebook_preview_urlstring
Time-limited URL to get the .htm preview file for this notebook.
- requirements_urlstring
Time-limited URL to get the requirements.txt file for this notebook.
- file_idstring
The file ID for the S3 file containing the .ipynb file.
- requirements_file_idstring
The file ID for the S3 file containing the requirements.txt file.
- userdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- docker_image_namestring
The name of the docker image to pull from DockerHub.
- docker_image_tagstring
The tag of the docker image to pull from DockerHub (default: latest).
- instance_typestring
The EC2 instance type to deploy to.
- memoryinteger
The amount of memory allocated to the notebook.
- cpuinteger
The amount of cpu allocated to the the notebook.
created_at : string/time
updated_at : string/time
- most_recent_deploymentdict::
- deployment_idinteger
The ID for this deployment.
- user_idinteger
The ID of the owner.
- hoststring
Domain of the deployment.
- namestring
Name of the deployment.
- docker_image_namestring
The name of the docker image to pull from DockerHub.
- docker_image_tagstring
The tag of the docker image to pull from DockerHub (default: latest).
- display_urlstring
A signed URL for viewing the deployed item.
- instance_typestring
The EC2 instance type requested for the deployment.
- memoryinteger
The memory allocated to the deployment, in MB.
- cpuinteger
The cpu allocated to the deployment, in millicores.
- statestring
The state of the deployment.
- state_messagestring
A detailed description of the state.
- max_memory_usagenumber/float
If the deployment has finished, the maximum amount of memory used during the deployment, in MB.
- max_cpu_usagenumber/float
If the deployment has finished, the maximum amount of cpu used during the deployment, in millicores.
created_at : string/time
updated_at : string/time
- notebook_idinteger
The ID of owning Notebook
- credentialslist
A list of credential IDs to pass to the notebook.
- environment_variablesdict
Environment variables to be passed into the Notebook.
- idle_timeoutinteger
How long the notebook will stay alive without any kernel activity.
- partition_labelstring
The partition label used to run this object. Only settable with custom_partitions feature flag. Beware attribute may break or change in the future.
- git_repo_idinteger
The ID of the git repository.
- git_repo_urlstring
The url of the git repository
- git_refstring
The git reference if git repo is specified
- git_pathstring
The path to the .ipynb file in the git repo that will be started up on notebook launch
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- archivedstring
The archival status of the requested item(s).
- hiddenboolean
The hidden status of the item.
- post_deployments(notebook_id, *, deployment_id='DEFAULT')¶
Deploy a Notebook
- Parameters
- notebook_idinteger
The ID of the owning Notebook
- deployment_idinteger, optional
The ID for this deployment
- Returns
civis.response.Response
- deployment_idinteger
The ID for this deployment.
- user_idinteger
The ID of the owner.
- hoststring
Domain of the deployment.
- namestring
Name of the deployment.
- docker_image_namestring
The name of the docker image to pull from DockerHub.
- docker_image_tagstring
The tag of the docker image to pull from DockerHub (default: latest).
- display_urlstring
A signed URL for viewing the deployed item.
- instance_typestring
The EC2 instance type requested for the deployment.
- memoryinteger
The memory allocated to the deployment, in MB.
- cpuinteger
The cpu allocated to the deployment, in millicores.
- statestring
The state of the deployment.
- state_messagestring
A detailed description of the state.
- max_memory_usagenumber/float
If the deployment has finished, the maximum amount of memory used during the deployment, in MB.
- max_cpu_usagenumber/float
If the deployment has finished, the maximum amount of cpu used during the deployment, in millicores.
created_at : string/time
updated_at : string/time
- notebook_idinteger
The ID of owning Notebook
- post_git_checkout(id)¶
Checkout content that the existing git_ref points to and save to the object
- Parameters
- idinteger
The ID of the file.
- Returns
civis.response.Response
- contentstring
The file’s contents.
- typestring
The file’s type.
- sizeinteger
The file’s size.
- file_hashstring
The SHA of the file.
- post_git_checkout_latest(id)¶
Checkout latest commit on the current branch of a script or workflow
- Parameters
- idinteger
The ID of the file.
- Returns
civis.response.Response
- contentstring
The file’s contents.
- typestring
The file’s type.
- sizeinteger
The file’s size.
- file_hashstring
The SHA of the file.
- post_git_commits(id, content, message, file_hash)¶
Commit and push a new version of the file
- Parameters
- idinteger
The ID of the file.
- contentstring
The contents to commit to the file.
- messagestring
A commit message describing the changes being made.
- file_hashstring
The full SHA of the file being replaced.
- Returns
civis.response.Response
- contentstring
The file’s contents.
- typestring
The file’s type.
- sizeinteger
The file’s size.
- file_hashstring
The SHA of the file.
- 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', instance_type='DEFAULT', memory='DEFAULT', cpu='DEFAULT', credentials='DEFAULT', environment_variables='DEFAULT', idle_timeout='DEFAULT', partition_label='DEFAULT', git_repo_url='DEFAULT', git_ref='DEFAULT', git_path='DEFAULT')¶
Replace all attributes of this Notebook
- Parameters
- idinteger
The ID for this notebook.
- namestring, optional
The name of this notebook.
- languagestring, optional
The kernel language of this notebook.
- descriptionstring, optional
The description of this notebook.
- file_idstring, optional
The file ID for the S3 file containing the .ipynb file.
- requirements_file_idstring, optional
The file ID for the S3 file containing the requirements.txt file.
- requirementsstring, optional
The requirements txt file.
- docker_image_namestring, optional
The name of the docker image to pull from DockerHub.
- docker_image_tagstring, optional
The tag of the docker image to pull from DockerHub (default: latest).
- instance_typestring, optional
The EC2 instance type to deploy to.
- memoryinteger, optional
The amount of memory allocated to the notebook.
- cpuinteger, optional
The amount of cpu allocated to the the notebook.
- credentialslist, optional
A list of credential IDs to pass to the notebook.
- environment_variablesdict, optional
Environment variables to be passed into the Notebook.
- idle_timeoutinteger, optional
How long the notebook will stay alive without any kernel activity.
- partition_labelstring, optional
The partition label used to run this object. Only settable with custom_partitions feature flag. Beware attribute may break or change in the future.
- git_repo_urlstring, optional
The url of the git repository
- git_refstring, optional
The git reference if git repo is specified
- git_pathstring, optional
The path to the .ipynb file in the git repo that will be started up on notebook launch
- Returns
civis.response.Response
- idinteger
The ID for this notebook.
- namestring
The name of this notebook.
- languagestring
The kernel language of this notebook.
- descriptionstring
The description of this notebook.
- notebook_urlstring
Time-limited URL to get the .ipynb file for this notebook.
- notebook_preview_urlstring
Time-limited URL to get the .htm preview file for this notebook.
- requirements_urlstring
Time-limited URL to get the requirements.txt file for this notebook.
- file_idstring
The file ID for the S3 file containing the .ipynb file.
- requirements_file_idstring
The file ID for the S3 file containing the requirements.txt file.
- userdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- docker_image_namestring
The name of the docker image to pull from DockerHub.
- docker_image_tagstring
The tag of the docker image to pull from DockerHub (default: latest).
- instance_typestring
The EC2 instance type to deploy to.
- memoryinteger
The amount of memory allocated to the notebook.
- cpuinteger
The amount of cpu allocated to the the notebook.
created_at : string/time
updated_at : string/time
- most_recent_deploymentdict::
- deployment_idinteger
The ID for this deployment.
- user_idinteger
The ID of the owner.
- hoststring
Domain of the deployment.
- namestring
Name of the deployment.
- docker_image_namestring
The name of the docker image to pull from DockerHub.
- docker_image_tagstring
The tag of the docker image to pull from DockerHub (default: latest).
- display_urlstring
A signed URL for viewing the deployed item.
- instance_typestring
The EC2 instance type requested for the deployment.
- memoryinteger
The memory allocated to the deployment, in MB.
- cpuinteger
The cpu allocated to the deployment, in millicores.
- statestring
The state of the deployment.
- state_messagestring
A detailed description of the state.
- max_memory_usagenumber/float
If the deployment has finished, the maximum amount of memory used during the deployment, in MB.
- max_cpu_usagenumber/float
If the deployment has finished, the maximum amount of cpu used during the deployment, in millicores.
created_at : string/time
updated_at : string/time
- notebook_idinteger
The ID of owning Notebook
- credentialslist
A list of credential IDs to pass to the notebook.
- environment_variablesdict
Environment variables to be passed into the Notebook.
- idle_timeoutinteger
How long the notebook will stay alive without any kernel activity.
- partition_labelstring
The partition label used to run this object. Only settable with custom_partitions feature flag. Beware attribute may break or change in the future.
- git_repo_idinteger
The ID of the git repository.
- git_repo_urlstring
The url of the git repository
- git_refstring
The git reference if git repo is specified
- git_pathstring
The path to the .ipynb file in the git repo that will be started up on notebook launch
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- archivedstring
The archival status of the requested item(s).
- hiddenboolean
The hidden status of the item.
- put_archive(id, status)¶
Update the archive status of this object
- Parameters
- idinteger
The ID of the object.
- statusboolean
The desired archived status of the object.
- Returns
civis.response.Response
- idinteger
The ID for this notebook.
- namestring
The name of this notebook.
- languagestring
The kernel language of this notebook.
- descriptionstring
The description of this notebook.
- notebook_urlstring
Time-limited URL to get the .ipynb file for this notebook.
- notebook_preview_urlstring
Time-limited URL to get the .htm preview file for this notebook.
- requirements_urlstring
Time-limited URL to get the requirements.txt file for this notebook.
- file_idstring
The file ID for the S3 file containing the .ipynb file.
- requirements_file_idstring
The file ID for the S3 file containing the requirements.txt file.
- userdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- docker_image_namestring
The name of the docker image to pull from DockerHub.
- docker_image_tagstring
The tag of the docker image to pull from DockerHub (default: latest).
- instance_typestring
The EC2 instance type to deploy to.
- memoryinteger
The amount of memory allocated to the notebook.
- cpuinteger
The amount of cpu allocated to the the notebook.
created_at : string/time
updated_at : string/time
- most_recent_deploymentdict::
- deployment_idinteger
The ID for this deployment.
- user_idinteger
The ID of the owner.
- hoststring
Domain of the deployment.
- namestring
Name of the deployment.
- docker_image_namestring
The name of the docker image to pull from DockerHub.
- docker_image_tagstring
The tag of the docker image to pull from DockerHub (default: latest).
- display_urlstring
A signed URL for viewing the deployed item.
- instance_typestring
The EC2 instance type requested for the deployment.
- memoryinteger
The memory allocated to the deployment, in MB.
- cpuinteger
The cpu allocated to the deployment, in millicores.
- statestring
The state of the deployment.
- state_messagestring
A detailed description of the state.
- max_memory_usagenumber/float
If the deployment has finished, the maximum amount of memory used during the deployment, in MB.
- max_cpu_usagenumber/float
If the deployment has finished, the maximum amount of cpu used during the deployment, in millicores.
created_at : string/time
updated_at : string/time
- notebook_idinteger
The ID of owning Notebook
- credentialslist
A list of credential IDs to pass to the notebook.
- environment_variablesdict
Environment variables to be passed into the Notebook.
- idle_timeoutinteger
How long the notebook will stay alive without any kernel activity.
- partition_labelstring
The partition label used to run this object. Only settable with custom_partitions feature flag. Beware attribute may break or change in the future.
- git_repo_idinteger
The ID of the git repository.
- git_repo_urlstring
The url of the git repository
- git_refstring
The git reference if git repo is specified
- git_pathstring
The path to the .ipynb file in the git repo that will be started up on notebook launch
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- archivedstring
The archival status of the requested item(s).
- hiddenboolean
The hidden status of the item.
- put_git(id, *, git_ref='DEFAULT', git_branch='DEFAULT', git_path='DEFAULT', git_repo_url='DEFAULT', git_ref_type='DEFAULT', pull_from_git='DEFAULT')¶
Attach an item to a file in a git repo
- Parameters
- idinteger
The ID of the file.
- git_refstring, optional
A git reference specifying an unambiguous version of the file. Can be a branch name, or the full or shortened SHA of a commit.
- git_branchstring, optional
The git branch that the file is on.
- git_pathstring, optional
The path of the file in the repository.
- git_repo_urlstring, optional
The URL of the git repository.
- git_ref_typestring, optional
Specifies if the file is versioned by branch or tag.
- pull_from_gitboolean, optional
Automatically pull latest commit from git. Only works for scripts.
- Returns
civis.response.Response
- git_refstring
A git reference specifying an unambiguous version of the file. Can be a branch name, tag or the full or shortened SHA of a commit.
- git_branchstring
The git branch that the file is on.
- git_pathstring
The path of the file in the repository.
- git_repodict::
- idinteger
The ID for this git repository.
- repo_urlstring
The URL for this git repository.
created_at : string/time
updated_at : string/time
- git_ref_typestring
Specifies if the file is versioned by branch or tag.
- pull_from_gitboolean
Automatically pull latest commit from git. Only works for scripts and workflows (assuming you have the feature enabled)
- put_projects(id, project_id)¶
Add a Notebook to a project
- Parameters
- idinteger
The ID of the Notebook.
- project_idinteger
The ID of the project.
- Returns
- None
Response code 204: success
Set the permissions groups has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- group_idslist
An array of one or more group IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
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
- idinteger
The ID of the resource that is shared.
- user_idslist
An array of one or more user IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
- put_transfer(id, user_id, include_dependencies, *, email_body='DEFAULT', send_email='DEFAULT')¶
Transfer ownership of this object to another user
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger
ID of target user
- include_dependenciesboolean
Whether or not to give manage permissions on all dependencies
- email_bodystring, optional
Custom body text for e-mail sent on transfer.
- send_emailboolean, optional
Send email to the target user of the transfer?
- Returns
civis.response.Response
- dependencieslist::
Dependent objects for this object - object_type : string
Dependent object type
- fco_typestring
Human readable dependent object type
- idinteger
Dependent object ID
- namestring
Dependent object name, or nil if the requesting user cannot read this object
- permission_levelstring
Permission level of target user (not user’s groups) for dependent object, or null if no target user
- sharedboolean
Whether dependent object was successfully shared with target user
Notifications¶
- class Notifications(session_kwargs, client, return_type='civis')¶
Examples
>>> import civis >>> client = civis.APIClient() >>> client.notifications.list(...)
Methods
list
(*[, last_event_id, r, mock])Receive a stream of notifications as they come in
- list(*, last_event_id='DEFAULT', r='DEFAULT', mock='DEFAULT')¶
Receive a stream of notifications as they come in
- Parameters
- last_event_idstring, optional
allows browser to keep track of last event fired
- rstring, optional
specifies retry/reconnect timeout
- mockstring, optional
used for testing
- Returns
- None
Response code 200: success
Ontology¶
- class Ontology(session_kwargs, client, return_type='civis')¶
Examples
>>> import civis >>> client = civis.APIClient() >>> client.ontology.list(...)
Methods
list
(*[, subset])List the ontology of column names Civis uses
- list(*, subset='DEFAULT')¶
List the ontology of column names Civis uses
- Parameters
- subsetstring, optional
A subset of fields to return.
- Returns
civis.response.Response
key : string
title : string
- descstring
A description of this field.
aliases : list
Permission_Sets¶
- class Permission_Sets(session_kwargs, client, return_type='civis')¶
Examples
>>> import civis >>> client = civis.APIClient() >>> client.permission_sets.list(...)
Methods
delete_resources
(id, name)Delete a resource in a permission set
delete_resources_shares_groups
(id, name, ...)Revoke the permissions a group has on this object
delete_resources_shares_users
(id, name, user_id)Revoke the permissions a user has on this object
delete_shares_groups
(id, group_id)Revoke the permissions a group has on this object
delete_shares_users
(id, user_id)Revoke the permissions a user has on this object
get
(id)Get a Permission Set
get_resources
(id, name)Get a resource in a permission set
list
(*[, archived, author, limit, page_num, ...])List Permission Sets
list_dependencies
(id, *[, user_id])List dependent objects for this object
list_resources
(id, *[, limit, page_num, ...])List resources in a permission set
list_resources_shares
(id, name)List users and groups permissioned on this object
list_shares
(id)List users and groups permissioned on this object
list_users_permissions
(id, user_id)Get all permissions for a user, in this permission set
patch
(id, *[, name, description])Update some attributes of this Permission Set
patch_resources
(id, name, *[, description])Update a resource in a permission set
post
(name, *[, description])Create a Permission Set
post_resources
(id, name, *[, description])Create a resource in a permission set
put
(id, name, *[, description])Replace all attributes of this Permission Set
put_archive
(id, status)Update the archive status of this object
put_resources_shares_groups
(id, name, ...[, ...])Set the permissions groups has on this object
put_resources_shares_users
(id, name, ...[, ...])Set the permissions users have on this object
put_shares_groups
(id, group_ids, ...[, ...])Set the permissions groups has on this object
put_shares_users
(id, user_ids, ...[, ...])Set the permissions users have on this object
put_transfer
(id, user_id, ...[, email_body, ...])Transfer ownership of this object to another user
- delete_resources(id, name)¶
Delete a resource in a permission set
- Parameters
- idinteger
The ID for this permission set.
- namestring
The name of this resource.
- Returns
- None
Response code 204: success
Revoke the permissions a group has on this object
- Parameters
- idinteger
The ID for this permission set.
- namestring
The name of this resource.
- group_idinteger
The ID of the group.
- Returns
- None
Response code 204: success
Revoke the permissions a user has on this object
- Parameters
- idinteger
The ID for this permission set.
- namestring
The name of this resource.
- user_idinteger
The ID of the user.
- Returns
- None
Response code 204: success
Revoke the permissions a group has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- group_idinteger
The ID of the group.
- Returns
- None
Response code 204: success
Revoke the permissions a user has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger
The ID of the user.
- Returns
- None
Response code 204: success
- get(id)¶
Get a Permission Set
- Parameters
- idinteger
- Returns
civis.response.Response
- idinteger
The ID for this permission set.
- namestring
The name of this permission set.
- descriptionstring
A description of this permission set.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
created_at : string/time
updated_at : string/time
- archivedstring
The archival status of the requested item(s).
- get_resources(id, name)¶
Get a resource in a permission set
- Parameters
- idinteger
The ID for this permission set.
- namestring
The name of this resource.
- Returns
civis.response.Response
- permission_set_idinteger
The ID for the permission set this resource belongs to.
- namestring
The name of this resource.
- descriptionstring
A description of this resource.
created_at : string/time
updated_at : string/time
- list(*, archived='DEFAULT', author='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶
List Permission Sets
- Parameters
- archivedstring, optional
The archival status of the requested item(s).
- authorstring, optional
If specified, return items from any of these authors. It accepts a comma- separated list of user IDs.
- limitinteger, optional
Number of results to return. Defaults to 20. Maximum allowed is 50.
- page_numinteger, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstring, optional
The field on which to order the result set. Defaults to updated_at. Must be one of: updated_at, name, created_at.
- order_dirstring, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iteratorbool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
- Returns
civis.response.PaginatedResponse
- idinteger
The ID for this permission set.
- namestring
The name of this permission set.
- descriptionstring
A description of this permission set.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
created_at : string/time
updated_at : string/time
- archivedstring
The archival status of the requested item(s).
- list_dependencies(id, *, user_id='DEFAULT')¶
List dependent objects for this object
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger, optional
ID of target user
- Returns
civis.response.Response
- object_typestring
Dependent object type
- fco_typestring
Human readable dependent object type
- idinteger
Dependent object ID
- namestring
Dependent object name, or nil if the requesting user cannot read this object
- permission_levelstring
Permission level of target user (not user’s groups) for dependent object, or null if no target user
- shareableboolean
Whether or not the requesting user can share this object.
- list_resources(id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶
List resources in a permission set
- Parameters
- idinteger
The ID for this permission set.
- limitinteger, optional
Number of results to return. Defaults to 50. Maximum allowed is 1000.
- page_numinteger, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstring, optional
The field on which to order the result set. Defaults to name. Must be one of: name, id, updated_at, created_at.
- order_dirstring, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to asc.
- iteratorbool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
- Returns
civis.response.PaginatedResponse
- permission_set_idinteger
The ID for the permission set this resource belongs to.
- namestring
The name of this resource.
- descriptionstring
A description of this resource.
created_at : string/time
updated_at : string/time
List users and groups permissioned on this object
- Parameters
- idinteger
The ID for this permission set.
- namestring
The name of this resource.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
List users and groups permissioned on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
- list_users_permissions(id, user_id)¶
Get all permissions for a user, in this permission set
- Parameters
- idinteger
The ID for this permission set.
- user_idinteger
The ID for the user.
- Returns
civis.response.Response
- resource_namestring
The name of the resource.
- readboolean
If true, the user has read permission on this resource.
- writeboolean
If true, the user has write permission on this resource.
- manageboolean
If true, the user has manage permission on this resource.
- patch(id, *, name='DEFAULT', description='DEFAULT')¶
Update some attributes of this Permission Set
- Parameters
- idinteger
The ID for this permission set.
- namestring, optional
The name of this permission set.
- descriptionstring, optional
A description of this permission set.
- Returns
civis.response.Response
- idinteger
The ID for this permission set.
- namestring
The name of this permission set.
- descriptionstring
A description of this permission set.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
created_at : string/time
updated_at : string/time
- archivedstring
The archival status of the requested item(s).
- patch_resources(id, name, *, description='DEFAULT')¶
Update a resource in a permission set
- Parameters
- idinteger
The ID for this permission set.
- namestring
The name of this resource.
- descriptionstring, optional
A description of this resource.
- Returns
civis.response.Response
- permission_set_idinteger
The ID for the permission set this resource belongs to.
- namestring
The name of this resource.
- descriptionstring
A description of this resource.
created_at : string/time
updated_at : string/time
- post(name, *, description='DEFAULT')¶
Create a Permission Set
- Parameters
- namestring
The name of this permission set.
- descriptionstring, optional
A description of this permission set.
- Returns
civis.response.Response
- idinteger
The ID for this permission set.
- namestring
The name of this permission set.
- descriptionstring
A description of this permission set.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
created_at : string/time
updated_at : string/time
- archivedstring
The archival status of the requested item(s).
- post_resources(id, name, *, description='DEFAULT')¶
Create a resource in a permission set
- Parameters
- idinteger
The ID for this permission set.
- namestring
The name of this resource.
- descriptionstring, optional
A description of this resource.
- Returns
civis.response.Response
- permission_set_idinteger
The ID for the permission set this resource belongs to.
- namestring
The name of this resource.
- descriptionstring
A description of this resource.
created_at : string/time
updated_at : string/time
- put(id, name, *, description='DEFAULT')¶
Replace all attributes of this Permission Set
- Parameters
- idinteger
The ID for this permission set.
- namestring
The name of this permission set.
- descriptionstring, optional
A description of this permission set.
- Returns
civis.response.Response
- idinteger
The ID for this permission set.
- namestring
The name of this permission set.
- descriptionstring
A description of this permission set.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
created_at : string/time
updated_at : string/time
- archivedstring
The archival status of the requested item(s).
- put_archive(id, status)¶
Update the archive status of this object
- Parameters
- idinteger
The ID of the object.
- statusboolean
The desired archived status of the object.
- Returns
civis.response.Response
- idinteger
The ID for this permission set.
- namestring
The name of this permission set.
- descriptionstring
A description of this permission set.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
created_at : string/time
updated_at : string/time
- archivedstring
The archival status of the requested item(s).
Set the permissions groups has on this object
- Parameters
- idinteger
The ID for this permission set.
- namestring
The name of this resource.
- group_idslist
An array of one or more group IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
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
- idinteger
The ID for this permission set.
- namestring
The name of this resource.
- user_idslist
An array of one or more user IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
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
- idinteger
The ID of the resource that is shared.
- group_idslist
An array of one or more group IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
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
- idinteger
The ID of the resource that is shared.
- user_idslist
An array of one or more user IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
- put_transfer(id, user_id, include_dependencies, *, email_body='DEFAULT', send_email='DEFAULT')¶
Transfer ownership of this object to another user
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger
ID of target user
- include_dependenciesboolean
Whether or not to give manage permissions on all dependencies
- email_bodystring, optional
Custom body text for e-mail sent on transfer.
- send_emailboolean, optional
Send email to the target user of the transfer?
- Returns
civis.response.Response
- dependencieslist::
Dependent objects for this object - object_type : string
Dependent object type
- fco_typestring
Human readable dependent object type
- idinteger
Dependent object ID
- namestring
Dependent object name, or nil if the requesting user cannot read this object
- permission_levelstring
Permission level of target user (not user’s groups) for dependent object, or null if no target user
- sharedboolean
Whether dependent object was successfully shared with target user
Predictions¶
- class Predictions(session_kwargs, client, return_type='civis')¶
Examples
>>> import civis >>> client = civis.APIClient() >>> client.predictions.list(...)
Methods
get
(id)Show the specified prediction
list
(*[, model_id])List predictions
list_schedules
(id)Show the prediction schedule
- get(id)¶
Show the specified prediction
- Parameters
- idinteger
The ID of the prediction.
- Returns
civis.response.Response
- idinteger
The ID of the prediction.
- model_idinteger
The ID of the model used for this prediction.
- scored_table_idinteger
The ID of the source table for this prediction.
- scored_table_namestring
The name of the source table for this prediction.
- output_table_namestring
The name of the output table for this prediction.
- statestring
The state of the last run of this prediction.
- errorstring
The error, if any, of the last run of this prediction.
- started_atstring/date-time
The start time of the last run of this prediction.
- finished_atstring/date-time
The end time of the last run of this prediction.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- scored_tableslist::
An array of created prediction tables. - id : integer
The ID of the table with created predictions.
- schemastring
The schema of table with created predictions.
- namestring
The name of table with created predictions.
- created_atstring/date-time
The time when the table with created predictions was created.
- score_statslist::
An array of metrics on the created predictions. - score_name : string
The name of the score.
- histogramlist
The histogram of the distribution of scores.
- avg_scorenumber/float
The average score.
- min_scorenumber/float
The minimum score.
- max_scorenumber/float
The maximum score.
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- limiting_sqlstring
A SQL WHERE clause used to scope the rows to be predicted.
- primary_keylist
The primary key or composite keys of the table being predicted.
- list(*, model_id='DEFAULT')¶
List predictions
- Parameters
- model_idinteger, optional
If specified, only return predictions associated with this model ID.
- Returns
civis.response.Response
- idinteger
The ID of the prediction.
- model_idinteger
The ID of the model used for this prediction.
- scored_table_idinteger
The ID of the source table for this prediction.
- scored_table_namestring
The name of the source table for this prediction.
- output_table_namestring
The name of the output table for this prediction.
- statestring
The state of the last run of this prediction.
- errorstring
The error, if any, of the last run of this prediction.
- started_atstring/date-time
The start time of the last run of this prediction.
- finished_atstring/date-time
The end time of the last run of this prediction.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- list_schedules(id)¶
Show the prediction schedule
- Parameters
- idinteger
ID of the prediction associated with this schedule.
- Returns
civis.response.Response
- idinteger
ID of the prediction associated with this schedule.
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- score_on_model_buildboolean
Whether the prediction will run after a rebuild of the associated model.
Projects¶
- class Projects(session_kwargs, client, return_type='civis')¶
Examples
>>> import civis >>> client = civis.APIClient() >>> client.projects.list(...)
Methods
delete_parent_projects
(id, parent_project_id)Remove an item from a Parent Project
delete_shares_groups
(id, group_id)Revoke the permissions a group has on this object
delete_shares_users
(id, user_id)Revoke the permissions a user has on this object
get
(project_id)Get a detailed view of a project and the objects in it
list
(*[, permission, author, hidden, ...])List projects
list_dependencies
(id, *[, user_id])List dependent objects for this object
list_parent_projects
(id, *[, hidden])List the Parent Projects an item belongs to
list_shares
(id)List users and groups permissioned on this object
post
(name, description, *[, note, hidden])Create a project
put
(project_id, *[, name, description, ...])Update a project
put_archive
(id, status)Update the archive status of this object
put_parent_projects
(id, parent_project_id)Add an item to a Parent Project
put_shares_groups
(id, group_ids, ...[, ...])Set the permissions groups has on this object
put_shares_users
(id, user_ids, ...[, ...])Set the permissions users have on this object
put_transfer
(id, user_id, ...[, email_body, ...])Transfer ownership of this object to another user
- delete_parent_projects(id, parent_project_id)¶
Remove an item from a Parent Project
- Parameters
- idinteger
The ID of the item.
- parent_project_idinteger
The ID of the Parent Project.
- Returns
- None
Response code 204: success
Revoke the permissions a group has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- group_idinteger
The ID of the group.
- Returns
- None
Response code 204: success
Revoke the permissions a user has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger
The 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_idinteger
- Returns
civis.response.Response
- idinteger
The ID for this project.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- namestring
The name of this project.
- descriptionstring
A description of the project.
- userslist::
Users who can see the project. - id : integer
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
auto_share : boolean
created_at : string/time
updated_at : string/time
- tableslist::
schema : string
name : string
row_count : integer
column_count : integer
created_at : string/time
updated_at : string/time
- surveyslist::
- idinteger
The item’s ID.
created_at : string/time
updated_at : string/time
- scriptslist::
- idinteger
The item’s ID.
created_at : string/time
updated_at : string/time
name : string
type : string
finished_at : string/time
state : string
- last_rundict::
state : string
updated_at : string/time
- importslist::
- idinteger
The item’s ID.
created_at : string/time
updated_at : string/time
name : string
type : string
finished_at : string/time
state : string
- last_rundict::
state : string
updated_at : string/time
- exportslist::
- idinteger
The item’s ID.
created_at : string/time
updated_at : string/time
name : string
type : string
finished_at : string/time
state : string
- last_rundict::
state : string
updated_at : string/time
- modelslist::
- idinteger
The item’s ID.
created_at : string/time
updated_at : string/time
name : string
state : string
- notebookslist::
- idinteger
The item’s ID.
created_at : string/time
updated_at : string/time
name : string
current_deployment_id : integer
- last_deploydict::
state : string
updated_at : string/time
- serviceslist::
- idinteger
The item’s ID.
created_at : string/time
updated_at : string/time
name : string
current_deployment_id : integer
- last_deploydict::
state : string
updated_at : string/time
- workflowslist::
- idinteger
The item’s ID.
created_at : string/time
updated_at : string/time
name : string
state : string
- last_executiondict::
state : string
updated_at : string/time
- reportslist::
- idinteger
The item’s ID.
created_at : string/time
updated_at : string/time
name : string
state : string
- script_templateslist::
- idinteger
The item’s ID.
created_at : string/time
updated_at : string/time
name : string
- fileslist::
- idinteger
The item’s ID.
created_at : string/time
updated_at : string/time
file_name : string
file_size : integer
expired : boolean
- enhancementslist::
- idinteger
The item’s ID.
created_at : string/time
updated_at : string/time
name : string
- last_rundict::
state : string
updated_at : string/time
- projectslist::
- idinteger
The item’s ID.
created_at : string/time
updated_at : string/time
name : string
description : string
- all_objectslist::
project_id : integer
object_id : integer
object_type : string
fco_type : string
sub_type : string
name : string
icon : string
author : string
updated_at : string/time
- archivedstring
The archival status of the requested item(s).
- hiddenboolean
The hidden status of the item.
note : string
- hiddenboolean
The hidden status of the item.
- archivedstring
The archival status of the requested item(s).
- parent_projectdict::
- idinteger
The parent project’s ID.
- nameinteger
The parent project’s name.
- list(*, permission='DEFAULT', author='DEFAULT', hidden='DEFAULT', archived='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶
List projects
- Parameters
- permissionstring, optional
A permissions string, one of “read”, “write”, or “manage”. Lists only projects for which the current user has that permission.
- authorstring, optional
If specified, return items from any of these authors. It accepts a comma- separated list of user IDs.
- hiddenboolean, optional
If specified to be true, returns hidden items. Defaults to false, returning non-hidden items.
- archivedstring, optional
The archival status of the requested item(s).
- limitinteger, optional
Number of results to return. Defaults to 20. Maximum allowed is 1000.
- page_numinteger, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstring, optional
The field on which to order the result set. Defaults to updated_at. Must be one of: updated_at, name, created_at.
- order_dirstring, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iteratorbool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
- Returns
civis.response.PaginatedResponse
- idinteger
The ID for this project.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- namestring
The name of this project.
- descriptionstring
A description of the project.
- userslist::
Users who can see the project. - id : integer
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
auto_share : boolean
created_at : string/time
updated_at : string/time
- archivedstring
The archival status of the requested item(s).
- list_dependencies(id, *, user_id='DEFAULT')¶
List dependent objects for this object
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger, optional
ID of target user
- Returns
civis.response.Response
- object_typestring
Dependent object type
- fco_typestring
Human readable dependent object type
- idinteger
Dependent object ID
- namestring
Dependent object name, or nil if the requesting user cannot read this object
- permission_levelstring
Permission level of target user (not user’s groups) for dependent object, or null if no target user
- shareableboolean
Whether or not the requesting user can share this object.
- list_parent_projects(id, *, hidden='DEFAULT')¶
List the Parent Projects an item belongs to
- Parameters
- idinteger
The ID of the item.
- hiddenboolean, optional
If specified to be true, returns hidden items. Defaults to false, returning non-hidden items.
- Returns
civis.response.Response
- idinteger
The ID for this project.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- namestring
The name of this project.
- descriptionstring
A description of the project.
- userslist::
Users who can see the project. - id : integer
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
auto_share : boolean
created_at : string/time
updated_at : string/time
- archivedstring
The archival status of the requested item(s).
List users and groups permissioned on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
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
- namestring
The name of this project.
- descriptionstring
A description of the project.
- notestring, optional
Notes for the project.
- hiddenboolean, optional
The hidden status of the item.
- Returns
civis.response.Response
- idinteger
The ID for this project.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- namestring
The name of this project.
- descriptionstring
A description of the project.
- userslist::
Users who can see the project. - id : integer
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
auto_share : boolean
created_at : string/time
updated_at : string/time
- tableslist::
schema : string
name : string
row_count : integer
column_count : integer
created_at : string/time
updated_at : string/time
- surveyslist::
- idinteger
The item’s ID.
created_at : string/time
updated_at : string/time
- scriptslist::
- idinteger
The item’s ID.
created_at : string/time
updated_at : string/time
name : string
type : string
finished_at : string/time
state : string
- last_rundict::
state : string
updated_at : string/time
- importslist::
- idinteger
The item’s ID.
created_at : string/time
updated_at : string/time
name : string
type : string
finished_at : string/time
state : string
- last_rundict::
state : string
updated_at : string/time
- exportslist::
- idinteger
The item’s ID.
created_at : string/time
updated_at : string/time
name : string
type : string
finished_at : string/time
state : string
- last_rundict::
state : string
updated_at : string/time
- modelslist::
- idinteger
The item’s ID.
created_at : string/time
updated_at : string/time
name : string
state : string
- notebookslist::
- idinteger
The item’s ID.
created_at : string/time
updated_at : string/time
name : string
current_deployment_id : integer
- last_deploydict::
state : string
updated_at : string/time
- serviceslist::
- idinteger
The item’s ID.
created_at : string/time
updated_at : string/time
name : string
current_deployment_id : integer
- last_deploydict::
state : string
updated_at : string/time
- workflowslist::
- idinteger
The item’s ID.
created_at : string/time
updated_at : string/time
name : string
state : string
- last_executiondict::
state : string
updated_at : string/time
- reportslist::
- idinteger
The item’s ID.
created_at : string/time
updated_at : string/time
name : string
state : string
- script_templateslist::
- idinteger
The item’s ID.
created_at : string/time
updated_at : string/time
name : string
- fileslist::
- idinteger
The item’s ID.
created_at : string/time
updated_at : string/time
file_name : string
file_size : integer
expired : boolean
- enhancementslist::
- idinteger
The item’s ID.
created_at : string/time
updated_at : string/time
name : string
- last_rundict::
state : string
updated_at : string/time
- projectslist::
- idinteger
The item’s ID.
created_at : string/time
updated_at : string/time
name : string
description : string
- all_objectslist::
project_id : integer
object_id : integer
object_type : string
fco_type : string
sub_type : string
name : string
icon : string
author : string
updated_at : string/time
- archivedstring
The archival status of the requested item(s).
- hiddenboolean
The hidden status of the item.
note : string
- hiddenboolean
The hidden status of the item.
- archivedstring
The archival status of the requested item(s).
- parent_projectdict::
- idinteger
The parent project’s ID.
- nameinteger
The parent project’s name.
- put(project_id, *, name='DEFAULT', description='DEFAULT', note='DEFAULT', auto_share='DEFAULT')¶
Update a project
- Parameters
- project_idinteger
- namestring, optional
The name of this project.
- descriptionstring, optional
A description of the project.
- notestring, optional
Notes for the project.
- auto_shareboolean, optional
A toggle for sharing the objects within the project when the project is shared.This does not automatically share new objects to the project.
- Returns
civis.response.Response
- idinteger
The ID for this project.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- namestring
The name of this project.
- descriptionstring
A description of the project.
- userslist::
Users who can see the project. - id : integer
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
auto_share : boolean
created_at : string/time
updated_at : string/time
- tableslist::
schema : string
name : string
row_count : integer
column_count : integer
created_at : string/time
updated_at : string/time
- surveyslist::
- idinteger
The item’s ID.
created_at : string/time
updated_at : string/time
- scriptslist::
- idinteger
The item’s ID.
created_at : string/time
updated_at : string/time
name : string
type : string
finished_at : string/time
state : string
- last_rundict::
state : string
updated_at : string/time
- importslist::
- idinteger
The item’s ID.
created_at : string/time
updated_at : string/time
name : string
type : string
finished_at : string/time
state : string
- last_rundict::
state : string
updated_at : string/time
- exportslist::
- idinteger
The item’s ID.
created_at : string/time
updated_at : string/time
name : string
type : string
finished_at : string/time
state : string
- last_rundict::
state : string
updated_at : string/time
- modelslist::
- idinteger
The item’s ID.
created_at : string/time
updated_at : string/time
name : string
state : string
- notebookslist::
- idinteger
The item’s ID.
created_at : string/time
updated_at : string/time
name : string
current_deployment_id : integer
- last_deploydict::
state : string
updated_at : string/time
- serviceslist::
- idinteger
The item’s ID.
created_at : string/time
updated_at : string/time
name : string
current_deployment_id : integer
- last_deploydict::
state : string
updated_at : string/time
- workflowslist::
- idinteger
The item’s ID.
created_at : string/time
updated_at : string/time
name : string
state : string
- last_executiondict::
state : string
updated_at : string/time
- reportslist::
- idinteger
The item’s ID.
created_at : string/time
updated_at : string/time
name : string
state : string
- script_templateslist::
- idinteger
The item’s ID.
created_at : string/time
updated_at : string/time
name : string
- fileslist::
- idinteger
The item’s ID.
created_at : string/time
updated_at : string/time
file_name : string
file_size : integer
expired : boolean
- enhancementslist::
- idinteger
The item’s ID.
created_at : string/time
updated_at : string/time
name : string
- last_rundict::
state : string
updated_at : string/time
- projectslist::
- idinteger
The item’s ID.
created_at : string/time
updated_at : string/time
name : string
description : string
- all_objectslist::
project_id : integer
object_id : integer
object_type : string
fco_type : string
sub_type : string
name : string
icon : string
author : string
updated_at : string/time
- archivedstring
The archival status of the requested item(s).
- hiddenboolean
The hidden status of the item.
note : string
- hiddenboolean
The hidden status of the item.
- archivedstring
The archival status of the requested item(s).
- parent_projectdict::
- idinteger
The parent project’s ID.
- nameinteger
The parent project’s name.
- put_archive(id, status)¶
Update the archive status of this object
- Parameters
- idinteger
The ID of the object.
- statusboolean
The desired archived status of the object.
- Returns
civis.response.Response
- idinteger
The ID for this project.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- namestring
The name of this project.
- descriptionstring
A description of the project.
- userslist::
Users who can see the project. - id : integer
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
auto_share : boolean
created_at : string/time
updated_at : string/time
- tableslist::
schema : string
name : string
row_count : integer
column_count : integer
created_at : string/time
updated_at : string/time
- surveyslist::
- idinteger
The item’s ID.
created_at : string/time
updated_at : string/time
- scriptslist::
- idinteger
The item’s ID.
created_at : string/time
updated_at : string/time
name : string
type : string
finished_at : string/time
state : string
- last_rundict::
state : string
updated_at : string/time
- importslist::
- idinteger
The item’s ID.
created_at : string/time
updated_at : string/time
name : string
type : string
finished_at : string/time
state : string
- last_rundict::
state : string
updated_at : string/time
- exportslist::
- idinteger
The item’s ID.
created_at : string/time
updated_at : string/time
name : string
type : string
finished_at : string/time
state : string
- last_rundict::
state : string
updated_at : string/time
- modelslist::
- idinteger
The item’s ID.
created_at : string/time
updated_at : string/time
name : string
state : string
- notebookslist::
- idinteger
The item’s ID.
created_at : string/time
updated_at : string/time
name : string
current_deployment_id : integer
- last_deploydict::
state : string
updated_at : string/time
- serviceslist::
- idinteger
The item’s ID.
created_at : string/time
updated_at : string/time
name : string
current_deployment_id : integer
- last_deploydict::
state : string
updated_at : string/time
- workflowslist::
- idinteger
The item’s ID.
created_at : string/time
updated_at : string/time
name : string
state : string
- last_executiondict::
state : string
updated_at : string/time
- reportslist::
- idinteger
The item’s ID.
created_at : string/time
updated_at : string/time
name : string
state : string
- script_templateslist::
- idinteger
The item’s ID.
created_at : string/time
updated_at : string/time
name : string
- fileslist::
- idinteger
The item’s ID.
created_at : string/time
updated_at : string/time
file_name : string
file_size : integer
expired : boolean
- enhancementslist::
- idinteger
The item’s ID.
created_at : string/time
updated_at : string/time
name : string
- last_rundict::
state : string
updated_at : string/time
- projectslist::
- idinteger
The item’s ID.
created_at : string/time
updated_at : string/time
name : string
description : string
- all_objectslist::
project_id : integer
object_id : integer
object_type : string
fco_type : string
sub_type : string
name : string
icon : string
author : string
updated_at : string/time
- archivedstring
The archival status of the requested item(s).
- hiddenboolean
The hidden status of the item.
note : string
- hiddenboolean
The hidden status of the item.
- archivedstring
The archival status of the requested item(s).
- parent_projectdict::
- idinteger
The parent project’s ID.
- nameinteger
The parent project’s name.
- put_parent_projects(id, parent_project_id)¶
Add an item to a Parent Project
- Parameters
- idinteger
The ID of the item.
- parent_project_idinteger
The ID of the Parent Project.
- Returns
- None
Response code 204: success
Set the permissions groups has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- group_idslist
An array of one or more group IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
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
- idinteger
The ID of the resource that is shared.
- user_idslist
An array of one or more user IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
- put_transfer(id, user_id, include_dependencies, *, email_body='DEFAULT', send_email='DEFAULT')¶
Transfer ownership of this object to another user
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger
ID of target user
- include_dependenciesboolean
Whether or not to give manage permissions on all dependencies
- email_bodystring, optional
Custom body text for e-mail sent on transfer.
- send_emailboolean, optional
Send email to the target user of the transfer?
- Returns
civis.response.Response
- dependencieslist::
Dependent objects for this object - object_type : string
Dependent object type
- fco_typestring
Human readable dependent object type
- idinteger
Dependent object ID
- namestring
Dependent object name, or nil if the requesting user cannot read this object
- permission_levelstring
Permission level of target user (not user’s groups) for dependent object, or null if no target user
- sharedboolean
Whether dependent object was successfully shared with target user
Queries¶
- class Queries(session_kwargs, client, return_type='civis')¶
Examples
>>> import civis >>> client = civis.APIClient() >>> client.queries.list(...)
Methods
delete
(id)Sets Query Hidden to true
delete_runs
(id, run_id)Cancel a run
get
(id)Get details about a query
get_runs
(id, run_id)Check status of a run
list
(*[, database_id, credential_id, ...])List
list_runs
(id, *[, limit, page_num, order, ...])List runs for the given query
list_runs_logs
(id, run_id, *[, last_id, limit])Get the logs for a run
post
(database, sql, preview_rows, *[, ...])Execute a query
post_runs
(id)Start a run
put_scripts
(id, script_id)Update the query's associated script
- delete(id)¶
Sets Query Hidden to true
- Parameters
- idinteger
The query ID.
- Returns
civis.response.Response
- idinteger
The query ID.
- databaseinteger
The database ID.
- sqlstring
The SQL to execute.
- credentialinteger
The credential ID.
- result_rowslist
A preview of rows returned by the query.
- result_columnslist
A preview of columns returned by the query.
- script_idinteger
The ID of the script associated with this query.
- exceptionstring
Deprecated and not used.
- errorstring
The error message for this run, if present.
created_at : string/time
updated_at : string/time
- started_atstring/date-time
The start time of the last run.
- finished_atstring/date-time
The end time of the last run.
- statestring
The state of the last run. One of queued, running, succeeded, failed, and cancelled.
- last_run_idinteger
The ID of the last run.
- hiddenboolean
The hidden status of the item.
- archivedstring
The archival status of the requested item(s).
- namestring
The name of the query.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- report_idinteger
The ID of the report associated with this query.
- delete_runs(id, run_id)¶
Cancel a run
- Parameters
- idinteger
The ID of the query.
- run_idinteger
The ID of the run.
- Returns
- None
Response code 202: success
- get(id)¶
Get details about a query
- Parameters
- idinteger
The query ID.
- Returns
civis.response.Response
- idinteger
The query ID.
- databaseinteger
The database ID.
- sqlstring
The SQL to execute.
- credentialinteger
The credential ID.
- result_rowslist
A preview of rows returned by the query.
- result_columnslist
A preview of columns returned by the query.
- script_idinteger
The ID of the script associated with this query.
- exceptionstring
Deprecated and not used.
- errorstring
The error message for this run, if present.
created_at : string/time
updated_at : string/time
- started_atstring/date-time
The start time of the last run.
- finished_atstring/date-time
The end time of the last run.
- statestring
The state of the last run. One of queued, running, succeeded, failed, and cancelled.
- last_run_idinteger
The ID of the last run.
- hiddenboolean
The hidden status of the item.
- archivedstring
The archival status of the requested item(s).
- namestring
The name of the query.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- report_idinteger
The ID of the report associated with this query.
- get_runs(id, run_id)¶
Check status of a run
- Parameters
- idinteger
The ID of the query.
- run_idinteger
The ID of the run.
- Returns
civis.response.Response
- idinteger
The ID of the run.
- query_idinteger
The ID of the query.
- statestring
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- is_cancel_requestedboolean
True if run cancel requested, else false.
- started_atstring/time
The time the last run started at.
- finished_atstring/time
The time the last run completed.
- errorstring
The error, if any, returned by the run.
- list(*, database_id='DEFAULT', credential_id='DEFAULT', author_id='DEFAULT', created_before='DEFAULT', created_after='DEFAULT', started_before='DEFAULT', started_after='DEFAULT', state='DEFAULT', exclude_results='DEFAULT', hidden='DEFAULT', archived='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶
List
- Parameters
- database_idinteger, optional
The database ID.
- credential_idinteger, optional
The credential ID.
- author_idinteger, optional
The author of the query.
- created_beforestring, optional
An upper bound for the creation date of the query.
- created_afterstring, optional
A lower bound for the creation date of the query.
- started_beforestring, optional
An upper bound for the start date of the last run.
- started_afterstring, optional
A lower bound for the start date of the last run.
- statearray, optional
The state of the last run. One or more of queued, running, succeeded, failed, and cancelled. Specify multiple values as a comma-separated list (e.g., “A,B”).
- exclude_resultsboolean, optional
If true, does not return cached query results.
- hiddenboolean, optional
If specified to be true, returns hidden items. Defaults to false, returning non-hidden items.
- archivedstring, optional
The archival status of the requested item(s).
- limitinteger, optional
Number of results to return. Defaults to 20. Maximum allowed is 50.
- page_numinteger, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstring, optional
The field on which to order the result set. Defaults to created_at. Must be one of: created_at, started_at.
- order_dirstring, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iteratorbool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
- Returns
civis.response.PaginatedResponse
- idinteger
The query ID.
- databaseinteger
The database ID.
- sqlstring
The SQL to execute.
- credentialinteger
The credential ID.
- result_rowslist
A preview of rows returned by the query.
- result_columnslist
A preview of columns returned by the query.
- script_idinteger
The ID of the script associated with this query.
- exceptionstring
Deprecated and not used.
- errorstring
The error message for this run, if present.
created_at : string/time
updated_at : string/time
- started_atstring/date-time
The start time of the last run.
- finished_atstring/date-time
The end time of the last run.
- statestring
The state of the last run. One of queued, running, succeeded, failed, and cancelled.
- last_run_idinteger
The ID of the last run.
- archivedstring
The archival status of the requested item(s).
- preview_rowsinteger
The number of rows to save from the query’s result (maximum: 100).
- report_idinteger
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
- idinteger
The ID of the query.
- limitinteger, optional
Number of results to return. Defaults to 20. Maximum allowed is 100.
- page_numinteger, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstring, optional
The field on which to order the result set. Defaults to id. Must be one of: id.
- order_dirstring, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iteratorbool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
- Returns
civis.response.PaginatedResponse
- idinteger
The ID of the run.
- query_idinteger
The ID of the query.
- statestring
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- is_cancel_requestedboolean
True if run cancel requested, else false.
- started_atstring/time
The time the last run started at.
- finished_atstring/time
The time the last run completed.
- errorstring
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
- idinteger
The ID of the query.
- run_idinteger
The ID of the run.
- last_idinteger, 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.
- limitinteger, optional
The maximum number of log messages to return. Default of 10000.
- Returns
civis.response.Response
- idinteger
The ID of the log.
- created_atstring/date-time
The time the log was created.
- messagestring
The log message.
- levelstring
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
- databaseinteger
The database ID.
- sqlstring
The SQL to execute.
- preview_rowsinteger
The number of rows to save from the query’s result (maximum: 100).
- credentialinteger, optional
The credential ID.
- hiddenboolean, optional
The hidden status of the item.
- interactiveboolean, optional
Deprecated and not used.
- include_headerboolean, optional
Whether the CSV output should include a header row [default: true].
- compressionstring, optional
The type of compression. One of gzip or zip, or none [default: gzip].
- column_delimiterstring, optional
The delimiter to use. One of comma or tab, or pipe [default: comma].
- unquotedboolean, optional
If true, will not quote fields.
- filename_prefixstring, optional
The output filename prefix.
- Returns
civis.response.Response
- idinteger
The query ID.
- databaseinteger
The database ID.
- sqlstring
The SQL to execute.
- credentialinteger
The credential ID.
- result_rowslist
A preview of rows returned by the query.
- result_columnslist
A preview of columns returned by the query.
- script_idinteger
The ID of the script associated with this query.
- exceptionstring
Deprecated and not used.
- errorstring
The error message for this run, if present.
created_at : string/time
updated_at : string/time
- started_atstring/date-time
The start time of the last run.
- finished_atstring/date-time
The end time of the last run.
- statestring
The state of the last run. One of queued, running, succeeded, failed, and cancelled.
- last_run_idinteger
The ID of the last run.
- hiddenboolean
The hidden status of the item.
- archivedstring
The archival status of the requested item(s).
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- interactiveboolean
Deprecated and not used.
- preview_rowsinteger
The number of rows to save from the query’s result (maximum: 100).
- include_headerboolean
Whether the CSV output should include a header row [default: true].
- compressionstring
The type of compression. One of gzip or zip, or none [default: gzip].
- column_delimiterstring
The delimiter to use. One of comma or tab, or pipe [default: comma].
- unquotedboolean
If true, will not quote fields.
- filename_prefixstring
The output filename prefix.
- report_idinteger
The ID of the report associated with this query.
- post_runs(id)¶
Start a run
- Parameters
- idinteger
The ID of the query.
- Returns
civis.response.Response
- idinteger
The ID of the run.
- query_idinteger
The ID of the query.
- statestring
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- is_cancel_requestedboolean
True if run cancel requested, else false.
- started_atstring/time
The time the last run started at.
- finished_atstring/time
The time the last run completed.
- errorstring
The error, if any, returned by the run.
- put_scripts(id, script_id)¶
Update the query’s associated script
- Parameters
- idinteger
The query ID.
- script_idinteger
The ID of the script associated with this query.
- Returns
civis.response.Response
- idinteger
The query ID.
- databaseinteger
The database ID.
- sqlstring
The SQL to execute.
- credentialinteger
The credential ID.
- result_rowslist
A preview of rows returned by the query.
- result_columnslist
A preview of columns returned by the query.
- script_idinteger
The ID of the script associated with this query.
- exceptionstring
Deprecated and not used.
- errorstring
The error message for this run, if present.
created_at : string/time
updated_at : string/time
- started_atstring/date-time
The start time of the last run.
- finished_atstring/date-time
The end time of the last run.
- statestring
The state of the last run. One of queued, running, succeeded, failed, and cancelled.
- last_run_idinteger
The ID of the last run.
- hiddenboolean
The hidden status of the item.
- archivedstring
The archival status of the requested item(s).
- namestring
The name of the query.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- report_idinteger
The ID of the report associated with this query.
Remote_Hosts¶
- class Remote_Hosts(session_kwargs, client, return_type='civis')¶
Examples
>>> import civis >>> client = civis.APIClient() >>> client.remote_hosts.list_shares(...)
Methods
delete_shares_groups
(id, group_id)Revoke the permissions a group has on this object
delete_shares_users
(id, user_id)Revoke the permissions a user has on this object
list
(*[, type])List the remote hosts
list_data_sets
(id, *[, credential_id, ...])List data sets available from a remote host
list_shares
(id)List users and groups permissioned on this object
post
(name, url, type)Create a new remote host
post_authenticate
(id, *[, credential_id, ...])Authenticate against a remote host using either a credential or a user name and password
put_shares_groups
(id, group_ids, ...[, ...])Set the permissions groups has on this object
put_shares_users
(id, user_ids, ...[, ...])Set the permissions users have on this object
Revoke the permissions a group has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- group_idinteger
The ID of the group.
- Returns
- None
Response code 204: success
Revoke the permissions a user has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger
The ID of the user.
- Returns
- None
Response code 204: success
- list(*, type='DEFAULT')¶
List the remote hosts
- Parameters
- typestring, optional
The type of remote host. One of: RemoteHostTypes::Bigquery, RemoteHostTypes::Bitbucket, RemoteHostTypes::GitSSH, RemoteHostTypes::Github, RemoteHostTypes::GoogleDoc, RemoteHostTypes::JDBC, RemoteHostTypes::Postgres, RemoteHostTypes::Redshift, RemoteHostTypes::S3Storage, and RemoteHostTypes::Salesforce
- Returns
civis.response.Response
- idinteger
The ID of the remote host.
- namestring
The name of the remote host.
- typestring
The type of remote host. One of: RemoteHostTypes::Bigquery, RemoteHostTypes::Bitbucket, RemoteHostTypes::GitSSH, RemoteHostTypes::Github, RemoteHostTypes::GoogleDoc, RemoteHostTypes::JDBC, RemoteHostTypes::Postgres, RemoteHostTypes::Redshift, RemoteHostTypes::S3Storage, and RemoteHostTypes::Salesforce
- urlstring
The URL for remote host.
- list_data_sets(id, *, credential_id='DEFAULT', username='DEFAULT', password='DEFAULT', q='DEFAULT', s='DEFAULT')¶
List data sets available from a remote host
- Parameters
- idinteger
The ID of the remote host.
- credential_idinteger, optional
The credential ID.
- usernamestring, optional
The user name for remote host.
- passwordstring, optional
The password for remote host.
- qstring, optional
The query string for data set.
- sboolean, optional
If true will only return schemas, otherwise, the results will be the full path.
- Returns
civis.response.Response
- namestring
The path to a data_set.
- full_pathboolean
Boolean that indicates whether further querying needs to be done before the table can be selected.
List users and groups permissioned on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
- post(name, url, type)¶
Create a new remote host
- Parameters
- namestring
The human readable name for the remote host.
- urlstring
The URL to your host.
- typestring
The type of remote host. One of: RemoteHostTypes::Bigquery, RemoteHostTypes::Bitbucket, RemoteHostTypes::GitSSH, RemoteHostTypes::Github, RemoteHostTypes::GoogleDoc, RemoteHostTypes::JDBC, RemoteHostTypes::Postgres, RemoteHostTypes::Redshift, RemoteHostTypes::S3Storage, and RemoteHostTypes::Salesforce
- Returns
civis.response.Response
- idinteger
The ID of the remote host.
- namestring
The name of the remote host.
- typestring
The type of remote host. One of: RemoteHostTypes::Bigquery, RemoteHostTypes::Bitbucket, RemoteHostTypes::GitSSH, RemoteHostTypes::Github, RemoteHostTypes::GoogleDoc, RemoteHostTypes::JDBC, RemoteHostTypes::Postgres, RemoteHostTypes::Redshift, RemoteHostTypes::S3Storage, and RemoteHostTypes::Salesforce
- urlstring
The URL for remote host.
- post_authenticate(id, *, credential_id='DEFAULT', username='DEFAULT', password='DEFAULT')¶
Authenticate against a remote host using either a credential or a user name and password
- Parameters
- idinteger
The ID of the remote host.
- credential_idinteger, optional
The credential ID.
- usernamestring, optional
The user name for remote host.
- passwordstring, optional
The password for remote host.
- Returns
- None
Response code 204: success
Set the permissions groups has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- group_idslist
An array of one or more group IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
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
- idinteger
The ID of the resource that is shared.
- user_idslist
An array of one or more user IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
Reports¶
- class Reports(session_kwargs, client, return_type='civis')¶
Examples
>>> import civis >>> client = civis.APIClient() >>> client.reports.list(...)
Methods
delete_grants
(id)Revoke permission for this report to perform Civis platform API operations on your behalf
delete_projects
(id, project_id)Remove a Report from a project
delete_services_projects
(id, project_id)Remove a Service Report from a project
delete_services_shares_groups
(id, group_id)Revoke the permissions a group has on this object
delete_services_shares_users
(id, user_id)Revoke the permissions a user has on this object
delete_shares_groups
(id, group_id)Revoke the permissions a group has on this object
delete_shares_users
(id, user_id)Revoke the permissions a user has on this object
get
(id)Show a single report
get_git_commits
(id, commit_hash)Get file contents at git ref
get_services
(id)Show a single service report
list
(*[, type, template_id, author, hidden, ...])List Reports
list_dependencies
(id, *[, user_id])List dependent objects for this object
list_git
(id)Get the git metadata attached to an item
list_git_commits
(id)Get the git commits for an item on the current branch
list_projects
(id, *[, hidden])List the projects a Report belongs to
list_services_dependencies
(id, *[, user_id])List dependent objects for this object
list_services_projects
(id, *[, hidden])List the projects a Service Report belongs to
List users and groups permissioned on this object
list_shares
(id)List users and groups permissioned on this object
patch
(id, *[, name, script_id, code_body, ...])Update a report
patch_git
(id, *[, git_ref, git_branch, ...])Update an attached git file
patch_services
(id, *[, name, provide_api_key])Update some attributes of this service report
post
(*[, script_id, name, code_body, ...])Create a report
Checkout content that the existing git_ref points to and save to the object
Checkout latest commit on the current branch of a script or workflow
post_git_commits
(id, content, message, file_hash)Commit and push a new version of the file
post_grants
(id)Grant this report the ability to perform Civis platform API operations on your behalf
post_refresh
(id)Refresh the data in this Tableau report
post_services
(service_id, *[, provide_api_key])Create a service report
put_archive
(id, status)Update the archive status of this object
put_git
(id, *[, git_ref, git_branch, ...])Attach an item to a file in a git repo
put_projects
(id, project_id)Add a Report to a project
put_services_archive
(id, status)Update the archive status of this object
put_services_projects
(id, project_id)Add a Service Report to a project
put_services_shares_groups
(id, group_ids, ...)Set the permissions groups has on this object
put_services_shares_users
(id, user_ids, ...)Set the permissions users have on this object
put_services_transfer
(id, user_id, ...[, ...])Transfer ownership of this object to another user
put_shares_groups
(id, group_ids, ...[, ...])Set the permissions groups has on this object
put_shares_users
(id, user_ids, ...[, ...])Set the permissions users have on this object
put_transfer
(id, user_id, ...[, email_body, ...])Transfer ownership of this object to another user
- delete_grants(id)¶
Revoke permission for this report to perform Civis platform API operations on your behalf
- Parameters
- idinteger
The ID of this report.
- Returns
- None
Response code 204: success
- delete_projects(id, project_id)¶
Remove a Report from a project
- Parameters
- idinteger
The ID of the Report.
- project_idinteger
The ID of the project.
- Returns
- None
Response code 204: success
- delete_services_projects(id, project_id)¶
Remove a Service Report from a project
- Parameters
- idinteger
The ID of the Service Report.
- project_idinteger
The ID of the project.
- Returns
- None
Response code 204: success
Revoke the permissions a group has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- group_idinteger
The ID of the group.
- Returns
- None
Response code 204: success
Revoke the permissions a user has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger
The ID of the user.
- Returns
- None
Response code 204: success
Revoke the permissions a group has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- group_idinteger
The ID of the group.
- Returns
- None
Response code 204: success
Revoke the permissions a user has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger
The ID of the user.
- Returns
- None
Response code 204: success
- get(id)¶
Show a single report
- Parameters
- idinteger
The ID of this report.
- Returns
civis.response.Response
- idinteger
The ID of this report.
- namestring
The name of the report.
- userdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
created_at : string/time
updated_at : string/time
- projectslist::
A list of projects containing the report. - id : integer
The ID for the project.
- namestring
The name of the project.
- statestring
The status of the report’s last run.
- finished_atstring/time
The time that the report’s last run finished.
- viz_updated_atstring/time
The time that the report’s visualization was last updated.
- scriptdict::
- idinteger
The ID for the script.
- namestring
The name of the script.
- sqlstring
The raw SQL query for the script.
- job_pathstring
The link to details of the job that backs this report.
tableau_id : integer
type : string
- template_idinteger
The ID of the template used for this report.
- auth_thumbnail_urlstring
URL for a thumbnail of the report.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- archivedstring
The archival status of the requested item(s).
- hiddenboolean
The hidden status of the item.
auth_data_url : string
auth_code_url : string
- configstring
Any configuration metadata for this report.
- valid_output_fileboolean
Whether the job (a script or a query) that backs the report currently has a valid output file.
- provide_api_keyboolean
Whether the report requests an API Key from the report viewer.
- api_keystring
A Civis API key that can be used by this report.
- api_key_idinteger
The ID of the API key. Can be used for auditing API use by this report.
- app_statedict
Any application state blob for this report.
- use_viewers_tableau_usernameboolean
Apply user level filtering on Tableau reports.
- get_git_commits(id, commit_hash)¶
Get file contents at git ref
- Parameters
- idinteger
The ID of the file.
- commit_hashstring
The SHA (full or shortened) of the desired git commit.
- Returns
civis.response.Response
- contentstring
The file’s contents.
- typestring
The file’s type.
- sizeinteger
The file’s size.
- file_hashstring
The SHA of the file.
- get_services(id)¶
Show a single service report
- Parameters
- idinteger
The ID of this report.
- Returns
civis.response.Response
- idinteger
The ID of this report.
- namestring
The name of the report.
- userdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
created_at : string/time
updated_at : string/time
- hoststring
The host for the service report
- display_urlstring
The URL to display the service report.
- service_idinteger
The id of the backing service
- provide_api_keyboolean
Whether the report requests an API Key from the report viewer.
- api_keystring
A Civis API key that can be used by this report.
- api_key_idinteger
The ID of the API key. Can be used for auditing API use by this report.
- archivedstring
The archival status of the requested item(s).
- list(*, type='DEFAULT', template_id='DEFAULT', author='DEFAULT', hidden='DEFAULT', archived='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶
List Reports
- Parameters
- typestring, optional
If specified, return report of these types. It accepts a comma-separated list, possible values are ‘tableau’ or ‘other’.
- template_idinteger, optional
If specified, return reports using the provided Template.
- authorstring, optional
If specified, return items from any of these authors. It accepts a comma- separated list of user IDs.
- hiddenboolean, optional
If specified to be true, returns hidden items. Defaults to false, returning non-hidden items.
- archivedstring, optional
The archival status of the requested item(s).
- limitinteger, optional
Number of results to return. Defaults to 20. Maximum allowed is 50.
- page_numinteger, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstring, optional
The field on which to order the result set. Defaults to updated_at. Must be one of: updated_at, name, created_at.
- order_dirstring, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iteratorbool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
- Returns
civis.response.PaginatedResponse
- idinteger
The ID of this report.
- namestring
The name of the report.
- userdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
created_at : string/time
updated_at : string/time
- projectslist::
A list of projects containing the report. - id : integer
The ID for the project.
- namestring
The name of the project.
- statestring
The status of the report’s last run.
- finished_atstring/time
The time that the report’s last run finished.
- viz_updated_atstring/time
The time that the report’s visualization was last updated.
- scriptdict::
- idinteger
The ID for the script.
- namestring
The name of the script.
- sqlstring
The raw SQL query for the script.
- job_pathstring
The link to details of the job that backs this report.
tableau_id : integer
type : string
- template_idinteger
The ID of the template used for this report.
- auth_thumbnail_urlstring
URL for a thumbnail of the report.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- archivedstring
The archival status of the requested item(s).
- list_dependencies(id, *, user_id='DEFAULT')¶
List dependent objects for this object
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger, optional
ID of target user
- Returns
civis.response.Response
- object_typestring
Dependent object type
- fco_typestring
Human readable dependent object type
- idinteger
Dependent object ID
- namestring
Dependent object name, or nil if the requesting user cannot read this object
- permission_levelstring
Permission level of target user (not user’s groups) for dependent object, or null if no target user
- shareableboolean
Whether or not the requesting user can share this object.
- list_git(id)¶
Get the git metadata attached to an item
- Parameters
- idinteger
The ID of the file.
- Returns
civis.response.Response
- git_refstring
A git reference specifying an unambiguous version of the file. Can be a branch name, tag or the full or shortened SHA of a commit.
- git_branchstring
The git branch that the file is on.
- git_pathstring
The path of the file in the repository.
- git_repodict::
- idinteger
The ID for this git repository.
- repo_urlstring
The URL for this git repository.
created_at : string/time
updated_at : string/time
- git_ref_typestring
Specifies if the file is versioned by branch or tag.
- pull_from_gitboolean
Automatically pull latest commit from git. Only works for scripts and workflows (assuming you have the feature enabled)
- list_git_commits(id)¶
Get the git commits for an item on the current branch
- Parameters
- idinteger
The ID of the file.
- Returns
civis.response.Response
- commit_hashstring
The SHA of the commit.
- author_namestring
The name of the commit’s author.
- datestring/time
The commit’s timestamp.
- messagestring
The commit message.
- list_projects(id, *, hidden='DEFAULT')¶
List the projects a Report belongs to
- Parameters
- idinteger
The ID of the Report.
- hiddenboolean, optional
If specified to be true, returns hidden items. Defaults to false, returning non-hidden items.
- Returns
civis.response.Response
- idinteger
The ID for this project.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- namestring
The name of this project.
- descriptionstring
A description of the project.
- userslist::
Users who can see the project. - id : integer
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
auto_share : boolean
created_at : string/time
updated_at : string/time
- archivedstring
The archival status of the requested item(s).
- list_services_dependencies(id, *, user_id='DEFAULT')¶
List dependent objects for this object
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger, optional
ID of target user
- Returns
civis.response.Response
- object_typestring
Dependent object type
- fco_typestring
Human readable dependent object type
- idinteger
Dependent object ID
- namestring
Dependent object name, or nil if the requesting user cannot read this object
- permission_levelstring
Permission level of target user (not user’s groups) for dependent object, or null if no target user
- shareableboolean
Whether or not the requesting user can share this object.
- list_services_projects(id, *, hidden='DEFAULT')¶
List the projects a Service Report belongs to
- Parameters
- idinteger
The ID of the Service Report.
- hiddenboolean, optional
If specified to be true, returns hidden items. Defaults to false, returning non-hidden items.
- Returns
civis.response.Response
- idinteger
The ID for this project.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- namestring
The name of this project.
- descriptionstring
A description of the project.
- userslist::
Users who can see the project. - id : integer
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
auto_share : boolean
created_at : string/time
updated_at : string/time
- archivedstring
The archival status of the requested item(s).
List users and groups permissioned on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
List users and groups permissioned on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
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
- idinteger
The ID of the report to modify.
- namestring, optional
The name of the report.
- script_idinteger, optional
The ID of the job (a script or a query) used to create this report.
- code_bodystring, optional
The code for the report visualization.
- configstring, optional
- app_statedict, optional
The application state blob for this report.
- provide_api_keyboolean, optional
Allow the report to provide an API key to front-end code.
- template_idinteger, 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_usernameboolean, optional
Apply user level filtering on Tableau reports.
- Returns
civis.response.Response
- idinteger
The ID of this report.
- namestring
The name of the report.
- userdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
created_at : string/time
updated_at : string/time
- projectslist::
A list of projects containing the report. - id : integer
The ID for the project.
- namestring
The name of the project.
- statestring
The status of the report’s last run.
- finished_atstring/time
The time that the report’s last run finished.
- viz_updated_atstring/time
The time that the report’s visualization was last updated.
- scriptdict::
- idinteger
The ID for the script.
- namestring
The name of the script.
- sqlstring
The raw SQL query for the script.
- job_pathstring
The link to details of the job that backs this report.
tableau_id : integer
type : string
- template_idinteger
The ID of the template used for this report.
- auth_thumbnail_urlstring
URL for a thumbnail of the report.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- archivedstring
The archival status of the requested item(s).
- hiddenboolean
The hidden status of the item.
auth_data_url : string
auth_code_url : string
- configstring
Any configuration metadata for this report.
- valid_output_fileboolean
Whether the job (a script or a query) that backs the report currently has a valid output file.
- provide_api_keyboolean
Whether the report requests an API Key from the report viewer.
- api_keystring
A Civis API key that can be used by this report.
- api_key_idinteger
The ID of the API key. Can be used for auditing API use by this report.
- app_statedict
Any application state blob for this report.
- use_viewers_tableau_usernameboolean
Apply user level filtering on Tableau reports.
- patch_git(id, *, git_ref='DEFAULT', git_branch='DEFAULT', git_path='DEFAULT', git_repo_url='DEFAULT', git_ref_type='DEFAULT', pull_from_git='DEFAULT')¶
Update an attached git file
- Parameters
- idinteger
The ID of the file.
- git_refstring, optional
A git reference specifying an unambiguous version of the file. Can be a branch name, or the full or shortened SHA of a commit.
- git_branchstring, optional
The git branch that the file is on.
- git_pathstring, optional
The path of the file in the repository.
- git_repo_urlstring, optional
The URL of the git repository.
- git_ref_typestring, optional
Specifies if the file is versioned by branch or tag.
- pull_from_gitboolean, optional
Automatically pull latest commit from git. Only works for scripts.
- Returns
civis.response.Response
- git_refstring
A git reference specifying an unambiguous version of the file. Can be a branch name, tag or the full or shortened SHA of a commit.
- git_branchstring
The git branch that the file is on.
- git_pathstring
The path of the file in the repository.
- git_repodict::
- idinteger
The ID for this git repository.
- repo_urlstring
The URL for this git repository.
created_at : string/time
updated_at : string/time
- git_ref_typestring
Specifies if the file is versioned by branch or tag.
- pull_from_gitboolean
Automatically pull latest commit from git. Only works for scripts and workflows (assuming you have the feature enabled)
- patch_services(id, *, name='DEFAULT', provide_api_key='DEFAULT')¶
Update some attributes of this service report
- Parameters
- idinteger
The ID of this report.
- namestring, optional
The name of the service report.
- provide_api_keyboolean, optional
Whether the report requests an API Key from the report viewer.
- Returns
civis.response.Response
- idinteger
The ID of this report.
- namestring
The name of the report.
- userdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
created_at : string/time
updated_at : string/time
- hoststring
The host for the service report
- display_urlstring
The URL to display the service report.
- service_idinteger
The id of the backing service
- provide_api_keyboolean
Whether the report requests an API Key from the report viewer.
- api_keystring
A Civis API key that can be used by this report.
- api_key_idinteger
The ID of the API key. Can be used for auditing API use by this report.
- archivedstring
The archival status of the requested item(s).
- 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_idinteger, optional
The ID of the job (a script or a query) used to create this report.
- namestring, optional
The name of the report.
- code_bodystring, optional
The code for the report visualization.
- app_statedict, optional
Any application state blob for this report.
- provide_api_keyboolean, optional
Allow the report to provide an API key to front-end code.
- template_idinteger, optional
The ID of the template used for this report.
- hiddenboolean, optional
The hidden status of the item.
- Returns
civis.response.Response
- idinteger
The ID of this report.
- namestring
The name of the report.
- userdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
created_at : string/time
updated_at : string/time
- projectslist::
A list of projects containing the report. - id : integer
The ID for the project.
- namestring
The name of the project.
- statestring
The status of the report’s last run.
- finished_atstring/time
The time that the report’s last run finished.
- viz_updated_atstring/time
The time that the report’s visualization was last updated.
- scriptdict::
- idinteger
The ID for the script.
- namestring
The name of the script.
- sqlstring
The raw SQL query for the script.
- job_pathstring
The link to details of the job that backs this report.
tableau_id : integer
type : string
- template_idinteger
The ID of the template used for this report.
- auth_thumbnail_urlstring
URL for a thumbnail of the report.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- archivedstring
The archival status of the requested item(s).
- hiddenboolean
The hidden status of the item.
auth_data_url : string
auth_code_url : string
- configstring
Any configuration metadata for this report.
- valid_output_fileboolean
Whether the job (a script or a query) that backs the report currently has a valid output file.
- provide_api_keyboolean
Whether the report requests an API Key from the report viewer.
- api_keystring
A Civis API key that can be used by this report.
- api_key_idinteger
The ID of the API key. Can be used for auditing API use by this report.
- app_statedict
Any application state blob for this report.
- use_viewers_tableau_usernameboolean
Apply user level filtering on Tableau reports.
- post_git_checkout(id)¶
Checkout content that the existing git_ref points to and save to the object
- Parameters
- idinteger
The ID of the file.
- Returns
civis.response.Response
- contentstring
The file’s contents.
- typestring
The file’s type.
- sizeinteger
The file’s size.
- file_hashstring
The SHA of the file.
- post_git_checkout_latest(id)¶
Checkout latest commit on the current branch of a script or workflow
- Parameters
- idinteger
The ID of the file.
- Returns
civis.response.Response
- contentstring
The file’s contents.
- typestring
The file’s type.
- sizeinteger
The file’s size.
- file_hashstring
The SHA of the file.
- post_git_commits(id, content, message, file_hash)¶
Commit and push a new version of the file
- Parameters
- idinteger
The ID of the file.
- contentstring
The contents to commit to the file.
- messagestring
A commit message describing the changes being made.
- file_hashstring
The full SHA of the file being replaced.
- Returns
civis.response.Response
- contentstring
The file’s contents.
- typestring
The file’s type.
- sizeinteger
The file’s size.
- file_hashstring
The SHA of the file.
- post_grants(id)¶
Grant this report the ability to perform Civis platform API operations on your behalf
- Parameters
- idinteger
The ID of this report.
- Returns
civis.response.Response
- idinteger
The ID of this report.
- namestring
The name of the report.
- userdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
created_at : string/time
updated_at : string/time
- projectslist::
A list of projects containing the report. - id : integer
The ID for the project.
- namestring
The name of the project.
- statestring
The status of the report’s last run.
- finished_atstring/time
The time that the report’s last run finished.
- viz_updated_atstring/time
The time that the report’s visualization was last updated.
- scriptdict::
- idinteger
The ID for the script.
- namestring
The name of the script.
- sqlstring
The raw SQL query for the script.
- job_pathstring
The link to details of the job that backs this report.
tableau_id : integer
type : string
- template_idinteger
The ID of the template used for this report.
- auth_thumbnail_urlstring
URL for a thumbnail of the report.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- archivedstring
The archival status of the requested item(s).
- hiddenboolean
The hidden status of the item.
auth_data_url : string
auth_code_url : string
- configstring
Any configuration metadata for this report.
- valid_output_fileboolean
Whether the job (a script or a query) that backs the report currently has a valid output file.
- provide_api_keyboolean
Whether the report requests an API Key from the report viewer.
- api_keystring
A Civis API key that can be used by this report.
- api_key_idinteger
The ID of the API key. Can be used for auditing API use by this report.
- app_statedict
Any application state blob for this report.
- use_viewers_tableau_usernameboolean
Apply user level filtering on Tableau reports.
- post_refresh(id)¶
Refresh the data in this Tableau report
- Parameters
- idinteger
The ID of this report.
- Returns
civis.response.Response
- idinteger
The ID of this report.
- organizationdict::
- idinteger
The ID of this organization.
- tableau_refresh_usageinteger
The number of tableau refreshes used this month.
- tableau_refresh_limitinteger
The number of monthly tableau refreshes permitted to this organization.
- tableau_refresh_historylist
The number of tableau refreshes used this month.
- post_services(service_id, *, provide_api_key='DEFAULT')¶
Create a service report
- Parameters
- service_idinteger
The id of the backing service
- provide_api_keyboolean, optional
Whether the report requests an API Key from the report viewer.
- Returns
civis.response.Response
- idinteger
The ID of this report.
- namestring
The name of the report.
- userdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
created_at : string/time
updated_at : string/time
- hoststring
The host for the service report
- display_urlstring
The URL to display the service report.
- service_idinteger
The id of the backing service
- provide_api_keyboolean
Whether the report requests an API Key from the report viewer.
- api_keystring
A Civis API key that can be used by this report.
- api_key_idinteger
The ID of the API key. Can be used for auditing API use by this report.
- archivedstring
The archival status of the requested item(s).
- put_archive(id, status)¶
Update the archive status of this object
- Parameters
- idinteger
The ID of the object.
- statusboolean
The desired archived status of the object.
- Returns
civis.response.Response
- idinteger
The ID of this report.
- namestring
The name of the report.
- userdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
created_at : string/time
updated_at : string/time
- projectslist::
A list of projects containing the report. - id : integer
The ID for the project.
- namestring
The name of the project.
- statestring
The status of the report’s last run.
- finished_atstring/time
The time that the report’s last run finished.
- viz_updated_atstring/time
The time that the report’s visualization was last updated.
- scriptdict::
- idinteger
The ID for the script.
- namestring
The name of the script.
- sqlstring
The raw SQL query for the script.
- job_pathstring
The link to details of the job that backs this report.
tableau_id : integer
type : string
- template_idinteger
The ID of the template used for this report.
- auth_thumbnail_urlstring
URL for a thumbnail of the report.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- archivedstring
The archival status of the requested item(s).
- hiddenboolean
The hidden status of the item.
auth_data_url : string
auth_code_url : string
- configstring
Any configuration metadata for this report.
- valid_output_fileboolean
Whether the job (a script or a query) that backs the report currently has a valid output file.
- provide_api_keyboolean
Whether the report requests an API Key from the report viewer.
- api_keystring
A Civis API key that can be used by this report.
- api_key_idinteger
The ID of the API key. Can be used for auditing API use by this report.
- app_statedict
Any application state blob for this report.
- use_viewers_tableau_usernameboolean
Apply user level filtering on Tableau reports.
- put_git(id, *, git_ref='DEFAULT', git_branch='DEFAULT', git_path='DEFAULT', git_repo_url='DEFAULT', git_ref_type='DEFAULT', pull_from_git='DEFAULT')¶
Attach an item to a file in a git repo
- Parameters
- idinteger
The ID of the file.
- git_refstring, optional
A git reference specifying an unambiguous version of the file. Can be a branch name, or the full or shortened SHA of a commit.
- git_branchstring, optional
The git branch that the file is on.
- git_pathstring, optional
The path of the file in the repository.
- git_repo_urlstring, optional
The URL of the git repository.
- git_ref_typestring, optional
Specifies if the file is versioned by branch or tag.
- pull_from_gitboolean, optional
Automatically pull latest commit from git. Only works for scripts.
- Returns
civis.response.Response
- git_refstring
A git reference specifying an unambiguous version of the file. Can be a branch name, tag or the full or shortened SHA of a commit.
- git_branchstring
The git branch that the file is on.
- git_pathstring
The path of the file in the repository.
- git_repodict::
- idinteger
The ID for this git repository.
- repo_urlstring
The URL for this git repository.
created_at : string/time
updated_at : string/time
- git_ref_typestring
Specifies if the file is versioned by branch or tag.
- pull_from_gitboolean
Automatically pull latest commit from git. Only works for scripts and workflows (assuming you have the feature enabled)
- put_projects(id, project_id)¶
Add a Report to a project
- Parameters
- idinteger
The ID of the Report.
- project_idinteger
The ID of the project.
- Returns
- None
Response code 204: success
- put_services_archive(id, status)¶
Update the archive status of this object
- Parameters
- idinteger
The ID of the object.
- statusboolean
The desired archived status of the object.
- Returns
civis.response.Response
- idinteger
The ID of this report.
- namestring
The name of the report.
- userdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
created_at : string/time
updated_at : string/time
- hoststring
The host for the service report
- display_urlstring
The URL to display the service report.
- service_idinteger
The id of the backing service
- provide_api_keyboolean
Whether the report requests an API Key from the report viewer.
- api_keystring
A Civis API key that can be used by this report.
- api_key_idinteger
The ID of the API key. Can be used for auditing API use by this report.
- archivedstring
The archival status of the requested item(s).
- put_services_projects(id, project_id)¶
Add a Service Report to a project
- Parameters
- idinteger
The ID of the Service Report.
- project_idinteger
The ID of the project.
- Returns
- None
Response code 204: success
Set the permissions groups has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- group_idslist
An array of one or more group IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
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
- idinteger
The ID of the resource that is shared.
- user_idslist
An array of one or more user IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
- put_services_transfer(id, user_id, include_dependencies, *, email_body='DEFAULT', send_email='DEFAULT')¶
Transfer ownership of this object to another user
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger
ID of target user
- include_dependenciesboolean
Whether or not to give manage permissions on all dependencies
- email_bodystring, optional
Custom body text for e-mail sent on transfer.
- send_emailboolean, optional
Send email to the target user of the transfer?
- Returns
civis.response.Response
- dependencieslist::
Dependent objects for this object - object_type : string
Dependent object type
- fco_typestring
Human readable dependent object type
- idinteger
Dependent object ID
- namestring
Dependent object name, or nil if the requesting user cannot read this object
- permission_levelstring
Permission level of target user (not user’s groups) for dependent object, or null if no target user
- sharedboolean
Whether dependent object was successfully shared with target user
Set the permissions groups has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- group_idslist
An array of one or more group IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
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
- idinteger
The ID of the resource that is shared.
- user_idslist
An array of one or more user IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
- put_transfer(id, user_id, include_dependencies, *, email_body='DEFAULT', send_email='DEFAULT')¶
Transfer ownership of this object to another user
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger
ID of target user
- include_dependenciesboolean
Whether or not to give manage permissions on all dependencies
- email_bodystring, optional
Custom body text for e-mail sent on transfer.
- send_emailboolean, optional
Send email to the target user of the transfer?
- Returns
civis.response.Response
- dependencieslist::
Dependent objects for this object - object_type : string
Dependent object type
- fco_typestring
Human readable dependent object type
- idinteger
Dependent object ID
- namestring
Dependent object name, or nil if the requesting user cannot read this object
- permission_levelstring
Permission level of target user (not user’s groups) for dependent object, or null if no target user
- sharedboolean
Whether dependent object was successfully shared with target user
Roles¶
- class Roles(session_kwargs, client, return_type='civis')¶
Examples
>>> import civis >>> client = civis.APIClient() >>> client.roles.list(...)
Methods
list
(*[, limit, page_num, order, order_dir, ...])List Roles
- list(*, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶
List Roles
- Parameters
- limitinteger, optional
Number of results to return. Defaults to 50. Maximum allowed is 1000.
- page_numinteger, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstring, optional
The field on which to order the result set. Defaults to id. Must be one of: id.
- order_dirstring, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to asc.
- iteratorbool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
- Returns
civis.response.PaginatedResponse
- idinteger
ID of the Role.
- namestring
The name of the Role.
- slugstring
The slug.
- descriptionstring
The description of the Role.
Saml_Service_Providers¶
- class Saml_Service_Providers(session_kwargs, client, return_type='civis')¶
Examples
>>> import civis >>> client = civis.APIClient() >>> client.saml_service_providers.list_shares(...)
Methods
delete_shares_groups
(id, group_id)Revoke the permissions a group has on this object
delete_shares_users
(id, user_id)Revoke the permissions a user has on this object
list_shares
(id)List users and groups permissioned on this object
put_shares_groups
(id, group_ids, ...[, ...])Set the permissions groups has on this object
put_shares_users
(id, user_ids, ...[, ...])Set the permissions users have on this object
Revoke the permissions a group has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- group_idinteger
The ID of the group.
- Returns
- None
Response code 204: success
Revoke the permissions a user has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger
The ID of the user.
- Returns
- None
Response code 204: success
List users and groups permissioned on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
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
- idinteger
The ID of the resource that is shared.
- group_idslist
An array of one or more group IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
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
- idinteger
The ID of the resource that is shared.
- user_idslist
An array of one or more user IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
Scripts¶
- class Scripts(session_kwargs, client, return_type='civis')¶
Examples
>>> import civis >>> client = civis.APIClient() >>> client.scripts.list_types(...)
Methods
delete_containers_projects
(id, project_id)Remove a Container Script from a project
delete_containers_runs
(id, run_id)Cancel a run
delete_containers_shares_groups
(id, group_id)Revoke the permissions a group has on this object
delete_containers_shares_users
(id, user_id)Revoke the permissions a user has on this object
delete_custom_projects
(id, project_id)Remove a Custom Script from a project
delete_custom_runs
(id, run_id)Cancel a run
delete_custom_shares_groups
(id, group_id)Revoke the permissions a group has on this object
delete_custom_shares_users
(id, user_id)Revoke the permissions a user has on this object
delete_javascript_projects
(id, project_id)Remove a JavaScript Script from a project
delete_javascript_runs
(id, run_id)Cancel a run
delete_javascript_shares_groups
(id, group_id)Revoke the permissions a group has on this object
delete_javascript_shares_users
(id, user_id)Revoke the permissions a user has on this object
delete_python3_projects
(id, project_id)Remove a Python Script from a project
delete_python3_runs
(id, run_id)Cancel a run
delete_python3_shares_groups
(id, group_id)Revoke the permissions a group has on this object
delete_python3_shares_users
(id, user_id)Revoke the permissions a user has on this object
delete_r_projects
(id, project_id)Remove an R Script from a project
delete_r_runs
(id, run_id)Cancel a run
delete_r_shares_groups
(id, group_id)Revoke the permissions a group has on this object
delete_r_shares_users
(id, user_id)Revoke the permissions a user has on this object
delete_sql_projects
(id, project_id)Remove a SQL script from a project
delete_sql_runs
(id, run_id)Cancel a run
delete_sql_shares_groups
(id, group_id)Revoke the permissions a group has on this object
delete_sql_shares_users
(id, user_id)Revoke the permissions a user has on this object
get
(id)Get details about a script
get_containers
(id)View a container
get_containers_runs
(id, run_id)Check status of a run
get_custom
(id)Get a Custom Script
get_custom_runs
(id, run_id)Check status of a run
get_javascript
(id)Get a JavaScript Script
get_javascript_git_commits
(id, commit_hash)Get file contents at git ref
get_javascript_runs
(id, run_id)Check status of a run
get_python3
(id)Get a Python Script
get_python3_git_commits
(id, commit_hash)Get file contents at git ref
get_python3_runs
(id, run_id)Check status of a run
get_r
(id)Get an R Script
get_r_git_commits
(id, commit_hash)Get file contents at git ref
get_r_runs
(id, run_id)Check status of a run
get_sql
(id)Get a SQL script
get_sql_git_commits
(id, commit_hash)Get file contents at git ref
get_sql_runs
(id, run_id)Check status of a run
list
(*[, type, category, author, status, ...])List Scripts
list_containers_dependencies
(id, *[, user_id])List dependent objects for this object
list_containers_projects
(id, *[, hidden])List the projects a Container Script belongs to
list_containers_runs
(id, *[, limit, ...])List runs for the given container
list_containers_runs_logs
(id, run_id, *[, ...])Get the logs for a run
list_containers_runs_outputs
(id, run_id, *)List the outputs for a run
List users and groups permissioned on this object
list_custom
(*[, from_template_id, author, ...])List Custom Scripts
list_custom_dependencies
(id, *[, user_id])List dependent objects for this object
list_custom_projects
(id, *[, hidden])List the projects a Custom Script belongs to
list_custom_runs
(id, *[, limit, page_num, ...])List runs for the given custom
list_custom_runs_logs
(id, run_id, *[, ...])Get the logs for a run
list_custom_runs_outputs
(id, run_id, *[, ...])List the outputs for a run
List users and groups permissioned on this object
list_history
(id)Get the run history and outputs of this script
list_javascript_dependencies
(id, *[, user_id])List dependent objects for this object
Get the git metadata attached to an item
Get the git commits for an item on the current branch
list_javascript_projects
(id, *[, hidden])List the projects a JavaScript Script belongs to
list_javascript_runs
(id, *[, limit, ...])List runs for the given javascript
list_javascript_runs_logs
(id, run_id, *[, ...])Get the logs for a run
list_javascript_runs_outputs
(id, run_id, *)List the outputs for a run
List users and groups permissioned on this object
list_python3_dependencies
(id, *[, user_id])List dependent objects for this object
list_python3_git
(id)Get the git metadata attached to an item
Get the git commits for an item on the current branch
list_python3_projects
(id, *[, hidden])List the projects a Python Script belongs to
list_python3_runs
(id, *[, limit, page_num, ...])List runs for the given python
list_python3_runs_logs
(id, run_id, *[, ...])Get the logs for a run
list_python3_runs_outputs
(id, run_id, *[, ...])List the outputs for a run
List users and groups permissioned on this object
list_r_dependencies
(id, *[, user_id])List dependent objects for this object
list_r_git
(id)Get the git metadata attached to an item
Get the git commits for an item on the current branch
list_r_projects
(id, *[, hidden])List the projects an R Script belongs to
list_r_runs
(id, *[, limit, page_num, order, ...])List runs for the given r
list_r_runs_logs
(id, run_id, *[, last_id, limit])Get the logs for a run
list_r_runs_outputs
(id, run_id, *[, limit, ...])List the outputs for a run
list_r_shares
(id)List users and groups permissioned on this object
list_sql_dependencies
(id, *[, user_id])List dependent objects for this object
list_sql_git
(id)Get the git metadata attached to an item
Get the git commits for an item on the current branch
list_sql_projects
(id, *[, hidden])List the projects a SQL script belongs to
list_sql_runs
(id, *[, limit, page_num, ...])List runs for the given sql
list_sql_runs_logs
(id, run_id, *[, last_id, ...])Get the logs for a run
list_sql_runs_outputs
(id, run_id, *[, ...])List the outputs for a run
list_sql_shares
(id)List users and groups permissioned on this object
List available script types
patch
(id, *[, name, sql, params, arguments, ...])Update a script
patch_container_runs
(id, run_id, *[, error])Update the given run
patch_containers
(id, *[, name, parent_id, ...])Update a container
patch_custom
(id, *[, name, parent_id, ...])Update some attributes of this Custom Script
patch_javascript
(id, *[, name, parent_id, ...])Update some attributes of this JavaScript Script
patch_javascript_git
(id, *[, git_ref, ...])Update an attached git file
patch_javascript_runs
(id, run_id, *[, error])Update the given run
patch_python3
(id, *[, name, parent_id, ...])Update some attributes of this Python Script
patch_python3_git
(id, *[, git_ref, ...])Update an attached git file
patch_python3_runs
(id, run_id, *[, error])Update the given run
patch_r
(id, *[, name, parent_id, ...])Update some attributes of this R Script
patch_r_git
(id, *[, git_ref, git_branch, ...])Update an attached git file
patch_r_runs
(id, run_id, *[, error])Update the given run
patch_sql
(id, *[, name, parent_id, ...])Update some attributes of this SQL script
patch_sql_git
(id, *[, git_ref, git_branch, ...])Update an attached git file
patch_sql_runs
(id, run_id, *[, error])Update the given run
post
(name, remote_host_id, credential_id, sql, *)Create a script
post_cancel
(id)Cancel a run
post_containers
(required_resources, ...[, ...])Create a container
post_containers_clone
(id, *[, ...])Clone this Container Script
Start a run
post_containers_runs_logs
(id, run_id, *[, ...])Add log messages
post_containers_runs_outputs
(id, run_id, ...)Add an output for a run
post_custom
(from_template_id, *[, name, ...])Create a Custom Script
post_custom_clone
(id, *[, clone_schedule, ...])Clone this Custom Script
post_custom_runs
(id)Start a run
post_custom_runs_outputs
(id, run_id, ...)Add an output for a run
post_javascript
(name, source, ...[, ...])Create a JavaScript Script
post_javascript_clone
(id, *[, ...])Clone this JavaScript Script
Checkout content that the existing git_ref points to and save to the object
Checkout latest commit on the current branch of a script or workflow
post_javascript_git_commits
(id, content, ...)Commit and push a new version of the file
Start a run
post_javascript_runs_outputs
(id, run_id, ...)Add an output for a run
post_python3
(name, source, *[, parent_id, ...])Create a Python Script
post_python3_clone
(id, *[, clone_schedule, ...])Clone this Python Script
Checkout content that the existing git_ref points to and save to the object
Checkout latest commit on the current branch of a script or workflow
post_python3_git_commits
(id, content, ...)Commit and push a new version of the file
Start a run
post_python3_runs_outputs
(id, run_id, ...)Add an output for a run
post_r
(name, source, *[, parent_id, ...])Create an R Script
post_r_clone
(id, *[, clone_schedule, ...])Clone this R Script
Checkout content that the existing git_ref points to and save to the object
Checkout latest commit on the current branch of a script or workflow
post_r_git_commits
(id, content, message, ...)Commit and push a new version of the file
post_r_runs
(id)Start a run
post_r_runs_outputs
(id, run_id, object_type, ...)Add an output for a run
post_run
(id)Run a script
post_sql
(name, sql, remote_host_id, ...[, ...])Create a SQL script
post_sql_clone
(id, *[, clone_schedule, ...])Clone this SQL script
Checkout content that the existing git_ref points to and save to the object
Checkout latest commit on the current branch of a script or workflow
post_sql_git_commits
(id, content, message, ...)Commit and push a new version of the file
post_sql_runs
(id)Start a run
put_containers
(id, required_resources, ...)Edit a container
put_containers_archive
(id, status)Update the archive status of this object
put_containers_projects
(id, project_id)Add a Container Script to a project
put_containers_shares_groups
(id, group_ids, ...)Set the permissions groups has on this object
put_containers_shares_users
(id, user_ids, ...)Set the permissions users have on this object
put_containers_transfer
(id, user_id, ...[, ...])Transfer ownership of this object to another user
put_custom
(id, *[, name, parent_id, ...])Replace all attributes of this Custom Script
put_custom_archive
(id, status)Update the archive status of this object
put_custom_projects
(id, project_id)Add a Custom Script to a project
put_custom_shares_groups
(id, group_ids, ...)Set the permissions groups has on this object
put_custom_shares_users
(id, user_ids, ...[, ...])Set the permissions users have on this object
put_custom_transfer
(id, user_id, ...[, ...])Transfer ownership of this object to another user
put_javascript
(id, name, source, ...[, ...])Replace all attributes of this JavaScript Script
put_javascript_archive
(id, status)Update the archive status of this object
put_javascript_git
(id, *[, git_ref, ...])Attach an item to a file in a git repo
put_javascript_projects
(id, project_id)Add a JavaScript Script to a project
put_javascript_shares_groups
(id, group_ids, ...)Set the permissions groups has on this object
put_javascript_shares_users
(id, user_ids, ...)Set the permissions users have on this object
put_javascript_transfer
(id, user_id, ...[, ...])Transfer ownership of this object to another user
put_python3
(id, name, source, *[, ...])Replace all attributes of this Python Script
put_python3_archive
(id, status)Update the archive status of this object
put_python3_git
(id, *[, git_ref, ...])Attach an item to a file in a git repo
put_python3_projects
(id, project_id)Add a Python Script to a project
put_python3_shares_groups
(id, group_ids, ...)Set the permissions groups has on this object
put_python3_shares_users
(id, user_ids, ...)Set the permissions users have on this object
put_python3_transfer
(id, user_id, ...[, ...])Transfer ownership of this object to another user
put_r
(id, name, source, *[, parent_id, ...])Replace all attributes of this R Script
put_r_archive
(id, status)Update the archive status of this object
put_r_git
(id, *[, git_ref, git_branch, ...])Attach an item to a file in a git repo
put_r_projects
(id, project_id)Add an R Script to a project
put_r_shares_groups
(id, group_ids, ...[, ...])Set the permissions groups has on this object
put_r_shares_users
(id, user_ids, ...[, ...])Set the permissions users have on this object
put_r_transfer
(id, user_id, ...[, ...])Transfer ownership of this object to another user
put_sql
(id, name, sql, remote_host_id, ...)Replace all attributes of this SQL script
put_sql_archive
(id, status)Update the archive status of this object
put_sql_git
(id, *[, git_ref, git_branch, ...])Attach an item to a file in a git repo
put_sql_projects
(id, project_id)Add a SQL script to a project
put_sql_shares_groups
(id, group_ids, ...[, ...])Set the permissions groups has on this object
put_sql_shares_users
(id, user_ids, ...[, ...])Set the permissions users have on this object
put_sql_transfer
(id, user_id, ...[, ...])Transfer ownership of this object to another user
- delete_containers_projects(id, project_id)¶
Remove a Container Script from a project
- Parameters
- idinteger
The ID of the Container Script.
- project_idinteger
The ID of the project.
- Returns
- None
Response code 204: success
- delete_containers_runs(id, run_id)¶
Cancel a run
- Parameters
- idinteger
The ID of the container.
- run_idinteger
The ID of the run.
- Returns
- None
Response code 202: success
Revoke the permissions a group has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- group_idinteger
The ID of the group.
- Returns
- None
Response code 204: success
Revoke the permissions a user has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger
The ID of the user.
- Returns
- None
Response code 204: success
- delete_custom_projects(id, project_id)¶
Remove a Custom Script from a project
- Parameters
- idinteger
The ID of the Custom Script.
- project_idinteger
The ID of the project.
- Returns
- None
Response code 204: success
- delete_custom_runs(id, run_id)¶
Cancel a run
- Parameters
- idinteger
The ID of the custom.
- run_idinteger
The ID of the run.
- Returns
- None
Response code 202: success
Revoke the permissions a group has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- group_idinteger
The ID of the group.
- Returns
- None
Response code 204: success
Revoke the permissions a user has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger
The ID of the user.
- Returns
- None
Response code 204: success
- delete_javascript_projects(id, project_id)¶
Remove a JavaScript Script from a project
- Parameters
- idinteger
The ID of the JavaScript Script.
- project_idinteger
The ID of the project.
- Returns
- None
Response code 204: success
- delete_javascript_runs(id, run_id)¶
Cancel a run
- Parameters
- idinteger
The ID of the javascript.
- run_idinteger
The ID of the run.
- Returns
- None
Response code 202: success
Revoke the permissions a group has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- group_idinteger
The ID of the group.
- Returns
- None
Response code 204: success
Revoke the permissions a user has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger
The ID of the user.
- Returns
- None
Response code 204: success
- delete_python3_projects(id, project_id)¶
Remove a Python Script from a project
- Parameters
- idinteger
The ID of the Python Script.
- project_idinteger
The ID of the project.
- Returns
- None
Response code 204: success
- delete_python3_runs(id, run_id)¶
Cancel a run
- Parameters
- idinteger
The ID of the python.
- run_idinteger
The ID of the run.
- Returns
- None
Response code 202: success
Revoke the permissions a group has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- group_idinteger
The ID of the group.
- Returns
- None
Response code 204: success
Revoke the permissions a user has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger
The ID of the user.
- Returns
- None
Response code 204: success
- delete_r_projects(id, project_id)¶
Remove an R Script from a project
- Parameters
- idinteger
The ID of the R Script.
- project_idinteger
The ID of the project.
- Returns
- None
Response code 204: success
- delete_r_runs(id, run_id)¶
Cancel a run
- Parameters
- idinteger
The ID of the r.
- run_idinteger
The ID of the run.
- Returns
- None
Response code 202: success
Revoke the permissions a group has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- group_idinteger
The ID of the group.
- Returns
- None
Response code 204: success
Revoke the permissions a user has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger
The ID of the user.
- Returns
- None
Response code 204: success
- delete_sql_projects(id, project_id)¶
Remove a SQL script from a project
- Parameters
- idinteger
The ID of the SQL script.
- project_idinteger
The ID of the project.
- Returns
- None
Response code 204: success
- delete_sql_runs(id, run_id)¶
Cancel a run
- Parameters
- idinteger
The ID of the sql.
- run_idinteger
The ID of the run.
- Returns
- None
Response code 202: success
Revoke the permissions a group has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- group_idinteger
The ID of the group.
- Returns
- None
Response code 204: success
Revoke the permissions a user has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger
The ID of the user.
- Returns
- None
Response code 204: success
- get(id)¶
Get details about a script
- Parameters
- idinteger
The ID for the script.
- Returns
civis.response.Response
- idinteger
The ID for the script.
- namestring
The name of the script.
- typestring
The type of script.
- created_atstring/time
The time this script was created.
- updated_atstring/time
The time this script was last updated.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- statestring
The status of the script’s last run.
- finished_atstring/time
The time that the script’s last run finished.
- categorystring
The category of the script.
- projectslist::
A list of projects containing the script. - id : integer
The ID for the project.
- namestring
The name of the project.
- parent_idinteger
The ID of the parent job that will trigger this script
- user_contextstring
“runner” or “author”, who to execute the script as when run as a template.
- paramslist::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- labelstring
The label to present to users when asking them for the value.
- descriptionstring
A short sentence or fragment describing this parameter to the end user.
- typestring
The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom
- requiredboolean
Whether this param is required.
- valuestring
The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- defaultstring
If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- allowed_valueslist
The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}
- argumentsdict
Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.
- is_templateboolean
Whether others scripts use this one as a template.
- published_as_template_idinteger
The ID of the template that this script is backing.
- from_template_idinteger
The ID of the template this script uses, if any.
- template_dependents_countinteger
How many other scripts use this one as a template.
- template_script_namestring
The name of the template script.
- linksdict::
- detailsstring
The details link to get more information about the script.
- runsstring
The runs link to get the run information list for this script.
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- notificationsdict::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- running_asdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- next_run_atstring/time
The time of the next scheduled run.
- time_zonestring
The time zone of this script.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- hiddenboolean
The hidden status of the item.
- target_project_idinteger
Target project to which script outputs will be added.
- archivedstring
The archival status of the requested item(s).
- sqlstring
The raw SQL query for the script.
- expanded_argumentsdict
Expanded arguments for use in injecting into different environments.
- template_script_idinteger
The ID of the template script, if any.
- get_containers(id)¶
View a container
- Parameters
- idinteger
The ID for the script.
- Returns
civis.response.Response
- idinteger
The ID for the script.
- namestring
The name of the container.
- typestring
The type of the script (e.g Container)
- created_atstring/time
The time this script was created.
- updated_atstring/time
The time the script was last updated.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- statestring
The status of the script’s last run.
- finished_atstring/time
The time that the script’s last run finished.
- categorystring
The category of the script.
- projectslist::
A list of projects containing the script. - id : integer
The ID for the project.
- namestring
The name of the project.
- parent_idinteger
The ID of the parent job that will trigger this script
- user_contextstring
“runner” or “author”, who to execute the script as when run as a template.
- paramslist::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- labelstring
The label to present to users when asking them for the value.
- descriptionstring
A short sentence or fragment describing this parameter to the end user.
- typestring
The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom
- requiredboolean
Whether this param is required.
- valuestring
The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- defaultstring
If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- allowed_valueslist
The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}
- argumentsdict
Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.
- is_templateboolean
Whether others scripts use this one as a template.
- template_dependents_countinteger
How many other scripts use this one as a template.
- published_as_template_idinteger
The ID of the template that this script is backing.
- from_template_idinteger
The ID of the template script.
- template_script_namestring
The name of the template script.
- linksdict::
- detailsstring
The details link to get more information about the script.
- runsstring
The runs link to get the run information list for this script.
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- notificationsdict::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- running_asdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- required_resourcesdict::
- cpuinteger
The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.
- memoryinteger
The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.
- disk_spacenumber/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_uristring
The location of a github repo to clone into the container, e.g. github.com/my-user/my-repo.git.
- repo_refstring
The tag or branch of the github repo to clone into the container.
- remote_host_credential_idinteger
The id of the database credentials to pass into the environment of the container.
- git_credential_idinteger
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_commandstring
The command to run on the container. Will be run via sh as: [“sh”, “-c”, dockerCommand]. Defaults to the Docker image’s ENTRYPOINT/CMD.
- docker_image_namestring
The name of the docker image to pull from DockerHub.
- docker_image_tagstring
The tag of the docker image to pull from DockerHub.
- instance_typestring
The EC2 instance type to deploy to. Only available for jobs running on kubernetes.
- cancel_timeoutinteger
The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- time_zonestring
The time zone of this script.
- partition_labelstring
The partition label used to run this object. Not generally available. Beware this attribute may be removed in the future.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- hiddenboolean
The hidden status of the item.
- archivedstring
The archival status of the requested item(s).
- target_project_idinteger
Target project to which script outputs will be added.
- running_as_idinteger
The ID of the runner of this script.
- get_containers_runs(id, run_id)¶
Check status of a run
- Parameters
- idinteger
The ID of the container.
- run_idinteger
The ID of the run.
- Returns
civis.response.Response
- idinteger
The ID of the run.
- container_idinteger
The ID of the container.
- statestring
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- is_cancel_requestedboolean
True if run cancel requested, else false.
- started_atstring/time
The time the last run started at.
- finished_atstring/time
The time the last run completed.
- errorstring
The error, if any, returned by the run.
- max_memory_usagenumber/float
If the run has finished, the maximum amount of memory used during the run, in MB.
- max_cpu_usagenumber/float
If the run has finished, the maximum amount of cpu used during the run, in millicores.
- get_custom(id)¶
Get a Custom Script
- Parameters
- idinteger
- Returns
civis.response.Response
- idinteger
The ID for the script.
- namestring
The name of the script.
- typestring
The type of the script (e.g Custom)
- created_atstring/time
The time this script was created.
- updated_atstring/time
The time the script was last updated.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- statestring
The status of the script’s last run.
- finished_atstring/time
The time that the script’s last run finished.
category : string
- projectslist::
A list of projects containing the script. - id : integer
The ID for the project.
- namestring
The name of the project.
- parent_idinteger
The ID of the parent job that will trigger this script
- paramslist::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- labelstring
The label to present to users when asking them for the value.
- descriptionstring
A short sentence or fragment describing this parameter to the end user.
- typestring
The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom
- requiredboolean
Whether this param is required.
- valuestring
The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- defaultstring
If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- allowed_valueslist
The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}
- argumentsdict
Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.
- is_templateboolean
Whether others scripts use this one as a template.
- published_as_template_idinteger
The ID of the template that this script is backing.
- from_template_idinteger
The ID of the template script.
- ui_report_urlinteger
The url of the custom HTML.
- ui_report_idinteger
The id of the report with the custom HTML.
- ui_report_provide_api_keyboolean
Whether the ui report requests an API Key from the report viewer.
- template_script_namestring
The name of the template script.
- template_notestring
The template’s note.
- remote_host_idinteger
The remote host ID that this script will connect to.
- credential_idinteger
The credential that this script will use.
- code_previewstring
The code that this script will run with arguments inserted.
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- notificationsdict::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- running_asdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- time_zonestring
The time zone of this script.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- hiddenboolean
The hidden status of the item.
- archivedstring
The archival status of the requested item(s).
- target_project_idinteger
Target project to which script outputs will be added.
- last_successful_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- required_resourcesdict::
- cpuinteger
The number of CPU shares to allocate for the container. Each core has 1000 shares.
- memoryinteger
The amount of RAM to allocate for the container (in MB).
- disk_spacenumber/float
The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.
- partition_labelstring
The partition label used to run this object. Only applicable for jobs using Docker.Not generally available. Beware this attribute may be removed in the future.
- running_as_idinteger
The ID of the runner of this script.
- get_custom_runs(id, run_id)¶
Check status of a run
- Parameters
- idinteger
The ID of the custom.
- run_idinteger
The ID of the run.
- Returns
civis.response.Response
- idinteger
The ID of the run.
- custom_idinteger
The ID of the custom.
- statestring
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- is_cancel_requestedboolean
True if run cancel requested, else false.
- started_atstring/time
The time the last run started at.
- finished_atstring/time
The time the last run completed.
- errorstring
The error, if any, returned by the run.
- max_memory_usagenumber/float
If the run has finished, the maximum amount of memory used during the run, in MB. Only available if the backing script is a Python, R, or container script.
- max_cpu_usagenumber/float
If the run has finished, the maximum amount of cpu used during the run, in millicores. Only available if the backing script is a Python, R, or container script.
- get_javascript(id)¶
Get a JavaScript Script
- Parameters
- idinteger
- Returns
civis.response.Response
- idinteger
The ID for the script.
- namestring
The name of the script.
- typestring
The type of the script (e.g SQL, Container, Python, R, JavaScript)
- created_atstring/time
The time this script was created.
- updated_atstring/time
The time the script was last updated.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- statestring
The status of the script’s last run.
- finished_atstring/time
The time that the script’s last run finished.
- categorystring
The category of the script.
- projectslist::
A list of projects containing the script. - id : integer
The ID for the project.
- namestring
The name of the project.
- parent_idinteger
The ID of the parent job that will trigger this script
- user_contextstring
“runner” or “author”, who to execute the script as when run as a template.
- paramslist::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- labelstring
The label to present to users when asking them for the value.
- descriptionstring
A short sentence or fragment describing this parameter to the end user.
- typestring
The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom
- requiredboolean
Whether this param is required.
- valuestring
The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- defaultstring
If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- allowed_valueslist
The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}
- argumentsdict
Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.
- is_templateboolean
Whether others scripts use this one as a template.
- published_as_template_idinteger
The ID of the template that this script is backing.
- from_template_idinteger
The ID of the template this script uses, if any.
- template_dependents_countinteger
How many other scripts use this one as a template.
- template_script_namestring
The name of the template script.
- linksdict::
- detailsstring
The details link to get more information about the script.
- runsstring
The runs link to get the run information list for this script.
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- notificationsdict::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- running_asdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- next_run_atstring/time
The time of the next scheduled run.
- time_zonestring
The time zone of this script.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- hiddenboolean
The hidden status of the item.
- target_project_idinteger
Target project to which script outputs will be added.
- archivedstring
The archival status of the requested item(s).
- sourcestring
The body/text of the script.
- remote_host_idinteger
The remote host ID that this script will connect to.
- credential_idinteger
The credential that this script will use.
- running_as_idinteger
The ID of the runner of this script.
- get_javascript_git_commits(id, commit_hash)¶
Get file contents at git ref
- Parameters
- idinteger
The ID of the file.
- commit_hashstring
The SHA (full or shortened) of the desired git commit.
- Returns
civis.response.Response
- contentstring
The file’s contents.
- typestring
The file’s type.
- sizeinteger
The file’s size.
- file_hashstring
The SHA of the file.
- get_javascript_runs(id, run_id)¶
Check status of a run
- Parameters
- idinteger
The ID of the javascript.
- run_idinteger
The ID of the run.
- Returns
civis.response.Response
- idinteger
The ID of the run.
- javascript_idinteger
The ID of the javascript.
- statestring
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- is_cancel_requestedboolean
True if run cancel requested, else false.
- started_atstring/time
The time the last run started at.
- finished_atstring/time
The time the last run completed.
- errorstring
The error, if any, returned by the run.
- get_python3(id)¶
Get a Python Script
- Parameters
- idinteger
- Returns
civis.response.Response
- idinteger
The ID for the script.
- namestring
The name of the script.
- typestring
The type of the script (e.g SQL, Container, Python, R, JavaScript)
- created_atstring/time
The time this script was created.
- updated_atstring/time
The time the script was last updated.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- statestring
The status of the script’s last run.
- finished_atstring/time
The time that the script’s last run finished.
- categorystring
The category of the script.
- projectslist::
A list of projects containing the script. - id : integer
The ID for the project.
- namestring
The name of the project.
- parent_idinteger
The ID of the parent job that will trigger this script
- user_contextstring
“runner” or “author”, who to execute the script as when run as a template.
- paramslist::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- labelstring
The label to present to users when asking them for the value.
- descriptionstring
A short sentence or fragment describing this parameter to the end user.
- typestring
The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom
- requiredboolean
Whether this param is required.
- valuestring
The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- defaultstring
If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- allowed_valueslist
The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}
- argumentsdict
Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.
- is_templateboolean
Whether others scripts use this one as a template.
- published_as_template_idinteger
The ID of the template that this script is backing.
- from_template_idinteger
The ID of the template this script uses, if any.
- template_dependents_countinteger
How many other scripts use this one as a template.
- template_script_namestring
The name of the template script.
- linksdict::
- detailsstring
The details link to get more information about the script.
- runsstring
The runs link to get the run information list for this script.
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- notificationsdict::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- running_asdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- next_run_atstring/time
The time of the next scheduled run.
- time_zonestring
The time zone of this script.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- hiddenboolean
The hidden status of the item.
- target_project_idinteger
Target project to which script outputs will be added.
- archivedstring
The archival status of the requested item(s).
- required_resourcesdict::
- cpuinteger
The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.
- memoryinteger
The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.
- disk_spacenumber/float
The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.
- instance_typestring
The EC2 instance type to deploy to. Only available for jobs running on kubernetes.
- sourcestring
The body/text of the script.
- cancel_timeoutinteger
The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.
- docker_image_tagstring
The tag of the docker image to pull from DockerHub.
- partition_labelstring
The partition label used to run this object. Not generally available. Beware this attribute may be removed in the future.
- running_as_idinteger
The ID of the runner of this script.
- get_python3_git_commits(id, commit_hash)¶
Get file contents at git ref
- Parameters
- idinteger
The ID of the file.
- commit_hashstring
The SHA (full or shortened) of the desired git commit.
- Returns
civis.response.Response
- contentstring
The file’s contents.
- typestring
The file’s type.
- sizeinteger
The file’s size.
- file_hashstring
The SHA of the file.
- get_python3_runs(id, run_id)¶
Check status of a run
- Parameters
- idinteger
The ID of the python.
- run_idinteger
The ID of the run.
- Returns
civis.response.Response
- idinteger
The ID of the run.
- python_idinteger
The ID of the python.
- statestring
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- is_cancel_requestedboolean
True if run cancel requested, else false.
- started_atstring/time
The time the last run started at.
- finished_atstring/time
The time the last run completed.
- errorstring
The error, if any, returned by the run.
- max_memory_usagenumber/float
If the run has finished, the maximum amount of memory used during the run, in MB.
- max_cpu_usagenumber/float
If the run has finished, the maximum amount of cpu used during the run, in millicores.
- get_r(id)¶
Get an R Script
- Parameters
- idinteger
- Returns
civis.response.Response
- idinteger
The ID for the script.
- namestring
The name of the script.
- typestring
The type of the script (e.g SQL, Container, Python, R, JavaScript)
- created_atstring/time
The time this script was created.
- updated_atstring/time
The time the script was last updated.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- statestring
The status of the script’s last run.
- finished_atstring/time
The time that the script’s last run finished.
- categorystring
The category of the script.
- projectslist::
A list of projects containing the script. - id : integer
The ID for the project.
- namestring
The name of the project.
- parent_idinteger
The ID of the parent job that will trigger this script
- user_contextstring
“runner” or “author”, who to execute the script as when run as a template.
- paramslist::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- labelstring
The label to present to users when asking them for the value.
- descriptionstring
A short sentence or fragment describing this parameter to the end user.
- typestring
The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom
- requiredboolean
Whether this param is required.
- valuestring
The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- defaultstring
If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- allowed_valueslist
The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}
- argumentsdict
Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.
- is_templateboolean
Whether others scripts use this one as a template.
- published_as_template_idinteger
The ID of the template that this script is backing.
- from_template_idinteger
The ID of the template this script uses, if any.
- template_dependents_countinteger
How many other scripts use this one as a template.
- template_script_namestring
The name of the template script.
- linksdict::
- detailsstring
The details link to get more information about the script.
- runsstring
The runs link to get the run information list for this script.
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- notificationsdict::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- running_asdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- next_run_atstring/time
The time of the next scheduled run.
- time_zonestring
The time zone of this script.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- hiddenboolean
The hidden status of the item.
- target_project_idinteger
Target project to which script outputs will be added.
- archivedstring
The archival status of the requested item(s).
- required_resourcesdict::
- cpuinteger
The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.
- memoryinteger
The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.
- disk_spacenumber/float
The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.
- instance_typestring
The EC2 instance type to deploy to. Only available for jobs running on kubernetes.
- sourcestring
The body/text of the script.
- cancel_timeoutinteger
The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.
- docker_image_tagstring
The tag of the docker image to pull from DockerHub.
- partition_labelstring
The partition label used to run this object. Not generally available. Beware this attribute may be removed in the future.
- running_as_idinteger
The ID of the runner of this script.
- get_r_git_commits(id, commit_hash)¶
Get file contents at git ref
- Parameters
- idinteger
The ID of the file.
- commit_hashstring
The SHA (full or shortened) of the desired git commit.
- Returns
civis.response.Response
- contentstring
The file’s contents.
- typestring
The file’s type.
- sizeinteger
The file’s size.
- file_hashstring
The SHA of the file.
- get_r_runs(id, run_id)¶
Check status of a run
- Parameters
- idinteger
The ID of the r.
- run_idinteger
The ID of the run.
- Returns
civis.response.Response
- idinteger
The ID of the run.
- r_idinteger
The ID of the r.
- statestring
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- is_cancel_requestedboolean
True if run cancel requested, else false.
- started_atstring/time
The time the last run started at.
- finished_atstring/time
The time the last run completed.
- errorstring
The error, if any, returned by the run.
- max_memory_usagenumber/float
If the run has finished, the maximum amount of memory used during the run, in MB.
- max_cpu_usagenumber/float
If the run has finished, the maximum amount of cpu used during the run, in millicores.
- get_sql(id)¶
Get a SQL script
- Parameters
- idinteger
- Returns
civis.response.Response
- idinteger
The ID for the script.
- namestring
The name of the script.
- typestring
The type of the script (e.g SQL, Container, Python, R, JavaScript)
- created_atstring/time
The time this script was created.
- updated_atstring/time
The time the script was last updated.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- statestring
The status of the script’s last run.
- finished_atstring/time
The time that the script’s last run finished.
- categorystring
The category of the script.
- projectslist::
A list of projects containing the script. - id : integer
The ID for the project.
- namestring
The name of the project.
- parent_idinteger
The ID of the parent job that will trigger this script
- user_contextstring
“runner” or “author”, who to execute the script as when run as a template.
- paramslist::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- labelstring
The label to present to users when asking them for the value.
- descriptionstring
A short sentence or fragment describing this parameter to the end user.
- typestring
The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom
- requiredboolean
Whether this param is required.
- valuestring
The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- defaultstring
If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- allowed_valueslist
The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}
- argumentsdict
Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.
- is_templateboolean
Whether others scripts use this one as a template.
- published_as_template_idinteger
The ID of the template that this script is backing.
- from_template_idinteger
The ID of the template this script uses, if any.
- template_dependents_countinteger
How many other scripts use this one as a template.
- template_script_namestring
The name of the template script.
- linksdict::
- detailsstring
The details link to get more information about the script.
- runsstring
The runs link to get the run information list for this script.
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- notificationsdict::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- running_asdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- next_run_atstring/time
The time of the next scheduled run.
- time_zonestring
The time zone of this script.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- hiddenboolean
The hidden status of the item.
- target_project_idinteger
Target project to which script outputs will be added.
- archivedstring
The archival status of the requested item(s).
- sqlstring
The raw SQL query for the script.
- expanded_argumentsdict
Expanded arguments for use in injecting into different environments.
- remote_host_idinteger
The remote host ID that this script will connect to.
- credential_idinteger
The credential that this script will use.
- code_previewstring
The code that this script will run with arguments inserted.
- csv_settingsdict::
- include_headerboolean
Whether or not to include headers in the output data. Default: true
- compressionstring
The type of compression to use, if any, one of “none”, “zip”, or “gzip”. Default: gzip
- column_delimiterstring
Which delimiter to use, one of “comma”, “tab”, or “pipe”. Default: comma
- unquotedboolean
Whether or not to quote fields. Default: false
- force_multifileboolean
Whether or not the csv should be split into multiple files. Default: false
- filename_prefixstring
A user specified filename prefix for the output file to have. Default: null
- max_file_sizeinteger
The max file size, in MB, created files will be. Only available when force_multifile is true.
- running_as_idinteger
The ID of the runner of this script.
- get_sql_git_commits(id, commit_hash)¶
Get file contents at git ref
- Parameters
- idinteger
The ID of the file.
- commit_hashstring
The SHA (full or shortened) of the desired git commit.
- Returns
civis.response.Response
- contentstring
The file’s contents.
- typestring
The file’s type.
- sizeinteger
The file’s size.
- file_hashstring
The SHA of the file.
- get_sql_runs(id, run_id)¶
Check status of a run
- Parameters
- idinteger
The ID of the sql.
- run_idinteger
The ID of the run.
- Returns
civis.response.Response
- idinteger
The ID of the run.
- sql_idinteger
The ID of the sql.
- statestring
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- is_cancel_requestedboolean
True if run cancel requested, else false.
- started_atstring/time
The time the last run started at.
- finished_atstring/time
The time the last run completed.
- errorstring
The error, if any, returned by the run.
- outputlist::
A list of the outputs of this script. - output_name : string
The name of the output file.
- file_idinteger
The unique ID of the output file.
- pathstring
The temporary link to download this output file, valid for 36 hours.
- output_cached_onstring/time
The time that the output was originally exported, if a cache entry was used by the run.
- 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
- typestring, optional
If specified, return items of these types. The valid types are sql, python3, javascript, r, and containers.
- categorystring, optional
A job category for filtering scripts. Must be one of script, import, export, and enhancement.
- authorstring, optional
If specified, return items from any of these authors. It accepts a comma- separated list of user IDs.
- statusstring, optional
If specified, returns items with one of these statuses. It accepts a comma- separated list, possible values are ‘running’, ‘failed’, ‘succeeded’, ‘idle’, ‘scheduled’.
- hiddenboolean, optional
If specified to be true, returns hidden items. Defaults to false, returning non-hidden items.
- archivedstring, optional
The archival status of the requested item(s).
- limitinteger, optional
Number of results to return. Defaults to 20. Maximum allowed is 50.
- page_numinteger, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstring, 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_dirstring, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iteratorbool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
- Returns
civis.response.PaginatedResponse
- idinteger
The ID for the script.
- namestring
The name of the script.
- typestring
The type of the script (e.g SQL, Container, Python, R, JavaScript)
- created_atstring/time
The time this script was created.
- updated_atstring/time
The time the script was last updated.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- statestring
The status of the script’s last run.
- finished_atstring/time
The time that the script’s last run finished.
- projectslist::
A list of projects containing the script. - id : integer
The ID for the project.
- namestring
The name of the project.
- parent_idinteger
The ID of the parent job that will trigger this script
- is_templateboolean
Whether others scripts use this one as a template.
- from_template_idinteger
The ID of the template this script uses, if any.
- linksdict::
- detailsstring
The details link to get more information about the script.
- runsstring
The runs link to get the run information list for this script.
- time_zonestring
The time zone of this script.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- archivedstring
The archival status of the requested item(s).
- template_script_idinteger
The ID of the template script, if any.
- list_containers_dependencies(id, *, user_id='DEFAULT')¶
List dependent objects for this object
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger, optional
ID of target user
- Returns
civis.response.Response
- object_typestring
Dependent object type
- fco_typestring
Human readable dependent object type
- idinteger
Dependent object ID
- namestring
Dependent object name, or nil if the requesting user cannot read this object
- permission_levelstring
Permission level of target user (not user’s groups) for dependent object, or null if no target user
- shareableboolean
Whether or not the requesting user can share this object.
- list_containers_projects(id, *, hidden='DEFAULT')¶
List the projects a Container Script belongs to
- Parameters
- idinteger
The ID of the Container Script.
- hiddenboolean, optional
If specified to be true, returns hidden items. Defaults to false, returning non-hidden items.
- Returns
civis.response.Response
- idinteger
The ID for this project.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- namestring
The name of this project.
- descriptionstring
A description of the project.
- userslist::
Users who can see the project. - id : integer
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
auto_share : boolean
created_at : string/time
updated_at : string/time
- archivedstring
The archival status of the requested item(s).
- list_containers_runs(id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶
List runs for the given container
- Parameters
- idinteger
The ID of the container.
- limitinteger, optional
Number of results to return. Defaults to 20. Maximum allowed is 100.
- page_numinteger, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstring, optional
The field on which to order the result set. Defaults to id. Must be one of: id.
- order_dirstring, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iteratorbool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
- Returns
civis.response.PaginatedResponse
- idinteger
The ID of the run.
- container_idinteger
The ID of the container.
- statestring
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- is_cancel_requestedboolean
True if run cancel requested, else false.
- started_atstring/time
The time the last run started at.
- finished_atstring/time
The time the last run completed.
- errorstring
The error, if any, returned by the run.
- max_memory_usagenumber/float
If the run has finished, the maximum amount of memory used during the run, in MB.
- max_cpu_usagenumber/float
If the run has finished, the maximum amount of cpu used during the run, in millicores.
- list_containers_runs_logs(id, run_id, *, last_id='DEFAULT', limit='DEFAULT')¶
Get the logs for a run
- Parameters
- idinteger
The ID of the container.
- run_idinteger
The ID of the run.
- last_idinteger, 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.
- limitinteger, optional
The maximum number of log messages to return. Default of 10000.
- Returns
civis.response.Response
- idinteger
The ID of the log.
- created_atstring/date-time
The time the log was created.
- messagestring
The log message.
- levelstring
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
- idinteger
The ID of the container script.
- run_idinteger
The ID of the run.
- limitinteger, optional
Number of results to return. Defaults to its maximum of 50.
- page_numinteger, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstring, optional
The field on which to order the result set. Defaults to created_at. Must be one of: created_at, id.
- order_dirstring, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iteratorbool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
- Returns
civis.response.PaginatedResponse
- object_typestring
The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue
- object_idinteger
The ID of the output.
- namestring
The name of the output.
- linkstring
The hypermedia link to the output.
value : string
List users and groups permissioned on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
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_idstring, optional
If specified, return scripts based on the template with this ID. Specify multiple IDs as a comma-separated list.
- authorstring, optional
If specified, return items from any of these authors. It accepts a comma- separated list of user IDs.
- statusstring, optional
If specified, returns items with one of these statuses. It accepts a comma- separated list, possible values are ‘running’, ‘failed’, ‘succeeded’, ‘idle’, ‘scheduled’.
- hiddenboolean, optional
If specified to be true, returns hidden items. Defaults to false, returning non-hidden items.
- archivedstring, optional
The archival status of the requested item(s).
- limitinteger, optional
Number of results to return. Defaults to its maximum of 50.
- page_numinteger, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstring, optional
The field on which to order the result set. Defaults to updated_at. Must be one of: updated_at, name, created_at.
- order_dirstring, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to asc.
- iteratorbool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
- Returns
civis.response.PaginatedResponse
- idinteger
The ID for the script.
- namestring
The name of the script.
- typestring
The type of the script (e.g Custom)
- created_atstring/time
The time this script was created.
- updated_atstring/time
The time the script was last updated.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- statestring
The status of the script’s last run.
- finished_atstring/time
The time that the script’s last run finished.
- projectslist::
A list of projects containing the script. - id : integer
The ID for the project.
- namestring
The name of the project.
- parent_idinteger
The ID of the parent job that will trigger this script
- from_template_idinteger
The ID of the template script.
- time_zonestring
The time zone of this script.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- archivedstring
The archival status of the requested item(s).
- last_successful_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- list_custom_dependencies(id, *, user_id='DEFAULT')¶
List dependent objects for this object
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger, optional
ID of target user
- Returns
civis.response.Response
- object_typestring
Dependent object type
- fco_typestring
Human readable dependent object type
- idinteger
Dependent object ID
- namestring
Dependent object name, or nil if the requesting user cannot read this object
- permission_levelstring
Permission level of target user (not user’s groups) for dependent object, or null if no target user
- shareableboolean
Whether or not the requesting user can share this object.
- list_custom_projects(id, *, hidden='DEFAULT')¶
List the projects a Custom Script belongs to
- Parameters
- idinteger
The ID of the Custom Script.
- hiddenboolean, optional
If specified to be true, returns hidden items. Defaults to false, returning non-hidden items.
- Returns
civis.response.Response
- idinteger
The ID for this project.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- namestring
The name of this project.
- descriptionstring
A description of the project.
- userslist::
Users who can see the project. - id : integer
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
auto_share : boolean
created_at : string/time
updated_at : string/time
- archivedstring
The archival status of the requested item(s).
- list_custom_runs(id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶
List runs for the given custom
- Parameters
- idinteger
The ID of the custom.
- limitinteger, optional
Number of results to return. Defaults to 20. Maximum allowed is 100.
- page_numinteger, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstring, optional
The field on which to order the result set. Defaults to id. Must be one of: id.
- order_dirstring, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iteratorbool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
- Returns
civis.response.PaginatedResponse
- idinteger
The ID of the run.
- custom_idinteger
The ID of the custom.
- statestring
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- is_cancel_requestedboolean
True if run cancel requested, else false.
- started_atstring/time
The time the last run started at.
- finished_atstring/time
The time the last run completed.
- errorstring
The error, if any, returned by the run.
- max_memory_usagenumber/float
If the run has finished, the maximum amount of memory used during the run, in MB. Only available if the backing script is a Python, R, or container script.
- max_cpu_usagenumber/float
If the run has finished, the maximum amount of cpu used during the run, in millicores. Only available if the backing script is a Python, R, or container script.
- list_custom_runs_logs(id, run_id, *, last_id='DEFAULT', limit='DEFAULT')¶
Get the logs for a run
- Parameters
- idinteger
The ID of the custom.
- run_idinteger
The ID of the run.
- last_idinteger, 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.
- limitinteger, optional
The maximum number of log messages to return. Default of 10000.
- Returns
civis.response.Response
- idinteger
The ID of the log.
- created_atstring/date-time
The time the log was created.
- messagestring
The log message.
- levelstring
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
- idinteger
The ID of the custom script.
- run_idinteger
The ID of the run.
- limitinteger, optional
Number of results to return. Defaults to its maximum of 50.
- page_numinteger, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstring, optional
The field on which to order the result set. Defaults to created_at. Must be one of: created_at, id.
- order_dirstring, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iteratorbool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
- Returns
civis.response.PaginatedResponse
- object_typestring
The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue
- object_idinteger
The ID of the output.
- namestring
The name of the output.
- linkstring
The hypermedia link to the output.
value : string
List users and groups permissioned on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
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
- idinteger
The ID for the script.
- Returns
civis.response.Response
- idinteger
The ID of this run.
- sql_idinteger
The ID of this sql.
- statestring
The state of this run.
- is_cancel_requestedboolean
True if run cancel requested, else false.
- finished_atstring/time
The time that this run finished.
- errorstring
The error message for this run, if present.
- outputlist::
A list of the outputs of this script. - output_name : string
The name of the output file.
- file_idinteger
The unique ID of the output file.
- pathstring
The temporary link to download this output file, valid for 36 hours.
- list_javascript_dependencies(id, *, user_id='DEFAULT')¶
List dependent objects for this object
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger, optional
ID of target user
- Returns
civis.response.Response
- object_typestring
Dependent object type
- fco_typestring
Human readable dependent object type
- idinteger
Dependent object ID
- namestring
Dependent object name, or nil if the requesting user cannot read this object
- permission_levelstring
Permission level of target user (not user’s groups) for dependent object, or null if no target user
- shareableboolean
Whether or not the requesting user can share this object.
- list_javascript_git(id)¶
Get the git metadata attached to an item
- Parameters
- idinteger
The ID of the file.
- Returns
civis.response.Response
- git_refstring
A git reference specifying an unambiguous version of the file. Can be a branch name, tag or the full or shortened SHA of a commit.
- git_branchstring
The git branch that the file is on.
- git_pathstring
The path of the file in the repository.
- git_repodict::
- idinteger
The ID for this git repository.
- repo_urlstring
The URL for this git repository.
created_at : string/time
updated_at : string/time
- git_ref_typestring
Specifies if the file is versioned by branch or tag.
- pull_from_gitboolean
Automatically pull latest commit from git. Only works for scripts and workflows (assuming you have the feature enabled)
- list_javascript_git_commits(id)¶
Get the git commits for an item on the current branch
- Parameters
- idinteger
The ID of the file.
- Returns
civis.response.Response
- commit_hashstring
The SHA of the commit.
- author_namestring
The name of the commit’s author.
- datestring/time
The commit’s timestamp.
- messagestring
The commit message.
- list_javascript_projects(id, *, hidden='DEFAULT')¶
List the projects a JavaScript Script belongs to
- Parameters
- idinteger
The ID of the JavaScript Script.
- hiddenboolean, optional
If specified to be true, returns hidden items. Defaults to false, returning non-hidden items.
- Returns
civis.response.Response
- idinteger
The ID for this project.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- namestring
The name of this project.
- descriptionstring
A description of the project.
- userslist::
Users who can see the project. - id : integer
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
auto_share : boolean
created_at : string/time
updated_at : string/time
- archivedstring
The archival status of the requested item(s).
- list_javascript_runs(id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶
List runs for the given javascript
- Parameters
- idinteger
The ID of the javascript.
- limitinteger, optional
Number of results to return. Defaults to 20. Maximum allowed is 100.
- page_numinteger, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstring, optional
The field on which to order the result set. Defaults to id. Must be one of: id.
- order_dirstring, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iteratorbool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
- Returns
civis.response.PaginatedResponse
- idinteger
The ID of the run.
- javascript_idinteger
The ID of the javascript.
- statestring
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- is_cancel_requestedboolean
True if run cancel requested, else false.
- started_atstring/time
The time the last run started at.
- finished_atstring/time
The time the last run completed.
- errorstring
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
- idinteger
The ID of the javascript.
- run_idinteger
The ID of the run.
- last_idinteger, 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.
- limitinteger, optional
The maximum number of log messages to return. Default of 10000.
- Returns
civis.response.Response
- idinteger
The ID of the log.
- created_atstring/date-time
The time the log was created.
- messagestring
The log message.
- levelstring
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
- idinteger
The ID of the javascript script.
- run_idinteger
The ID of the run.
- limitinteger, optional
Number of results to return. Defaults to its maximum of 50.
- page_numinteger, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstring, optional
The field on which to order the result set. Defaults to created_at. Must be one of: created_at, id.
- order_dirstring, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iteratorbool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
- Returns
civis.response.PaginatedResponse
- object_typestring
The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue
- object_idinteger
The ID of the output.
- namestring
The name of the output.
- linkstring
The hypermedia link to the output.
value : string
List users and groups permissioned on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
- list_python3_dependencies(id, *, user_id='DEFAULT')¶
List dependent objects for this object
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger, optional
ID of target user
- Returns
civis.response.Response
- object_typestring
Dependent object type
- fco_typestring
Human readable dependent object type
- idinteger
Dependent object ID
- namestring
Dependent object name, or nil if the requesting user cannot read this object
- permission_levelstring
Permission level of target user (not user’s groups) for dependent object, or null if no target user
- shareableboolean
Whether or not the requesting user can share this object.
- list_python3_git(id)¶
Get the git metadata attached to an item
- Parameters
- idinteger
The ID of the file.
- Returns
civis.response.Response
- git_refstring
A git reference specifying an unambiguous version of the file. Can be a branch name, tag or the full or shortened SHA of a commit.
- git_branchstring
The git branch that the file is on.
- git_pathstring
The path of the file in the repository.
- git_repodict::
- idinteger
The ID for this git repository.
- repo_urlstring
The URL for this git repository.
created_at : string/time
updated_at : string/time
- git_ref_typestring
Specifies if the file is versioned by branch or tag.
- pull_from_gitboolean
Automatically pull latest commit from git. Only works for scripts and workflows (assuming you have the feature enabled)
- list_python3_git_commits(id)¶
Get the git commits for an item on the current branch
- Parameters
- idinteger
The ID of the file.
- Returns
civis.response.Response
- commit_hashstring
The SHA of the commit.
- author_namestring
The name of the commit’s author.
- datestring/time
The commit’s timestamp.
- messagestring
The commit message.
- list_python3_projects(id, *, hidden='DEFAULT')¶
List the projects a Python Script belongs to
- Parameters
- idinteger
The ID of the Python Script.
- hiddenboolean, optional
If specified to be true, returns hidden items. Defaults to false, returning non-hidden items.
- Returns
civis.response.Response
- idinteger
The ID for this project.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- namestring
The name of this project.
- descriptionstring
A description of the project.
- userslist::
Users who can see the project. - id : integer
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
auto_share : boolean
created_at : string/time
updated_at : string/time
- archivedstring
The archival status of the requested item(s).
- list_python3_runs(id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶
List runs for the given python
- Parameters
- idinteger
The ID of the python.
- limitinteger, optional
Number of results to return. Defaults to 20. Maximum allowed is 100.
- page_numinteger, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstring, optional
The field on which to order the result set. Defaults to id. Must be one of: id.
- order_dirstring, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iteratorbool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
- Returns
civis.response.PaginatedResponse
- idinteger
The ID of the run.
- python_idinteger
The ID of the python.
- statestring
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- is_cancel_requestedboolean
True if run cancel requested, else false.
- started_atstring/time
The time the last run started at.
- finished_atstring/time
The time the last run completed.
- errorstring
The error, if any, returned by the run.
- max_memory_usagenumber/float
If the run has finished, the maximum amount of memory used during the run, in MB.
- max_cpu_usagenumber/float
If the run has finished, the maximum amount of cpu used during the run, in millicores.
- list_python3_runs_logs(id, run_id, *, last_id='DEFAULT', limit='DEFAULT')¶
Get the logs for a run
- Parameters
- idinteger
The ID of the python.
- run_idinteger
The ID of the run.
- last_idinteger, 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.
- limitinteger, optional
The maximum number of log messages to return. Default of 10000.
- Returns
civis.response.Response
- idinteger
The ID of the log.
- created_atstring/date-time
The time the log was created.
- messagestring
The log message.
- levelstring
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
- idinteger
The ID of the python script.
- run_idinteger
The ID of the run.
- limitinteger, optional
Number of results to return. Defaults to its maximum of 50.
- page_numinteger, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstring, optional
The field on which to order the result set. Defaults to created_at. Must be one of: created_at, id.
- order_dirstring, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iteratorbool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
- Returns
civis.response.PaginatedResponse
- object_typestring
The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue
- object_idinteger
The ID of the output.
- namestring
The name of the output.
- linkstring
The hypermedia link to the output.
value : string
List users and groups permissioned on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
- list_r_dependencies(id, *, user_id='DEFAULT')¶
List dependent objects for this object
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger, optional
ID of target user
- Returns
civis.response.Response
- object_typestring
Dependent object type
- fco_typestring
Human readable dependent object type
- idinteger
Dependent object ID
- namestring
Dependent object name, or nil if the requesting user cannot read this object
- permission_levelstring
Permission level of target user (not user’s groups) for dependent object, or null if no target user
- shareableboolean
Whether or not the requesting user can share this object.
- list_r_git(id)¶
Get the git metadata attached to an item
- Parameters
- idinteger
The ID of the file.
- Returns
civis.response.Response
- git_refstring
A git reference specifying an unambiguous version of the file. Can be a branch name, tag or the full or shortened SHA of a commit.
- git_branchstring
The git branch that the file is on.
- git_pathstring
The path of the file in the repository.
- git_repodict::
- idinteger
The ID for this git repository.
- repo_urlstring
The URL for this git repository.
created_at : string/time
updated_at : string/time
- git_ref_typestring
Specifies if the file is versioned by branch or tag.
- pull_from_gitboolean
Automatically pull latest commit from git. Only works for scripts and workflows (assuming you have the feature enabled)
- list_r_git_commits(id)¶
Get the git commits for an item on the current branch
- Parameters
- idinteger
The ID of the file.
- Returns
civis.response.Response
- commit_hashstring
The SHA of the commit.
- author_namestring
The name of the commit’s author.
- datestring/time
The commit’s timestamp.
- messagestring
The commit message.
- list_r_projects(id, *, hidden='DEFAULT')¶
List the projects an R Script belongs to
- Parameters
- idinteger
The ID of the R Script.
- hiddenboolean, optional
If specified to be true, returns hidden items. Defaults to false, returning non-hidden items.
- Returns
civis.response.Response
- idinteger
The ID for this project.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- namestring
The name of this project.
- descriptionstring
A description of the project.
- userslist::
Users who can see the project. - id : integer
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
auto_share : boolean
created_at : string/time
updated_at : string/time
- archivedstring
The archival status of the requested item(s).
- list_r_runs(id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶
List runs for the given r
- Parameters
- idinteger
The ID of the r.
- limitinteger, optional
Number of results to return. Defaults to 20. Maximum allowed is 100.
- page_numinteger, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstring, optional
The field on which to order the result set. Defaults to id. Must be one of: id.
- order_dirstring, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iteratorbool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
- Returns
civis.response.PaginatedResponse
- idinteger
The ID of the run.
- r_idinteger
The ID of the r.
- statestring
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- is_cancel_requestedboolean
True if run cancel requested, else false.
- started_atstring/time
The time the last run started at.
- finished_atstring/time
The time the last run completed.
- errorstring
The error, if any, returned by the run.
- max_memory_usagenumber/float
If the run has finished, the maximum amount of memory used during the run, in MB.
- max_cpu_usagenumber/float
If the run has finished, the maximum amount of cpu used during the run, in millicores.
- list_r_runs_logs(id, run_id, *, last_id='DEFAULT', limit='DEFAULT')¶
Get the logs for a run
- Parameters
- idinteger
The ID of the r.
- run_idinteger
The ID of the run.
- last_idinteger, 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.
- limitinteger, optional
The maximum number of log messages to return. Default of 10000.
- Returns
civis.response.Response
- idinteger
The ID of the log.
- created_atstring/date-time
The time the log was created.
- messagestring
The log message.
- levelstring
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
- idinteger
The ID of the r script.
- run_idinteger
The ID of the run.
- limitinteger, optional
Number of results to return. Defaults to its maximum of 50.
- page_numinteger, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstring, optional
The field on which to order the result set. Defaults to created_at. Must be one of: created_at, id.
- order_dirstring, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iteratorbool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
- Returns
civis.response.PaginatedResponse
- object_typestring
The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue
- object_idinteger
The ID of the output.
- namestring
The name of the output.
- linkstring
The hypermedia link to the output.
value : string
List users and groups permissioned on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
- list_sql_dependencies(id, *, user_id='DEFAULT')¶
List dependent objects for this object
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger, optional
ID of target user
- Returns
civis.response.Response
- object_typestring
Dependent object type
- fco_typestring
Human readable dependent object type
- idinteger
Dependent object ID
- namestring
Dependent object name, or nil if the requesting user cannot read this object
- permission_levelstring
Permission level of target user (not user’s groups) for dependent object, or null if no target user
- shareableboolean
Whether or not the requesting user can share this object.
- list_sql_git(id)¶
Get the git metadata attached to an item
- Parameters
- idinteger
The ID of the file.
- Returns
civis.response.Response
- git_refstring
A git reference specifying an unambiguous version of the file. Can be a branch name, tag or the full or shortened SHA of a commit.
- git_branchstring
The git branch that the file is on.
- git_pathstring
The path of the file in the repository.
- git_repodict::
- idinteger
The ID for this git repository.
- repo_urlstring
The URL for this git repository.
created_at : string/time
updated_at : string/time
- git_ref_typestring
Specifies if the file is versioned by branch or tag.
- pull_from_gitboolean
Automatically pull latest commit from git. Only works for scripts and workflows (assuming you have the feature enabled)
- list_sql_git_commits(id)¶
Get the git commits for an item on the current branch
- Parameters
- idinteger
The ID of the file.
- Returns
civis.response.Response
- commit_hashstring
The SHA of the commit.
- author_namestring
The name of the commit’s author.
- datestring/time
The commit’s timestamp.
- messagestring
The commit message.
- list_sql_projects(id, *, hidden='DEFAULT')¶
List the projects a SQL script belongs to
- Parameters
- idinteger
The ID of the SQL script.
- hiddenboolean, optional
If specified to be true, returns hidden items. Defaults to false, returning non-hidden items.
- Returns
civis.response.Response
- idinteger
The ID for this project.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- namestring
The name of this project.
- descriptionstring
A description of the project.
- userslist::
Users who can see the project. - id : integer
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
auto_share : boolean
created_at : string/time
updated_at : string/time
- archivedstring
The archival status of the requested item(s).
- list_sql_runs(id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶
List runs for the given sql
- Parameters
- idinteger
The ID of the sql.
- limitinteger, optional
Number of results to return. Defaults to 20. Maximum allowed is 100.
- page_numinteger, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstring, optional
The field on which to order the result set. Defaults to id. Must be one of: id.
- order_dirstring, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iteratorbool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
- Returns
civis.response.PaginatedResponse
- idinteger
The ID of the run.
- sql_idinteger
The ID of the sql.
- statestring
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- is_cancel_requestedboolean
True if run cancel requested, else false.
- started_atstring/time
The time the last run started at.
- finished_atstring/time
The time the last run completed.
- errorstring
The error, if any, returned by the run.
- outputlist::
A list of the outputs of this script. - output_name : string
The name of the output file.
- file_idinteger
The unique ID of the output file.
- pathstring
The temporary link to download this output file, valid for 36 hours.
- output_cached_onstring/time
The time that the output was originally exported, if a cache entry was used by the run.
- list_sql_runs_logs(id, run_id, *, last_id='DEFAULT', limit='DEFAULT')¶
Get the logs for a run
- Parameters
- idinteger
The ID of the sql.
- run_idinteger
The ID of the run.
- last_idinteger, 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.
- limitinteger, optional
The maximum number of log messages to return. Default of 10000.
- Returns
civis.response.Response
- idinteger
The ID of the log.
- created_atstring/date-time
The time the log was created.
- messagestring
The log message.
- levelstring
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
- idinteger
The ID of the sql script.
- run_idinteger
The ID of the run.
- limitinteger, optional
Number of results to return. Defaults to its maximum of 50.
- page_numinteger, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstring, optional
The field on which to order the result set. Defaults to created_at. Must be one of: created_at, id.
- order_dirstring, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iteratorbool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
- Returns
civis.response.PaginatedResponse
- object_typestring
The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue
- object_idinteger
The ID of the output.
- namestring
The name of the output.
- linkstring
The hypermedia link to the output.
value : string
List users and groups permissioned on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
- list_types()¶
List available script types
- Returns
civis.response.Response
- namestring
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', running_as_id='DEFAULT')¶
Update a script
- Parameters
- idinteger
The ID for the script.
- namestring, optional
The name of the script.
- sqlstring, optional
The raw SQL query for the script.
- paramslist, 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.
- labelstring
The label to present to users when asking them for the value.
- descriptionstring
A short sentence or fragment describing this parameter to the end user.
- typestring
The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom
- requiredboolean
Whether this param is required.
- valuestring
The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- defaultstring
If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- allowed_valueslist
The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}
- argumentsdict, optional
Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.
- template_script_idinteger, optional
The ID of the template script, if any. A script cannot both have a template script and be a template for other scripts.
- scheduledict, optional::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- notificationsdict, optional::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- parent_idinteger, optional
The ID of the parent job that will trigger this script
- running_as_idinteger, optional
The ID of the runner of this script.
- Returns
civis.response.Response
- idinteger
The ID for the script.
- namestring
The name of the script.
- typestring
The type of script.
- created_atstring/time
The time this script was created.
- updated_atstring/time
The time this script was last updated.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- statestring
The status of the script’s last run.
- finished_atstring/time
The time that the script’s last run finished.
- categorystring
The category of the script.
- projectslist::
A list of projects containing the script. - id : integer
The ID for the project.
- namestring
The name of the project.
- parent_idinteger
The ID of the parent job that will trigger this script
- user_contextstring
“runner” or “author”, who to execute the script as when run as a template.
- paramslist::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- labelstring
The label to present to users when asking them for the value.
- descriptionstring
A short sentence or fragment describing this parameter to the end user.
- typestring
The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom
- requiredboolean
Whether this param is required.
- valuestring
The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- defaultstring
If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- allowed_valueslist
The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}
- argumentsdict
Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.
- is_templateboolean
Whether others scripts use this one as a template.
- published_as_template_idinteger
The ID of the template that this script is backing.
- from_template_idinteger
The ID of the template this script uses, if any.
- template_dependents_countinteger
How many other scripts use this one as a template.
- template_script_namestring
The name of the template script.
- linksdict::
- detailsstring
The details link to get more information about the script.
- runsstring
The runs link to get the run information list for this script.
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- notificationsdict::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- running_asdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- next_run_atstring/time
The time of the next scheduled run.
- time_zonestring
The time zone of this script.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- hiddenboolean
The hidden status of the item.
- target_project_idinteger
Target project to which script outputs will be added.
- archivedstring
The archival status of the requested item(s).
- sqlstring
The raw SQL query for the script.
- expanded_argumentsdict
Expanded arguments for use in injecting into different environments.
- template_script_idinteger
The ID of the template script, if any.
- patch_container_runs(id, run_id, *, error='DEFAULT')¶
Update the given run
- Parameters
- idinteger
ID of the Job
- run_idinteger
ID of the Run
- errorstring, optional
The error message to update
- Returns
- None
Response code 204: success
- 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', instance_type='DEFAULT', cancel_timeout='DEFAULT', time_zone='DEFAULT', partition_label='DEFAULT', target_project_id='DEFAULT', running_as_id='DEFAULT')¶
Update a container
- Parameters
- idinteger
The ID for the script.
- namestring, optional
The name of the container.
- parent_idinteger, optional
The ID of the parent job that will trigger this script
- user_contextstring, optional
“runner” or “author”, who to execute the script as when run as a template.
- paramslist, optional::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- labelstring
The label to present to users when asking them for the value.
- descriptionstring
A short sentence or fragment describing this parameter to the end user.
- typestring
The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom
- requiredboolean
Whether this param is required.
- valuestring
The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- defaultstring
If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- allowed_valueslist
The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}
- argumentsdict, optional
Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.
- scheduledict, optional::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- notificationsdict, optional::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- required_resourcesdict, optional::
- cpuinteger
The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.
- memoryinteger
The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.
- disk_spacenumber/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_uristring, optional
The location of a github repo to clone into the container, e.g. github.com/my-user/my-repo.git.
- repo_refstring, optional
The tag or branch of the github repo to clone into the container.
- remote_host_credential_idinteger, optional
The id of the database credentials to pass into the environment of the container.
- git_credential_idinteger, 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_commandstring, optional
The command to run on the container. Will be run via sh as: [“sh”, “-c”, dockerCommand]. Defaults to the Docker image’s ENTRYPOINT/CMD.
- docker_image_namestring, optional
The name of the docker image to pull from DockerHub.
- docker_image_tagstring, optional
The tag of the docker image to pull from DockerHub.
- instance_typestring, optional
The EC2 instance type to deploy to. Only available for jobs running on kubernetes.
- cancel_timeoutinteger, 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_zonestring, optional
The time zone of this script.
- partition_labelstring, optional
The partition label used to run this object. Not generally available. Beware this attribute may be removed in the future.
- target_project_idinteger, optional
Target project to which script outputs will be added.
- running_as_idinteger, optional
The ID of the runner of this script.
- Returns
civis.response.Response
- idinteger
The ID for the script.
- namestring
The name of the container.
- typestring
The type of the script (e.g Container)
- created_atstring/time
The time this script was created.
- updated_atstring/time
The time the script was last updated.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- statestring
The status of the script’s last run.
- finished_atstring/time
The time that the script’s last run finished.
- categorystring
The category of the script.
- projectslist::
A list of projects containing the script. - id : integer
The ID for the project.
- namestring
The name of the project.
- parent_idinteger
The ID of the parent job that will trigger this script
- user_contextstring
“runner” or “author”, who to execute the script as when run as a template.
- paramslist::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- labelstring
The label to present to users when asking them for the value.
- descriptionstring
A short sentence or fragment describing this parameter to the end user.
- typestring
The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom
- requiredboolean
Whether this param is required.
- valuestring
The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- defaultstring
If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- allowed_valueslist
The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}
- argumentsdict
Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.
- is_templateboolean
Whether others scripts use this one as a template.
- template_dependents_countinteger
How many other scripts use this one as a template.
- published_as_template_idinteger
The ID of the template that this script is backing.
- from_template_idinteger
The ID of the template script.
- template_script_namestring
The name of the template script.
- linksdict::
- detailsstring
The details link to get more information about the script.
- runsstring
The runs link to get the run information list for this script.
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- notificationsdict::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- running_asdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- required_resourcesdict::
- cpuinteger
The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.
- memoryinteger
The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.
- disk_spacenumber/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_uristring
The location of a github repo to clone into the container, e.g. github.com/my-user/my-repo.git.
- repo_refstring
The tag or branch of the github repo to clone into the container.
- remote_host_credential_idinteger
The id of the database credentials to pass into the environment of the container.
- git_credential_idinteger
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_commandstring
The command to run on the container. Will be run via sh as: [“sh”, “-c”, dockerCommand]. Defaults to the Docker image’s ENTRYPOINT/CMD.
- docker_image_namestring
The name of the docker image to pull from DockerHub.
- docker_image_tagstring
The tag of the docker image to pull from DockerHub.
- instance_typestring
The EC2 instance type to deploy to. Only available for jobs running on kubernetes.
- cancel_timeoutinteger
The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- time_zonestring
The time zone of this script.
- partition_labelstring
The partition label used to run this object. Not generally available. Beware this attribute may be removed in the future.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- hiddenboolean
The hidden status of the item.
- archivedstring
The archival status of the requested item(s).
- target_project_idinteger
Target project to which script outputs will be added.
- running_as_idinteger
The ID of the runner of this script.
- 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', required_resources='DEFAULT', partition_label='DEFAULT', running_as_id='DEFAULT')¶
Update some attributes of this Custom Script
- Parameters
- idinteger
The ID for the script.
- namestring, optional
The name of the script.
- parent_idinteger, optional
The ID of the parent job that will trigger this script
- argumentsdict, optional
Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.
- remote_host_idinteger, optional
The remote host ID that this script will connect to.
- credential_idinteger, optional
The credential that this script will use.
- scheduledict, optional::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- notificationsdict, optional::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- time_zonestring, optional
The time zone of this script.
- target_project_idinteger, optional
Target project to which script outputs will be added.
- required_resourcesdict, optional::
- cpuinteger
The number of CPU shares to allocate for the container. Each core has 1000 shares.
- memoryinteger
The amount of RAM to allocate for the container (in MB).
- disk_spacenumber/float
The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.
- partition_labelstring, optional
The partition label used to run this object. Only applicable for jobs using Docker.Not generally available. Beware this attribute may be removed in the future.
- running_as_idinteger, optional
The ID of the runner of this script.
- Returns
civis.response.Response
- idinteger
The ID for the script.
- namestring
The name of the script.
- typestring
The type of the script (e.g Custom)
- created_atstring/time
The time this script was created.
- updated_atstring/time
The time the script was last updated.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- statestring
The status of the script’s last run.
- finished_atstring/time
The time that the script’s last run finished.
category : string
- projectslist::
A list of projects containing the script. - id : integer
The ID for the project.
- namestring
The name of the project.
- parent_idinteger
The ID of the parent job that will trigger this script
- paramslist::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- labelstring
The label to present to users when asking them for the value.
- descriptionstring
A short sentence or fragment describing this parameter to the end user.
- typestring
The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom
- requiredboolean
Whether this param is required.
- valuestring
The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- defaultstring
If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- allowed_valueslist
The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}
- argumentsdict
Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.
- is_templateboolean
Whether others scripts use this one as a template.
- published_as_template_idinteger
The ID of the template that this script is backing.
- from_template_idinteger
The ID of the template script.
- ui_report_urlinteger
The url of the custom HTML.
- ui_report_idinteger
The id of the report with the custom HTML.
- ui_report_provide_api_keyboolean
Whether the ui report requests an API Key from the report viewer.
- template_script_namestring
The name of the template script.
- template_notestring
The template’s note.
- remote_host_idinteger
The remote host ID that this script will connect to.
- credential_idinteger
The credential that this script will use.
- code_previewstring
The code that this script will run with arguments inserted.
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- notificationsdict::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- running_asdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- time_zonestring
The time zone of this script.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- hiddenboolean
The hidden status of the item.
- archivedstring
The archival status of the requested item(s).
- target_project_idinteger
Target project to which script outputs will be added.
- last_successful_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- required_resourcesdict::
- cpuinteger
The number of CPU shares to allocate for the container. Each core has 1000 shares.
- memoryinteger
The amount of RAM to allocate for the container (in MB).
- disk_spacenumber/float
The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.
- partition_labelstring
The partition label used to run this object. Only applicable for jobs using Docker.Not generally available. Beware this attribute may be removed in the future.
- running_as_idinteger
The ID of the runner of this script.
- 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', running_as_id='DEFAULT')¶
Update some attributes of this JavaScript Script
- Parameters
- idinteger
The ID for the script.
- namestring, optional
The name of the script.
- parent_idinteger, optional
The ID of the parent job that will trigger this script
- user_contextstring, optional
“runner” or “author”, who to execute the script as when run as a template.
- paramslist, optional::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- labelstring
The label to present to users when asking them for the value.
- descriptionstring
A short sentence or fragment describing this parameter to the end user.
- typestring
The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom
- requiredboolean
Whether this param is required.
- valuestring
The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- defaultstring
If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- allowed_valueslist
The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}
- argumentsdict, optional
Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.
- scheduledict, optional::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- notificationsdict, optional::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- next_run_atstring/time, optional
The time of the next scheduled run.
- time_zonestring, optional
The time zone of this script.
- target_project_idinteger, optional
Target project to which script outputs will be added.
- sourcestring, optional
The body/text of the script.
- remote_host_idinteger, optional
The remote host ID that this script will connect to.
- credential_idinteger, optional
The credential that this script will use.
- running_as_idinteger, optional
The ID of the runner of this script.
- Returns
civis.response.Response
- idinteger
The ID for the script.
- namestring
The name of the script.
- typestring
The type of the script (e.g SQL, Container, Python, R, JavaScript)
- created_atstring/time
The time this script was created.
- updated_atstring/time
The time the script was last updated.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- statestring
The status of the script’s last run.
- finished_atstring/time
The time that the script’s last run finished.
- categorystring
The category of the script.
- projectslist::
A list of projects containing the script. - id : integer
The ID for the project.
- namestring
The name of the project.
- parent_idinteger
The ID of the parent job that will trigger this script
- user_contextstring
“runner” or “author”, who to execute the script as when run as a template.
- paramslist::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- labelstring
The label to present to users when asking them for the value.
- descriptionstring
A short sentence or fragment describing this parameter to the end user.
- typestring
The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom
- requiredboolean
Whether this param is required.
- valuestring
The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- defaultstring
If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- allowed_valueslist
The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}
- argumentsdict
Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.
- is_templateboolean
Whether others scripts use this one as a template.
- published_as_template_idinteger
The ID of the template that this script is backing.
- from_template_idinteger
The ID of the template this script uses, if any.
- template_dependents_countinteger
How many other scripts use this one as a template.
- template_script_namestring
The name of the template script.
- linksdict::
- detailsstring
The details link to get more information about the script.
- runsstring
The runs link to get the run information list for this script.
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- notificationsdict::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- running_asdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- next_run_atstring/time
The time of the next scheduled run.
- time_zonestring
The time zone of this script.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- hiddenboolean
The hidden status of the item.
- target_project_idinteger
Target project to which script outputs will be added.
- archivedstring
The archival status of the requested item(s).
- sourcestring
The body/text of the script.
- remote_host_idinteger
The remote host ID that this script will connect to.
- credential_idinteger
The credential that this script will use.
- running_as_idinteger
The ID of the runner of this script.
- patch_javascript_git(id, *, git_ref='DEFAULT', git_branch='DEFAULT', git_path='DEFAULT', git_repo_url='DEFAULT', git_ref_type='DEFAULT', pull_from_git='DEFAULT')¶
Update an attached git file
- Parameters
- idinteger
The ID of the file.
- git_refstring, optional
A git reference specifying an unambiguous version of the file. Can be a branch name, or the full or shortened SHA of a commit.
- git_branchstring, optional
The git branch that the file is on.
- git_pathstring, optional
The path of the file in the repository.
- git_repo_urlstring, optional
The URL of the git repository.
- git_ref_typestring, optional
Specifies if the file is versioned by branch or tag.
- pull_from_gitboolean, optional
Automatically pull latest commit from git. Only works for scripts.
- Returns
civis.response.Response
- git_refstring
A git reference specifying an unambiguous version of the file. Can be a branch name, tag or the full or shortened SHA of a commit.
- git_branchstring
The git branch that the file is on.
- git_pathstring
The path of the file in the repository.
- git_repodict::
- idinteger
The ID for this git repository.
- repo_urlstring
The URL for this git repository.
created_at : string/time
updated_at : string/time
- git_ref_typestring
Specifies if the file is versioned by branch or tag.
- pull_from_gitboolean
Automatically pull latest commit from git. Only works for scripts and workflows (assuming you have the feature enabled)
- patch_javascript_runs(id, run_id, *, error='DEFAULT')¶
Update the given run
- Parameters
- idinteger
ID of the Job
- run_idinteger
ID of the Run
- errorstring, optional
The error message to update
- Returns
- None
Response code 204: success
- 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', instance_type='DEFAULT', source='DEFAULT', cancel_timeout='DEFAULT', docker_image_tag='DEFAULT', partition_label='DEFAULT', running_as_id='DEFAULT')¶
Update some attributes of this Python Script
- Parameters
- idinteger
The ID for the script.
- namestring, optional
The name of the script.
- parent_idinteger, optional
The ID of the parent job that will trigger this script
- user_contextstring, optional
“runner” or “author”, who to execute the script as when run as a template.
- paramslist, optional::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- labelstring
The label to present to users when asking them for the value.
- descriptionstring
A short sentence or fragment describing this parameter to the end user.
- typestring
The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom
- requiredboolean
Whether this param is required.
- valuestring
The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- defaultstring
If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- allowed_valueslist
The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}
- argumentsdict, optional
Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.
- scheduledict, optional::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- notificationsdict, optional::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- next_run_atstring/time, optional
The time of the next scheduled run.
- time_zonestring, optional
The time zone of this script.
- target_project_idinteger, optional
Target project to which script outputs will be added.
- required_resourcesdict, optional::
- cpuinteger
The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.
- memoryinteger
The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.
- disk_spacenumber/float
The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.
- instance_typestring, optional
The EC2 instance type to deploy to. Only available for jobs running on kubernetes.
- sourcestring, optional
The body/text of the script.
- cancel_timeoutinteger, optional
The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.
- docker_image_tagstring, optional
The tag of the docker image to pull from DockerHub.
- partition_labelstring, optional
The partition label used to run this object. Not generally available. Beware this attribute may be removed in the future.
- running_as_idinteger, optional
The ID of the runner of this script.
- Returns
civis.response.Response
- idinteger
The ID for the script.
- namestring
The name of the script.
- typestring
The type of the script (e.g SQL, Container, Python, R, JavaScript)
- created_atstring/time
The time this script was created.
- updated_atstring/time
The time the script was last updated.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- statestring
The status of the script’s last run.
- finished_atstring/time
The time that the script’s last run finished.
- categorystring
The category of the script.
- projectslist::
A list of projects containing the script. - id : integer
The ID for the project.
- namestring
The name of the project.
- parent_idinteger
The ID of the parent job that will trigger this script
- user_contextstring
“runner” or “author”, who to execute the script as when run as a template.
- paramslist::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- labelstring
The label to present to users when asking them for the value.
- descriptionstring
A short sentence or fragment describing this parameter to the end user.
- typestring
The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom
- requiredboolean
Whether this param is required.
- valuestring
The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- defaultstring
If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- allowed_valueslist
The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}
- argumentsdict
Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.
- is_templateboolean
Whether others scripts use this one as a template.
- published_as_template_idinteger
The ID of the template that this script is backing.
- from_template_idinteger
The ID of the template this script uses, if any.
- template_dependents_countinteger
How many other scripts use this one as a template.
- template_script_namestring
The name of the template script.
- linksdict::
- detailsstring
The details link to get more information about the script.
- runsstring
The runs link to get the run information list for this script.
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- notificationsdict::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- running_asdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- next_run_atstring/time
The time of the next scheduled run.
- time_zonestring
The time zone of this script.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- hiddenboolean
The hidden status of the item.
- target_project_idinteger
Target project to which script outputs will be added.
- archivedstring
The archival status of the requested item(s).
- required_resourcesdict::
- cpuinteger
The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.
- memoryinteger
The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.
- disk_spacenumber/float
The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.
- instance_typestring
The EC2 instance type to deploy to. Only available for jobs running on kubernetes.
- sourcestring
The body/text of the script.
- cancel_timeoutinteger
The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.
- docker_image_tagstring
The tag of the docker image to pull from DockerHub.
- partition_labelstring
The partition label used to run this object. Not generally available. Beware this attribute may be removed in the future.
- running_as_idinteger
The ID of the runner of this script.
- patch_python3_git(id, *, git_ref='DEFAULT', git_branch='DEFAULT', git_path='DEFAULT', git_repo_url='DEFAULT', git_ref_type='DEFAULT', pull_from_git='DEFAULT')¶
Update an attached git file
- Parameters
- idinteger
The ID of the file.
- git_refstring, optional
A git reference specifying an unambiguous version of the file. Can be a branch name, or the full or shortened SHA of a commit.
- git_branchstring, optional
The git branch that the file is on.
- git_pathstring, optional
The path of the file in the repository.
- git_repo_urlstring, optional
The URL of the git repository.
- git_ref_typestring, optional
Specifies if the file is versioned by branch or tag.
- pull_from_gitboolean, optional
Automatically pull latest commit from git. Only works for scripts.
- Returns
civis.response.Response
- git_refstring
A git reference specifying an unambiguous version of the file. Can be a branch name, tag or the full or shortened SHA of a commit.
- git_branchstring
The git branch that the file is on.
- git_pathstring
The path of the file in the repository.
- git_repodict::
- idinteger
The ID for this git repository.
- repo_urlstring
The URL for this git repository.
created_at : string/time
updated_at : string/time
- git_ref_typestring
Specifies if the file is versioned by branch or tag.
- pull_from_gitboolean
Automatically pull latest commit from git. Only works for scripts and workflows (assuming you have the feature enabled)
- patch_python3_runs(id, run_id, *, error='DEFAULT')¶
Update the given run
- Parameters
- idinteger
ID of the Job
- run_idinteger
ID of the Run
- errorstring, optional
The error message to update
- Returns
- None
Response code 204: success
- 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', instance_type='DEFAULT', source='DEFAULT', cancel_timeout='DEFAULT', docker_image_tag='DEFAULT', partition_label='DEFAULT', running_as_id='DEFAULT')¶
Update some attributes of this R Script
- Parameters
- idinteger
The ID for the script.
- namestring, optional
The name of the script.
- parent_idinteger, optional
The ID of the parent job that will trigger this script
- user_contextstring, optional
“runner” or “author”, who to execute the script as when run as a template.
- paramslist, optional::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- labelstring
The label to present to users when asking them for the value.
- descriptionstring
A short sentence or fragment describing this parameter to the end user.
- typestring
The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom
- requiredboolean
Whether this param is required.
- valuestring
The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- defaultstring
If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- allowed_valueslist
The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}
- argumentsdict, optional
Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.
- scheduledict, optional::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- notificationsdict, optional::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- next_run_atstring/time, optional
The time of the next scheduled run.
- time_zonestring, optional
The time zone of this script.
- target_project_idinteger, optional
Target project to which script outputs will be added.
- required_resourcesdict, optional::
- cpuinteger
The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.
- memoryinteger
The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.
- disk_spacenumber/float
The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.
- instance_typestring, optional
The EC2 instance type to deploy to. Only available for jobs running on kubernetes.
- sourcestring, optional
The body/text of the script.
- cancel_timeoutinteger, optional
The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.
- docker_image_tagstring, optional
The tag of the docker image to pull from DockerHub.
- partition_labelstring, optional
The partition label used to run this object. Not generally available. Beware this attribute may be removed in the future.
- running_as_idinteger, optional
The ID of the runner of this script.
- Returns
civis.response.Response
- idinteger
The ID for the script.
- namestring
The name of the script.
- typestring
The type of the script (e.g SQL, Container, Python, R, JavaScript)
- created_atstring/time
The time this script was created.
- updated_atstring/time
The time the script was last updated.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- statestring
The status of the script’s last run.
- finished_atstring/time
The time that the script’s last run finished.
- categorystring
The category of the script.
- projectslist::
A list of projects containing the script. - id : integer
The ID for the project.
- namestring
The name of the project.
- parent_idinteger
The ID of the parent job that will trigger this script
- user_contextstring
“runner” or “author”, who to execute the script as when run as a template.
- paramslist::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- labelstring
The label to present to users when asking them for the value.
- descriptionstring
A short sentence or fragment describing this parameter to the end user.
- typestring
The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom
- requiredboolean
Whether this param is required.
- valuestring
The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- defaultstring
If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- allowed_valueslist
The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}
- argumentsdict
Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.
- is_templateboolean
Whether others scripts use this one as a template.
- published_as_template_idinteger
The ID of the template that this script is backing.
- from_template_idinteger
The ID of the template this script uses, if any.
- template_dependents_countinteger
How many other scripts use this one as a template.
- template_script_namestring
The name of the template script.
- linksdict::
- detailsstring
The details link to get more information about the script.
- runsstring
The runs link to get the run information list for this script.
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- notificationsdict::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- running_asdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- next_run_atstring/time
The time of the next scheduled run.
- time_zonestring
The time zone of this script.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- hiddenboolean
The hidden status of the item.
- target_project_idinteger
Target project to which script outputs will be added.
- archivedstring
The archival status of the requested item(s).
- required_resourcesdict::
- cpuinteger
The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.
- memoryinteger
The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.
- disk_spacenumber/float
The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.
- instance_typestring
The EC2 instance type to deploy to. Only available for jobs running on kubernetes.
- sourcestring
The body/text of the script.
- cancel_timeoutinteger
The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.
- docker_image_tagstring
The tag of the docker image to pull from DockerHub.
- partition_labelstring
The partition label used to run this object. Not generally available. Beware this attribute may be removed in the future.
- running_as_idinteger
The ID of the runner of this script.
- patch_r_git(id, *, git_ref='DEFAULT', git_branch='DEFAULT', git_path='DEFAULT', git_repo_url='DEFAULT', git_ref_type='DEFAULT', pull_from_git='DEFAULT')¶
Update an attached git file
- Parameters
- idinteger
The ID of the file.
- git_refstring, optional
A git reference specifying an unambiguous version of the file. Can be a branch name, or the full or shortened SHA of a commit.
- git_branchstring, optional
The git branch that the file is on.
- git_pathstring, optional
The path of the file in the repository.
- git_repo_urlstring, optional
The URL of the git repository.
- git_ref_typestring, optional
Specifies if the file is versioned by branch or tag.
- pull_from_gitboolean, optional
Automatically pull latest commit from git. Only works for scripts.
- Returns
civis.response.Response
- git_refstring
A git reference specifying an unambiguous version of the file. Can be a branch name, tag or the full or shortened SHA of a commit.
- git_branchstring
The git branch that the file is on.
- git_pathstring
The path of the file in the repository.
- git_repodict::
- idinteger
The ID for this git repository.
- repo_urlstring
The URL for this git repository.
created_at : string/time
updated_at : string/time
- git_ref_typestring
Specifies if the file is versioned by branch or tag.
- pull_from_gitboolean
Automatically pull latest commit from git. Only works for scripts and workflows (assuming you have the feature enabled)
- patch_r_runs(id, run_id, *, error='DEFAULT')¶
Update the given run
- Parameters
- idinteger
ID of the Job
- run_idinteger
ID of the Run
- errorstring, optional
The error message to update
- Returns
- None
Response code 204: success
- 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', running_as_id='DEFAULT')¶
Update some attributes of this SQL script
- Parameters
- idinteger
The ID for the script.
- namestring, optional
The name of the script.
- parent_idinteger, optional
The ID of the parent job that will trigger this script
- user_contextstring, optional
“runner” or “author”, who to execute the script as when run as a template.
- paramslist, optional::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- labelstring
The label to present to users when asking them for the value.
- descriptionstring
A short sentence or fragment describing this parameter to the end user.
- typestring
The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom
- requiredboolean
Whether this param is required.
- valuestring
The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- defaultstring
If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- allowed_valueslist
The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}
- argumentsdict, optional
Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.
- scheduledict, optional::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- notificationsdict, optional::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- next_run_atstring/time, optional
The time of the next scheduled run.
- time_zonestring, optional
The time zone of this script.
- target_project_idinteger, optional
Target project to which script outputs will be added.
- sqlstring, optional
The raw SQL query for the script.
- remote_host_idinteger, optional
The remote host ID that this script will connect to.
- credential_idinteger, optional
The credential that this script will use.
- csv_settingsdict, optional::
- include_headerboolean
Whether or not to include headers in the output data. Default: true
- compressionstring
The type of compression to use, if any, one of “none”, “zip”, or “gzip”. Default: gzip
- column_delimiterstring
Which delimiter to use, one of “comma”, “tab”, or “pipe”. Default: comma
- unquotedboolean
Whether or not to quote fields. Default: false
- force_multifileboolean
Whether or not the csv should be split into multiple files. Default: false
- filename_prefixstring
A user specified filename prefix for the output file to have. Default: null
- max_file_sizeinteger
The max file size, in MB, created files will be. Only available when force_multifile is true.
- running_as_idinteger, optional
The ID of the runner of this script.
- Returns
civis.response.Response
- idinteger
The ID for the script.
- namestring
The name of the script.
- typestring
The type of the script (e.g SQL, Container, Python, R, JavaScript)
- created_atstring/time
The time this script was created.
- updated_atstring/time
The time the script was last updated.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- statestring
The status of the script’s last run.
- finished_atstring/time
The time that the script’s last run finished.
- categorystring
The category of the script.
- projectslist::
A list of projects containing the script. - id : integer
The ID for the project.
- namestring
The name of the project.
- parent_idinteger
The ID of the parent job that will trigger this script
- user_contextstring
“runner” or “author”, who to execute the script as when run as a template.
- paramslist::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- labelstring
The label to present to users when asking them for the value.
- descriptionstring
A short sentence or fragment describing this parameter to the end user.
- typestring
The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom
- requiredboolean
Whether this param is required.
- valuestring
The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- defaultstring
If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- allowed_valueslist
The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}
- argumentsdict
Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.
- is_templateboolean
Whether others scripts use this one as a template.
- published_as_template_idinteger
The ID of the template that this script is backing.
- from_template_idinteger
The ID of the template this script uses, if any.
- template_dependents_countinteger
How many other scripts use this one as a template.
- template_script_namestring
The name of the template script.
- linksdict::
- detailsstring
The details link to get more information about the script.
- runsstring
The runs link to get the run information list for this script.
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- notificationsdict::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- running_asdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- next_run_atstring/time
The time of the next scheduled run.
- time_zonestring
The time zone of this script.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- hiddenboolean
The hidden status of the item.
- target_project_idinteger
Target project to which script outputs will be added.
- archivedstring
The archival status of the requested item(s).
- sqlstring
The raw SQL query for the script.
- expanded_argumentsdict
Expanded arguments for use in injecting into different environments.
- remote_host_idinteger
The remote host ID that this script will connect to.
- credential_idinteger
The credential that this script will use.
- code_previewstring
The code that this script will run with arguments inserted.
- csv_settingsdict::
- include_headerboolean
Whether or not to include headers in the output data. Default: true
- compressionstring
The type of compression to use, if any, one of “none”, “zip”, or “gzip”. Default: gzip
- column_delimiterstring
Which delimiter to use, one of “comma”, “tab”, or “pipe”. Default: comma
- unquotedboolean
Whether or not to quote fields. Default: false
- force_multifileboolean
Whether or not the csv should be split into multiple files. Default: false
- filename_prefixstring
A user specified filename prefix for the output file to have. Default: null
- max_file_sizeinteger
The max file size, in MB, created files will be. Only available when force_multifile is true.
- running_as_idinteger
The ID of the runner of this script.
- patch_sql_git(id, *, git_ref='DEFAULT', git_branch='DEFAULT', git_path='DEFAULT', git_repo_url='DEFAULT', git_ref_type='DEFAULT', pull_from_git='DEFAULT')¶
Update an attached git file
- Parameters
- idinteger
The ID of the file.
- git_refstring, optional
A git reference specifying an unambiguous version of the file. Can be a branch name, or the full or shortened SHA of a commit.
- git_branchstring, optional
The git branch that the file is on.
- git_pathstring, optional
The path of the file in the repository.
- git_repo_urlstring, optional
The URL of the git repository.
- git_ref_typestring, optional
Specifies if the file is versioned by branch or tag.
- pull_from_gitboolean, optional
Automatically pull latest commit from git. Only works for scripts.
- Returns
civis.response.Response
- git_refstring
A git reference specifying an unambiguous version of the file. Can be a branch name, tag or the full or shortened SHA of a commit.
- git_branchstring
The git branch that the file is on.
- git_pathstring
The path of the file in the repository.
- git_repodict::
- idinteger
The ID for this git repository.
- repo_urlstring
The URL for this git repository.
created_at : string/time
updated_at : string/time
- git_ref_typestring
Specifies if the file is versioned by branch or tag.
- pull_from_gitboolean
Automatically pull latest commit from git. Only works for scripts and workflows (assuming you have the feature enabled)
- patch_sql_runs(id, run_id, *, error='DEFAULT')¶
Update the given run
- Parameters
- idinteger
ID of the Job
- run_idinteger
ID of the Run
- errorstring, optional
The error message to update
- Returns
- None
Response code 204: success
- post(name, remote_host_id, credential_id, sql, *, params='DEFAULT', arguments='DEFAULT', template_script_id='DEFAULT', notifications='DEFAULT', hidden='DEFAULT')¶
Create a script
- Parameters
- namestring
The name of the script.
- remote_host_idinteger
The database ID.
- credential_idinteger
The credential ID.
- sqlstring
The raw SQL query for the script.
- paramslist, 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.
- labelstring
The label to present to users when asking them for the value.
- descriptionstring
A short sentence or fragment describing this parameter to the end user.
- typestring
The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom
- requiredboolean
Whether this param is required.
- valuestring
The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- defaultstring
If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- allowed_valueslist
The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}
- argumentsdict, optional
Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.
- template_script_idinteger, optional
The ID of the template script, if any. A script cannot both have a template script and be a template for other scripts.
- notificationsdict, optional::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- hiddenboolean, optional
The hidden status of the item.
- Returns
civis.response.Response
- idinteger
The ID for the script.
- namestring
The name of the script.
- typestring
The type of the script (e.g SQL, Container, Python, R, JavaScript)
- created_atstring/time
The time this script was created.
- updated_atstring/time
The time the script was last updated.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- statestring
The status of the script’s last run.
- finished_atstring/time
The time that the script’s last run finished.
- categorystring
The category of the script.
- projectslist::
A list of projects containing the script. - id : integer
The ID for the project.
- namestring
The name of the project.
- parent_idinteger
The ID of the parent job that will trigger this script
- user_contextstring
“runner” or “author”, who to execute the script as when run as a template.
- paramslist::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- labelstring
The label to present to users when asking them for the value.
- descriptionstring
A short sentence or fragment describing this parameter to the end user.
- typestring
The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom
- requiredboolean
Whether this param is required.
- valuestring
The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- defaultstring
If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- allowed_valueslist
The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}
- argumentsdict
Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.
- is_templateboolean
Whether others scripts use this one as a template.
- published_as_template_idinteger
The ID of the template that this script is backing.
- from_template_idinteger
The ID of the template this script uses, if any.
- template_dependents_countinteger
How many other scripts use this one as a template.
- template_script_namestring
The name of the template script.
- linksdict::
- detailsstring
The details link to get more information about the script.
- runsstring
The runs link to get the run information list for this script.
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- notificationsdict::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- running_asdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- next_run_atstring/time
The time of the next scheduled run.
- time_zonestring
The time zone of this script.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- hiddenboolean
The hidden status of the item.
- target_project_idinteger
Target project to which script outputs will be added.
- archivedstring
The archival status of the requested item(s).
- template_script_idinteger
The ID of the template script, if any.
- post_cancel(id)¶
Cancel a run
- Parameters
- idinteger
The ID of the job.
- Returns
civis.response.Response
- idinteger
The ID of the run.
- statestring
The state of the run, one of ‘queued’, ‘running’ or ‘cancelled’.
- is_cancel_requestedboolean
True if run cancel requested, else false.
- post_containers(required_resources, 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_command='DEFAULT', docker_image_tag='DEFAULT', instance_type='DEFAULT', cancel_timeout='DEFAULT', time_zone='DEFAULT', partition_label='DEFAULT', hidden='DEFAULT', target_project_id='DEFAULT', running_as_id='DEFAULT')¶
Create a container
- Parameters
- required_resourcesdict::
- cpuinteger
The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.
- memoryinteger
The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.
- disk_spacenumber/float
The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.
- docker_image_namestring
The name of the docker image to pull from DockerHub.
- namestring, optional
The name of the container.
- parent_idinteger, optional
The ID of the parent job that will trigger this script
- user_contextstring, optional
“runner” or “author”, who to execute the script as when run as a template.
- paramslist, optional::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- labelstring
The label to present to users when asking them for the value.
- descriptionstring
A short sentence or fragment describing this parameter to the end user.
- typestring
The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom
- requiredboolean
Whether this param is required.
- valuestring
The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- defaultstring
If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- allowed_valueslist
The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}
- argumentsdict, optional
Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.
- scheduledict, optional::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- notificationsdict, optional::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- repo_http_uristring, optional
The location of a github repo to clone into the container, e.g. github.com/my-user/my-repo.git.
- repo_refstring, optional
The tag or branch of the github repo to clone into the container.
- remote_host_credential_idinteger, optional
The id of the database credentials to pass into the environment of the container.
- git_credential_idinteger, 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_commandstring, optional
The command to run on the container. Will be run via sh as: [“sh”, “-c”, dockerCommand]. Defaults to the Docker image’s ENTRYPOINT/CMD.
- docker_image_tagstring, optional
The tag of the docker image to pull from DockerHub.
- instance_typestring, optional
The EC2 instance type to deploy to. Only available for jobs running on kubernetes.
- cancel_timeoutinteger, 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_zonestring, optional
The time zone of this script.
- partition_labelstring, optional
The partition label used to run this object. Not generally available. Beware this attribute may be removed in the future.
- hiddenboolean, optional
The hidden status of the item.
- target_project_idinteger, optional
Target project to which script outputs will be added.
- running_as_idinteger, optional
The ID of the runner of this script.
- Returns
civis.response.Response
- idinteger
The ID for the script.
- namestring
The name of the container.
- typestring
The type of the script (e.g Container)
- created_atstring/time
The time this script was created.
- updated_atstring/time
The time the script was last updated.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- statestring
The status of the script’s last run.
- finished_atstring/time
The time that the script’s last run finished.
- categorystring
The category of the script.
- projectslist::
A list of projects containing the script. - id : integer
The ID for the project.
- namestring
The name of the project.
- parent_idinteger
The ID of the parent job that will trigger this script
- user_contextstring
“runner” or “author”, who to execute the script as when run as a template.
- paramslist::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- labelstring
The label to present to users when asking them for the value.
- descriptionstring
A short sentence or fragment describing this parameter to the end user.
- typestring
The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom
- requiredboolean
Whether this param is required.
- valuestring
The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- defaultstring
If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- allowed_valueslist
The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}
- argumentsdict
Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.
- is_templateboolean
Whether others scripts use this one as a template.
- template_dependents_countinteger
How many other scripts use this one as a template.
- published_as_template_idinteger
The ID of the template that this script is backing.
- from_template_idinteger
The ID of the template script.
- template_script_namestring
The name of the template script.
- linksdict::
- detailsstring
The details link to get more information about the script.
- runsstring
The runs link to get the run information list for this script.
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- notificationsdict::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- running_asdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- required_resourcesdict::
- cpuinteger
The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.
- memoryinteger
The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.
- disk_spacenumber/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_uristring
The location of a github repo to clone into the container, e.g. github.com/my-user/my-repo.git.
- repo_refstring
The tag or branch of the github repo to clone into the container.
- remote_host_credential_idinteger
The id of the database credentials to pass into the environment of the container.
- git_credential_idinteger
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_commandstring
The command to run on the container. Will be run via sh as: [“sh”, “-c”, dockerCommand]. Defaults to the Docker image’s ENTRYPOINT/CMD.
- docker_image_namestring
The name of the docker image to pull from DockerHub.
- docker_image_tagstring
The tag of the docker image to pull from DockerHub.
- instance_typestring
The EC2 instance type to deploy to. Only available for jobs running on kubernetes.
- cancel_timeoutinteger
The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- time_zonestring
The time zone of this script.
- partition_labelstring
The partition label used to run this object. Not generally available. Beware this attribute may be removed in the future.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- hiddenboolean
The hidden status of the item.
- archivedstring
The archival status of the requested item(s).
- target_project_idinteger
Target project to which script outputs will be added.
- running_as_idinteger
The ID of the runner of this script.
- post_containers_clone(id, *, clone_schedule='DEFAULT', clone_triggers='DEFAULT', clone_notifications='DEFAULT')¶
Clone this Container Script
- Parameters
- idinteger
The ID for the script.
- clone_scheduleboolean, optional
If true, also copy the schedule to the new script.
- clone_triggersboolean, optional
If true, also copy the triggers to the new script.
- clone_notificationsboolean, optional
If true, also copy the notifications to the new script.
- Returns
civis.response.Response
- idinteger
The ID for the script.
- namestring
The name of the container.
- typestring
The type of the script (e.g Container)
- created_atstring/time
The time this script was created.
- updated_atstring/time
The time the script was last updated.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- statestring
The status of the script’s last run.
- finished_atstring/time
The time that the script’s last run finished.
- categorystring
The category of the script.
- projectslist::
A list of projects containing the script. - id : integer
The ID for the project.
- namestring
The name of the project.
- parent_idinteger
The ID of the parent job that will trigger this script
- user_contextstring
“runner” or “author”, who to execute the script as when run as a template.
- paramslist::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- labelstring
The label to present to users when asking them for the value.
- descriptionstring
A short sentence or fragment describing this parameter to the end user.
- typestring
The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom
- requiredboolean
Whether this param is required.
- valuestring
The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- defaultstring
If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- allowed_valueslist
The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}
- argumentsdict
Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.
- is_templateboolean
Whether others scripts use this one as a template.
- template_dependents_countinteger
How many other scripts use this one as a template.
- published_as_template_idinteger
The ID of the template that this script is backing.
- from_template_idinteger
The ID of the template script.
- template_script_namestring
The name of the template script.
- linksdict::
- detailsstring
The details link to get more information about the script.
- runsstring
The runs link to get the run information list for this script.
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- notificationsdict::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- running_asdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- required_resourcesdict::
- cpuinteger
The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.
- memoryinteger
The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.
- disk_spacenumber/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_uristring
The location of a github repo to clone into the container, e.g. github.com/my-user/my-repo.git.
- repo_refstring
The tag or branch of the github repo to clone into the container.
- remote_host_credential_idinteger
The id of the database credentials to pass into the environment of the container.
- git_credential_idinteger
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_commandstring
The command to run on the container. Will be run via sh as: [“sh”, “-c”, dockerCommand]. Defaults to the Docker image’s ENTRYPOINT/CMD.
- docker_image_namestring
The name of the docker image to pull from DockerHub.
- docker_image_tagstring
The tag of the docker image to pull from DockerHub.
- instance_typestring
The EC2 instance type to deploy to. Only available for jobs running on kubernetes.
- cancel_timeoutinteger
The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- time_zonestring
The time zone of this script.
- partition_labelstring
The partition label used to run this object. Not generally available. Beware this attribute may be removed in the future.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- hiddenboolean
The hidden status of the item.
- archivedstring
The archival status of the requested item(s).
- target_project_idinteger
Target project to which script outputs will be added.
- running_as_idinteger
The ID of the runner of this script.
- post_containers_runs(id)¶
Start a run
- Parameters
- idinteger
The ID of the container.
- Returns
civis.response.Response
- idinteger
The ID of the run.
- container_idinteger
The ID of the container.
- statestring
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- is_cancel_requestedboolean
True if run cancel requested, else false.
- started_atstring/time
The time the last run started at.
- finished_atstring/time
The time the last run completed.
- errorstring
The error, if any, returned by the run.
- max_memory_usagenumber/float
If the run has finished, the maximum amount of memory used during the run, in MB.
- max_cpu_usagenumber/float
If the run has finished, the maximum amount of cpu used during the run, in millicores.
- post_containers_runs_logs(id, run_id, *, message='DEFAULT', level='DEFAULT', messages='DEFAULT', child_job_id='DEFAULT')¶
Add log messages
- Parameters
- idinteger
The ID of the script.
- run_idinteger
The ID of the script run.
- messagestring, optional
The log message to store.
- levelstring, optional
The log level of this message [default: info]
- messageslist, optional::
If specified, a batch of logs to store. If createdAt timestamps for the logs are supplied, the ordering of this list is not preserved, and the timestamps are used to sort the logs.If createdAt timestamps are not supplied, the ordering of this list is preserved and the logs are given the timestamp of when they were received. - message : string
The log message to store.
- levelstring
The log level of this message [default: info]
- created_atstring/date-time
The timestamp of this message in ISO 8601 format. This is what logs are ordered by, so it is recommended to use timestamps with nanosecond precision. If absent, defaults to the time that the log was received by the API.
- child_job_idinteger, optional
The ID of the child job the message came from.
- Returns
- None
Response code 204: success
- post_containers_runs_outputs(id, run_id, object_type, object_id)¶
Add an output for a run
- Parameters
- idinteger
The ID of the container script.
- run_idinteger
The ID of the run.
- object_typestring
The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue
- object_idinteger
The ID of the output.
- Returns
civis.response.Response
- object_typestring
The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue
- object_idinteger
The ID of the output.
- namestring
The name of the output.
- linkstring
The hypermedia link to the output.
value : string
- 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', required_resources='DEFAULT', partition_label='DEFAULT', running_as_id='DEFAULT')¶
Create a Custom Script
- Parameters
- from_template_idinteger
The ID of the template script.
- namestring, optional
The name of the script.
- parent_idinteger, optional
The ID of the parent job that will trigger this script
- argumentsdict, optional
Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.
- remote_host_idinteger, optional
The remote host ID that this script will connect to.
- credential_idinteger, optional
The credential that this script will use.
- scheduledict, optional::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- notificationsdict, optional::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- time_zonestring, optional
The time zone of this script.
- hiddenboolean, optional
The hidden status of the item.
- target_project_idinteger, optional
Target project to which script outputs will be added.
- required_resourcesdict, optional::
- cpuinteger
The number of CPU shares to allocate for the container. Each core has 1000 shares.
- memoryinteger
The amount of RAM to allocate for the container (in MB).
- disk_spacenumber/float
The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.
- partition_labelstring, optional
The partition label used to run this object. Only applicable for jobs using Docker.Not generally available. Beware this attribute may be removed in the future.
- running_as_idinteger, optional
The ID of the runner of this script.
- Returns
civis.response.Response
- idinteger
The ID for the script.
- namestring
The name of the script.
- typestring
The type of the script (e.g Custom)
- created_atstring/time
The time this script was created.
- updated_atstring/time
The time the script was last updated.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- statestring
The status of the script’s last run.
- finished_atstring/time
The time that the script’s last run finished.
category : string
- projectslist::
A list of projects containing the script. - id : integer
The ID for the project.
- namestring
The name of the project.
- parent_idinteger
The ID of the parent job that will trigger this script
- paramslist::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- labelstring
The label to present to users when asking them for the value.
- descriptionstring
A short sentence or fragment describing this parameter to the end user.
- typestring
The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom
- requiredboolean
Whether this param is required.
- valuestring
The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- defaultstring
If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- allowed_valueslist
The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}
- argumentsdict
Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.
- is_templateboolean
Whether others scripts use this one as a template.
- published_as_template_idinteger
The ID of the template that this script is backing.
- from_template_idinteger
The ID of the template script.
- ui_report_urlinteger
The url of the custom HTML.
- ui_report_idinteger
The id of the report with the custom HTML.
- ui_report_provide_api_keyboolean
Whether the ui report requests an API Key from the report viewer.
- template_script_namestring
The name of the template script.
- template_notestring
The template’s note.
- remote_host_idinteger
The remote host ID that this script will connect to.
- credential_idinteger
The credential that this script will use.
- code_previewstring
The code that this script will run with arguments inserted.
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- notificationsdict::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- running_asdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- time_zonestring
The time zone of this script.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- hiddenboolean
The hidden status of the item.
- archivedstring
The archival status of the requested item(s).
- target_project_idinteger
Target project to which script outputs will be added.
- last_successful_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- required_resourcesdict::
- cpuinteger
The number of CPU shares to allocate for the container. Each core has 1000 shares.
- memoryinteger
The amount of RAM to allocate for the container (in MB).
- disk_spacenumber/float
The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.
- partition_labelstring
The partition label used to run this object. Only applicable for jobs using Docker.Not generally available. Beware this attribute may be removed in the future.
- running_as_idinteger
The ID of the runner of this script.
- post_custom_clone(id, *, clone_schedule='DEFAULT', clone_triggers='DEFAULT', clone_notifications='DEFAULT')¶
Clone this Custom Script
- Parameters
- idinteger
The ID for the script.
- clone_scheduleboolean, optional
If true, also copy the schedule to the new script.
- clone_triggersboolean, optional
If true, also copy the triggers to the new script.
- clone_notificationsboolean, optional
If true, also copy the notifications to the new script.
- Returns
civis.response.Response
- idinteger
The ID for the script.
- namestring
The name of the script.
- typestring
The type of the script (e.g Custom)
- created_atstring/time
The time this script was created.
- updated_atstring/time
The time the script was last updated.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- statestring
The status of the script’s last run.
- finished_atstring/time
The time that the script’s last run finished.
category : string
- projectslist::
A list of projects containing the script. - id : integer
The ID for the project.
- namestring
The name of the project.
- parent_idinteger
The ID of the parent job that will trigger this script
- paramslist::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- labelstring
The label to present to users when asking them for the value.
- descriptionstring
A short sentence or fragment describing this parameter to the end user.
- typestring
The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom
- requiredboolean
Whether this param is required.
- valuestring
The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- defaultstring
If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- allowed_valueslist
The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}
- argumentsdict
Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.
- is_templateboolean
Whether others scripts use this one as a template.
- published_as_template_idinteger
The ID of the template that this script is backing.
- from_template_idinteger
The ID of the template script.
- ui_report_urlinteger
The url of the custom HTML.
- ui_report_idinteger
The id of the report with the custom HTML.
- ui_report_provide_api_keyboolean
Whether the ui report requests an API Key from the report viewer.
- template_script_namestring
The name of the template script.
- template_notestring
The template’s note.
- remote_host_idinteger
The remote host ID that this script will connect to.
- credential_idinteger
The credential that this script will use.
- code_previewstring
The code that this script will run with arguments inserted.
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- notificationsdict::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- running_asdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- time_zonestring
The time zone of this script.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- hiddenboolean
The hidden status of the item.
- archivedstring
The archival status of the requested item(s).
- target_project_idinteger
Target project to which script outputs will be added.
- last_successful_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- required_resourcesdict::
- cpuinteger
The number of CPU shares to allocate for the container. Each core has 1000 shares.
- memoryinteger
The amount of RAM to allocate for the container (in MB).
- disk_spacenumber/float
The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.
- partition_labelstring
The partition label used to run this object. Only applicable for jobs using Docker.Not generally available. Beware this attribute may be removed in the future.
- running_as_idinteger
The ID of the runner of this script.
- post_custom_runs(id)¶
Start a run
- Parameters
- idinteger
The ID of the custom.
- Returns
civis.response.Response
- idinteger
The ID of the run.
- custom_idinteger
The ID of the custom.
- statestring
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- is_cancel_requestedboolean
True if run cancel requested, else false.
- started_atstring/time
The time the last run started at.
- finished_atstring/time
The time the last run completed.
- errorstring
The error, if any, returned by the run.
- max_memory_usagenumber/float
If the run has finished, the maximum amount of memory used during the run, in MB. Only available if the backing script is a Python, R, or container script.
- max_cpu_usagenumber/float
If the run has finished, the maximum amount of cpu used during the run, in millicores. Only available if the backing script is a Python, R, or container script.
- post_custom_runs_outputs(id, run_id, object_type, object_id)¶
Add an output for a run
- Parameters
- idinteger
The ID of the custom script.
- run_idinteger
The ID of the run.
- object_typestring
The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue
- object_idinteger
The ID of the output.
- Returns
civis.response.Response
- object_typestring
The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue
- object_idinteger
The ID of the output.
- namestring
The name of the output.
- linkstring
The hypermedia link to the output.
value : string
- 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', running_as_id='DEFAULT')¶
Create a JavaScript Script
- Parameters
- namestring
The name of the script.
- sourcestring
The body/text of the script.
- remote_host_idinteger
The remote host ID that this script will connect to.
- credential_idinteger
The credential that this script will use.
- parent_idinteger, optional
The ID of the parent job that will trigger this script
- user_contextstring, optional
“runner” or “author”, who to execute the script as when run as a template.
- paramslist, optional::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- labelstring
The label to present to users when asking them for the value.
- descriptionstring
A short sentence or fragment describing this parameter to the end user.
- typestring
The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom
- requiredboolean
Whether this param is required.
- valuestring
The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- defaultstring
If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- allowed_valueslist
The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}
- argumentsdict, optional
Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.
- scheduledict, optional::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- notificationsdict, optional::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- next_run_atstring/time, optional
The time of the next scheduled run.
- time_zonestring, optional
The time zone of this script.
- hiddenboolean, optional
The hidden status of the item.
- target_project_idinteger, optional
Target project to which script outputs will be added.
- running_as_idinteger, optional
The ID of the runner of this script.
- Returns
civis.response.Response
- idinteger
The ID for the script.
- namestring
The name of the script.
- typestring
The type of the script (e.g SQL, Container, Python, R, JavaScript)
- created_atstring/time
The time this script was created.
- updated_atstring/time
The time the script was last updated.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- statestring
The status of the script’s last run.
- finished_atstring/time
The time that the script’s last run finished.
- categorystring
The category of the script.
- projectslist::
A list of projects containing the script. - id : integer
The ID for the project.
- namestring
The name of the project.
- parent_idinteger
The ID of the parent job that will trigger this script
- user_contextstring
“runner” or “author”, who to execute the script as when run as a template.
- paramslist::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- labelstring
The label to present to users when asking them for the value.
- descriptionstring
A short sentence or fragment describing this parameter to the end user.
- typestring
The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom
- requiredboolean
Whether this param is required.
- valuestring
The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- defaultstring
If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- allowed_valueslist
The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}
- argumentsdict
Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.
- is_templateboolean
Whether others scripts use this one as a template.
- published_as_template_idinteger
The ID of the template that this script is backing.
- from_template_idinteger
The ID of the template this script uses, if any.
- template_dependents_countinteger
How many other scripts use this one as a template.
- template_script_namestring
The name of the template script.
- linksdict::
- detailsstring
The details link to get more information about the script.
- runsstring
The runs link to get the run information list for this script.
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- notificationsdict::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- running_asdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- next_run_atstring/time
The time of the next scheduled run.
- time_zonestring
The time zone of this script.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- hiddenboolean
The hidden status of the item.
- target_project_idinteger
Target project to which script outputs will be added.
- archivedstring
The archival status of the requested item(s).
- sourcestring
The body/text of the script.
- remote_host_idinteger
The remote host ID that this script will connect to.
- credential_idinteger
The credential that this script will use.
- running_as_idinteger
The ID of the runner of this script.
- post_javascript_clone(id, *, clone_schedule='DEFAULT', clone_triggers='DEFAULT', clone_notifications='DEFAULT')¶
Clone this JavaScript Script
- Parameters
- idinteger
The ID for the script.
- clone_scheduleboolean, optional
If true, also copy the schedule to the new script.
- clone_triggersboolean, optional
If true, also copy the triggers to the new script.
- clone_notificationsboolean, optional
If true, also copy the notifications to the new script.
- Returns
civis.response.Response
- idinteger
The ID for the script.
- namestring
The name of the script.
- typestring
The type of the script (e.g SQL, Container, Python, R, JavaScript)
- created_atstring/time
The time this script was created.
- updated_atstring/time
The time the script was last updated.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- statestring
The status of the script’s last run.
- finished_atstring/time
The time that the script’s last run finished.
- categorystring
The category of the script.
- projectslist::
A list of projects containing the script. - id : integer
The ID for the project.
- namestring
The name of the project.
- parent_idinteger
The ID of the parent job that will trigger this script
- user_contextstring
“runner” or “author”, who to execute the script as when run as a template.
- paramslist::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- labelstring
The label to present to users when asking them for the value.
- descriptionstring
A short sentence or fragment describing this parameter to the end user.
- typestring
The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom
- requiredboolean
Whether this param is required.
- valuestring
The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- defaultstring
If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- allowed_valueslist
The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}
- argumentsdict
Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.
- is_templateboolean
Whether others scripts use this one as a template.
- published_as_template_idinteger
The ID of the template that this script is backing.
- from_template_idinteger
The ID of the template this script uses, if any.
- template_dependents_countinteger
How many other scripts use this one as a template.
- template_script_namestring
The name of the template script.
- linksdict::
- detailsstring
The details link to get more information about the script.
- runsstring
The runs link to get the run information list for this script.
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- notificationsdict::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- running_asdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- next_run_atstring/time
The time of the next scheduled run.
- time_zonestring
The time zone of this script.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- hiddenboolean
The hidden status of the item.
- target_project_idinteger
Target project to which script outputs will be added.
- archivedstring
The archival status of the requested item(s).
- sourcestring
The body/text of the script.
- remote_host_idinteger
The remote host ID that this script will connect to.
- credential_idinteger
The credential that this script will use.
- running_as_idinteger
The ID of the runner of this script.
- post_javascript_git_checkout(id)¶
Checkout content that the existing git_ref points to and save to the object
- Parameters
- idinteger
The ID of the file.
- Returns
civis.response.Response
- contentstring
The file’s contents.
- typestring
The file’s type.
- sizeinteger
The file’s size.
- file_hashstring
The SHA of the file.
- post_javascript_git_checkout_latest(id)¶
Checkout latest commit on the current branch of a script or workflow
- Parameters
- idinteger
The ID of the file.
- Returns
civis.response.Response
- contentstring
The file’s contents.
- typestring
The file’s type.
- sizeinteger
The file’s size.
- file_hashstring
The SHA of the file.
- post_javascript_git_commits(id, content, message, file_hash)¶
Commit and push a new version of the file
- Parameters
- idinteger
The ID of the file.
- contentstring
The contents to commit to the file.
- messagestring
A commit message describing the changes being made.
- file_hashstring
The full SHA of the file being replaced.
- Returns
civis.response.Response
- contentstring
The file’s contents.
- typestring
The file’s type.
- sizeinteger
The file’s size.
- file_hashstring
The SHA of the file.
- post_javascript_runs(id)¶
Start a run
- Parameters
- idinteger
The ID of the javascript.
- Returns
civis.response.Response
- idinteger
The ID of the run.
- javascript_idinteger
The ID of the javascript.
- statestring
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- is_cancel_requestedboolean
True if run cancel requested, else false.
- started_atstring/time
The time the last run started at.
- finished_atstring/time
The time the last run completed.
- errorstring
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
- idinteger
The ID of the javascript script.
- run_idinteger
The ID of the run.
- object_typestring
The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue
- object_idinteger
The ID of the output.
- Returns
civis.response.Response
- object_typestring
The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue
- object_idinteger
The ID of the output.
- namestring
The name of the output.
- linkstring
The hypermedia link to the output.
value : string
- 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', instance_type='DEFAULT', cancel_timeout='DEFAULT', docker_image_tag='DEFAULT', partition_label='DEFAULT', running_as_id='DEFAULT')¶
Create a Python Script
- Parameters
- namestring
The name of the script.
- sourcestring
The body/text of the script.
- parent_idinteger, optional
The ID of the parent job that will trigger this script
- user_contextstring, optional
“runner” or “author”, who to execute the script as when run as a template.
- paramslist, optional::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- labelstring
The label to present to users when asking them for the value.
- descriptionstring
A short sentence or fragment describing this parameter to the end user.
- typestring
The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom
- requiredboolean
Whether this param is required.
- valuestring
The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- defaultstring
If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- allowed_valueslist
The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}
- argumentsdict, optional
Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.
- scheduledict, optional::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- notificationsdict, optional::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- next_run_atstring/time, optional
The time of the next scheduled run.
- time_zonestring, optional
The time zone of this script.
- hiddenboolean, optional
The hidden status of the item.
- target_project_idinteger, optional
Target project to which script outputs will be added.
- required_resourcesdict, optional::
- cpuinteger
The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.
- memoryinteger
The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.
- disk_spacenumber/float
The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.
- instance_typestring, optional
The EC2 instance type to deploy to. Only available for jobs running on kubernetes.
- cancel_timeoutinteger, optional
The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.
- docker_image_tagstring, optional
The tag of the docker image to pull from DockerHub.
- partition_labelstring, optional
The partition label used to run this object. Not generally available. Beware this attribute may be removed in the future.
- running_as_idinteger, optional
The ID of the runner of this script.
- Returns
civis.response.Response
- idinteger
The ID for the script.
- namestring
The name of the script.
- typestring
The type of the script (e.g SQL, Container, Python, R, JavaScript)
- created_atstring/time
The time this script was created.
- updated_atstring/time
The time the script was last updated.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- statestring
The status of the script’s last run.
- finished_atstring/time
The time that the script’s last run finished.
- categorystring
The category of the script.
- projectslist::
A list of projects containing the script. - id : integer
The ID for the project.
- namestring
The name of the project.
- parent_idinteger
The ID of the parent job that will trigger this script
- user_contextstring
“runner” or “author”, who to execute the script as when run as a template.
- paramslist::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- labelstring
The label to present to users when asking them for the value.
- descriptionstring
A short sentence or fragment describing this parameter to the end user.
- typestring
The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom
- requiredboolean
Whether this param is required.
- valuestring
The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- defaultstring
If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- allowed_valueslist
The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}
- argumentsdict
Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.
- is_templateboolean
Whether others scripts use this one as a template.
- published_as_template_idinteger
The ID of the template that this script is backing.
- from_template_idinteger
The ID of the template this script uses, if any.
- template_dependents_countinteger
How many other scripts use this one as a template.
- template_script_namestring
The name of the template script.
- linksdict::
- detailsstring
The details link to get more information about the script.
- runsstring
The runs link to get the run information list for this script.
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- notificationsdict::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- running_asdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- next_run_atstring/time
The time of the next scheduled run.
- time_zonestring
The time zone of this script.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- hiddenboolean
The hidden status of the item.
- target_project_idinteger
Target project to which script outputs will be added.
- archivedstring
The archival status of the requested item(s).
- required_resourcesdict::
- cpuinteger
The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.
- memoryinteger
The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.
- disk_spacenumber/float
The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.
- instance_typestring
The EC2 instance type to deploy to. Only available for jobs running on kubernetes.
- sourcestring
The body/text of the script.
- cancel_timeoutinteger
The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.
- docker_image_tagstring
The tag of the docker image to pull from DockerHub.
- partition_labelstring
The partition label used to run this object. Not generally available. Beware this attribute may be removed in the future.
- running_as_idinteger
The ID of the runner of this script.
- post_python3_clone(id, *, clone_schedule='DEFAULT', clone_triggers='DEFAULT', clone_notifications='DEFAULT')¶
Clone this Python Script
- Parameters
- idinteger
The ID for the script.
- clone_scheduleboolean, optional
If true, also copy the schedule to the new script.
- clone_triggersboolean, optional
If true, also copy the triggers to the new script.
- clone_notificationsboolean, optional
If true, also copy the notifications to the new script.
- Returns
civis.response.Response
- idinteger
The ID for the script.
- namestring
The name of the script.
- typestring
The type of the script (e.g SQL, Container, Python, R, JavaScript)
- created_atstring/time
The time this script was created.
- updated_atstring/time
The time the script was last updated.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- statestring
The status of the script’s last run.
- finished_atstring/time
The time that the script’s last run finished.
- categorystring
The category of the script.
- projectslist::
A list of projects containing the script. - id : integer
The ID for the project.
- namestring
The name of the project.
- parent_idinteger
The ID of the parent job that will trigger this script
- user_contextstring
“runner” or “author”, who to execute the script as when run as a template.
- paramslist::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- labelstring
The label to present to users when asking them for the value.
- descriptionstring
A short sentence or fragment describing this parameter to the end user.
- typestring
The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom
- requiredboolean
Whether this param is required.
- valuestring
The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- defaultstring
If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- allowed_valueslist
The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}
- argumentsdict
Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.
- is_templateboolean
Whether others scripts use this one as a template.
- published_as_template_idinteger
The ID of the template that this script is backing.
- from_template_idinteger
The ID of the template this script uses, if any.
- template_dependents_countinteger
How many other scripts use this one as a template.
- template_script_namestring
The name of the template script.
- linksdict::
- detailsstring
The details link to get more information about the script.
- runsstring
The runs link to get the run information list for this script.
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- notificationsdict::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- running_asdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- next_run_atstring/time
The time of the next scheduled run.
- time_zonestring
The time zone of this script.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- hiddenboolean
The hidden status of the item.
- target_project_idinteger
Target project to which script outputs will be added.
- archivedstring
The archival status of the requested item(s).
- required_resourcesdict::
- cpuinteger
The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.
- memoryinteger
The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.
- disk_spacenumber/float
The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.
- instance_typestring
The EC2 instance type to deploy to. Only available for jobs running on kubernetes.
- sourcestring
The body/text of the script.
- cancel_timeoutinteger
The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.
- docker_image_tagstring
The tag of the docker image to pull from DockerHub.
- partition_labelstring
The partition label used to run this object. Not generally available. Beware this attribute may be removed in the future.
- running_as_idinteger
The ID of the runner of this script.
- post_python3_git_checkout(id)¶
Checkout content that the existing git_ref points to and save to the object
- Parameters
- idinteger
The ID of the file.
- Returns
civis.response.Response
- contentstring
The file’s contents.
- typestring
The file’s type.
- sizeinteger
The file’s size.
- file_hashstring
The SHA of the file.
- post_python3_git_checkout_latest(id)¶
Checkout latest commit on the current branch of a script or workflow
- Parameters
- idinteger
The ID of the file.
- Returns
civis.response.Response
- contentstring
The file’s contents.
- typestring
The file’s type.
- sizeinteger
The file’s size.
- file_hashstring
The SHA of the file.
- post_python3_git_commits(id, content, message, file_hash)¶
Commit and push a new version of the file
- Parameters
- idinteger
The ID of the file.
- contentstring
The contents to commit to the file.
- messagestring
A commit message describing the changes being made.
- file_hashstring
The full SHA of the file being replaced.
- Returns
civis.response.Response
- contentstring
The file’s contents.
- typestring
The file’s type.
- sizeinteger
The file’s size.
- file_hashstring
The SHA of the file.
- post_python3_runs(id)¶
Start a run
- Parameters
- idinteger
The ID of the python.
- Returns
civis.response.Response
- idinteger
The ID of the run.
- python_idinteger
The ID of the python.
- statestring
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- is_cancel_requestedboolean
True if run cancel requested, else false.
- started_atstring/time
The time the last run started at.
- finished_atstring/time
The time the last run completed.
- errorstring
The error, if any, returned by the run.
- max_memory_usagenumber/float
If the run has finished, the maximum amount of memory used during the run, in MB.
- max_cpu_usagenumber/float
If the run has finished, the maximum amount of cpu used during the run, in millicores.
- post_python3_runs_outputs(id, run_id, object_type, object_id)¶
Add an output for a run
- Parameters
- idinteger
The ID of the python script.
- run_idinteger
The ID of the run.
- object_typestring
The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue
- object_idinteger
The ID of the output.
- Returns
civis.response.Response
- object_typestring
The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue
- object_idinteger
The ID of the output.
- namestring
The name of the output.
- linkstring
The hypermedia link to the output.
value : string
- 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', instance_type='DEFAULT', cancel_timeout='DEFAULT', docker_image_tag='DEFAULT', partition_label='DEFAULT', running_as_id='DEFAULT')¶
Create an R Script
- Parameters
- namestring
The name of the script.
- sourcestring
The body/text of the script.
- parent_idinteger, optional
The ID of the parent job that will trigger this script
- user_contextstring, optional
“runner” or “author”, who to execute the script as when run as a template.
- paramslist, optional::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- labelstring
The label to present to users when asking them for the value.
- descriptionstring
A short sentence or fragment describing this parameter to the end user.
- typestring
The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom
- requiredboolean
Whether this param is required.
- valuestring
The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- defaultstring
If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- allowed_valueslist
The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}
- argumentsdict, optional
Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.
- scheduledict, optional::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- notificationsdict, optional::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- next_run_atstring/time, optional
The time of the next scheduled run.
- time_zonestring, optional
The time zone of this script.
- hiddenboolean, optional
The hidden status of the item.
- target_project_idinteger, optional
Target project to which script outputs will be added.
- required_resourcesdict, optional::
- cpuinteger
The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.
- memoryinteger
The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.
- disk_spacenumber/float
The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.
- instance_typestring, optional
The EC2 instance type to deploy to. Only available for jobs running on kubernetes.
- cancel_timeoutinteger, optional
The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.
- docker_image_tagstring, optional
The tag of the docker image to pull from DockerHub.
- partition_labelstring, optional
The partition label used to run this object. Not generally available. Beware this attribute may be removed in the future.
- running_as_idinteger, optional
The ID of the runner of this script.
- Returns
civis.response.Response
- idinteger
The ID for the script.
- namestring
The name of the script.
- typestring
The type of the script (e.g SQL, Container, Python, R, JavaScript)
- created_atstring/time
The time this script was created.
- updated_atstring/time
The time the script was last updated.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- statestring
The status of the script’s last run.
- finished_atstring/time
The time that the script’s last run finished.
- categorystring
The category of the script.
- projectslist::
A list of projects containing the script. - id : integer
The ID for the project.
- namestring
The name of the project.
- parent_idinteger
The ID of the parent job that will trigger this script
- user_contextstring
“runner” or “author”, who to execute the script as when run as a template.
- paramslist::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- labelstring
The label to present to users when asking them for the value.
- descriptionstring
A short sentence or fragment describing this parameter to the end user.
- typestring
The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom
- requiredboolean
Whether this param is required.
- valuestring
The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- defaultstring
If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- allowed_valueslist
The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}
- argumentsdict
Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.
- is_templateboolean
Whether others scripts use this one as a template.
- published_as_template_idinteger
The ID of the template that this script is backing.
- from_template_idinteger
The ID of the template this script uses, if any.
- template_dependents_countinteger
How many other scripts use this one as a template.
- template_script_namestring
The name of the template script.
- linksdict::
- detailsstring
The details link to get more information about the script.
- runsstring
The runs link to get the run information list for this script.
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- notificationsdict::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- running_asdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- next_run_atstring/time
The time of the next scheduled run.
- time_zonestring
The time zone of this script.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- hiddenboolean
The hidden status of the item.
- target_project_idinteger
Target project to which script outputs will be added.
- archivedstring
The archival status of the requested item(s).
- required_resourcesdict::
- cpuinteger
The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.
- memoryinteger
The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.
- disk_spacenumber/float
The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.
- instance_typestring
The EC2 instance type to deploy to. Only available for jobs running on kubernetes.
- sourcestring
The body/text of the script.
- cancel_timeoutinteger
The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.
- docker_image_tagstring
The tag of the docker image to pull from DockerHub.
- partition_labelstring
The partition label used to run this object. Not generally available. Beware this attribute may be removed in the future.
- running_as_idinteger
The ID of the runner of this script.
- post_r_clone(id, *, clone_schedule='DEFAULT', clone_triggers='DEFAULT', clone_notifications='DEFAULT')¶
Clone this R Script
- Parameters
- idinteger
The ID for the script.
- clone_scheduleboolean, optional
If true, also copy the schedule to the new script.
- clone_triggersboolean, optional
If true, also copy the triggers to the new script.
- clone_notificationsboolean, optional
If true, also copy the notifications to the new script.
- Returns
civis.response.Response
- idinteger
The ID for the script.
- namestring
The name of the script.
- typestring
The type of the script (e.g SQL, Container, Python, R, JavaScript)
- created_atstring/time
The time this script was created.
- updated_atstring/time
The time the script was last updated.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- statestring
The status of the script’s last run.
- finished_atstring/time
The time that the script’s last run finished.
- categorystring
The category of the script.
- projectslist::
A list of projects containing the script. - id : integer
The ID for the project.
- namestring
The name of the project.
- parent_idinteger
The ID of the parent job that will trigger this script
- user_contextstring
“runner” or “author”, who to execute the script as when run as a template.
- paramslist::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- labelstring
The label to present to users when asking them for the value.
- descriptionstring
A short sentence or fragment describing this parameter to the end user.
- typestring
The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom
- requiredboolean
Whether this param is required.
- valuestring
The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- defaultstring
If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- allowed_valueslist
The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}
- argumentsdict
Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.
- is_templateboolean
Whether others scripts use this one as a template.
- published_as_template_idinteger
The ID of the template that this script is backing.
- from_template_idinteger
The ID of the template this script uses, if any.
- template_dependents_countinteger
How many other scripts use this one as a template.
- template_script_namestring
The name of the template script.
- linksdict::
- detailsstring
The details link to get more information about the script.
- runsstring
The runs link to get the run information list for this script.
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- notificationsdict::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- running_asdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- next_run_atstring/time
The time of the next scheduled run.
- time_zonestring
The time zone of this script.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- hiddenboolean
The hidden status of the item.
- target_project_idinteger
Target project to which script outputs will be added.
- archivedstring
The archival status of the requested item(s).
- required_resourcesdict::
- cpuinteger
The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.
- memoryinteger
The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.
- disk_spacenumber/float
The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.
- instance_typestring
The EC2 instance type to deploy to. Only available for jobs running on kubernetes.
- sourcestring
The body/text of the script.
- cancel_timeoutinteger
The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.
- docker_image_tagstring
The tag of the docker image to pull from DockerHub.
- partition_labelstring
The partition label used to run this object. Not generally available. Beware this attribute may be removed in the future.
- running_as_idinteger
The ID of the runner of this script.
- post_r_git_checkout(id)¶
Checkout content that the existing git_ref points to and save to the object
- Parameters
- idinteger
The ID of the file.
- Returns
civis.response.Response
- contentstring
The file’s contents.
- typestring
The file’s type.
- sizeinteger
The file’s size.
- file_hashstring
The SHA of the file.
- post_r_git_checkout_latest(id)¶
Checkout latest commit on the current branch of a script or workflow
- Parameters
- idinteger
The ID of the file.
- Returns
civis.response.Response
- contentstring
The file’s contents.
- typestring
The file’s type.
- sizeinteger
The file’s size.
- file_hashstring
The SHA of the file.
- post_r_git_commits(id, content, message, file_hash)¶
Commit and push a new version of the file
- Parameters
- idinteger
The ID of the file.
- contentstring
The contents to commit to the file.
- messagestring
A commit message describing the changes being made.
- file_hashstring
The full SHA of the file being replaced.
- Returns
civis.response.Response
- contentstring
The file’s contents.
- typestring
The file’s type.
- sizeinteger
The file’s size.
- file_hashstring
The SHA of the file.
- post_r_runs(id)¶
Start a run
- Parameters
- idinteger
The ID of the r.
- Returns
civis.response.Response
- idinteger
The ID of the run.
- r_idinteger
The ID of the r.
- statestring
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- is_cancel_requestedboolean
True if run cancel requested, else false.
- started_atstring/time
The time the last run started at.
- finished_atstring/time
The time the last run completed.
- errorstring
The error, if any, returned by the run.
- max_memory_usagenumber/float
If the run has finished, the maximum amount of memory used during the run, in MB.
- max_cpu_usagenumber/float
If the run has finished, the maximum amount of cpu used during the run, in millicores.
- post_r_runs_outputs(id, run_id, object_type, object_id)¶
Add an output for a run
- Parameters
- idinteger
The ID of the r script.
- run_idinteger
The ID of the run.
- object_typestring
The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue
- object_idinteger
The ID of the output.
- Returns
civis.response.Response
- object_typestring
The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue
- object_idinteger
The ID of the output.
- namestring
The name of the output.
- linkstring
The hypermedia link to the output.
value : string
- post_run(id)¶
Run a script
- Parameters
- idinteger
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', running_as_id='DEFAULT')¶
Create a SQL script
- Parameters
- namestring
The name of the script.
- sqlstring
The raw SQL query for the script.
- remote_host_idinteger
The remote host ID that this script will connect to.
- credential_idinteger
The credential that this script will use.
- parent_idinteger, optional
The ID of the parent job that will trigger this script
- user_contextstring, optional
“runner” or “author”, who to execute the script as when run as a template.
- paramslist, optional::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- labelstring
The label to present to users when asking them for the value.
- descriptionstring
A short sentence or fragment describing this parameter to the end user.
- typestring
The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom
- requiredboolean
Whether this param is required.
- valuestring
The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- defaultstring
If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- allowed_valueslist
The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}
- argumentsdict, optional
Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.
- scheduledict, optional::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- notificationsdict, optional::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- next_run_atstring/time, optional
The time of the next scheduled run.
- time_zonestring, optional
The time zone of this script.
- hiddenboolean, optional
The hidden status of the item.
- target_project_idinteger, optional
Target project to which script outputs will be added.
- csv_settingsdict, optional::
- include_headerboolean
Whether or not to include headers in the output data. Default: true
- compressionstring
The type of compression to use, if any, one of “none”, “zip”, or “gzip”. Default: gzip
- column_delimiterstring
Which delimiter to use, one of “comma”, “tab”, or “pipe”. Default: comma
- unquotedboolean
Whether or not to quote fields. Default: false
- force_multifileboolean
Whether or not the csv should be split into multiple files. Default: false
- filename_prefixstring
A user specified filename prefix for the output file to have. Default: null
- max_file_sizeinteger
The max file size, in MB, created files will be. Only available when force_multifile is true.
- running_as_idinteger, optional
The ID of the runner of this script.
- Returns
civis.response.Response
- idinteger
The ID for the script.
- namestring
The name of the script.
- typestring
The type of the script (e.g SQL, Container, Python, R, JavaScript)
- created_atstring/time
The time this script was created.
- updated_atstring/time
The time the script was last updated.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- statestring
The status of the script’s last run.
- finished_atstring/time
The time that the script’s last run finished.
- categorystring
The category of the script.
- projectslist::
A list of projects containing the script. - id : integer
The ID for the project.
- namestring
The name of the project.
- parent_idinteger
The ID of the parent job that will trigger this script
- user_contextstring
“runner” or “author”, who to execute the script as when run as a template.
- paramslist::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- labelstring
The label to present to users when asking them for the value.
- descriptionstring
A short sentence or fragment describing this parameter to the end user.
- typestring
The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom
- requiredboolean
Whether this param is required.
- valuestring
The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- defaultstring
If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- allowed_valueslist
The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}
- argumentsdict
Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.
- is_templateboolean
Whether others scripts use this one as a template.
- published_as_template_idinteger
The ID of the template that this script is backing.
- from_template_idinteger
The ID of the template this script uses, if any.
- template_dependents_countinteger
How many other scripts use this one as a template.
- template_script_namestring
The name of the template script.
- linksdict::
- detailsstring
The details link to get more information about the script.
- runsstring
The runs link to get the run information list for this script.
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- notificationsdict::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- running_asdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- next_run_atstring/time
The time of the next scheduled run.
- time_zonestring
The time zone of this script.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- hiddenboolean
The hidden status of the item.
- target_project_idinteger
Target project to which script outputs will be added.
- archivedstring
The archival status of the requested item(s).
- sqlstring
The raw SQL query for the script.
- expanded_argumentsdict
Expanded arguments for use in injecting into different environments.
- remote_host_idinteger
The remote host ID that this script will connect to.
- credential_idinteger
The credential that this script will use.
- code_previewstring
The code that this script will run with arguments inserted.
- csv_settingsdict::
- include_headerboolean
Whether or not to include headers in the output data. Default: true
- compressionstring
The type of compression to use, if any, one of “none”, “zip”, or “gzip”. Default: gzip
- column_delimiterstring
Which delimiter to use, one of “comma”, “tab”, or “pipe”. Default: comma
- unquotedboolean
Whether or not to quote fields. Default: false
- force_multifileboolean
Whether or not the csv should be split into multiple files. Default: false
- filename_prefixstring
A user specified filename prefix for the output file to have. Default: null
- max_file_sizeinteger
The max file size, in MB, created files will be. Only available when force_multifile is true.
- running_as_idinteger
The ID of the runner of this script.
- post_sql_clone(id, *, clone_schedule='DEFAULT', clone_triggers='DEFAULT', clone_notifications='DEFAULT')¶
Clone this SQL script
- Parameters
- idinteger
The ID for the script.
- clone_scheduleboolean, optional
If true, also copy the schedule to the new script.
- clone_triggersboolean, optional
If true, also copy the triggers to the new script.
- clone_notificationsboolean, optional
If true, also copy the notifications to the new script.
- Returns
civis.response.Response
- idinteger
The ID for the script.
- namestring
The name of the script.
- typestring
The type of the script (e.g SQL, Container, Python, R, JavaScript)
- created_atstring/time
The time this script was created.
- updated_atstring/time
The time the script was last updated.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- statestring
The status of the script’s last run.
- finished_atstring/time
The time that the script’s last run finished.
- categorystring
The category of the script.
- projectslist::
A list of projects containing the script. - id : integer
The ID for the project.
- namestring
The name of the project.
- parent_idinteger
The ID of the parent job that will trigger this script
- user_contextstring
“runner” or “author”, who to execute the script as when run as a template.
- paramslist::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- labelstring
The label to present to users when asking them for the value.
- descriptionstring
A short sentence or fragment describing this parameter to the end user.
- typestring
The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom
- requiredboolean
Whether this param is required.
- valuestring
The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- defaultstring
If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- allowed_valueslist
The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}
- argumentsdict
Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.
- is_templateboolean
Whether others scripts use this one as a template.
- published_as_template_idinteger
The ID of the template that this script is backing.
- from_template_idinteger
The ID of the template this script uses, if any.
- template_dependents_countinteger
How many other scripts use this one as a template.
- template_script_namestring
The name of the template script.
- linksdict::
- detailsstring
The details link to get more information about the script.
- runsstring
The runs link to get the run information list for this script.
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- notificationsdict::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- running_asdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- next_run_atstring/time
The time of the next scheduled run.
- time_zonestring
The time zone of this script.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- hiddenboolean
The hidden status of the item.
- target_project_idinteger
Target project to which script outputs will be added.
- archivedstring
The archival status of the requested item(s).
- sqlstring
The raw SQL query for the script.
- expanded_argumentsdict
Expanded arguments for use in injecting into different environments.
- remote_host_idinteger
The remote host ID that this script will connect to.
- credential_idinteger
The credential that this script will use.
- code_previewstring
The code that this script will run with arguments inserted.
- csv_settingsdict::
- include_headerboolean
Whether or not to include headers in the output data. Default: true
- compressionstring
The type of compression to use, if any, one of “none”, “zip”, or “gzip”. Default: gzip
- column_delimiterstring
Which delimiter to use, one of “comma”, “tab”, or “pipe”. Default: comma
- unquotedboolean
Whether or not to quote fields. Default: false
- force_multifileboolean
Whether or not the csv should be split into multiple files. Default: false
- filename_prefixstring
A user specified filename prefix for the output file to have. Default: null
- max_file_sizeinteger
The max file size, in MB, created files will be. Only available when force_multifile is true.
- running_as_idinteger
The ID of the runner of this script.
- post_sql_git_checkout(id)¶
Checkout content that the existing git_ref points to and save to the object
- Parameters
- idinteger
The ID of the file.
- Returns
civis.response.Response
- contentstring
The file’s contents.
- typestring
The file’s type.
- sizeinteger
The file’s size.
- file_hashstring
The SHA of the file.
- post_sql_git_checkout_latest(id)¶
Checkout latest commit on the current branch of a script or workflow
- Parameters
- idinteger
The ID of the file.
- Returns
civis.response.Response
- contentstring
The file’s contents.
- typestring
The file’s type.
- sizeinteger
The file’s size.
- file_hashstring
The SHA of the file.
- post_sql_git_commits(id, content, message, file_hash)¶
Commit and push a new version of the file
- Parameters
- idinteger
The ID of the file.
- contentstring
The contents to commit to the file.
- messagestring
A commit message describing the changes being made.
- file_hashstring
The full SHA of the file being replaced.
- Returns
civis.response.Response
- contentstring
The file’s contents.
- typestring
The file’s type.
- sizeinteger
The file’s size.
- file_hashstring
The SHA of the file.
- post_sql_runs(id)¶
Start a run
- Parameters
- idinteger
The ID of the sql.
- Returns
civis.response.Response
- idinteger
The ID of the run.
- sql_idinteger
The ID of the sql.
- statestring
The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- is_cancel_requestedboolean
True if run cancel requested, else false.
- started_atstring/time
The time the last run started at.
- finished_atstring/time
The time the last run completed.
- errorstring
The error, if any, returned by the run.
- outputlist::
A list of the outputs of this script. - output_name : string
The name of the output file.
- file_idinteger
The unique ID of the output file.
- pathstring
The temporary link to download this output file, valid for 36 hours.
- output_cached_onstring/time
The time that the output was originally exported, if a cache entry was used by the run.
- put_containers(id, required_resources, 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_command='DEFAULT', docker_image_tag='DEFAULT', instance_type='DEFAULT', cancel_timeout='DEFAULT', time_zone='DEFAULT', partition_label='DEFAULT', target_project_id='DEFAULT', running_as_id='DEFAULT')¶
Edit a container
- Parameters
- idinteger
The ID for the script.
- required_resourcesdict::
- cpuinteger
The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.
- memoryinteger
The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.
- disk_spacenumber/float
The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.
- docker_image_namestring
The name of the docker image to pull from DockerHub.
- namestring, optional
The name of the container.
- parent_idinteger, optional
The ID of the parent job that will trigger this script
- user_contextstring, optional
“runner” or “author”, who to execute the script as when run as a template.
- paramslist, optional::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- labelstring
The label to present to users when asking them for the value.
- descriptionstring
A short sentence or fragment describing this parameter to the end user.
- typestring
The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom
- requiredboolean
Whether this param is required.
- valuestring
The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- defaultstring
If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- allowed_valueslist
The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}
- argumentsdict, optional
Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.
- scheduledict, optional::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- notificationsdict, optional::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- repo_http_uristring, optional
The location of a github repo to clone into the container, e.g. github.com/my-user/my-repo.git.
- repo_refstring, optional
The tag or branch of the github repo to clone into the container.
- remote_host_credential_idinteger, optional
The id of the database credentials to pass into the environment of the container.
- git_credential_idinteger, 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_commandstring, optional
The command to run on the container. Will be run via sh as: [“sh”, “-c”, dockerCommand]. Defaults to the Docker image’s ENTRYPOINT/CMD.
- docker_image_tagstring, optional
The tag of the docker image to pull from DockerHub.
- instance_typestring, optional
The EC2 instance type to deploy to. Only available for jobs running on kubernetes.
- cancel_timeoutinteger, 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_zonestring, optional
The time zone of this script.
- partition_labelstring, optional
The partition label used to run this object. Not generally available. Beware this attribute may be removed in the future.
- target_project_idinteger, optional
Target project to which script outputs will be added.
- running_as_idinteger, optional
The ID of the runner of this script.
- Returns
civis.response.Response
- idinteger
The ID for the script.
- namestring
The name of the container.
- typestring
The type of the script (e.g Container)
- created_atstring/time
The time this script was created.
- updated_atstring/time
The time the script was last updated.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- statestring
The status of the script’s last run.
- finished_atstring/time
The time that the script’s last run finished.
- categorystring
The category of the script.
- projectslist::
A list of projects containing the script. - id : integer
The ID for the project.
- namestring
The name of the project.
- parent_idinteger
The ID of the parent job that will trigger this script
- user_contextstring
“runner” or “author”, who to execute the script as when run as a template.
- paramslist::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- labelstring
The label to present to users when asking them for the value.
- descriptionstring
A short sentence or fragment describing this parameter to the end user.
- typestring
The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom
- requiredboolean
Whether this param is required.
- valuestring
The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- defaultstring
If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- allowed_valueslist
The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}
- argumentsdict
Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.
- is_templateboolean
Whether others scripts use this one as a template.
- template_dependents_countinteger
How many other scripts use this one as a template.
- published_as_template_idinteger
The ID of the template that this script is backing.
- from_template_idinteger
The ID of the template script.
- template_script_namestring
The name of the template script.
- linksdict::
- detailsstring
The details link to get more information about the script.
- runsstring
The runs link to get the run information list for this script.
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- notificationsdict::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- running_asdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- required_resourcesdict::
- cpuinteger
The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.
- memoryinteger
The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.
- disk_spacenumber/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_uristring
The location of a github repo to clone into the container, e.g. github.com/my-user/my-repo.git.
- repo_refstring
The tag or branch of the github repo to clone into the container.
- remote_host_credential_idinteger
The id of the database credentials to pass into the environment of the container.
- git_credential_idinteger
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_commandstring
The command to run on the container. Will be run via sh as: [“sh”, “-c”, dockerCommand]. Defaults to the Docker image’s ENTRYPOINT/CMD.
- docker_image_namestring
The name of the docker image to pull from DockerHub.
- docker_image_tagstring
The tag of the docker image to pull from DockerHub.
- instance_typestring
The EC2 instance type to deploy to. Only available for jobs running on kubernetes.
- cancel_timeoutinteger
The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- time_zonestring
The time zone of this script.
- partition_labelstring
The partition label used to run this object. Not generally available. Beware this attribute may be removed in the future.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- hiddenboolean
The hidden status of the item.
- archivedstring
The archival status of the requested item(s).
- target_project_idinteger
Target project to which script outputs will be added.
- running_as_idinteger
The ID of the runner of this script.
- put_containers_archive(id, status)¶
Update the archive status of this object
- Parameters
- idinteger
The ID of the object.
- statusboolean
The desired archived status of the object.
- Returns
civis.response.Response
- idinteger
The ID for the script.
- namestring
The name of the container.
- typestring
The type of the script (e.g Container)
- created_atstring/time
The time this script was created.
- updated_atstring/time
The time the script was last updated.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- statestring
The status of the script’s last run.
- finished_atstring/time
The time that the script’s last run finished.
- categorystring
The category of the script.
- projectslist::
A list of projects containing the script. - id : integer
The ID for the project.
- namestring
The name of the project.
- parent_idinteger
The ID of the parent job that will trigger this script
- user_contextstring
“runner” or “author”, who to execute the script as when run as a template.
- paramslist::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- labelstring
The label to present to users when asking them for the value.
- descriptionstring
A short sentence or fragment describing this parameter to the end user.
- typestring
The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom
- requiredboolean
Whether this param is required.
- valuestring
The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- defaultstring
If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- allowed_valueslist
The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}
- argumentsdict
Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.
- is_templateboolean
Whether others scripts use this one as a template.
- template_dependents_countinteger
How many other scripts use this one as a template.
- published_as_template_idinteger
The ID of the template that this script is backing.
- from_template_idinteger
The ID of the template script.
- template_script_namestring
The name of the template script.
- linksdict::
- detailsstring
The details link to get more information about the script.
- runsstring
The runs link to get the run information list for this script.
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- notificationsdict::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- running_asdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- required_resourcesdict::
- cpuinteger
The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.
- memoryinteger
The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.
- disk_spacenumber/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_uristring
The location of a github repo to clone into the container, e.g. github.com/my-user/my-repo.git.
- repo_refstring
The tag or branch of the github repo to clone into the container.
- remote_host_credential_idinteger
The id of the database credentials to pass into the environment of the container.
- git_credential_idinteger
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_commandstring
The command to run on the container. Will be run via sh as: [“sh”, “-c”, dockerCommand]. Defaults to the Docker image’s ENTRYPOINT/CMD.
- docker_image_namestring
The name of the docker image to pull from DockerHub.
- docker_image_tagstring
The tag of the docker image to pull from DockerHub.
- instance_typestring
The EC2 instance type to deploy to. Only available for jobs running on kubernetes.
- cancel_timeoutinteger
The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- time_zonestring
The time zone of this script.
- partition_labelstring
The partition label used to run this object. Not generally available. Beware this attribute may be removed in the future.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- hiddenboolean
The hidden status of the item.
- archivedstring
The archival status of the requested item(s).
- target_project_idinteger
Target project to which script outputs will be added.
- running_as_idinteger
The ID of the runner of this script.
- put_containers_projects(id, project_id)¶
Add a Container Script to a project
- Parameters
- idinteger
The ID of the Container Script.
- project_idinteger
The ID of the project.
- Returns
- None
Response code 204: success
Set the permissions groups has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- group_idslist
An array of one or more group IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
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
- idinteger
The ID of the resource that is shared.
- user_idslist
An array of one or more user IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
- put_containers_transfer(id, user_id, include_dependencies, *, email_body='DEFAULT', send_email='DEFAULT')¶
Transfer ownership of this object to another user
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger
ID of target user
- include_dependenciesboolean
Whether or not to give manage permissions on all dependencies
- email_bodystring, optional
Custom body text for e-mail sent on transfer.
- send_emailboolean, optional
Send email to the target user of the transfer?
- Returns
civis.response.Response
- dependencieslist::
Dependent objects for this object - object_type : string
Dependent object type
- fco_typestring
Human readable dependent object type
- idinteger
Dependent object ID
- namestring
Dependent object name, or nil if the requesting user cannot read this object
- permission_levelstring
Permission level of target user (not user’s groups) for dependent object, or null if no target user
- sharedboolean
Whether dependent object was successfully shared with target user
- 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', required_resources='DEFAULT', partition_label='DEFAULT', running_as_id='DEFAULT')¶
Replace all attributes of this Custom Script
- Parameters
- idinteger
The ID for the script.
- namestring, optional
The name of the script.
- parent_idinteger, optional
The ID of the parent job that will trigger this script
- argumentsdict, optional
Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.
- remote_host_idinteger, optional
The remote host ID that this script will connect to.
- credential_idinteger, optional
The credential that this script will use.
- scheduledict, optional::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- notificationsdict, optional::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- time_zonestring, optional
The time zone of this script.
- target_project_idinteger, optional
Target project to which script outputs will be added.
- required_resourcesdict, optional::
- cpuinteger
The number of CPU shares to allocate for the container. Each core has 1000 shares.
- memoryinteger
The amount of RAM to allocate for the container (in MB).
- disk_spacenumber/float
The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.
- partition_labelstring, optional
The partition label used to run this object. Only applicable for jobs using Docker.Not generally available. Beware this attribute may be removed in the future.
- running_as_idinteger, optional
The ID of the runner of this script.
- Returns
civis.response.Response
- idinteger
The ID for the script.
- namestring
The name of the script.
- typestring
The type of the script (e.g Custom)
- created_atstring/time
The time this script was created.
- updated_atstring/time
The time the script was last updated.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- statestring
The status of the script’s last run.
- finished_atstring/time
The time that the script’s last run finished.
category : string
- projectslist::
A list of projects containing the script. - id : integer
The ID for the project.
- namestring
The name of the project.
- parent_idinteger
The ID of the parent job that will trigger this script
- paramslist::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- labelstring
The label to present to users when asking them for the value.
- descriptionstring
A short sentence or fragment describing this parameter to the end user.
- typestring
The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom
- requiredboolean
Whether this param is required.
- valuestring
The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- defaultstring
If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- allowed_valueslist
The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}
- argumentsdict
Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.
- is_templateboolean
Whether others scripts use this one as a template.
- published_as_template_idinteger
The ID of the template that this script is backing.
- from_template_idinteger
The ID of the template script.
- ui_report_urlinteger
The url of the custom HTML.
- ui_report_idinteger
The id of the report with the custom HTML.
- ui_report_provide_api_keyboolean
Whether the ui report requests an API Key from the report viewer.
- template_script_namestring
The name of the template script.
- template_notestring
The template’s note.
- remote_host_idinteger
The remote host ID that this script will connect to.
- credential_idinteger
The credential that this script will use.
- code_previewstring
The code that this script will run with arguments inserted.
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- notificationsdict::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- running_asdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- time_zonestring
The time zone of this script.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- hiddenboolean
The hidden status of the item.
- archivedstring
The archival status of the requested item(s).
- target_project_idinteger
Target project to which script outputs will be added.
- last_successful_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- required_resourcesdict::
- cpuinteger
The number of CPU shares to allocate for the container. Each core has 1000 shares.
- memoryinteger
The amount of RAM to allocate for the container (in MB).
- disk_spacenumber/float
The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.
- partition_labelstring
The partition label used to run this object. Only applicable for jobs using Docker.Not generally available. Beware this attribute may be removed in the future.
- running_as_idinteger
The ID of the runner of this script.
- put_custom_archive(id, status)¶
Update the archive status of this object
- Parameters
- idinteger
The ID of the object.
- statusboolean
The desired archived status of the object.
- Returns
civis.response.Response
- idinteger
The ID for the script.
- namestring
The name of the script.
- typestring
The type of the script (e.g Custom)
- created_atstring/time
The time this script was created.
- updated_atstring/time
The time the script was last updated.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- statestring
The status of the script’s last run.
- finished_atstring/time
The time that the script’s last run finished.
category : string
- projectslist::
A list of projects containing the script. - id : integer
The ID for the project.
- namestring
The name of the project.
- parent_idinteger
The ID of the parent job that will trigger this script
- paramslist::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- labelstring
The label to present to users when asking them for the value.
- descriptionstring
A short sentence or fragment describing this parameter to the end user.
- typestring
The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom
- requiredboolean
Whether this param is required.
- valuestring
The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- defaultstring
If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- allowed_valueslist
The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}
- argumentsdict
Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.
- is_templateboolean
Whether others scripts use this one as a template.
- published_as_template_idinteger
The ID of the template that this script is backing.
- from_template_idinteger
The ID of the template script.
- ui_report_urlinteger
The url of the custom HTML.
- ui_report_idinteger
The id of the report with the custom HTML.
- ui_report_provide_api_keyboolean
Whether the ui report requests an API Key from the report viewer.
- template_script_namestring
The name of the template script.
- template_notestring
The template’s note.
- remote_host_idinteger
The remote host ID that this script will connect to.
- credential_idinteger
The credential that this script will use.
- code_previewstring
The code that this script will run with arguments inserted.
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- notificationsdict::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- running_asdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- time_zonestring
The time zone of this script.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- hiddenboolean
The hidden status of the item.
- archivedstring
The archival status of the requested item(s).
- target_project_idinteger
Target project to which script outputs will be added.
- last_successful_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- required_resourcesdict::
- cpuinteger
The number of CPU shares to allocate for the container. Each core has 1000 shares.
- memoryinteger
The amount of RAM to allocate for the container (in MB).
- disk_spacenumber/float
The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.
- partition_labelstring
The partition label used to run this object. Only applicable for jobs using Docker.Not generally available. Beware this attribute may be removed in the future.
- running_as_idinteger
The ID of the runner of this script.
- put_custom_projects(id, project_id)¶
Add a Custom Script to a project
- Parameters
- idinteger
The ID of the Custom Script.
- project_idinteger
The ID of the project.
- Returns
- None
Response code 204: success
Set the permissions groups has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- group_idslist
An array of one or more group IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
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
- idinteger
The ID of the resource that is shared.
- user_idslist
An array of one or more user IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
- put_custom_transfer(id, user_id, include_dependencies, *, email_body='DEFAULT', send_email='DEFAULT')¶
Transfer ownership of this object to another user
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger
ID of target user
- include_dependenciesboolean
Whether or not to give manage permissions on all dependencies
- email_bodystring, optional
Custom body text for e-mail sent on transfer.
- send_emailboolean, optional
Send email to the target user of the transfer?
- Returns
civis.response.Response
- dependencieslist::
Dependent objects for this object - object_type : string
Dependent object type
- fco_typestring
Human readable dependent object type
- idinteger
Dependent object ID
- namestring
Dependent object name, or nil if the requesting user cannot read this object
- permission_levelstring
Permission level of target user (not user’s groups) for dependent object, or null if no target user
- sharedboolean
Whether dependent object was successfully shared with target user
- 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', running_as_id='DEFAULT')¶
Replace all attributes of this JavaScript Script
- Parameters
- idinteger
The ID for the script.
- namestring
The name of the script.
- sourcestring
The body/text of the script.
- remote_host_idinteger
The remote host ID that this script will connect to.
- credential_idinteger
The credential that this script will use.
- parent_idinteger, optional
The ID of the parent job that will trigger this script
- user_contextstring, optional
“runner” or “author”, who to execute the script as when run as a template.
- paramslist, optional::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- labelstring
The label to present to users when asking them for the value.
- descriptionstring
A short sentence or fragment describing this parameter to the end user.
- typestring
The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom
- requiredboolean
Whether this param is required.
- valuestring
The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- defaultstring
If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- allowed_valueslist
The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}
- argumentsdict, optional
Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.
- scheduledict, optional::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- notificationsdict, optional::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- next_run_atstring/time, optional
The time of the next scheduled run.
- time_zonestring, optional
The time zone of this script.
- target_project_idinteger, optional
Target project to which script outputs will be added.
- running_as_idinteger, optional
The ID of the runner of this script.
- Returns
civis.response.Response
- idinteger
The ID for the script.
- namestring
The name of the script.
- typestring
The type of the script (e.g SQL, Container, Python, R, JavaScript)
- created_atstring/time
The time this script was created.
- updated_atstring/time
The time the script was last updated.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- statestring
The status of the script’s last run.
- finished_atstring/time
The time that the script’s last run finished.
- categorystring
The category of the script.
- projectslist::
A list of projects containing the script. - id : integer
The ID for the project.
- namestring
The name of the project.
- parent_idinteger
The ID of the parent job that will trigger this script
- user_contextstring
“runner” or “author”, who to execute the script as when run as a template.
- paramslist::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- labelstring
The label to present to users when asking them for the value.
- descriptionstring
A short sentence or fragment describing this parameter to the end user.
- typestring
The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom
- requiredboolean
Whether this param is required.
- valuestring
The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- defaultstring
If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- allowed_valueslist
The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}
- argumentsdict
Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.
- is_templateboolean
Whether others scripts use this one as a template.
- published_as_template_idinteger
The ID of the template that this script is backing.
- from_template_idinteger
The ID of the template this script uses, if any.
- template_dependents_countinteger
How many other scripts use this one as a template.
- template_script_namestring
The name of the template script.
- linksdict::
- detailsstring
The details link to get more information about the script.
- runsstring
The runs link to get the run information list for this script.
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- notificationsdict::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- running_asdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- next_run_atstring/time
The time of the next scheduled run.
- time_zonestring
The time zone of this script.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- hiddenboolean
The hidden status of the item.
- target_project_idinteger
Target project to which script outputs will be added.
- archivedstring
The archival status of the requested item(s).
- sourcestring
The body/text of the script.
- remote_host_idinteger
The remote host ID that this script will connect to.
- credential_idinteger
The credential that this script will use.
- running_as_idinteger
The ID of the runner of this script.
- put_javascript_archive(id, status)¶
Update the archive status of this object
- Parameters
- idinteger
The ID of the object.
- statusboolean
The desired archived status of the object.
- Returns
civis.response.Response
- idinteger
The ID for the script.
- namestring
The name of the script.
- typestring
The type of the script (e.g SQL, Container, Python, R, JavaScript)
- created_atstring/time
The time this script was created.
- updated_atstring/time
The time the script was last updated.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- statestring
The status of the script’s last run.
- finished_atstring/time
The time that the script’s last run finished.
- categorystring
The category of the script.
- projectslist::
A list of projects containing the script. - id : integer
The ID for the project.
- namestring
The name of the project.
- parent_idinteger
The ID of the parent job that will trigger this script
- user_contextstring
“runner” or “author”, who to execute the script as when run as a template.
- paramslist::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- labelstring
The label to present to users when asking them for the value.
- descriptionstring
A short sentence or fragment describing this parameter to the end user.
- typestring
The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom
- requiredboolean
Whether this param is required.
- valuestring
The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- defaultstring
If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- allowed_valueslist
The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}
- argumentsdict
Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.
- is_templateboolean
Whether others scripts use this one as a template.
- published_as_template_idinteger
The ID of the template that this script is backing.
- from_template_idinteger
The ID of the template this script uses, if any.
- template_dependents_countinteger
How many other scripts use this one as a template.
- template_script_namestring
The name of the template script.
- linksdict::
- detailsstring
The details link to get more information about the script.
- runsstring
The runs link to get the run information list for this script.
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- notificationsdict::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- running_asdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- next_run_atstring/time
The time of the next scheduled run.
- time_zonestring
The time zone of this script.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- hiddenboolean
The hidden status of the item.
- target_project_idinteger
Target project to which script outputs will be added.
- archivedstring
The archival status of the requested item(s).
- sourcestring
The body/text of the script.
- remote_host_idinteger
The remote host ID that this script will connect to.
- credential_idinteger
The credential that this script will use.
- running_as_idinteger
The ID of the runner of this script.
- put_javascript_git(id, *, git_ref='DEFAULT', git_branch='DEFAULT', git_path='DEFAULT', git_repo_url='DEFAULT', git_ref_type='DEFAULT', pull_from_git='DEFAULT')¶
Attach an item to a file in a git repo
- Parameters
- idinteger
The ID of the file.
- git_refstring, optional
A git reference specifying an unambiguous version of the file. Can be a branch name, or the full or shortened SHA of a commit.
- git_branchstring, optional
The git branch that the file is on.
- git_pathstring, optional
The path of the file in the repository.
- git_repo_urlstring, optional
The URL of the git repository.
- git_ref_typestring, optional
Specifies if the file is versioned by branch or tag.
- pull_from_gitboolean, optional
Automatically pull latest commit from git. Only works for scripts.
- Returns
civis.response.Response
- git_refstring
A git reference specifying an unambiguous version of the file. Can be a branch name, tag or the full or shortened SHA of a commit.
- git_branchstring
The git branch that the file is on.
- git_pathstring
The path of the file in the repository.
- git_repodict::
- idinteger
The ID for this git repository.
- repo_urlstring
The URL for this git repository.
created_at : string/time
updated_at : string/time
- git_ref_typestring
Specifies if the file is versioned by branch or tag.
- pull_from_gitboolean
Automatically pull latest commit from git. Only works for scripts and workflows (assuming you have the feature enabled)
- put_javascript_projects(id, project_id)¶
Add a JavaScript Script to a project
- Parameters
- idinteger
The ID of the JavaScript Script.
- project_idinteger
The ID of the project.
- Returns
- None
Response code 204: success
Set the permissions groups has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- group_idslist
An array of one or more group IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
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
- idinteger
The ID of the resource that is shared.
- user_idslist
An array of one or more user IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
- put_javascript_transfer(id, user_id, include_dependencies, *, email_body='DEFAULT', send_email='DEFAULT')¶
Transfer ownership of this object to another user
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger
ID of target user
- include_dependenciesboolean
Whether or not to give manage permissions on all dependencies
- email_bodystring, optional
Custom body text for e-mail sent on transfer.
- send_emailboolean, optional
Send email to the target user of the transfer?
- Returns
civis.response.Response
- dependencieslist::
Dependent objects for this object - object_type : string
Dependent object type
- fco_typestring
Human readable dependent object type
- idinteger
Dependent object ID
- namestring
Dependent object name, or nil if the requesting user cannot read this object
- permission_levelstring
Permission level of target user (not user’s groups) for dependent object, or null if no target user
- sharedboolean
Whether dependent object was successfully shared with target user
- 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', instance_type='DEFAULT', cancel_timeout='DEFAULT', docker_image_tag='DEFAULT', partition_label='DEFAULT', running_as_id='DEFAULT')¶
Replace all attributes of this Python Script
- Parameters
- idinteger
The ID for the script.
- namestring
The name of the script.
- sourcestring
The body/text of the script.
- parent_idinteger, optional
The ID of the parent job that will trigger this script
- user_contextstring, optional
“runner” or “author”, who to execute the script as when run as a template.
- paramslist, optional::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- labelstring
The label to present to users when asking them for the value.
- descriptionstring
A short sentence or fragment describing this parameter to the end user.
- typestring
The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom
- requiredboolean
Whether this param is required.
- valuestring
The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- defaultstring
If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- allowed_valueslist
The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}
- argumentsdict, optional
Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.
- scheduledict, optional::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- notificationsdict, optional::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- next_run_atstring/time, optional
The time of the next scheduled run.
- time_zonestring, optional
The time zone of this script.
- target_project_idinteger, optional
Target project to which script outputs will be added.
- required_resourcesdict, optional::
- cpuinteger
The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.
- memoryinteger
The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.
- disk_spacenumber/float
The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.
- instance_typestring, optional
The EC2 instance type to deploy to. Only available for jobs running on kubernetes.
- cancel_timeoutinteger, optional
The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.
- docker_image_tagstring, optional
The tag of the docker image to pull from DockerHub.
- partition_labelstring, optional
The partition label used to run this object. Not generally available. Beware this attribute may be removed in the future.
- running_as_idinteger, optional
The ID of the runner of this script.
- Returns
civis.response.Response
- idinteger
The ID for the script.
- namestring
The name of the script.
- typestring
The type of the script (e.g SQL, Container, Python, R, JavaScript)
- created_atstring/time
The time this script was created.
- updated_atstring/time
The time the script was last updated.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- statestring
The status of the script’s last run.
- finished_atstring/time
The time that the script’s last run finished.
- categorystring
The category of the script.
- projectslist::
A list of projects containing the script. - id : integer
The ID for the project.
- namestring
The name of the project.
- parent_idinteger
The ID of the parent job that will trigger this script
- user_contextstring
“runner” or “author”, who to execute the script as when run as a template.
- paramslist::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- labelstring
The label to present to users when asking them for the value.
- descriptionstring
A short sentence or fragment describing this parameter to the end user.
- typestring
The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom
- requiredboolean
Whether this param is required.
- valuestring
The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- defaultstring
If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- allowed_valueslist
The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}
- argumentsdict
Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.
- is_templateboolean
Whether others scripts use this one as a template.
- published_as_template_idinteger
The ID of the template that this script is backing.
- from_template_idinteger
The ID of the template this script uses, if any.
- template_dependents_countinteger
How many other scripts use this one as a template.
- template_script_namestring
The name of the template script.
- linksdict::
- detailsstring
The details link to get more information about the script.
- runsstring
The runs link to get the run information list for this script.
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- notificationsdict::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- running_asdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- next_run_atstring/time
The time of the next scheduled run.
- time_zonestring
The time zone of this script.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- hiddenboolean
The hidden status of the item.
- target_project_idinteger
Target project to which script outputs will be added.
- archivedstring
The archival status of the requested item(s).
- required_resourcesdict::
- cpuinteger
The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.
- memoryinteger
The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.
- disk_spacenumber/float
The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.
- instance_typestring
The EC2 instance type to deploy to. Only available for jobs running on kubernetes.
- sourcestring
The body/text of the script.
- cancel_timeoutinteger
The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.
- docker_image_tagstring
The tag of the docker image to pull from DockerHub.
- partition_labelstring
The partition label used to run this object. Not generally available. Beware this attribute may be removed in the future.
- running_as_idinteger
The ID of the runner of this script.
- put_python3_archive(id, status)¶
Update the archive status of this object
- Parameters
- idinteger
The ID of the object.
- statusboolean
The desired archived status of the object.
- Returns
civis.response.Response
- idinteger
The ID for the script.
- namestring
The name of the script.
- typestring
The type of the script (e.g SQL, Container, Python, R, JavaScript)
- created_atstring/time
The time this script was created.
- updated_atstring/time
The time the script was last updated.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- statestring
The status of the script’s last run.
- finished_atstring/time
The time that the script’s last run finished.
- categorystring
The category of the script.
- projectslist::
A list of projects containing the script. - id : integer
The ID for the project.
- namestring
The name of the project.
- parent_idinteger
The ID of the parent job that will trigger this script
- user_contextstring
“runner” or “author”, who to execute the script as when run as a template.
- paramslist::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- labelstring
The label to present to users when asking them for the value.
- descriptionstring
A short sentence or fragment describing this parameter to the end user.
- typestring
The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom
- requiredboolean
Whether this param is required.
- valuestring
The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- defaultstring
If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- allowed_valueslist
The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}
- argumentsdict
Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.
- is_templateboolean
Whether others scripts use this one as a template.
- published_as_template_idinteger
The ID of the template that this script is backing.
- from_template_idinteger
The ID of the template this script uses, if any.
- template_dependents_countinteger
How many other scripts use this one as a template.
- template_script_namestring
The name of the template script.
- linksdict::
- detailsstring
The details link to get more information about the script.
- runsstring
The runs link to get the run information list for this script.
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- notificationsdict::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- running_asdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- next_run_atstring/time
The time of the next scheduled run.
- time_zonestring
The time zone of this script.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- hiddenboolean
The hidden status of the item.
- target_project_idinteger
Target project to which script outputs will be added.
- archivedstring
The archival status of the requested item(s).
- required_resourcesdict::
- cpuinteger
The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.
- memoryinteger
The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.
- disk_spacenumber/float
The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.
- instance_typestring
The EC2 instance type to deploy to. Only available for jobs running on kubernetes.
- sourcestring
The body/text of the script.
- cancel_timeoutinteger
The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.
- docker_image_tagstring
The tag of the docker image to pull from DockerHub.
- partition_labelstring
The partition label used to run this object. Not generally available. Beware this attribute may be removed in the future.
- running_as_idinteger
The ID of the runner of this script.
- put_python3_git(id, *, git_ref='DEFAULT', git_branch='DEFAULT', git_path='DEFAULT', git_repo_url='DEFAULT', git_ref_type='DEFAULT', pull_from_git='DEFAULT')¶
Attach an item to a file in a git repo
- Parameters
- idinteger
The ID of the file.
- git_refstring, optional
A git reference specifying an unambiguous version of the file. Can be a branch name, or the full or shortened SHA of a commit.
- git_branchstring, optional
The git branch that the file is on.
- git_pathstring, optional
The path of the file in the repository.
- git_repo_urlstring, optional
The URL of the git repository.
- git_ref_typestring, optional
Specifies if the file is versioned by branch or tag.
- pull_from_gitboolean, optional
Automatically pull latest commit from git. Only works for scripts.
- Returns
civis.response.Response
- git_refstring
A git reference specifying an unambiguous version of the file. Can be a branch name, tag or the full or shortened SHA of a commit.
- git_branchstring
The git branch that the file is on.
- git_pathstring
The path of the file in the repository.
- git_repodict::
- idinteger
The ID for this git repository.
- repo_urlstring
The URL for this git repository.
created_at : string/time
updated_at : string/time
- git_ref_typestring
Specifies if the file is versioned by branch or tag.
- pull_from_gitboolean
Automatically pull latest commit from git. Only works for scripts and workflows (assuming you have the feature enabled)
- put_python3_projects(id, project_id)¶
Add a Python Script to a project
- Parameters
- idinteger
The ID of the Python Script.
- project_idinteger
The ID of the project.
- Returns
- None
Response code 204: success
Set the permissions groups has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- group_idslist
An array of one or more group IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
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
- idinteger
The ID of the resource that is shared.
- user_idslist
An array of one or more user IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
- put_python3_transfer(id, user_id, include_dependencies, *, email_body='DEFAULT', send_email='DEFAULT')¶
Transfer ownership of this object to another user
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger
ID of target user
- include_dependenciesboolean
Whether or not to give manage permissions on all dependencies
- email_bodystring, optional
Custom body text for e-mail sent on transfer.
- send_emailboolean, optional
Send email to the target user of the transfer?
- Returns
civis.response.Response
- dependencieslist::
Dependent objects for this object - object_type : string
Dependent object type
- fco_typestring
Human readable dependent object type
- idinteger
Dependent object ID
- namestring
Dependent object name, or nil if the requesting user cannot read this object
- permission_levelstring
Permission level of target user (not user’s groups) for dependent object, or null if no target user
- sharedboolean
Whether dependent object was successfully shared with target user
- 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', instance_type='DEFAULT', cancel_timeout='DEFAULT', docker_image_tag='DEFAULT', partition_label='DEFAULT', running_as_id='DEFAULT')¶
Replace all attributes of this R Script
- Parameters
- idinteger
The ID for the script.
- namestring
The name of the script.
- sourcestring
The body/text of the script.
- parent_idinteger, optional
The ID of the parent job that will trigger this script
- user_contextstring, optional
“runner” or “author”, who to execute the script as when run as a template.
- paramslist, optional::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- labelstring
The label to present to users when asking them for the value.
- descriptionstring
A short sentence or fragment describing this parameter to the end user.
- typestring
The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom
- requiredboolean
Whether this param is required.
- valuestring
The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- defaultstring
If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- allowed_valueslist
The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}
- argumentsdict, optional
Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.
- scheduledict, optional::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- notificationsdict, optional::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- next_run_atstring/time, optional
The time of the next scheduled run.
- time_zonestring, optional
The time zone of this script.
- target_project_idinteger, optional
Target project to which script outputs will be added.
- required_resourcesdict, optional::
- cpuinteger
The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.
- memoryinteger
The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.
- disk_spacenumber/float
The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.
- instance_typestring, optional
The EC2 instance type to deploy to. Only available for jobs running on kubernetes.
- cancel_timeoutinteger, optional
The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.
- docker_image_tagstring, optional
The tag of the docker image to pull from DockerHub.
- partition_labelstring, optional
The partition label used to run this object. Not generally available. Beware this attribute may be removed in the future.
- running_as_idinteger, optional
The ID of the runner of this script.
- Returns
civis.response.Response
- idinteger
The ID for the script.
- namestring
The name of the script.
- typestring
The type of the script (e.g SQL, Container, Python, R, JavaScript)
- created_atstring/time
The time this script was created.
- updated_atstring/time
The time the script was last updated.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- statestring
The status of the script’s last run.
- finished_atstring/time
The time that the script’s last run finished.
- categorystring
The category of the script.
- projectslist::
A list of projects containing the script. - id : integer
The ID for the project.
- namestring
The name of the project.
- parent_idinteger
The ID of the parent job that will trigger this script
- user_contextstring
“runner” or “author”, who to execute the script as when run as a template.
- paramslist::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- labelstring
The label to present to users when asking them for the value.
- descriptionstring
A short sentence or fragment describing this parameter to the end user.
- typestring
The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom
- requiredboolean
Whether this param is required.
- valuestring
The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- defaultstring
If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- allowed_valueslist
The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}
- argumentsdict
Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.
- is_templateboolean
Whether others scripts use this one as a template.
- published_as_template_idinteger
The ID of the template that this script is backing.
- from_template_idinteger
The ID of the template this script uses, if any.
- template_dependents_countinteger
How many other scripts use this one as a template.
- template_script_namestring
The name of the template script.
- linksdict::
- detailsstring
The details link to get more information about the script.
- runsstring
The runs link to get the run information list for this script.
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- notificationsdict::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- running_asdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- next_run_atstring/time
The time of the next scheduled run.
- time_zonestring
The time zone of this script.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- hiddenboolean
The hidden status of the item.
- target_project_idinteger
Target project to which script outputs will be added.
- archivedstring
The archival status of the requested item(s).
- required_resourcesdict::
- cpuinteger
The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.
- memoryinteger
The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.
- disk_spacenumber/float
The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.
- instance_typestring
The EC2 instance type to deploy to. Only available for jobs running on kubernetes.
- sourcestring
The body/text of the script.
- cancel_timeoutinteger
The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.
- docker_image_tagstring
The tag of the docker image to pull from DockerHub.
- partition_labelstring
The partition label used to run this object. Not generally available. Beware this attribute may be removed in the future.
- running_as_idinteger
The ID of the runner of this script.
- put_r_archive(id, status)¶
Update the archive status of this object
- Parameters
- idinteger
The ID of the object.
- statusboolean
The desired archived status of the object.
- Returns
civis.response.Response
- idinteger
The ID for the script.
- namestring
The name of the script.
- typestring
The type of the script (e.g SQL, Container, Python, R, JavaScript)
- created_atstring/time
The time this script was created.
- updated_atstring/time
The time the script was last updated.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- statestring
The status of the script’s last run.
- finished_atstring/time
The time that the script’s last run finished.
- categorystring
The category of the script.
- projectslist::
A list of projects containing the script. - id : integer
The ID for the project.
- namestring
The name of the project.
- parent_idinteger
The ID of the parent job that will trigger this script
- user_contextstring
“runner” or “author”, who to execute the script as when run as a template.
- paramslist::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- labelstring
The label to present to users when asking them for the value.
- descriptionstring
A short sentence or fragment describing this parameter to the end user.
- typestring
The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom
- requiredboolean
Whether this param is required.
- valuestring
The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- defaultstring
If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- allowed_valueslist
The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}
- argumentsdict
Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.
- is_templateboolean
Whether others scripts use this one as a template.
- published_as_template_idinteger
The ID of the template that this script is backing.
- from_template_idinteger
The ID of the template this script uses, if any.
- template_dependents_countinteger
How many other scripts use this one as a template.
- template_script_namestring
The name of the template script.
- linksdict::
- detailsstring
The details link to get more information about the script.
- runsstring
The runs link to get the run information list for this script.
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- notificationsdict::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- running_asdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- next_run_atstring/time
The time of the next scheduled run.
- time_zonestring
The time zone of this script.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- hiddenboolean
The hidden status of the item.
- target_project_idinteger
Target project to which script outputs will be added.
- archivedstring
The archival status of the requested item(s).
- required_resourcesdict::
- cpuinteger
The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.
- memoryinteger
The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.
- disk_spacenumber/float
The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.
- instance_typestring
The EC2 instance type to deploy to. Only available for jobs running on kubernetes.
- sourcestring
The body/text of the script.
- cancel_timeoutinteger
The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.
- docker_image_tagstring
The tag of the docker image to pull from DockerHub.
- partition_labelstring
The partition label used to run this object. Not generally available. Beware this attribute may be removed in the future.
- running_as_idinteger
The ID of the runner of this script.
- put_r_git(id, *, git_ref='DEFAULT', git_branch='DEFAULT', git_path='DEFAULT', git_repo_url='DEFAULT', git_ref_type='DEFAULT', pull_from_git='DEFAULT')¶
Attach an item to a file in a git repo
- Parameters
- idinteger
The ID of the file.
- git_refstring, optional
A git reference specifying an unambiguous version of the file. Can be a branch name, or the full or shortened SHA of a commit.
- git_branchstring, optional
The git branch that the file is on.
- git_pathstring, optional
The path of the file in the repository.
- git_repo_urlstring, optional
The URL of the git repository.
- git_ref_typestring, optional
Specifies if the file is versioned by branch or tag.
- pull_from_gitboolean, optional
Automatically pull latest commit from git. Only works for scripts.
- Returns
civis.response.Response
- git_refstring
A git reference specifying an unambiguous version of the file. Can be a branch name, tag or the full or shortened SHA of a commit.
- git_branchstring
The git branch that the file is on.
- git_pathstring
The path of the file in the repository.
- git_repodict::
- idinteger
The ID for this git repository.
- repo_urlstring
The URL for this git repository.
created_at : string/time
updated_at : string/time
- git_ref_typestring
Specifies if the file is versioned by branch or tag.
- pull_from_gitboolean
Automatically pull latest commit from git. Only works for scripts and workflows (assuming you have the feature enabled)
- put_r_projects(id, project_id)¶
Add an R Script to a project
- Parameters
- idinteger
The ID of the R Script.
- project_idinteger
The ID of the project.
- Returns
- None
Response code 204: success
Set the permissions groups has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- group_idslist
An array of one or more group IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
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
- idinteger
The ID of the resource that is shared.
- user_idslist
An array of one or more user IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
- put_r_transfer(id, user_id, include_dependencies, *, email_body='DEFAULT', send_email='DEFAULT')¶
Transfer ownership of this object to another user
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger
ID of target user
- include_dependenciesboolean
Whether or not to give manage permissions on all dependencies
- email_bodystring, optional
Custom body text for e-mail sent on transfer.
- send_emailboolean, optional
Send email to the target user of the transfer?
- Returns
civis.response.Response
- dependencieslist::
Dependent objects for this object - object_type : string
Dependent object type
- fco_typestring
Human readable dependent object type
- idinteger
Dependent object ID
- namestring
Dependent object name, or nil if the requesting user cannot read this object
- permission_levelstring
Permission level of target user (not user’s groups) for dependent object, or null if no target user
- sharedboolean
Whether dependent object was successfully shared with target user
- 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', running_as_id='DEFAULT')¶
Replace all attributes of this SQL script
- Parameters
- idinteger
The ID for the script.
- namestring
The name of the script.
- sqlstring
The raw SQL query for the script.
- remote_host_idinteger
The remote host ID that this script will connect to.
- credential_idinteger
The credential that this script will use.
- parent_idinteger, optional
The ID of the parent job that will trigger this script
- user_contextstring, optional
“runner” or “author”, who to execute the script as when run as a template.
- paramslist, optional::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- labelstring
The label to present to users when asking them for the value.
- descriptionstring
A short sentence or fragment describing this parameter to the end user.
- typestring
The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom
- requiredboolean
Whether this param is required.
- valuestring
The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- defaultstring
If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- allowed_valueslist
The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}
- argumentsdict, optional
Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.
- scheduledict, optional::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- notificationsdict, optional::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- next_run_atstring/time, optional
The time of the next scheduled run.
- time_zonestring, optional
The time zone of this script.
- target_project_idinteger, optional
Target project to which script outputs will be added.
- csv_settingsdict, optional::
- include_headerboolean
Whether or not to include headers in the output data. Default: true
- compressionstring
The type of compression to use, if any, one of “none”, “zip”, or “gzip”. Default: gzip
- column_delimiterstring
Which delimiter to use, one of “comma”, “tab”, or “pipe”. Default: comma
- unquotedboolean
Whether or not to quote fields. Default: false
- force_multifileboolean
Whether or not the csv should be split into multiple files. Default: false
- filename_prefixstring
A user specified filename prefix for the output file to have. Default: null
- max_file_sizeinteger
The max file size, in MB, created files will be. Only available when force_multifile is true.
- running_as_idinteger, optional
The ID of the runner of this script.
- Returns
civis.response.Response
- idinteger
The ID for the script.
- namestring
The name of the script.
- typestring
The type of the script (e.g SQL, Container, Python, R, JavaScript)
- created_atstring/time
The time this script was created.
- updated_atstring/time
The time the script was last updated.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- statestring
The status of the script’s last run.
- finished_atstring/time
The time that the script’s last run finished.
- categorystring
The category of the script.
- projectslist::
A list of projects containing the script. - id : integer
The ID for the project.
- namestring
The name of the project.
- parent_idinteger
The ID of the parent job that will trigger this script
- user_contextstring
“runner” or “author”, who to execute the script as when run as a template.
- paramslist::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- labelstring
The label to present to users when asking them for the value.
- descriptionstring
A short sentence or fragment describing this parameter to the end user.
- typestring
The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom
- requiredboolean
Whether this param is required.
- valuestring
The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- defaultstring
If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- allowed_valueslist
The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}
- argumentsdict
Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.
- is_templateboolean
Whether others scripts use this one as a template.
- published_as_template_idinteger
The ID of the template that this script is backing.
- from_template_idinteger
The ID of the template this script uses, if any.
- template_dependents_countinteger
How many other scripts use this one as a template.
- template_script_namestring
The name of the template script.
- linksdict::
- detailsstring
The details link to get more information about the script.
- runsstring
The runs link to get the run information list for this script.
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- notificationsdict::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- running_asdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- next_run_atstring/time
The time of the next scheduled run.
- time_zonestring
The time zone of this script.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- hiddenboolean
The hidden status of the item.
- target_project_idinteger
Target project to which script outputs will be added.
- archivedstring
The archival status of the requested item(s).
- sqlstring
The raw SQL query for the script.
- expanded_argumentsdict
Expanded arguments for use in injecting into different environments.
- remote_host_idinteger
The remote host ID that this script will connect to.
- credential_idinteger
The credential that this script will use.
- code_previewstring
The code that this script will run with arguments inserted.
- csv_settingsdict::
- include_headerboolean
Whether or not to include headers in the output data. Default: true
- compressionstring
The type of compression to use, if any, one of “none”, “zip”, or “gzip”. Default: gzip
- column_delimiterstring
Which delimiter to use, one of “comma”, “tab”, or “pipe”. Default: comma
- unquotedboolean
Whether or not to quote fields. Default: false
- force_multifileboolean
Whether or not the csv should be split into multiple files. Default: false
- filename_prefixstring
A user specified filename prefix for the output file to have. Default: null
- max_file_sizeinteger
The max file size, in MB, created files will be. Only available when force_multifile is true.
- running_as_idinteger
The ID of the runner of this script.
- put_sql_archive(id, status)¶
Update the archive status of this object
- Parameters
- idinteger
The ID of the object.
- statusboolean
The desired archived status of the object.
- Returns
civis.response.Response
- idinteger
The ID for the script.
- namestring
The name of the script.
- typestring
The type of the script (e.g SQL, Container, Python, R, JavaScript)
- created_atstring/time
The time this script was created.
- updated_atstring/time
The time the script was last updated.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- statestring
The status of the script’s last run.
- finished_atstring/time
The time that the script’s last run finished.
- categorystring
The category of the script.
- projectslist::
A list of projects containing the script. - id : integer
The ID for the project.
- namestring
The name of the project.
- parent_idinteger
The ID of the parent job that will trigger this script
- user_contextstring
“runner” or “author”, who to execute the script as when run as a template.
- paramslist::
A definition of the parameters this script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- labelstring
The label to present to users when asking them for the value.
- descriptionstring
A short sentence or fragment describing this parameter to the end user.
- typestring
The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom
- requiredboolean
Whether this param is required.
- valuestring
The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- defaultstring
If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- allowed_valueslist
The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}
- argumentsdict
Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.
- is_templateboolean
Whether others scripts use this one as a template.
- published_as_template_idinteger
The ID of the template that this script is backing.
- from_template_idinteger
The ID of the template this script uses, if any.
- template_dependents_countinteger
How many other scripts use this one as a template.
- template_script_namestring
The name of the template script.
- linksdict::
- detailsstring
The details link to get more information about the script.
- runsstring
The runs link to get the run information list for this script.
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- notificationsdict::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- success_email_from_namestring
Name from which success emails are sent; defaults to “Civis.”
- success_email_reply_tostring
Address for replies to success emails; defaults to the author of the job.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on.
- failure_onboolean
If failure email notifications are on.
- running_asdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- next_run_atstring/time
The time of the next scheduled run.
- time_zonestring
The time zone of this script.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- hiddenboolean
The hidden status of the item.
- target_project_idinteger
Target project to which script outputs will be added.
- archivedstring
The archival status of the requested item(s).
- sqlstring
The raw SQL query for the script.
- expanded_argumentsdict
Expanded arguments for use in injecting into different environments.
- remote_host_idinteger
The remote host ID that this script will connect to.
- credential_idinteger
The credential that this script will use.
- code_previewstring
The code that this script will run with arguments inserted.
- csv_settingsdict::
- include_headerboolean
Whether or not to include headers in the output data. Default: true
- compressionstring
The type of compression to use, if any, one of “none”, “zip”, or “gzip”. Default: gzip
- column_delimiterstring
Which delimiter to use, one of “comma”, “tab”, or “pipe”. Default: comma
- unquotedboolean
Whether or not to quote fields. Default: false
- force_multifileboolean
Whether or not the csv should be split into multiple files. Default: false
- filename_prefixstring
A user specified filename prefix for the output file to have. Default: null
- max_file_sizeinteger
The max file size, in MB, created files will be. Only available when force_multifile is true.
- running_as_idinteger
The ID of the runner of this script.
- put_sql_git(id, *, git_ref='DEFAULT', git_branch='DEFAULT', git_path='DEFAULT', git_repo_url='DEFAULT', git_ref_type='DEFAULT', pull_from_git='DEFAULT')¶
Attach an item to a file in a git repo
- Parameters
- idinteger
The ID of the file.
- git_refstring, optional
A git reference specifying an unambiguous version of the file. Can be a branch name, or the full or shortened SHA of a commit.
- git_branchstring, optional
The git branch that the file is on.
- git_pathstring, optional
The path of the file in the repository.
- git_repo_urlstring, optional
The URL of the git repository.
- git_ref_typestring, optional
Specifies if the file is versioned by branch or tag.
- pull_from_gitboolean, optional
Automatically pull latest commit from git. Only works for scripts.
- Returns
civis.response.Response
- git_refstring
A git reference specifying an unambiguous version of the file. Can be a branch name, tag or the full or shortened SHA of a commit.
- git_branchstring
The git branch that the file is on.
- git_pathstring
The path of the file in the repository.
- git_repodict::
- idinteger
The ID for this git repository.
- repo_urlstring
The URL for this git repository.
created_at : string/time
updated_at : string/time
- git_ref_typestring
Specifies if the file is versioned by branch or tag.
- pull_from_gitboolean
Automatically pull latest commit from git. Only works for scripts and workflows (assuming you have the feature enabled)
- put_sql_projects(id, project_id)¶
Add a SQL script to a project
- Parameters
- idinteger
The ID of the SQL script.
- project_idinteger
The ID of the project.
- Returns
- None
Response code 204: success
Set the permissions groups has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- group_idslist
An array of one or more group IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
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
- idinteger
The ID of the resource that is shared.
- user_idslist
An array of one or more user IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
- put_sql_transfer(id, user_id, include_dependencies, *, email_body='DEFAULT', send_email='DEFAULT')¶
Transfer ownership of this object to another user
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger
ID of target user
- include_dependenciesboolean
Whether or not to give manage permissions on all dependencies
- email_bodystring, optional
Custom body text for e-mail sent on transfer.
- send_emailboolean, optional
Send email to the target user of the transfer?
- Returns
civis.response.Response
- dependencieslist::
Dependent objects for this object - object_type : string
Dependent object type
- fco_typestring
Human readable dependent object type
- idinteger
Dependent object ID
- namestring
Dependent object name, or nil if the requesting user cannot read this object
- permission_levelstring
Permission level of target user (not user’s groups) for dependent object, or null if no target user
- sharedboolean
Whether dependent object was successfully shared with target user
Search¶
- class Search(session_kwargs, client, return_type='civis')¶
Examples
>>> import civis >>> client = civis.APIClient() >>> client.search.list(...)
Methods
list
(*[, query, type, offset, order, owner, ...])Perform a search
list_queries
(*[, search_string, ...])Search queries that are not hidden
List available search types
- list(*, query='DEFAULT', type='DEFAULT', offset='DEFAULT', order='DEFAULT', owner='DEFAULT', limit='DEFAULT', archived='DEFAULT', last_run_state='DEFAULT')¶
Perform a search
- Parameters
- querystring, optional
The search query.
- typestring, optional
The type for the search. It accepts a comma-separated list. Valid arguments are listed on the “GET /search/types” endpoint.
- offsetinteger, optional
The offset for the search results.
- orderstring, optional
The field on which to order the result set.
- ownerstring, optional
The owner for the search.
- limitinteger, optional
Defaults to 10. Maximum allowed is 1000.
- archivedstring, optional
If specified, return only results with the chosen archived status; either ‘true’, ‘false’, or ‘all’. Defaults to ‘false’.
- last_run_statestring, optional
The last run state of the job being searched for; either: ‘queued’, ‘running’, ‘succeeded’, ‘failed’, or ‘cancelled’.
- Returns
civis.response.Response
- total_resultsinteger
The number of items matching the search query.
- aggregationsdict
Aggregations by owner and type for the search results.
- resultslist::
The items returned by the search. - score : number/float
The relevance score from the search request.
- typestring
The type of the item.
- idinteger
The ID of the item.
- namestring
The name of the item.
- type_namestring
The verbose name of the type.
- updated_atstring/time
The time the item was last updated.
- ownerstring
The owner of the item.
- use_countinteger
The use count of the item, if the item is a template.
- last_run_idinteger
The last run id of the item, if the item is a job.
- last_run_statestring
The last run state of the item, if the item is a job.
- last_run_startstring/time
The last run start time of the item, if the item is a job.
- last_run_finishstring/time
The last run finish time of the item, if the item is a job.
- publicboolean
The flag that indicates a template is available to all users.
- last_run_exceptionstring
The exception of the item after the last run, if the item is a job.
- list_queries(*, search_string='DEFAULT', database_id='DEFAULT', credential_id='DEFAULT', author_id='DEFAULT', archived='DEFAULT', state='DEFAULT', started_before='DEFAULT', started_after='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶
Search queries that are not hidden
- Parameters
- search_stringstring, optional
Space delimited search terms for searching queries by their SQL. Supports wild card characters “?” for any single character, and “*” for zero or more characters.
- database_idinteger, optional
The database ID.
- credential_idinteger, optional
The credential ID.
- author_idinteger, optional
The author of the query.
- archivedboolean, optional
The archival status of the requested item(s). Defaults to false.
- statearray, optional
The state of the last run. One or more of queued, running, succeeded, failed, and cancelled.
- started_beforestring, optional
An upper bound for the start date of the last run.
- started_afterstring, optional
A lower bound for the start date of the last run.
- limitinteger, optional
Number of results to return. Defaults to 10. Maximum allowed is 1000.
- page_numinteger, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstring, optional
The field on which to order the result set. Defaults to last_run_started_at. Must be one of: last_run_started_at.
- order_dirstring, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iteratorbool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
- Returns
civis.response.PaginatedResponse
- idinteger
The query ID.
- databaseinteger
The database ID.
- credentialinteger
The credential ID.
- sqlstring
The SQL executed by the query.
- author_idinteger
The author of the query.
- archivedboolean
The archival status of the requested item(s).
created_at : string/time
updated_at : string/time
- last_rundict::
id : integer
- statestring
The state of the run. One of queued, running, succeeded, failed, and cancelled.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- list_types()¶
List available search types
- Returns
civis.response.Response
- typestring
The name of the item type.
Services¶
- class Services(session_kwargs, client, return_type='civis')¶
Examples
>>> import civis >>> client = civis.APIClient() >>> client.services.list(...)
Methods
delete_deployments
(service_id, deployment_id)Delete a Service deployment
delete_projects
(id, project_id)Remove a Service from a project
delete_shares_groups
(id, group_id)Revoke the permissions a group has on this object
delete_shares_users
(id, user_id)Revoke the permissions a user has on this object
delete_tokens
(id, token_id)Revoke a token by id
get
(id)Get a Service
get_deployments
(service_id, deployment_id)Get details about a Service deployment
list
(*[, hidden, archived, author, status, ...])List Services
list_dependencies
(id, *[, user_id])List dependent objects for this object
list_deployments
(service_id, *[, ...])List deployments for a Service
list_deployments_logs
(id, deployment_id, *)Get the logs for a Service deployment
list_projects
(id, *[, hidden])List the projects a Service belongs to
list_shares
(id)List users and groups permissioned on this object
list_tokens
(id)List tokens
patch
(id, *[, name, description, ...])Update some attributes of this Service
post
(*[, name, description, type, ...])Create a Service
post_clone
(id)Clone this Service
post_deployments
(service_id, *[, deployment_id])Deploy a Service
post_redeploy
(service_id, *[, deployment_id])Redeploy a Service
post_tokens
(id, name, *[, machine_token, ...])Create a new long-lived service token
put
(id, *[, name, description, ...])Replace all attributes of this Service
put_archive
(id, status)Update the archive status of this object
put_projects
(id, project_id)Add a Service to a project
put_shares_groups
(id, group_ids, ...[, ...])Set the permissions groups has on this object
put_shares_users
(id, user_ids, ...[, ...])Set the permissions users have on this object
put_transfer
(id, user_id, ...[, email_body, ...])Transfer ownership of this object to another user
- delete_deployments(service_id, deployment_id)¶
Delete a Service deployment
- Parameters
- service_idinteger
The ID of the owning Service
- deployment_idinteger
The ID for this deployment
- Returns
- None
Response code 204: success
- delete_projects(id, project_id)¶
Remove a Service from a project
- Parameters
- idinteger
The ID of the Service.
- project_idinteger
The ID of the project.
- Returns
- None
Response code 204: success
Revoke the permissions a group has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- group_idinteger
The ID of the group.
- Returns
- None
Response code 204: success
Revoke the permissions a user has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger
The ID of the user.
- Returns
- None
Response code 204: success
- delete_tokens(id, token_id)¶
Revoke a token by id
- Parameters
- idinteger
The ID of the service.
- token_idinteger
The ID of the token.
- Returns
- None
Response code 204: success
- get(id)¶
Get a Service
- Parameters
- idinteger
- Returns
civis.response.Response
- idinteger
The ID for this Service.
- namestring
The name of this Service.
- descriptionstring
The description of this Service.
- userdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- typestring
The type of this Service
- docker_image_namestring
The name of the docker image to pull from DockerHub.
- docker_image_tagstring
The tag of the docker image to pull from DockerHub (default: latest).
- scheduledict::
- runtime_planstring
Only affects the service when deployed. On Demand means that the service will be turned on when viewed and automatically turned off after periods of inactivity. Specific Times means the service will be on when scheduled. Always On means the deployed service will always be on.
- recurrenceslist::
List of day-hour combinations this item is scheduled for - scheduled_days : list
Days it is scheduled on, based on numeric value starting at 0 for Sunday
- scheduled_hourslist
Hours it is scheduled on
time_zone : string
- replicasinteger
The number of Service replicas to deploy. When maxReplicas is set, this field defines the minimum number of replicas to deploy.
- max_replicasinteger
The maximum number of Service replicas to deploy. Defining this field enables autoscaling.
- instance_typestring
The EC2 instance type to deploy to.
- memoryinteger
The amount of memory allocated to each replica of the Service.
- cpuinteger
The amount of cpu allocated to each replica of the the Service.
created_at : string/time
updated_at : string/time
- credentialslist
A list of credential IDs to pass to the Service.
- permission_set_idinteger
The ID of the associated permission set, if any.
- git_repo_urlstring
The url for the git repo where the Service code lives.
- git_repo_refstring
The git reference to use when pulling code from the repo.
- git_path_dirstring
The path to the Service code within the git repo. If unspecified, the root directory will be used.
- report_idinteger
The ID of the associated report.
- current_deploymentdict::
- deployment_idinteger
The ID for this deployment.
- user_idinteger
The ID of the owner.
- hoststring
Domain of the deployment.
- namestring
Name of the deployment.
- docker_image_namestring
The name of the docker image to pull from DockerHub.
- docker_image_tagstring
The tag of the docker image to pull from DockerHub (default: latest).
- display_urlstring
A signed URL for viewing the deployed item.
- instance_typestring
The EC2 instance type requested for the deployment.
- memoryinteger
The memory allocated to the deployment, in MB.
- cpuinteger
The cpu allocated to the deployment, in millicores.
- statestring
The state of the deployment.
- state_messagestring
A detailed description of the state.
- max_memory_usagenumber/float
If the deployment has finished, the maximum amount of memory used during the deployment, in MB.
- max_cpu_usagenumber/float
If the deployment has finished, the maximum amount of cpu used during the deployment, in millicores.
created_at : string/time
updated_at : string/time
- service_idinteger
The ID of owning Service
- current_urlstring
The URL that the service is hosted at.
- environment_variablesdict
Environment Variables to be passed into the Service.
- notificationsdict::
- failure_email_addresseslist
Addresses to notify by e-mail when the service fails.
- failure_onboolean
If failure email notifications are on
- partition_labelstring
The partition label used to run this object. Only settable with custom_partitions feature flag. Beware attribute may break or change in the future.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- archivedstring
The archival status of the requested item(s).
- hiddenboolean
The hidden status of the item.
- get_deployments(service_id, deployment_id)¶
Get details about a Service deployment
- Parameters
- service_idinteger
The ID of the owning Service
- deployment_idinteger
The ID for this deployment
- Returns
civis.response.Response
- deployment_idinteger
The ID for this deployment.
- user_idinteger
The ID of the owner.
- hoststring
Domain of the deployment.
- namestring
Name of the deployment.
- docker_image_namestring
The name of the docker image to pull from DockerHub.
- docker_image_tagstring
The tag of the docker image to pull from DockerHub (default: latest).
- display_urlstring
A signed URL for viewing the deployed item.
- instance_typestring
The EC2 instance type requested for the deployment.
- memoryinteger
The memory allocated to the deployment, in MB.
- cpuinteger
The cpu allocated to the deployment, in millicores.
- statestring
The state of the deployment.
- state_messagestring
A detailed description of the state.
- max_memory_usagenumber/float
If the deployment has finished, the maximum amount of memory used during the deployment, in MB.
- max_cpu_usagenumber/float
If the deployment has finished, the maximum amount of cpu used during the deployment, in millicores.
created_at : string/time
updated_at : string/time
- service_idinteger
The ID of owning Service
- list(*, hidden='DEFAULT', archived='DEFAULT', author='DEFAULT', status='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶
List Services
- Parameters
- hiddenboolean, optional
If specified to be true, returns hidden items. Defaults to false, returning non-hidden items.
- archivedstring, optional
The archival status of the requested item(s).
- authorstring, optional
If specified, return items from any of these authors. It accepts a comma- separated list of user IDs.
- statusstring, optional
If specified, returns Services with one of these statuses. It accepts a comma-separated list, possible values are ‘running’, ‘idle’.
- limitinteger, optional
Number of results to return. Defaults to 20. Maximum allowed is 50.
- page_numinteger, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstring, optional
The field on which to order the result set. Defaults to updated_at. Must be one of: updated_at, name, created_at.
- order_dirstring, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iteratorbool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
- Returns
civis.response.PaginatedResponse
- idinteger
The ID for this Service.
- namestring
The name of this Service.
- descriptionstring
The description of this Service.
- userdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- typestring
The type of this Service
created_at : string/time
updated_at : string/time
- git_repo_urlstring
The url for the git repo where the Service code lives.
- git_repo_refstring
The git reference to use when pulling code from the repo.
- git_path_dirstring
The path to the Service code within the git repo. If unspecified, the root directory will be used.
- current_deploymentdict::
- deployment_idinteger
The ID for this deployment.
- user_idinteger
The ID of the owner.
- hoststring
Domain of the deployment.
- namestring
Name of the deployment.
- docker_image_namestring
The name of the docker image to pull from DockerHub.
- docker_image_tagstring
The tag of the docker image to pull from DockerHub (default: latest).
- instance_typestring
The EC2 instance type requested for the deployment.
- memoryinteger
The memory allocated to the deployment, in MB.
- cpuinteger
The cpu allocated to the deployment, in millicores.
- statestring
The state of the deployment.
- state_messagestring
A detailed description of the state.
- max_memory_usagenumber/float
If the deployment has finished, the maximum amount of memory used during the deployment, in MB.
- max_cpu_usagenumber/float
If the deployment has finished, the maximum amount of cpu used during the deployment, in millicores.
created_at : string/time
updated_at : string/time
- service_idinteger
The ID of owning Service
- archivedstring
The archival status of the requested item(s).
- list_dependencies(id, *, user_id='DEFAULT')¶
List dependent objects for this object
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger, optional
ID of target user
- Returns
civis.response.Response
- object_typestring
Dependent object type
- fco_typestring
Human readable dependent object type
- idinteger
Dependent object ID
- namestring
Dependent object name, or nil if the requesting user cannot read this object
- permission_levelstring
Permission level of target user (not user’s groups) for dependent object, or null if no target user
- shareableboolean
Whether or not the requesting user can share this object.
- list_deployments(service_id, *, deployment_id='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶
List deployments for a Service
- Parameters
- service_idinteger
The ID of the owning Service
- deployment_idinteger, optional
The ID for this deployment
- limitinteger, optional
Number of results to return. Defaults to 20. Maximum allowed is 50.
- page_numinteger, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstring, optional
The field on which to order the result set. Defaults to created_at. Must be one of: created_at.
- order_dirstring, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iteratorbool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
- Returns
civis.response.PaginatedResponse
- deployment_idinteger
The ID for this deployment.
- user_idinteger
The ID of the owner.
- hoststring
Domain of the deployment.
- namestring
Name of the deployment.
- docker_image_namestring
The name of the docker image to pull from DockerHub.
- docker_image_tagstring
The tag of the docker image to pull from DockerHub (default: latest).
- instance_typestring
The EC2 instance type requested for the deployment.
- memoryinteger
The memory allocated to the deployment, in MB.
- cpuinteger
The cpu allocated to the deployment, in millicores.
- statestring
The state of the deployment.
- state_messagestring
A detailed description of the state.
- max_memory_usagenumber/float
If the deployment has finished, the maximum amount of memory used during the deployment, in MB.
- max_cpu_usagenumber/float
If the deployment has finished, the maximum amount of cpu used during the deployment, in millicores.
created_at : string/time
updated_at : string/time
- service_idinteger
The ID of owning Service
- list_deployments_logs(id, deployment_id, *, start_at='DEFAULT', end_at='DEFAULT', limit='DEFAULT')¶
Get the logs for a Service deployment
- Parameters
- idinteger
The ID of the owning Service.
- deployment_idinteger
The ID for this deployment.
- start_atstring, optional
Log entries with a lower timestamp will be omitted.
- end_atstring, optional
Log entries with a higher timestamp will be omitted.
- limitinteger, optional
The maximum number of log messages to return. Default of 10000.
- Returns
civis.response.Response
- messagestring
The log message.
- streamstring
The stream of the log. One of “stdout”, “stderr”.
- created_atstring/date-time
The time the log was created.
- sourcestring
The source of the log. One of “system”, “user”.
- list_projects(id, *, hidden='DEFAULT')¶
List the projects a Service belongs to
- Parameters
- idinteger
The ID of the Service.
- hiddenboolean, optional
If specified to be true, returns hidden items. Defaults to false, returning non-hidden items.
- Returns
civis.response.Response
- idinteger
The ID for this project.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- namestring
The name of this project.
- descriptionstring
A description of the project.
- userslist::
Users who can see the project. - id : integer
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
auto_share : boolean
created_at : string/time
updated_at : string/time
- archivedstring
The archival status of the requested item(s).
List users and groups permissioned on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
- list_tokens(id)¶
List tokens
- Parameters
- idinteger
The ID of the service.
- Returns
civis.response.Response
- idinteger
The ID of the token.
- namestring
The name of the token.
- userdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- machine_tokenboolean
If true, this token is not tied to a particular user.
- expires_atstring/date-time
The date and time when the token expires.
- created_atstring/time
The date and time when the token was created.
- patch(id, *, name='DEFAULT', description='DEFAULT', docker_image_name='DEFAULT', docker_image_tag='DEFAULT', schedule='DEFAULT', replicas='DEFAULT', max_replicas='DEFAULT', instance_type='DEFAULT', memory='DEFAULT', cpu='DEFAULT', credentials='DEFAULT', permission_set_id='DEFAULT', git_repo_url='DEFAULT', git_repo_ref='DEFAULT', git_path_dir='DEFAULT', environment_variables='DEFAULT', notifications='DEFAULT', partition_label='DEFAULT')¶
Update some attributes of this Service
- Parameters
- idinteger
The ID for this Service.
- namestring, optional
The name of this Service.
- descriptionstring, optional
The description of this Service.
- docker_image_namestring, optional
The name of the docker image to pull from DockerHub.
- docker_image_tagstring, optional
The tag of the docker image to pull from DockerHub (default: latest).
- scheduledict, optional::
- runtime_planstring
Only affects the service when deployed. On Demand means that the service will be turned on when viewed and automatically turned off after periods of inactivity. Specific Times means the service will be on when scheduled. Always On means the deployed service will always be on.
- recurrenceslist::
List of day-hour combinations this item is scheduled for - scheduled_days : list
Days it is scheduled on, based on numeric value starting at 0 for Sunday
- scheduled_hourslist
Hours it is scheduled on
- replicasinteger, optional
The number of Service replicas to deploy. When maxReplicas is set, this field defines the minimum number of replicas to deploy.
- max_replicasinteger, optional
The maximum number of Service replicas to deploy. Defining this field enables autoscaling.
- instance_typestring, optional
The EC2 instance type to deploy to.
- memoryinteger, optional
The amount of memory allocated to each replica of the Service.
- cpuinteger, optional
The amount of cpu allocated to each replica of the the Service.
- credentialslist, optional
A list of credential IDs to pass to the Service.
- permission_set_idinteger, optional
The ID of the associated permission set, if any.
- git_repo_urlstring, optional
The url for the git repo where the Service code lives.
- git_repo_refstring, optional
The git reference to use when pulling code from the repo.
- git_path_dirstring, optional
The path to the Service code within the git repo. If unspecified, the root directory will be used.
- environment_variablesdict, optional
Environment Variables to be passed into the Service.
- notificationsdict, optional::
- failure_email_addresseslist
Addresses to notify by e-mail when the service fails.
- failure_onboolean
If failure email notifications are on
- partition_labelstring, optional
The partition label used to run this object. Only settable with custom_partitions feature flag. Beware attribute may break or change in the future.
- Returns
civis.response.Response
- idinteger
The ID for this Service.
- namestring
The name of this Service.
- descriptionstring
The description of this Service.
- userdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- typestring
The type of this Service
- docker_image_namestring
The name of the docker image to pull from DockerHub.
- docker_image_tagstring
The tag of the docker image to pull from DockerHub (default: latest).
- scheduledict::
- runtime_planstring
Only affects the service when deployed. On Demand means that the service will be turned on when viewed and automatically turned off after periods of inactivity. Specific Times means the service will be on when scheduled. Always On means the deployed service will always be on.
- recurrenceslist::
List of day-hour combinations this item is scheduled for - scheduled_days : list
Days it is scheduled on, based on numeric value starting at 0 for Sunday
- scheduled_hourslist
Hours it is scheduled on
time_zone : string
- replicasinteger
The number of Service replicas to deploy. When maxReplicas is set, this field defines the minimum number of replicas to deploy.
- max_replicasinteger
The maximum number of Service replicas to deploy. Defining this field enables autoscaling.
- instance_typestring
The EC2 instance type to deploy to.
- memoryinteger
The amount of memory allocated to each replica of the Service.
- cpuinteger
The amount of cpu allocated to each replica of the the Service.
created_at : string/time
updated_at : string/time
- credentialslist
A list of credential IDs to pass to the Service.
- permission_set_idinteger
The ID of the associated permission set, if any.
- git_repo_urlstring
The url for the git repo where the Service code lives.
- git_repo_refstring
The git reference to use when pulling code from the repo.
- git_path_dirstring
The path to the Service code within the git repo. If unspecified, the root directory will be used.
- report_idinteger
The ID of the associated report.
- current_deploymentdict::
- deployment_idinteger
The ID for this deployment.
- user_idinteger
The ID of the owner.
- hoststring
Domain of the deployment.
- namestring
Name of the deployment.
- docker_image_namestring
The name of the docker image to pull from DockerHub.
- docker_image_tagstring
The tag of the docker image to pull from DockerHub (default: latest).
- display_urlstring
A signed URL for viewing the deployed item.
- instance_typestring
The EC2 instance type requested for the deployment.
- memoryinteger
The memory allocated to the deployment, in MB.
- cpuinteger
The cpu allocated to the deployment, in millicores.
- statestring
The state of the deployment.
- state_messagestring
A detailed description of the state.
- max_memory_usagenumber/float
If the deployment has finished, the maximum amount of memory used during the deployment, in MB.
- max_cpu_usagenumber/float
If the deployment has finished, the maximum amount of cpu used during the deployment, in millicores.
created_at : string/time
updated_at : string/time
- service_idinteger
The ID of owning Service
- current_urlstring
The URL that the service is hosted at.
- environment_variablesdict
Environment Variables to be passed into the Service.
- notificationsdict::
- failure_email_addresseslist
Addresses to notify by e-mail when the service fails.
- failure_onboolean
If failure email notifications are on
- partition_labelstring
The partition label used to run this object. Only settable with custom_partitions feature flag. Beware attribute may break or change in the future.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- archivedstring
The archival status of the requested item(s).
- hiddenboolean
The hidden status of the item.
- post(*, name='DEFAULT', description='DEFAULT', type='DEFAULT', docker_image_name='DEFAULT', docker_image_tag='DEFAULT', schedule='DEFAULT', replicas='DEFAULT', max_replicas='DEFAULT', instance_type='DEFAULT', memory='DEFAULT', cpu='DEFAULT', credentials='DEFAULT', permission_set_id='DEFAULT', git_repo_url='DEFAULT', git_repo_ref='DEFAULT', git_path_dir='DEFAULT', environment_variables='DEFAULT', notifications='DEFAULT', partition_label='DEFAULT', hidden='DEFAULT')¶
Create a Service
- Parameters
- namestring, optional
The name of this Service.
- descriptionstring, optional
The description of this Service.
- typestring, optional
The type of this Service
- docker_image_namestring, optional
The name of the docker image to pull from DockerHub.
- docker_image_tagstring, optional
The tag of the docker image to pull from DockerHub (default: latest).
- scheduledict, optional::
- runtime_planstring
Only affects the service when deployed. On Demand means that the service will be turned on when viewed and automatically turned off after periods of inactivity. Specific Times means the service will be on when scheduled. Always On means the deployed service will always be on.
- recurrenceslist::
List of day-hour combinations this item is scheduled for - scheduled_days : list
Days it is scheduled on, based on numeric value starting at 0 for Sunday
- scheduled_hourslist
Hours it is scheduled on
- replicasinteger, optional
The number of Service replicas to deploy. When maxReplicas is set, this field defines the minimum number of replicas to deploy.
- max_replicasinteger, optional
The maximum number of Service replicas to deploy. Defining this field enables autoscaling.
- instance_typestring, optional
The EC2 instance type to deploy to.
- memoryinteger, optional
The amount of memory allocated to each replica of the Service.
- cpuinteger, optional
The amount of cpu allocated to each replica of the the Service.
- credentialslist, optional
A list of credential IDs to pass to the Service.
- permission_set_idinteger, optional
The ID of the associated permission set, if any.
- git_repo_urlstring, optional
The url for the git repo where the Service code lives.
- git_repo_refstring, optional
The git reference to use when pulling code from the repo.
- git_path_dirstring, optional
The path to the Service code within the git repo. If unspecified, the root directory will be used.
- environment_variablesdict, optional
Environment Variables to be passed into the Service.
- notificationsdict, optional::
- failure_email_addresseslist
Addresses to notify by e-mail when the service fails.
- failure_onboolean
If failure email notifications are on
- partition_labelstring, optional
The partition label used to run this object. Only settable with custom_partitions feature flag. Beware attribute may break or change in the future.
- hiddenboolean, optional
The hidden status of the item.
- Returns
civis.response.Response
- idinteger
The ID for this Service.
- namestring
The name of this Service.
- descriptionstring
The description of this Service.
- userdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- typestring
The type of this Service
- docker_image_namestring
The name of the docker image to pull from DockerHub.
- docker_image_tagstring
The tag of the docker image to pull from DockerHub (default: latest).
- scheduledict::
- runtime_planstring
Only affects the service when deployed. On Demand means that the service will be turned on when viewed and automatically turned off after periods of inactivity. Specific Times means the service will be on when scheduled. Always On means the deployed service will always be on.
- recurrenceslist::
List of day-hour combinations this item is scheduled for - scheduled_days : list
Days it is scheduled on, based on numeric value starting at 0 for Sunday
- scheduled_hourslist
Hours it is scheduled on
time_zone : string
- replicasinteger
The number of Service replicas to deploy. When maxReplicas is set, this field defines the minimum number of replicas to deploy.
- max_replicasinteger
The maximum number of Service replicas to deploy. Defining this field enables autoscaling.
- instance_typestring
The EC2 instance type to deploy to.
- memoryinteger
The amount of memory allocated to each replica of the Service.
- cpuinteger
The amount of cpu allocated to each replica of the the Service.
created_at : string/time
updated_at : string/time
- credentialslist
A list of credential IDs to pass to the Service.
- permission_set_idinteger
The ID of the associated permission set, if any.
- git_repo_urlstring
The url for the git repo where the Service code lives.
- git_repo_refstring
The git reference to use when pulling code from the repo.
- git_path_dirstring
The path to the Service code within the git repo. If unspecified, the root directory will be used.
- report_idinteger
The ID of the associated report.
- current_deploymentdict::
- deployment_idinteger
The ID for this deployment.
- user_idinteger
The ID of the owner.
- hoststring
Domain of the deployment.
- namestring
Name of the deployment.
- docker_image_namestring
The name of the docker image to pull from DockerHub.
- docker_image_tagstring
The tag of the docker image to pull from DockerHub (default: latest).
- display_urlstring
A signed URL for viewing the deployed item.
- instance_typestring
The EC2 instance type requested for the deployment.
- memoryinteger
The memory allocated to the deployment, in MB.
- cpuinteger
The cpu allocated to the deployment, in millicores.
- statestring
The state of the deployment.
- state_messagestring
A detailed description of the state.
- max_memory_usagenumber/float
If the deployment has finished, the maximum amount of memory used during the deployment, in MB.
- max_cpu_usagenumber/float
If the deployment has finished, the maximum amount of cpu used during the deployment, in millicores.
created_at : string/time
updated_at : string/time
- service_idinteger
The ID of owning Service
- current_urlstring
The URL that the service is hosted at.
- environment_variablesdict
Environment Variables to be passed into the Service.
- notificationsdict::
- failure_email_addresseslist
Addresses to notify by e-mail when the service fails.
- failure_onboolean
If failure email notifications are on
- partition_labelstring
The partition label used to run this object. Only settable with custom_partitions feature flag. Beware attribute may break or change in the future.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- archivedstring
The archival status of the requested item(s).
- hiddenboolean
The hidden status of the item.
- post_clone(id)¶
Clone this Service
- Parameters
- idinteger
- Returns
civis.response.Response
- idinteger
The ID for this Service.
- namestring
The name of this Service.
- descriptionstring
The description of this Service.
- userdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- typestring
The type of this Service
- docker_image_namestring
The name of the docker image to pull from DockerHub.
- docker_image_tagstring
The tag of the docker image to pull from DockerHub (default: latest).
- scheduledict::
- runtime_planstring
Only affects the service when deployed. On Demand means that the service will be turned on when viewed and automatically turned off after periods of inactivity. Specific Times means the service will be on when scheduled. Always On means the deployed service will always be on.
- recurrenceslist::
List of day-hour combinations this item is scheduled for - scheduled_days : list
Days it is scheduled on, based on numeric value starting at 0 for Sunday
- scheduled_hourslist
Hours it is scheduled on
time_zone : string
- replicasinteger
The number of Service replicas to deploy. When maxReplicas is set, this field defines the minimum number of replicas to deploy.
- max_replicasinteger
The maximum number of Service replicas to deploy. Defining this field enables autoscaling.
- instance_typestring
The EC2 instance type to deploy to.
- memoryinteger
The amount of memory allocated to each replica of the Service.
- cpuinteger
The amount of cpu allocated to each replica of the the Service.
created_at : string/time
updated_at : string/time
- credentialslist
A list of credential IDs to pass to the Service.
- permission_set_idinteger
The ID of the associated permission set, if any.
- git_repo_urlstring
The url for the git repo where the Service code lives.
- git_repo_refstring
The git reference to use when pulling code from the repo.
- git_path_dirstring
The path to the Service code within the git repo. If unspecified, the root directory will be used.
- report_idinteger
The ID of the associated report.
- current_deploymentdict::
- deployment_idinteger
The ID for this deployment.
- user_idinteger
The ID of the owner.
- hoststring
Domain of the deployment.
- namestring
Name of the deployment.
- docker_image_namestring
The name of the docker image to pull from DockerHub.
- docker_image_tagstring
The tag of the docker image to pull from DockerHub (default: latest).
- display_urlstring
A signed URL for viewing the deployed item.
- instance_typestring
The EC2 instance type requested for the deployment.
- memoryinteger
The memory allocated to the deployment, in MB.
- cpuinteger
The cpu allocated to the deployment, in millicores.
- statestring
The state of the deployment.
- state_messagestring
A detailed description of the state.
- max_memory_usagenumber/float
If the deployment has finished, the maximum amount of memory used during the deployment, in MB.
- max_cpu_usagenumber/float
If the deployment has finished, the maximum amount of cpu used during the deployment, in millicores.
created_at : string/time
updated_at : string/time
- service_idinteger
The ID of owning Service
- current_urlstring
The URL that the service is hosted at.
- environment_variablesdict
Environment Variables to be passed into the Service.
- notificationsdict::
- failure_email_addresseslist
Addresses to notify by e-mail when the service fails.
- failure_onboolean
If failure email notifications are on
- partition_labelstring
The partition label used to run this object. Only settable with custom_partitions feature flag. Beware attribute may break or change in the future.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- archivedstring
The archival status of the requested item(s).
- hiddenboolean
The hidden status of the item.
- post_deployments(service_id, *, deployment_id='DEFAULT')¶
Deploy a Service
- Parameters
- service_idinteger
The ID of the owning Service
- deployment_idinteger, optional
The ID for this deployment
- Returns
civis.response.Response
- deployment_idinteger
The ID for this deployment.
- user_idinteger
The ID of the owner.
- hoststring
Domain of the deployment.
- namestring
Name of the deployment.
- docker_image_namestring
The name of the docker image to pull from DockerHub.
- docker_image_tagstring
The tag of the docker image to pull from DockerHub (default: latest).
- display_urlstring
A signed URL for viewing the deployed item.
- instance_typestring
The EC2 instance type requested for the deployment.
- memoryinteger
The memory allocated to the deployment, in MB.
- cpuinteger
The cpu allocated to the deployment, in millicores.
- statestring
The state of the deployment.
- state_messagestring
A detailed description of the state.
- max_memory_usagenumber/float
If the deployment has finished, the maximum amount of memory used during the deployment, in MB.
- max_cpu_usagenumber/float
If the deployment has finished, the maximum amount of cpu used during the deployment, in millicores.
created_at : string/time
updated_at : string/time
- service_idinteger
The ID of owning Service
- post_redeploy(service_id, *, deployment_id='DEFAULT')¶
Redeploy a Service
- Parameters
- service_idinteger
The ID of the owning Service
- deployment_idinteger, optional
The ID for this deployment
- Returns
civis.response.Response
- deployment_idinteger
The ID for this deployment.
- user_idinteger
The ID of the owner.
- hoststring
Domain of the deployment.
- namestring
Name of the deployment.
- docker_image_namestring
The name of the docker image to pull from DockerHub.
- docker_image_tagstring
The tag of the docker image to pull from DockerHub (default: latest).
- display_urlstring
A signed URL for viewing the deployed item.
- instance_typestring
The EC2 instance type requested for the deployment.
- memoryinteger
The memory allocated to the deployment, in MB.
- cpuinteger
The cpu allocated to the deployment, in millicores.
- statestring
The state of the deployment.
- state_messagestring
A detailed description of the state.
- max_memory_usagenumber/float
If the deployment has finished, the maximum amount of memory used during the deployment, in MB.
- max_cpu_usagenumber/float
If the deployment has finished, the maximum amount of cpu used during the deployment, in millicores.
created_at : string/time
updated_at : string/time
- service_idinteger
The ID of owning Service
- post_tokens(id, name, *, machine_token='DEFAULT', expires_in='DEFAULT')¶
Create a new long-lived service token
- Parameters
- idinteger
The ID of the service.
- namestring
The name of the token.
- machine_tokenboolean, optional
If true, create a compact token with no user information.
- expires_ininteger, optional
The number of seconds until the token should expire
- Returns
civis.response.Response
- idinteger
The ID of the token.
- namestring
The name of the token.
- userdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- machine_tokenboolean
If true, this token is not tied to a particular user.
- expires_atstring/date-time
The date and time when the token expires.
- created_atstring/time
The date and time when the token was created.
- tokenstring
The value of the token. Only returned when the token is first created.
- put(id, *, name='DEFAULT', description='DEFAULT', docker_image_name='DEFAULT', docker_image_tag='DEFAULT', schedule='DEFAULT', replicas='DEFAULT', max_replicas='DEFAULT', instance_type='DEFAULT', memory='DEFAULT', cpu='DEFAULT', credentials='DEFAULT', permission_set_id='DEFAULT', git_repo_url='DEFAULT', git_repo_ref='DEFAULT', git_path_dir='DEFAULT', environment_variables='DEFAULT', notifications='DEFAULT', partition_label='DEFAULT')¶
Replace all attributes of this Service
- Parameters
- idinteger
The ID for this Service.
- namestring, optional
The name of this Service.
- descriptionstring, optional
The description of this Service.
- docker_image_namestring, optional
The name of the docker image to pull from DockerHub.
- docker_image_tagstring, optional
The tag of the docker image to pull from DockerHub (default: latest).
- scheduledict, optional::
- runtime_planstring
Only affects the service when deployed. On Demand means that the service will be turned on when viewed and automatically turned off after periods of inactivity. Specific Times means the service will be on when scheduled. Always On means the deployed service will always be on.
- recurrenceslist::
List of day-hour combinations this item is scheduled for - scheduled_days : list
Days it is scheduled on, based on numeric value starting at 0 for Sunday
- scheduled_hourslist
Hours it is scheduled on
- replicasinteger, optional
The number of Service replicas to deploy. When maxReplicas is set, this field defines the minimum number of replicas to deploy.
- max_replicasinteger, optional
The maximum number of Service replicas to deploy. Defining this field enables autoscaling.
- instance_typestring, optional
The EC2 instance type to deploy to.
- memoryinteger, optional
The amount of memory allocated to each replica of the Service.
- cpuinteger, optional
The amount of cpu allocated to each replica of the the Service.
- credentialslist, optional
A list of credential IDs to pass to the Service.
- permission_set_idinteger, optional
The ID of the associated permission set, if any.
- git_repo_urlstring, optional
The url for the git repo where the Service code lives.
- git_repo_refstring, optional
The git reference to use when pulling code from the repo.
- git_path_dirstring, optional
The path to the Service code within the git repo. If unspecified, the root directory will be used.
- environment_variablesdict, optional
Environment Variables to be passed into the Service.
- notificationsdict, optional::
- failure_email_addresseslist
Addresses to notify by e-mail when the service fails.
- failure_onboolean
If failure email notifications are on
- partition_labelstring, optional
The partition label used to run this object. Only settable with custom_partitions feature flag. Beware attribute may break or change in the future.
- Returns
civis.response.Response
- idinteger
The ID for this Service.
- namestring
The name of this Service.
- descriptionstring
The description of this Service.
- userdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- typestring
The type of this Service
- docker_image_namestring
The name of the docker image to pull from DockerHub.
- docker_image_tagstring
The tag of the docker image to pull from DockerHub (default: latest).
- scheduledict::
- runtime_planstring
Only affects the service when deployed. On Demand means that the service will be turned on when viewed and automatically turned off after periods of inactivity. Specific Times means the service will be on when scheduled. Always On means the deployed service will always be on.
- recurrenceslist::
List of day-hour combinations this item is scheduled for - scheduled_days : list
Days it is scheduled on, based on numeric value starting at 0 for Sunday
- scheduled_hourslist
Hours it is scheduled on
time_zone : string
- replicasinteger
The number of Service replicas to deploy. When maxReplicas is set, this field defines the minimum number of replicas to deploy.
- max_replicasinteger
The maximum number of Service replicas to deploy. Defining this field enables autoscaling.
- instance_typestring
The EC2 instance type to deploy to.
- memoryinteger
The amount of memory allocated to each replica of the Service.
- cpuinteger
The amount of cpu allocated to each replica of the the Service.
created_at : string/time
updated_at : string/time
- credentialslist
A list of credential IDs to pass to the Service.
- permission_set_idinteger
The ID of the associated permission set, if any.
- git_repo_urlstring
The url for the git repo where the Service code lives.
- git_repo_refstring
The git reference to use when pulling code from the repo.
- git_path_dirstring
The path to the Service code within the git repo. If unspecified, the root directory will be used.
- report_idinteger
The ID of the associated report.
- current_deploymentdict::
- deployment_idinteger
The ID for this deployment.
- user_idinteger
The ID of the owner.
- hoststring
Domain of the deployment.
- namestring
Name of the deployment.
- docker_image_namestring
The name of the docker image to pull from DockerHub.
- docker_image_tagstring
The tag of the docker image to pull from DockerHub (default: latest).
- display_urlstring
A signed URL for viewing the deployed item.
- instance_typestring
The EC2 instance type requested for the deployment.
- memoryinteger
The memory allocated to the deployment, in MB.
- cpuinteger
The cpu allocated to the deployment, in millicores.
- statestring
The state of the deployment.
- state_messagestring
A detailed description of the state.
- max_memory_usagenumber/float
If the deployment has finished, the maximum amount of memory used during the deployment, in MB.
- max_cpu_usagenumber/float
If the deployment has finished, the maximum amount of cpu used during the deployment, in millicores.
created_at : string/time
updated_at : string/time
- service_idinteger
The ID of owning Service
- current_urlstring
The URL that the service is hosted at.
- environment_variablesdict
Environment Variables to be passed into the Service.
- notificationsdict::
- failure_email_addresseslist
Addresses to notify by e-mail when the service fails.
- failure_onboolean
If failure email notifications are on
- partition_labelstring
The partition label used to run this object. Only settable with custom_partitions feature flag. Beware attribute may break or change in the future.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- archivedstring
The archival status of the requested item(s).
- hiddenboolean
The hidden status of the item.
- put_archive(id, status)¶
Update the archive status of this object
- Parameters
- idinteger
The ID of the object.
- statusboolean
The desired archived status of the object.
- Returns
civis.response.Response
- idinteger
The ID for this Service.
- namestring
The name of this Service.
- descriptionstring
The description of this Service.
- userdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- typestring
The type of this Service
- docker_image_namestring
The name of the docker image to pull from DockerHub.
- docker_image_tagstring
The tag of the docker image to pull from DockerHub (default: latest).
- scheduledict::
- runtime_planstring
Only affects the service when deployed. On Demand means that the service will be turned on when viewed and automatically turned off after periods of inactivity. Specific Times means the service will be on when scheduled. Always On means the deployed service will always be on.
- recurrenceslist::
List of day-hour combinations this item is scheduled for - scheduled_days : list
Days it is scheduled on, based on numeric value starting at 0 for Sunday
- scheduled_hourslist
Hours it is scheduled on
time_zone : string
- replicasinteger
The number of Service replicas to deploy. When maxReplicas is set, this field defines the minimum number of replicas to deploy.
- max_replicasinteger
The maximum number of Service replicas to deploy. Defining this field enables autoscaling.
- instance_typestring
The EC2 instance type to deploy to.
- memoryinteger
The amount of memory allocated to each replica of the Service.
- cpuinteger
The amount of cpu allocated to each replica of the the Service.
created_at : string/time
updated_at : string/time
- credentialslist
A list of credential IDs to pass to the Service.
- permission_set_idinteger
The ID of the associated permission set, if any.
- git_repo_urlstring
The url for the git repo where the Service code lives.
- git_repo_refstring
The git reference to use when pulling code from the repo.
- git_path_dirstring
The path to the Service code within the git repo. If unspecified, the root directory will be used.
- report_idinteger
The ID of the associated report.
- current_deploymentdict::
- deployment_idinteger
The ID for this deployment.
- user_idinteger
The ID of the owner.
- hoststring
Domain of the deployment.
- namestring
Name of the deployment.
- docker_image_namestring
The name of the docker image to pull from DockerHub.
- docker_image_tagstring
The tag of the docker image to pull from DockerHub (default: latest).
- display_urlstring
A signed URL for viewing the deployed item.
- instance_typestring
The EC2 instance type requested for the deployment.
- memoryinteger
The memory allocated to the deployment, in MB.
- cpuinteger
The cpu allocated to the deployment, in millicores.
- statestring
The state of the deployment.
- state_messagestring
A detailed description of the state.
- max_memory_usagenumber/float
If the deployment has finished, the maximum amount of memory used during the deployment, in MB.
- max_cpu_usagenumber/float
If the deployment has finished, the maximum amount of cpu used during the deployment, in millicores.
created_at : string/time
updated_at : string/time
- service_idinteger
The ID of owning Service
- current_urlstring
The URL that the service is hosted at.
- environment_variablesdict
Environment Variables to be passed into the Service.
- notificationsdict::
- failure_email_addresseslist
Addresses to notify by e-mail when the service fails.
- failure_onboolean
If failure email notifications are on
- partition_labelstring
The partition label used to run this object. Only settable with custom_partitions feature flag. Beware attribute may break or change in the future.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- archivedstring
The archival status of the requested item(s).
- hiddenboolean
The hidden status of the item.
- put_projects(id, project_id)¶
Add a Service to a project
- Parameters
- idinteger
The ID of the Service.
- project_idinteger
The ID of the project.
- Returns
- None
Response code 204: success
Set the permissions groups has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- group_idslist
An array of one or more group IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
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
- idinteger
The ID of the resource that is shared.
- user_idslist
An array of one or more user IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
- put_transfer(id, user_id, include_dependencies, *, email_body='DEFAULT', send_email='DEFAULT')¶
Transfer ownership of this object to another user
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger
ID of target user
- include_dependenciesboolean
Whether or not to give manage permissions on all dependencies
- email_bodystring, optional
Custom body text for e-mail sent on transfer.
- send_emailboolean, optional
Send email to the target user of the transfer?
- Returns
civis.response.Response
- dependencieslist::
Dependent objects for this object - object_type : string
Dependent object type
- fco_typestring
Human readable dependent object type
- idinteger
Dependent object ID
- namestring
Dependent object name, or nil if the requesting user cannot read this object
- permission_levelstring
Permission level of target user (not user’s groups) for dependent object, or null if no target user
- sharedboolean
Whether dependent object was successfully shared with target user
Storage_Hosts¶
- class Storage_Hosts(session_kwargs, client, return_type='civis')¶
Examples
>>> import civis >>> client = civis.APIClient() >>> client.storage_hosts.list(...)
Methods
delete_shares_groups
(id, group_id)Revoke the permissions a group has on this object
delete_shares_users
(id, user_id)Revoke the permissions a user has on this object
get
(id)Get a storage host
list
()List the storage hosts
list_dependencies
(id, *[, user_id])List dependent objects for this object
list_shares
(id)List users and groups permissioned on this object
patch
(id, *[, name, provider, bucket, ...])Update some attributes of this storage host
post
(provider, bucket, name, *[, s3_options])Create a new storage host
put
(id, name, provider, bucket, *[, s3_options])Replace all attributes of this storage host
put_shares_groups
(id, group_ids, ...[, ...])Set the permissions groups has on this object
put_shares_users
(id, user_ids, ...[, ...])Set the permissions users have on this object
put_transfer
(id, user_id, ...[, email_body, ...])Transfer ownership of this object to another user
Revoke the permissions a group has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- group_idinteger
The ID of the group.
- Returns
- None
Response code 204: success
Revoke the permissions a user has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger
The ID of the user.
- Returns
- None
Response code 204: success
- get(id)¶
Get a storage host
- Parameters
- idinteger
The ID of the storage host.
- Returns
civis.response.Response
- idinteger
The ID of the storage host.
- ownerdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- namestring
The human readable name for the storage host.
- providerstring
The storage provider.One of: s3.
- bucketstring
The bucket for this storage host.
- s3_optionsdict::
- regionstring
The region for this storage host (ex. “us-east-1”)
- list()¶
List the storage hosts
- Returns
civis.response.Response
- idinteger
The ID of the storage host.
- ownerdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- namestring
The human readable name for the storage host.
- providerstring
The storage provider.One of: s3.
- bucketstring
The bucket for this storage host.
- s3_optionsdict::
- regionstring
The region for this storage host (ex. “us-east-1”)
- list_dependencies(id, *, user_id='DEFAULT')¶
List dependent objects for this object
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger, optional
ID of target user
- Returns
civis.response.Response
- object_typestring
Dependent object type
- fco_typestring
Human readable dependent object type
- idinteger
Dependent object ID
- namestring
Dependent object name, or nil if the requesting user cannot read this object
- permission_levelstring
Permission level of target user (not user’s groups) for dependent object, or null if no target user
- shareableboolean
Whether or not the requesting user can share this object.
List users and groups permissioned on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
- patch(id, *, name='DEFAULT', provider='DEFAULT', bucket='DEFAULT', s3_options='DEFAULT')¶
Update some attributes of this storage host
- Parameters
- idinteger
The ID of the storage host.
- namestring, optional
The human readable name for the storage host.
- providerstring, optional
The storage provider.One of: s3.
- bucketstring, optional
The bucket for this storage host.
- s3_optionsdict, optional::
- regionstring
The region for this storage host (ex. “us-east-1”)
- Returns
civis.response.Response
- idinteger
The ID of the storage host.
- ownerdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- namestring
The human readable name for the storage host.
- providerstring
The storage provider.One of: s3.
- bucketstring
The bucket for this storage host.
- s3_optionsdict::
- regionstring
The region for this storage host (ex. “us-east-1”)
- post(provider, bucket, name, *, s3_options='DEFAULT')¶
Create a new storage host
- Parameters
- providerstring
The storage provider.One of: s3.
- bucketstring
The bucket for this storage host.
- namestring
The human readable name for the storage host.
- s3_optionsdict, optional::
- regionstring
The region for this storage host (ex. “us-east-1”)
- Returns
civis.response.Response
- idinteger
The ID of the storage host.
- ownerdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- namestring
The human readable name for the storage host.
- providerstring
The storage provider.One of: s3.
- bucketstring
The bucket for this storage host.
- s3_optionsdict::
- regionstring
The region for this storage host (ex. “us-east-1”)
- put(id, name, provider, bucket, *, s3_options='DEFAULT')¶
Replace all attributes of this storage host
- Parameters
- idinteger
The ID of the storage host.
- namestring
The human readable name for the storage host.
- providerstring
The storage provider.One of: s3.
- bucketstring
The bucket for this storage host.
- s3_optionsdict, optional::
- regionstring
The region for this storage host (ex. “us-east-1”)
- Returns
civis.response.Response
- idinteger
The ID of the storage host.
- ownerdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- namestring
The human readable name for the storage host.
- providerstring
The storage provider.One of: s3.
- bucketstring
The bucket for this storage host.
- s3_optionsdict::
- regionstring
The region for this storage host (ex. “us-east-1”)
Set the permissions groups has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- group_idslist
An array of one or more group IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
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
- idinteger
The ID of the resource that is shared.
- user_idslist
An array of one or more user IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
- put_transfer(id, user_id, include_dependencies, *, email_body='DEFAULT', send_email='DEFAULT')¶
Transfer ownership of this object to another user
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger
ID of target user
- include_dependenciesboolean
Whether or not to give manage permissions on all dependencies
- email_bodystring, optional
Custom body text for e-mail sent on transfer.
- send_emailboolean, optional
Send email to the target user of the transfer?
- Returns
civis.response.Response
- dependencieslist::
Dependent objects for this object - object_type : string
Dependent object type
- fco_typestring
Human readable dependent object type
- idinteger
Dependent object ID
- namestring
Dependent object name, or nil if the requesting user cannot read this object
- permission_levelstring
Permission level of target user (not user’s groups) for dependent object, or null if no target user
- sharedboolean
Whether dependent object was successfully shared with target user
Tables¶
- class Tables(session_kwargs, client, return_type='civis')¶
Examples
>>> import civis >>> client = civis.APIClient() >>> client.tables.post_enhancements_geocodings(...)
Methods
delete_projects
(id, project_id)Remove a Table from a project
delete_tags
(id, table_tag_id)Add a tag to a table
get
(id)Show basic table info
get_enhancements_cass_ncoa
(id, source_table_id)Deprecation warning! :2: (WARNING/2) Title underline too short. Deprecation warning! ------------------ Warning: The tables/:source_table_id/enhancements/cass-ncoa/:id endpoint is deprecated and will be removed after January 1, 2021. View the status of a CASS / NCOA table enhancement
get_enhancements_geocodings
(id, source_table_id)Deprecation warning! :2: (WARNING/2) Title underline too short. Deprecation warning! ------------------ Warning: The tables/:source_table_id/enhancements/geocodings/:id endpoint is deprecated and will be removed after January 1, 2021. View the status of a geocoding table enhancement
list
(*[, database_id, schema, name, search, ...])List tables
list_columns
(id, *[, name, limit, page_num, ...])List columns in the specified table
list_projects
(id, *[, hidden])List the projects a Table belongs to
patch
(id, *[, ontology_mapping, ...])Update a table
post_enhancements_cass_ncoa
(source_table_id, *)Deprecation warning! :2: (WARNING/2) Title underline too short. Deprecation warning! ------------------ Warning: The tables/:source_table_id/enhancements/cass-ncoa endpoint is deprecated and will be removed after January 1, 2021. Standardize addresses in a table
post_enhancements_geocodings
(source_table_id)Deprecation warning! :2: (WARNING/2) Title underline too short. Deprecation warning! ------------------ Warning: The tables/:source_table_id/enhancements/geocodings endpoint is deprecated and will be removed after January 1, 2021. Geocode a table
post_refresh
(id)Deprecation warning! :2: (WARNING/2) Title underline too short. Deprecation warning! ------------------ Warning: The tables/:id/refresh endpoint is deprecated. Please use tables/scan from now on. Request a refresh for column and table statistics
post_scan
(database_id, schema, table_name, *)Creates and enqueues a single table scanner job on a new table
put_projects
(id, project_id)Add a Table to a project
put_tags
(id, table_tag_id)Add a tag to a table
- delete_projects(id, project_id)¶
Remove a Table from a project
- Parameters
- idinteger
The ID of the Table.
- project_idinteger
The ID of the project.
- Returns
- None
Response code 204: success
- delete_tags(id, table_tag_id)¶
Add a tag to a table
- Parameters
- idinteger
The ID of the table.
- table_tag_idinteger
The ID of the tag.
- Returns
- None
Response code 200: success
- get(id)¶
Show basic table info
- Parameters
- idinteger
- Returns
civis.response.Response
- idinteger
The ID of the table.
- database_idinteger
The ID of the database.
- schemastring
The name of the schema containing the table.
- namestring
Name of the table.
- descriptionstring
The description of the table, as specified by the table owner
- is_viewboolean
True if this table represents a view. False if it represents a regular table.
- row_countinteger
The number of rows in the table.
- column_countinteger
The number of columns in the table.
- size_mbnumber/float
The size of the table in megabytes.
- ownerstring
The database username of the table’s owner.
- distkeystring
The column used as the Amazon Redshift distkey.
- sortkeysstring
The column used as the Amazon Redshift sortkey.
- refresh_statusstring
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_refreshstring/date-time
The time of the last statistics refresh.
- data_updated_atstring/date-time
The last time that Civis Platform captured a change in this table.Only applicable for Redshift tables; please see the Civis help desk for more info.
- schema_updated_atstring/date-time
The last time that Civis Platform captured a change to the table attributes/structure.Only applicable for Redshift tables; please see the Civis help desk for more info.
- refresh_idstring
The ID of the most recent statistics refresh.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- primary_keyslist
The primary keys for this table.
- last_modified_keyslist
The columns indicating an entry’s modification status for this table.
- table_tagslist::
The table tags associated with this table. - id : integer
Table Tag ID
- namestring
Table Tag Name
- ontology_mappingdict
The ontology-key to column-name mapping. See /ontology for the list of valid ontology keys.
- columnslist::
- namestring
Name of the column.
- civis_data_typestring
The generic data type of the column (ex. “string”). Since this is database-agnostic, it may be helpful when loading data to R/Python.
- sql_typestring
The database-specific SQL type of the column (ex. “varchar(30)”).
- sample_valueslist
A sample of values from the column.
- encodingstring
The compression encoding for this columnSee: http://docs.aws.amazon .com/redshift/latest/dg/c_Compression_encodings.html
- descriptionstring
The description of the column, as specified by the table owner
- orderinteger
Relative position of the column in the table.
- min_valuestring
Smallest value in the column.
- max_valuestring
Largest value in the column.
- avg_valuenumber/float
This parameter is deprecated.
- stddevnumber/float
This parameter is deprecated.
- value_distribution_percentdict
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_countinteger
Number of non-null values in the column.
- null_countinteger
Number of null values in the column.
- possible_dependent_variable_typeslist
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_variableboolean
Whether the column may be used as an independent variable to train a model.
- useable_as_primary_keyboolean
Whether the column may be used as an primary key to identify table rows.
- value_distributiondict
An object mapping distinct values in the column to the number of times they appear in the column
- distinct_countinteger
Number of distinct values in the column. NULL values are counted and treated as a single distinct value.
- joinslist::
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
- enhancementslist::
type : string
created_at : string/time
updated_at : string/time
join_id : integer
view_def : string
table_def : string
- outgoing_table_matcheslist::
- source_table_idinteger
Source table
- target_typestring
Target type
- target_idinteger
Target ID
- targetdict::
name : string
- jobdict::
id : integer
name : string
type : string
from_template_id : integer
- statestring
Whether the job is idle, queued, running, cancelled, or failed.
created_at : string/date-time
updated_at : string/date-time
- runslist::
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_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- hiddenboolean
The hidden status of the item.
- match_optionsdict::
max_matches : integer
threshold : string
- get_enhancements_cass_ncoa(id, source_table_id)¶
Warning: The tables/:source_table_id/enhancements/cass-ncoa/:id endpoint is deprecated and will be removed after January 1, 2021. View the status of a CASS / NCOA table enhancement
- Parameters
- idinteger
The ID of the enhancement.
- source_table_idinteger
The ID of the table that was enhanced.
- Returns
civis.response.Response
- idinteger
The ID of the enhancement.
- source_table_idinteger
The ID of the table that was enhanced.
- statestring
The state of the enhancement, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- enhanced_table_schemastring
The schema name of the table created by the enhancement.
- enhanced_table_namestring
The name of the table created by the enhancement.
- perform_ncoaboolean
Whether to update addresses for records matching the National Change of Address (NCOA) database.
- ncoa_credential_idinteger
Credential to use when performing NCOA updates. Required if ‘performNcoa’ is true.
- output_levelstring
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)¶
Warning: The tables/:source_table_id/enhancements/geocodings/:id endpoint is deprecated and will be removed after January 1, 2021. View the status of a geocoding table enhancement
- Parameters
- idinteger
The ID of the enhancement.
- source_table_idinteger
The ID of the table that was enhanced.
- Returns
civis.response.Response
- idinteger
The ID of the enhancement.
- source_table_idinteger
The ID of the table that was enhanced.
- statestring
The state of the enhancement, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- enhanced_table_schemastring
The schema name of the table created by the enhancement.
- enhanced_table_namestring
The name of the table created by the enhancement.
- list(*, database_id='DEFAULT', schema='DEFAULT', name='DEFAULT', search='DEFAULT', table_tag_ids='DEFAULT', credential_id='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶
List tables
- Parameters
- database_idinteger, optional
The ID of the database.
- schemastring, 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”).
- namestring, 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”).
- searchstring, 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.
- table_tag_idsarray, optional
If specified, will be used to filter the tables returned. Will search across Table Tags and will return any tables that have one of the matching Table Tags.
- credential_idinteger, optional
If specified, will be used instead of the default credential to filter the tables returned.
- limitinteger, optional
Number of results to return. Defaults to 50. Maximum allowed is 1000.
- page_numinteger, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstring, optional
The field on which to order the result set. Defaults to schema. Must be one of: schema, name, search, table_tag_ids, credential_id.
- order_dirstring, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to asc.
- iteratorbool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
- Returns
civis.response.PaginatedResponse
- idinteger
The ID of the table.
- database_idinteger
The ID of the database.
- schemastring
The name of the schema containing the table.
- namestring
Name of the table.
- descriptionstring
The description of the table, as specified by the table owner
- is_viewboolean
True if this table represents a view. False if it represents a regular table.
- row_countinteger
The number of rows in the table.
- column_countinteger
The number of columns in the table.
- size_mbnumber/float
The size of the table in megabytes.
- ownerstring
The database username of the table’s owner.
- distkeystring
The column used as the Amazon Redshift distkey.
- sortkeysstring
The column used as the Amazon Redshift sortkey.
- refresh_statusstring
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_refreshstring/date-time
The time of the last statistics refresh.
- refresh_idstring
The ID of the most recent statistics refresh.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- table_tagslist::
The table tags associated with this table. - id : integer
Table Tag ID
- namestring
Table Tag Name
- list_columns(id, *, name='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶
List columns in the specified table
- Parameters
- idinteger
- namestring, optional
Search for columns with the given name, within the specified table.
- limitinteger, optional
Number of results to return. Defaults to its maximum of 50.
- page_numinteger, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstring, optional
The field on which to order the result set. Defaults to name. Must be one of: name, order.
- order_dirstring, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to asc.
- iteratorbool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
- Returns
civis.response.PaginatedResponse
- namestring
Name of the column.
- civis_data_typestring
The generic data type of the column (ex. “string”). Since this is database-agnostic, it may be helpful when loading data to R/Python.
- sql_typestring
The database-specific SQL type of the column (ex. “varchar(30)”).
- sample_valueslist
A sample of values from the column.
- encodingstring
The compression encoding for this columnSee: http://docs.aws.amazon.com /redshift/latest/dg/c_Compression_encodings.html
- descriptionstring
The description of the column, as specified by the table owner
- orderinteger
Relative position of the column in the table.
- min_valuestring
Smallest value in the column.
- max_valuestring
Largest value in the column.
- avg_valuenumber/float
This parameter is deprecated.
- stddevnumber/float
This parameter is deprecated.
- value_distribution_percentdict
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_countinteger
Number of non-null values in the column.
- null_countinteger
Number of null values in the column.
- possible_dependent_variable_typeslist
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_variableboolean
Whether the column may be used as an independent variable to train a model.
- useable_as_primary_keyboolean
Whether the column may be used as an primary key to identify table rows.
- value_distributiondict
An object mapping distinct values in the column to the number of times they appear in the column
- distinct_countinteger
Number of distinct values in the column. NULL values are counted and treated as a single distinct value.
- list_projects(id, *, hidden='DEFAULT')¶
List the projects a Table belongs to
- Parameters
- idinteger
The ID of the Table.
- hiddenboolean, optional
If specified to be true, returns hidden items. Defaults to false, returning non-hidden items.
- Returns
civis.response.Response
- idinteger
The ID for this project.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- namestring
The name of this project.
- descriptionstring
A description of the project.
- userslist::
Users who can see the project. - id : integer
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
auto_share : boolean
created_at : string/time
updated_at : string/time
- archivedstring
The archival status of the requested item(s).
- patch(id, *, ontology_mapping='DEFAULT', description='DEFAULT', primary_keys='DEFAULT', last_modified_keys='DEFAULT')¶
Update a table
- Parameters
- idinteger
The ID of the table.
- ontology_mappingdict, optional
The ontology-key to column-name mapping. See /ontology for the list of valid ontology keys.
- descriptionstring, optional
The user-defined description of the table.
- primary_keyslist, optional
A list of column(s) which together uniquely identify a row in the data.These columns must not contain NULL values.
- last_modified_keyslist, optional
The columns indicating when a row was last modified.
- Returns
civis.response.Response
- idinteger
The ID of the table.
- database_idinteger
The ID of the database.
- schemastring
The name of the schema containing the table.
- namestring
Name of the table.
- descriptionstring
The description of the table, as specified by the table owner
- is_viewboolean
True if this table represents a view. False if it represents a regular table.
- row_countinteger
The number of rows in the table.
- column_countinteger
The number of columns in the table.
- size_mbnumber/float
The size of the table in megabytes.
- ownerstring
The database username of the table’s owner.
- distkeystring
The column used as the Amazon Redshift distkey.
- sortkeysstring
The column used as the Amazon Redshift sortkey.
- refresh_statusstring
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_refreshstring/date-time
The time of the last statistics refresh.
- data_updated_atstring/date-time
The last time that Civis Platform captured a change in this table.Only applicable for Redshift tables; please see the Civis help desk for more info.
- schema_updated_atstring/date-time
The last time that Civis Platform captured a change to the table attributes/structure.Only applicable for Redshift tables; please see the Civis help desk for more info.
- refresh_idstring
The ID of the most recent statistics refresh.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- primary_keyslist
The primary keys for this table.
- last_modified_keyslist
The columns indicating an entry’s modification status for this table.
- table_tagslist::
The table tags associated with this table. - id : integer
Table Tag ID
- namestring
Table Tag Name
- ontology_mappingdict
The ontology-key to column-name mapping. See /ontology for the list of valid ontology keys.
- post_enhancements_cass_ncoa(source_table_id, *, perform_ncoa='DEFAULT', ncoa_credential_id='DEFAULT', output_level='DEFAULT')¶
Warning: The tables/:source_table_id/enhancements/cass-ncoa endpoint is deprecated and will be removed after January 1, 2021. Standardize addresses in a table
- Parameters
- source_table_idinteger
The ID of the table to be enhanced.
- perform_ncoaboolean, optional
Whether to update addresses for records matching the National Change of Address (NCOA) database.
- ncoa_credential_idinteger, optional
Credential to use when performing NCOA updates. Required if ‘performNcoa’ is true.
- output_levelstring, 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
civis.response.Response
- idinteger
The ID of the enhancement.
- source_table_idinteger
The ID of the table that was enhanced.
- statestring
The state of the enhancement, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- enhanced_table_schemastring
The schema name of the table created by the enhancement.
- enhanced_table_namestring
The name of the table created by the enhancement.
- perform_ncoaboolean
Whether to update addresses for records matching the National Change of Address (NCOA) database.
- ncoa_credential_idinteger
Credential to use when performing NCOA updates. Required if ‘performNcoa’ is true.
- output_levelstring
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)¶
Warning: The tables/:source_table_id/enhancements/geocodings endpoint is deprecated and will be removed after January 1, 2021. Geocode a table
- Parameters
- source_table_idinteger
The ID of the table to be enhanced.
- Returns
civis.response.Response
- idinteger
The ID of the enhancement.
- source_table_idinteger
The ID of the table that was enhanced.
- statestring
The state of the enhancement, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.
- enhanced_table_schemastring
The schema name of the table created by the enhancement.
- enhanced_table_namestring
The name of the table created by the enhancement.
- post_refresh(id)¶
Warning: The tables/:id/refresh endpoint is deprecated. Please use tables/scan from now on. Request a refresh for column and table statistics
- Parameters
- idinteger
- Returns
civis.response.Response
- idinteger
The ID of the table.
- database_idinteger
The ID of the database.
- schemastring
The name of the schema containing the table.
- namestring
Name of the table.
- descriptionstring
The description of the table, as specified by the table owner
- is_viewboolean
True if this table represents a view. False if it represents a regular table.
- row_countinteger
The number of rows in the table.
- column_countinteger
The number of columns in the table.
- size_mbnumber/float
The size of the table in megabytes.
- ownerstring
The database username of the table’s owner.
- distkeystring
The column used as the Amazon Redshift distkey.
- sortkeysstring
The column used as the Amazon Redshift sortkey.
- refresh_statusstring
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_refreshstring/date-time
The time of the last statistics refresh.
- data_updated_atstring/date-time
The last time that Civis Platform captured a change in this table.Only applicable for Redshift tables; please see the Civis help desk for more info.
- schema_updated_atstring/date-time
The last time that Civis Platform captured a change to the table attributes/structure.Only applicable for Redshift tables; please see the Civis help desk for more info.
- refresh_idstring
The ID of the most recent statistics refresh.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- primary_keyslist
The primary keys for this table.
- last_modified_keyslist
The columns indicating an entry’s modification status for this table.
- table_tagslist::
The table tags associated with this table. - id : integer
Table Tag ID
- namestring
Table Tag Name
- ontology_mappingdict
The ontology-key to column-name mapping. See /ontology for the list of valid ontology keys.
- columnslist::
- namestring
Name of the column.
- civis_data_typestring
The generic data type of the column (ex. “string”). Since this is database-agnostic, it may be helpful when loading data to R/Python.
- sql_typestring
The database-specific SQL type of the column (ex. “varchar(30)”).
- sample_valueslist
A sample of values from the column.
- encodingstring
The compression encoding for this columnSee: http://docs.aws.amazon .com/redshift/latest/dg/c_Compression_encodings.html
- descriptionstring
The description of the column, as specified by the table owner
- orderinteger
Relative position of the column in the table.
- min_valuestring
Smallest value in the column.
- max_valuestring
Largest value in the column.
- avg_valuenumber/float
This parameter is deprecated.
- stddevnumber/float
This parameter is deprecated.
- value_distribution_percentdict
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_countinteger
Number of non-null values in the column.
- null_countinteger
Number of null values in the column.
- possible_dependent_variable_typeslist
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_variableboolean
Whether the column may be used as an independent variable to train a model.
- useable_as_primary_keyboolean
Whether the column may be used as an primary key to identify table rows.
- value_distributiondict
An object mapping distinct values in the column to the number of times they appear in the column
- distinct_countinteger
Number of distinct values in the column. NULL values are counted and treated as a single distinct value.
- joinslist::
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
- enhancementslist::
type : string
created_at : string/time
updated_at : string/time
join_id : integer
view_def : string
table_def : string
- outgoing_table_matcheslist::
- source_table_idinteger
Source table
- target_typestring
Target type
- target_idinteger
Target ID
- targetdict::
name : string
- jobdict::
id : integer
name : string
type : string
from_template_id : integer
- statestring
Whether the job is idle, queued, running, cancelled, or failed.
created_at : string/date-time
updated_at : string/date-time
- runslist::
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_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- last_rundict::
id : integer
state : string
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- errorstring
The error message for this run, if present.
- hiddenboolean
The hidden status of the item.
- match_optionsdict::
max_matches : integer
threshold : string
- post_scan(database_id, schema, table_name, *, stats_priority='DEFAULT')¶
Creates and enqueues a single table scanner job on a new table
- Parameters
- database_idinteger
The ID of the database.
- schemastring
The name of the schema containing the table.
- table_namestring
The name of the table.
- stats_prioritystring, optional
When to sync table statistics. Valid Options are the following. Option: ‘flag’ means to flag stats for the next scheduled run of a full table scan on the database. Option: ‘block’ means to block this job on stats syncing. Option: ‘queue’ means to queue a separate job for syncing stats and do not block this job on the queued job. Defaults to ‘flag’
- Returns
civis.response.Response
- job_idinteger
The ID of the job created.
- run_idinteger
The ID of the run created.
- put_projects(id, project_id)¶
Add a Table to a project
- Parameters
- idinteger
The ID of the Table.
- project_idinteger
The ID of the project.
- Returns
- None
Response code 204: success
- put_tags(id, table_tag_id)¶
Add a tag to a table
- Parameters
- idinteger
The ID of the table.
- table_tag_idinteger
The ID of the tag.
- Returns
civis.response.Response
- idinteger
The ID of the table.
- table_tag_idinteger
The ID of the tag.
Templates¶
- class Templates(session_kwargs, client, return_type='civis')¶
Examples
>>> import civis >>> client = civis.APIClient() >>> client.templates.list_reports_shares(...)
Methods
delete_reports_shares_groups
(id, group_id)Revoke the permissions a group has on this object
delete_reports_shares_users
(id, user_id)Revoke the permissions a user has on this object
delete_scripts_projects
(id, project_id)Remove a Script Template from a project
delete_scripts_shares_groups
(id, group_id)Revoke the permissions a group has on this object
delete_scripts_shares_users
(id, user_id)Revoke the permissions a user has on this object
get_reports
(id)Get a Report Template
get_scripts
(id)Get a Script Template
list_reports
(*[, hidden, author, category, ...])List Report Templates
list_reports_dependencies
(id, *[, user_id])List dependent objects for this object
List users and groups permissioned on this object
list_scripts
(*[, hidden, author, category, ...])List Script Templates
list_scripts_dependencies
(id, *[, user_id])List dependent objects for this object
list_scripts_projects
(id, *[, hidden])List the projects a Script Template belongs to
List users and groups permissioned on this object
patch_reports
(id, *[, name, category, ...])Update some attributes of this Report Template
patch_scripts
(id, *[, name, note, ...])Update some attributes of this Script Template
post_reports
(name, code_body, *[, category, ...])Create a Report Template
post_reports_review
(id, status)Review a template for security vulnerability and correctness (admin-only)
post_scripts
(script_id, name, *[, note, ...])Create a Script Template
post_scripts_review
(id, status)Review a template for security vulnerability and correctness (admin-only)
put_reports
(id, name, code_body, *[, ...])Replace all attributes of this Report Template
put_reports_shares_groups
(id, group_ids, ...)Set the permissions groups has on this object
put_reports_shares_users
(id, user_ids, ...)Set the permissions users have on this object
put_reports_transfer
(id, user_id, ...[, ...])Transfer ownership of this object to another user
put_scripts
(id, name, *[, note, ...])Replace all attributes of this Script Template
put_scripts_projects
(id, project_id)Add a Script Template to a project
put_scripts_shares_groups
(id, group_ids, ...)Set the permissions groups has on this object
put_scripts_shares_users
(id, user_ids, ...)Set the permissions users have on this object
put_scripts_transfer
(id, user_id, ...[, ...])Transfer ownership of this object to another user
Revoke the permissions a group has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- group_idinteger
The ID of the group.
- Returns
- None
Response code 204: success
Revoke the permissions a user has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger
The ID of the user.
- Returns
- None
Response code 204: success
- delete_scripts_projects(id, project_id)¶
Remove a Script Template from a project
- Parameters
- idinteger
The ID of the Script Template.
- project_idinteger
The ID of the project.
- Returns
- None
Response code 204: success
Revoke the permissions a group has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- group_idinteger
The ID of the group.
- Returns
- None
Response code 204: success
Revoke the permissions a user has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger
The ID of the user.
- Returns
- None
Response code 204: success
- get_reports(id)¶
Get a Report Template
- Parameters
- idinteger
- Returns
civis.response.Response
id : integer
- namestring
The name of the template.
- categorystring
The category of this report template. Can be left blank. Acceptable values are: dataset-viz
created_at : string/time
updated_at : string/time
- use_countinteger
The number of uses of this template.
- archivedboolean
Whether the template has been archived.
- tech_reviewedboolean
Whether this template has been audited by Civis for security vulnerability and correctness.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- auth_code_urlstring
A URL to the template’s stored code body.
- provide_api_keyboolean
Whether reports based on this template request an API Key from the report viewer.
- hiddenboolean
The hidden status of the item.
- get_scripts(id)¶
Get a Script Template
- Parameters
- idinteger
- Returns
civis.response.Response
id : integer
- publicboolean
If the template is public or not.
- script_idinteger
The id of the script that this template uses.
- script_typestring
The type of the template’s backing script (e.g SQL, Container, Python, R, JavaScript)
- user_contextstring
The user context of the script that this template uses.
- paramslist::
A definition of the parameters that this template’s backing script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- labelstring
The label to present to users when asking them for the value.
- descriptionstring
A short sentence or fragment describing this parameter to the end user.
- typestring
The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom
- requiredboolean
Whether this param is required.
- valuestring
The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- defaultstring
If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- allowed_valueslist
The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}
- namestring
The name of the template.
- categorystring
The category of this template.
- notestring
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_countinteger
The number of uses of this template.
- ui_report_idinteger
The id of the report that this template uses.
- tech_reviewedboolean
Whether this template has been audited by Civis for security vulnerability and correctness.
- archivedboolean
Whether the template has been archived.
- hiddenboolean
The hidden status of the item.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- list_reports(*, hidden='DEFAULT', author='DEFAULT', category='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶
List Report Templates
- Parameters
- hiddenboolean, optional
If specified to be true, returns hidden items. Defaults to false, returning non-hidden items.
- authorstring, optional
If specified, return items from any of these authors. It accepts a comma- separated list of user IDs.
- categorystring, optional
A category to filter results by, one of: dataset-viz
- limitinteger, optional
Number of results to return. Defaults to 50. Maximum allowed is 1000.
- page_numinteger, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstring, optional
The field on which to order the result set. Defaults to name. Must be one of: name, updated_at, created_at.
- order_dirstring, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to asc.
- iteratorbool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
- Returns
civis.response.PaginatedResponse
id : integer
- namestring
The name of the template.
- categorystring
The category of this report template. Can be left blank. Acceptable values are: dataset-viz
created_at : string/time
updated_at : string/time
- use_countinteger
The number of uses of this template.
- archivedboolean
Whether the template has been archived.
- tech_reviewedboolean
Whether this template has been audited by Civis for security vulnerability and correctness.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- list_reports_dependencies(id, *, user_id='DEFAULT')¶
List dependent objects for this object
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger, optional
ID of target user
- Returns
civis.response.Response
- object_typestring
Dependent object type
- fco_typestring
Human readable dependent object type
- idinteger
Dependent object ID
- namestring
Dependent object name, or nil if the requesting user cannot read this object
- permission_levelstring
Permission level of target user (not user’s groups) for dependent object, or null if no target user
- shareableboolean
Whether or not the requesting user can share this object.
List users and groups permissioned on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
- list_scripts(*, hidden='DEFAULT', author='DEFAULT', category='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶
List Script Templates
- Parameters
- hiddenboolean, optional
If specified to be true, returns hidden items. Defaults to false, returning non-hidden items.
- authorstring, optional
If specified, return items from any of these authors. It accepts a comma- separated list of user IDs.
- categorystring, optional
A category to filter results by, one of: import, export, enhancement, model, and script
- limitinteger, optional
Number of results to return. Defaults to 50. Maximum allowed is 1000.
- page_numinteger, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstring, optional
The field on which to order the result set. Defaults to name. Must be one of: name, updated_at, created_at.
- order_dirstring, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to asc.
- iteratorbool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
- Returns
civis.response.PaginatedResponse
id : integer
- publicboolean
If the template is public or not.
- script_idinteger
The id of the script that this template uses.
- user_contextstring
The user context of the script that this template uses.
- namestring
The name of the template.
- categorystring
The category of this template.
created_at : string/time
updated_at : string/time
- use_countinteger
The number of uses of this template.
- ui_report_idinteger
The id of the report that this template uses.
- tech_reviewedboolean
Whether this template has been audited by Civis for security vulnerability and correctness.
- archivedboolean
Whether the template has been archived.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- list_scripts_dependencies(id, *, user_id='DEFAULT')¶
List dependent objects for this object
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger, optional
ID of target user
- Returns
civis.response.Response
- object_typestring
Dependent object type
- fco_typestring
Human readable dependent object type
- idinteger
Dependent object ID
- namestring
Dependent object name, or nil if the requesting user cannot read this object
- permission_levelstring
Permission level of target user (not user’s groups) for dependent object, or null if no target user
- shareableboolean
Whether or not the requesting user can share this object.
- list_scripts_projects(id, *, hidden='DEFAULT')¶
List the projects a Script Template belongs to
- Parameters
- idinteger
The ID of the Script Template.
- hiddenboolean, optional
If specified to be true, returns hidden items. Defaults to false, returning non-hidden items.
- Returns
civis.response.Response
- idinteger
The ID for this project.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- namestring
The name of this project.
- descriptionstring
A description of the project.
- userslist::
Users who can see the project. - id : integer
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
auto_share : boolean
created_at : string/time
updated_at : string/time
- archivedstring
The archival status of the requested item(s).
List users and groups permissioned on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
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
- idinteger
- namestring, optional
The name of the template.
- categorystring, optional
The category of this report template. Can be left blank. Acceptable values are: dataset-viz
- archivedboolean, optional
Whether the template has been archived.
- code_bodystring, optional
The code for the Template body.
- provide_api_keyboolean, optional
Whether reports based on this template request an API Key from the report viewer.
- Returns
civis.response.Response
id : integer
- namestring
The name of the template.
- categorystring
The category of this report template. Can be left blank. Acceptable values are: dataset-viz
created_at : string/time
updated_at : string/time
- use_countinteger
The number of uses of this template.
- archivedboolean
Whether the template has been archived.
- tech_reviewedboolean
Whether this template has been audited by Civis for security vulnerability and correctness.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- auth_code_urlstring
A URL to the template’s stored code body.
- provide_api_keyboolean
Whether reports based on this template request an API Key from the report viewer.
- hiddenboolean
The hidden status of the item.
- patch_scripts(id, *, name='DEFAULT', note='DEFAULT', ui_report_id='DEFAULT', archived='DEFAULT')¶
Update some attributes of this Script Template
- Parameters
- idinteger
- namestring, optional
The name of the template.
- notestring, optional
A note describing what this template is used for; custom scripts created off this template will display this description.
- ui_report_idinteger, optional
The id of the report that this template uses.
- archivedboolean, optional
Whether the template has been archived.
- Returns
civis.response.Response
id : integer
- publicboolean
If the template is public or not.
- script_idinteger
The id of the script that this template uses.
- script_typestring
The type of the template’s backing script (e.g SQL, Container, Python, R, JavaScript)
- user_contextstring
The user context of the script that this template uses.
- paramslist::
A definition of the parameters that this template’s backing script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- labelstring
The label to present to users when asking them for the value.
- descriptionstring
A short sentence or fragment describing this parameter to the end user.
- typestring
The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom
- requiredboolean
Whether this param is required.
- valuestring
The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- defaultstring
If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- allowed_valueslist
The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}
- namestring
The name of the template.
- categorystring
The category of this template.
- notestring
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_countinteger
The number of uses of this template.
- ui_report_idinteger
The id of the report that this template uses.
- tech_reviewedboolean
Whether this template has been audited by Civis for security vulnerability and correctness.
- archivedboolean
Whether the template has been archived.
- hiddenboolean
The hidden status of the item.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- post_reports(name, code_body, *, category='DEFAULT', archived='DEFAULT', provide_api_key='DEFAULT', hidden='DEFAULT')¶
Create a Report Template
- Parameters
- namestring
The name of the template.
- code_bodystring
The code for the Template body.
- categorystring, optional
The category of this report template. Can be left blank. Acceptable values are: dataset-viz
- archivedboolean, optional
Whether the template has been archived.
- provide_api_keyboolean, optional
Whether reports based on this template request an API Key from the report viewer.
- hiddenboolean, optional
The hidden status of the item.
- Returns
civis.response.Response
id : integer
- namestring
The name of the template.
- categorystring
The category of this report template. Can be left blank. Acceptable values are: dataset-viz
created_at : string/time
updated_at : string/time
- use_countinteger
The number of uses of this template.
- archivedboolean
Whether the template has been archived.
- tech_reviewedboolean
Whether this template has been audited by Civis for security vulnerability and correctness.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- auth_code_urlstring
A URL to the template’s stored code body.
- provide_api_keyboolean
Whether reports based on this template request an API Key from the report viewer.
- hiddenboolean
The hidden status of the item.
- post_reports_review(id, status)¶
Review a template for security vulnerability and correctness (admin-only)
- Parameters
- idinteger
The ID of the item.
- statusboolean
Whether this item has been reviewed.
- Returns
civis.response.Response
id : integer
- namestring
The name of the template.
- categorystring
The category of this report template. Can be left blank. Acceptable values are: dataset-viz
created_at : string/time
updated_at : string/time
- use_countinteger
The number of uses of this template.
- archivedboolean
Whether the template has been archived.
- tech_reviewedboolean
Whether this template has been audited by Civis for security vulnerability and correctness.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- auth_code_urlstring
A URL to the template’s stored code body.
- provide_api_keyboolean
Whether reports based on this template request an API Key from the report viewer.
- hiddenboolean
The hidden status of the item.
- post_scripts(script_id, name, *, note='DEFAULT', ui_report_id='DEFAULT', archived='DEFAULT', hidden='DEFAULT')¶
Create a Script Template
- Parameters
- script_idinteger
The id of the script that this template uses.
- namestring
The name of the template.
- notestring, optional
A note describing what this template is used for; custom scripts created off this template will display this description.
- ui_report_idinteger, optional
The id of the report that this template uses.
- archivedboolean, optional
Whether the template has been archived.
- hiddenboolean, optional
The hidden status of the item.
- Returns
civis.response.Response
id : integer
- publicboolean
If the template is public or not.
- script_idinteger
The id of the script that this template uses.
- script_typestring
The type of the template’s backing script (e.g SQL, Container, Python, R, JavaScript)
- user_contextstring
The user context of the script that this template uses.
- paramslist::
A definition of the parameters that this template’s backing script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- labelstring
The label to present to users when asking them for the value.
- descriptionstring
A short sentence or fragment describing this parameter to the end user.
- typestring
The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom
- requiredboolean
Whether this param is required.
- valuestring
The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- defaultstring
If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- allowed_valueslist
The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}
- namestring
The name of the template.
- categorystring
The category of this template.
- notestring
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_countinteger
The number of uses of this template.
- ui_report_idinteger
The id of the report that this template uses.
- tech_reviewedboolean
Whether this template has been audited by Civis for security vulnerability and correctness.
- archivedboolean
Whether the template has been archived.
- hiddenboolean
The hidden status of the item.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- post_scripts_review(id, status)¶
Review a template for security vulnerability and correctness (admin-only)
- Parameters
- idinteger
The ID of the item.
- statusboolean
Whether this item has been reviewed.
- Returns
civis.response.Response
id : integer
- publicboolean
If the template is public or not.
- script_idinteger
The id of the script that this template uses.
- script_typestring
The type of the template’s backing script (e.g SQL, Container, Python, R, JavaScript)
- user_contextstring
The user context of the script that this template uses.
- paramslist::
A definition of the parameters that this template’s backing script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- labelstring
The label to present to users when asking them for the value.
- descriptionstring
A short sentence or fragment describing this parameter to the end user.
- typestring
The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom
- requiredboolean
Whether this param is required.
- valuestring
The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- defaultstring
If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- allowed_valueslist
The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}
- namestring
The name of the template.
- categorystring
The category of this template.
- notestring
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_countinteger
The number of uses of this template.
- ui_report_idinteger
The id of the report that this template uses.
- tech_reviewedboolean
Whether this template has been audited by Civis for security vulnerability and correctness.
- archivedboolean
Whether the template has been archived.
- hiddenboolean
The hidden status of the item.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- put_reports(id, name, code_body, *, category='DEFAULT', archived='DEFAULT', provide_api_key='DEFAULT')¶
Replace all attributes of this Report Template
- Parameters
- idinteger
- namestring
The name of the template.
- code_bodystring
The code for the Template body.
- categorystring, optional
The category of this report template. Can be left blank. Acceptable values are: dataset-viz
- archivedboolean, optional
Whether the template has been archived.
- provide_api_keyboolean, optional
Whether reports based on this template request an API Key from the report viewer.
- Returns
civis.response.Response
id : integer
- namestring
The name of the template.
- categorystring
The category of this report template. Can be left blank. Acceptable values are: dataset-viz
created_at : string/time
updated_at : string/time
- use_countinteger
The number of uses of this template.
- archivedboolean
Whether the template has been archived.
- tech_reviewedboolean
Whether this template has been audited by Civis for security vulnerability and correctness.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- auth_code_urlstring
A URL to the template’s stored code body.
- provide_api_keyboolean
Whether reports based on this template request an API Key from the report viewer.
- hiddenboolean
The hidden status of the item.
Set the permissions groups has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- group_idslist
An array of one or more group IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
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
- idinteger
The ID of the resource that is shared.
- user_idslist
An array of one or more user IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
- put_reports_transfer(id, user_id, include_dependencies, *, email_body='DEFAULT', send_email='DEFAULT')¶
Transfer ownership of this object to another user
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger
ID of target user
- include_dependenciesboolean
Whether or not to give manage permissions on all dependencies
- email_bodystring, optional
Custom body text for e-mail sent on transfer.
- send_emailboolean, optional
Send email to the target user of the transfer?
- Returns
civis.response.Response
- dependencieslist::
Dependent objects for this object - object_type : string
Dependent object type
- fco_typestring
Human readable dependent object type
- idinteger
Dependent object ID
- namestring
Dependent object name, or nil if the requesting user cannot read this object
- permission_levelstring
Permission level of target user (not user’s groups) for dependent object, or null if no target user
- sharedboolean
Whether dependent object was successfully shared with target user
- put_scripts(id, name, *, note='DEFAULT', ui_report_id='DEFAULT', archived='DEFAULT')¶
Replace all attributes of this Script Template
- Parameters
- idinteger
- namestring
The name of the template.
- notestring, optional
A note describing what this template is used for; custom scripts created off this template will display this description.
- ui_report_idinteger, optional
The id of the report that this template uses.
- archivedboolean, optional
Whether the template has been archived.
- Returns
civis.response.Response
id : integer
- publicboolean
If the template is public or not.
- script_idinteger
The id of the script that this template uses.
- script_typestring
The type of the template’s backing script (e.g SQL, Container, Python, R, JavaScript)
- user_contextstring
The user context of the script that this template uses.
- paramslist::
A definition of the parameters that this template’s backing script accepts in the arguments field. - name : string
The variable’s name as used within your code.
- labelstring
The label to present to users when asking them for the value.
- descriptionstring
A short sentence or fragment describing this parameter to the end user.
- typestring
The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom
- requiredboolean
Whether this param is required.
- valuestring
The value you would like to set this param to. Setting this value makes this parameter a fixed param.
- defaultstring
If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.
- allowed_valueslist
The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}
- namestring
The name of the template.
- categorystring
The category of this template.
- notestring
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_countinteger
The number of uses of this template.
- ui_report_idinteger
The id of the report that this template uses.
- tech_reviewedboolean
Whether this template has been audited by Civis for security vulnerability and correctness.
- archivedboolean
Whether the template has been archived.
- hiddenboolean
The hidden status of the item.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- put_scripts_projects(id, project_id)¶
Add a Script Template to a project
- Parameters
- idinteger
The ID of the Script Template.
- project_idinteger
The ID of the project.
- Returns
- None
Response code 204: success
Set the permissions groups has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- group_idslist
An array of one or more group IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
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
- idinteger
The ID of the resource that is shared.
- user_idslist
An array of one or more user IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
- put_scripts_transfer(id, user_id, include_dependencies, *, email_body='DEFAULT', send_email='DEFAULT')¶
Transfer ownership of this object to another user
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger
ID of target user
- include_dependenciesboolean
Whether or not to give manage permissions on all dependencies
- email_bodystring, optional
Custom body text for e-mail sent on transfer.
- send_emailboolean, optional
Send email to the target user of the transfer?
- Returns
civis.response.Response
- dependencieslist::
Dependent objects for this object - object_type : string
Dependent object type
- fco_typestring
Human readable dependent object type
- idinteger
Dependent object ID
- namestring
Dependent object name, or nil if the requesting user cannot read this object
- permission_levelstring
Permission level of target user (not user’s groups) for dependent object, or null if no target user
- sharedboolean
Whether dependent object was successfully shared with target user
Users¶
- class Users(session_kwargs, client, return_type='civis')¶
Examples
>>> import civis >>> client = civis.APIClient() >>> client.users.list(...)
Methods
delete_api_keys
(id, key_id)Revoke the specified API key
Unfavorite an item
Disables Superadmin Mode for the current user
delete_sessions
(id)Terminate all of the user's active sessions (must be an admin or client user admin)
get
(id)Show info about a user
get_api_keys
(id, key_id)Show the specified API key
list
(*[, feature_flag, account_status, ...])List users
list_api_keys
(id, *[, limit, page_num, ...])Show API keys belonging to the specified user
list_me
()Show info about the logged-in user
list_me_favorites
(*[, object_id, ...])List Favorites
UI configuration for logged-in user
patch
(id, *[, name, email, active, ...])Update info about a user (must be an admin or client user admin)
patch_me
(*[, preferences, ...])Update info about the logged-in user
post
(name, email, primary_group_id, user, *)Create a new user (must be an admin or client user admin)
post_api_keys
(id, expires_in, name, *[, ...])Create a new API key belonging to the logged-in user
post_me_favorites
(object_id, object_type)Favorite an item
Enables Superadmin Mode for the current user
post_unsuspend
(id)Unsuspends user
- delete_api_keys(id, key_id)¶
Revoke the specified API key
- Parameters
- idstring
The ID of the user or ‘me’.
- key_idinteger
The ID of the API key.
- Returns
civis.response.Response
- idinteger
The ID of the API key.
- namestring
The name of the API key.
- expires_atstring/date-time
The date and time when the key expired.
- created_atstring/date-time
The date and time when the key was created.
- revoked_atstring/date-time
The date and time when the key was revoked.
- last_used_atstring/date-time
The date and time when the key was last used.
- scopeslist
The scopes which the key is permissioned on.
- use_countinteger
The number of times the key has been used.
- expiredboolean
True if the key has expired.
- activeboolean
True if the key has neither expired nor been revoked.
- constraintslist::
Constraints on the abilities of the created key - constraint : string
The path matcher of the constraint.
- constraint_typestring
The type of constraint (exact/prefix/regex/verb).
- get_allowedboolean
Whether the constraint allows GET requests.
- head_allowedboolean
Whether the constraint allows HEAD requests.
- post_allowedboolean
Whether the constraint allows POST requests.
- put_allowedboolean
Whether the constraint allows PUT requests.
- patch_allowedboolean
Whether the constraint allows PATCH requests.
- delete_allowedboolean
Whether the constraint allows DELETE requests.
- delete_me_favorites(id)¶
Unfavorite an item
- Parameters
- idinteger
The id of the favorite.
- Returns
- None
Response code 204: success
- delete_me_superadmin()¶
Disables Superadmin Mode for the current user
- Returns
civis.response.Response
- idinteger
The ID of this user.
- namestring
This user’s name.
- emailstring
This user’s email address.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- last_checked_announcementsstring/date-time
The date and time at which the user last checked their announcements.
- feature_flagsdict
The feature flag settings for this user.
- roleslist
The roles this user has, listed by slug.
- preferencesdict
This user’s preferences.
- custom_brandingstring
The branding of Platform for this user.
- primary_group_idinteger
The ID of the primary group of this user.
- groupslist::
An array of all the groups this user is in. - id : integer
The ID of this group.
- namestring
The name of this group.
- organization_idinteger
The ID of the organization associated with this group.
- organization_namestring
The name of the organization associated with this group.
- organization_namestring
The name of the organization the user belongs to.
- organization_slugstring
The slug of the organization the user belongs to.
- organization_default_theme_idinteger
The ID of the organizations’s default theme.
- created_atstring/date-time
The date and time when the user was created.
- sign_in_countinteger
The number of times the user has signed in.
- assuming_roleboolean
Whether the user is assuming a role or not.
- assuming_adminboolean
Whether the user is assuming admin.
- assuming_admin_expirationstring/date-time
When the user’s admin role is set to expire.
- superadmin_mode_expirationstring/date-time
The user is in superadmin mode when set to a DateTime. The user is not in superadmin mode when set to null.
- disable_non_compliant_fedramp_featuresboolean
Whether to disable non-compliant fedramp features.
- created_by_idinteger
The ID of the user who created this user.
- last_updated_by_idinteger
The ID of the user who last updated this user.
- delete_sessions(id)¶
Terminate all of the user’s active sessions (must be an admin or client user admin)
- Parameters
- idinteger
The ID of this user.
- Returns
civis.response.Response
- idinteger
The ID of this user.
- userstring
The username of this user.
- namestring
The name of this user.
- emailstring
The email of this user.
- activeboolean
The account status of this user.
- primary_group_idinteger
The ID of the primary group of this user.
- groupslist::
An array of all the groups this user is in. - id : integer
The ID of this group.
- namestring
The name of this group.
- organization_idinteger
The ID of the organization associated with this group.
- organization_namestring
The name of the organization associated with this group.
- citystring
The city of this user.
- statestring
The state of this user.
- time_zonestring
The time zone of this user.
- initialsstring
The initials of this user.
- departmentstring
The department of this user.
- titlestring
The title of this user.
- github_usernamestring
The GitHub username of this user.
- prefers_sms_otpboolean
The preference for phone authorization of this user
- vpn_enabledboolean
The availability of vpn for this user.
- sso_disabledboolean
The availability of SSO for this user.
- otp_required_for_loginboolean
The two factor authentication requirement for this user.
- exempt_from_org_sms_otp_disabledboolean
Whether the user has SMS OTP enabled on an individual level. This field does not matter if the org does not have SMS OTP disabled.
- sms_otp_allowedboolean
Whether the user is allowed to receive two factor authentication codes via SMS.
- robotboolean
Whether the user is a robot.
- phonestring
The phone number of this user.
- organization_slugstring
The slug of the organization the user belongs to.
- organization_sso_disable_capableboolean
The user’s organization’s ability to disable sso for their users.
- organization_login_typestring
The user’s organization’s login type.
- organization_sms_otp_disabledboolean
Whether the user’s organization has SMS OTP disabled.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- created_atstring/date-time
The date and time when the user was created.
- updated_atstring/date-time
The date and time when the user was last updated.
- last_seen_atstring/date-time
The date and time when the user last visited Platform.
- suspendedboolean
Whether the user is suspended due to inactivity.
- created_by_idinteger
The ID of the user who created this user.
- last_updated_by_idinteger
The ID of the user who last updated this user.
- get(id)¶
Show info about a user
- Parameters
- idinteger
The ID of this user.
- Returns
civis.response.Response
- idinteger
The ID of this user.
- userstring
The username of this user.
- namestring
The name of this user.
- emailstring
The email of this user.
- activeboolean
The account status of this user.
- primary_group_idinteger
The ID of the primary group of this user.
- groupslist::
An array of all the groups this user is in. - id : integer
The ID of this group.
- namestring
The name of this group.
- organization_idinteger
The ID of the organization associated with this group.
- organization_namestring
The name of the organization associated with this group.
- citystring
The city of this user.
- statestring
The state of this user.
- time_zonestring
The time zone of this user.
- initialsstring
The initials of this user.
- departmentstring
The department of this user.
- titlestring
The title of this user.
- github_usernamestring
The GitHub username of this user.
- prefers_sms_otpboolean
The preference for phone authorization of this user
- vpn_enabledboolean
The availability of vpn for this user.
- sso_disabledboolean
The availability of SSO for this user.
- otp_required_for_loginboolean
The two factor authentication requirement for this user.
- exempt_from_org_sms_otp_disabledboolean
Whether the user has SMS OTP enabled on an individual level. This field does not matter if the org does not have SMS OTP disabled.
- sms_otp_allowedboolean
Whether the user is allowed to receive two factor authentication codes via SMS.
- robotboolean
Whether the user is a robot.
- phonestring
The phone number of this user.
- organization_slugstring
The slug of the organization the user belongs to.
- organization_sso_disable_capableboolean
The user’s organization’s ability to disable sso for their users.
- organization_login_typestring
The user’s organization’s login type.
- organization_sms_otp_disabledboolean
Whether the user’s organization has SMS OTP disabled.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- created_atstring/date-time
The date and time when the user was created.
- updated_atstring/date-time
The date and time when the user was last updated.
- last_seen_atstring/date-time
The date and time when the user last visited Platform.
- suspendedboolean
Whether the user is suspended due to inactivity.
- created_by_idinteger
The ID of the user who created this user.
- last_updated_by_idinteger
The ID of the user who last updated this user.
- get_api_keys(id, key_id)¶
Show the specified API key
- Parameters
- idstring
The ID of the user or ‘me’.
- key_idinteger
The ID of the API key.
- Returns
civis.response.Response
- idinteger
The ID of the API key.
- namestring
The name of the API key.
- expires_atstring/date-time
The date and time when the key expired.
- created_atstring/date-time
The date and time when the key was created.
- revoked_atstring/date-time
The date and time when the key was revoked.
- last_used_atstring/date-time
The date and time when the key was last used.
- scopeslist
The scopes which the key is permissioned on.
- use_countinteger
The number of times the key has been used.
- expiredboolean
True if the key has expired.
- activeboolean
True if the key has neither expired nor been revoked.
- constraintslist::
Constraints on the abilities of the created key - constraint : string
The path matcher of the constraint.
- constraint_typestring
The type of constraint (exact/prefix/regex/verb).
- get_allowedboolean
Whether the constraint allows GET requests.
- head_allowedboolean
Whether the constraint allows HEAD requests.
- post_allowedboolean
Whether the constraint allows POST requests.
- put_allowedboolean
Whether the constraint allows PUT requests.
- patch_allowedboolean
Whether the constraint allows PATCH requests.
- delete_allowedboolean
Whether the constraint allows DELETE requests.
- list(*, feature_flag='DEFAULT', account_status='DEFAULT', query='DEFAULT', group_id='DEFAULT', group_ids='DEFAULT', organization_id='DEFAULT', exclude_groups='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶
List users
- Parameters
- feature_flagstring, optional
Return users that have a feature flag enabled.
- account_statusstring, optional
The account status by which to filter users. May be one of “active”, “inactive”, or “all”. Defaults to active.
- querystring, optional
Return users who match the given query, based on name, user, email, and id.
- group_idinteger, optional
The ID of the group by which to filter users. Cannot be present if group_ids is.
- group_idsarray, optional
The IDs of the groups by which to filter users. Cannot be present if group_id is.
- organization_idinteger, optional
The ID of the organization by which to filter users.
- exclude_groupsboolean, optional
Whether or to exclude users’ groups. Default: false.
- limitinteger, optional
Number of results to return. Defaults to 20. Maximum allowed is 10000.
- page_numinteger, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstring, optional
The field on which to order the result set. Defaults to name. Must be one of: name, user.
- order_dirstring, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to asc.
- iteratorbool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
- Returns
civis.response.PaginatedResponse
- idinteger
The ID of this user.
- userstring
The username of this user.
- namestring
The name of this user.
- emailstring
The email of this user.
- activeboolean
The account status of this user.
- primary_group_idinteger
The ID of the primary group of this user.
- groupslist::
An array of all the groups this user is in. - id : integer
The ID of this group.
- namestring
The name of this group.
- organization_idinteger
The ID of the organization associated with this group.
- organization_namestring
The name of the organization associated with this group.
- created_atstring/date-time
The date and time when the user was created.
- current_sign_in_atstring/date-time
The date and time when the user’s current session began.
- updated_atstring/date-time
The date and time when the user was last updated.
- last_seen_atstring/date-time
The date and time when the user last visited Platform.
- suspendedboolean
Whether the user is suspended due to inactivity.
- created_by_idinteger
The ID of the user who created this user.
- last_updated_by_idinteger
The ID of the user who last updated this user.
- 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
- idstring
The ID of the user or ‘me’.
- limitinteger, optional
Number of results to return. Defaults to its maximum of 50.
- page_numinteger, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstring, optional
The field on which to order the result set. Defaults to id. Must be one of: id.
- order_dirstring, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iteratorbool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
- Returns
civis.response.PaginatedResponse
- idinteger
The ID of the API key.
- namestring
The name of the API key.
- expires_atstring/date-time
The date and time when the key expired.
- created_atstring/date-time
The date and time when the key was created.
- revoked_atstring/date-time
The date and time when the key was revoked.
- last_used_atstring/date-time
The date and time when the key was last used.
- scopeslist
The scopes which the key is permissioned on.
- use_countinteger
The number of times the key has been used.
- expiredboolean
True if the key has expired.
- activeboolean
True if the key has neither expired nor been revoked.
- constraint_countinteger
The number of constraints on the created key
- list_me()¶
Show info about the logged-in user
- Returns
civis.response.Response
- idinteger
The ID of this user.
- namestring
This user’s name.
- emailstring
This user’s email address.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- last_checked_announcementsstring/date-time
The date and time at which the user last checked their announcements.
- feature_flagsdict
The feature flag settings for this user.
- roleslist
The roles this user has, listed by slug.
- preferencesdict
This user’s preferences.
- custom_brandingstring
The branding of Platform for this user.
- primary_group_idinteger
The ID of the primary group of this user.
- groupslist::
An array of all the groups this user is in. - id : integer
The ID of this group.
- namestring
The name of this group.
- organization_idinteger
The ID of the organization associated with this group.
- organization_namestring
The name of the organization associated with this group.
- organization_namestring
The name of the organization the user belongs to.
- organization_slugstring
The slug of the organization the user belongs to.
- organization_default_theme_idinteger
The ID of the organizations’s default theme.
- created_atstring/date-time
The date and time when the user was created.
- sign_in_countinteger
The number of times the user has signed in.
- assuming_roleboolean
Whether the user is assuming a role or not.
- assuming_adminboolean
Whether the user is assuming admin.
- assuming_admin_expirationstring/date-time
When the user’s admin role is set to expire.
- superadmin_mode_expirationstring/date-time
The user is in superadmin mode when set to a DateTime. The user is not in superadmin mode when set to null.
- disable_non_compliant_fedramp_featuresboolean
Whether to disable non-compliant fedramp features.
- created_by_idinteger
The ID of the user who created this user.
- last_updated_by_idinteger
The ID of the user who last updated this user.
- list_me_favorites(*, object_id='DEFAULT', object_type='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶
List Favorites
- Parameters
- object_idinteger, optional
The id of the object. If specified as a query parameter, must also specify object_type parameter.
- object_typestring, optional
The type of the object that is favorited. Valid options: Project
- limitinteger, optional
Number of results to return. Defaults to 50. Maximum allowed is 1000.
- page_numinteger, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstring, optional
The field on which to order the result set. Defaults to created_at. Must be one of: created_at, object_type, object_id.
- order_dirstring, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iteratorbool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
- Returns
civis.response.PaginatedResponse
- idinteger
The id of the favorite.
- object_idinteger
The id of the object. If specified as a query parameter, must also specify object_type parameter.
- object_typestring
The type of the object that is favorited. Valid options: Project
- object_namestring
The name of the object that is favorited.
- created_atstring/time
The time this favorite was created.
- list_me_ui()¶
UI configuration for logged-in user
- Returns
civis.response.Response
- idinteger
The ID of this user.
- navigation_menusdict
Navigation menus visible to this user.
- user_menusdict
User profile menu items available to this user.
- user_typedict::
- vendorboolean
This attribute is deprecated
- mediaboolean
True if user has access to the Media Optimizer job type.
- main_appstring
This attribute is deprecated
- app_countinteger
This attribute is deprecated
- reports_onlyboolean
True if user is a reports-only user.
- reports_creatorboolean
True if this user is allowed to create HTML reports.
- zendesk_tokenstring
JSON web token for this user’s Zendesk widget.
- patch(id, *, name='DEFAULT', email='DEFAULT', active='DEFAULT', primary_group_id='DEFAULT', city='DEFAULT', state='DEFAULT', time_zone='DEFAULT', initials='DEFAULT', department='DEFAULT', title='DEFAULT', prefers_sms_otp='DEFAULT', group_ids='DEFAULT', vpn_enabled='DEFAULT', sso_disabled='DEFAULT', otp_required_for_login='DEFAULT', exempt_from_org_sms_otp_disabled='DEFAULT', robot='DEFAULT', phone='DEFAULT', password='DEFAULT')¶
Update info about a user (must be an admin or client user admin)
- Parameters
- idinteger
The ID of this user.
- namestring, optional
The name of this user.
- emailstring, optional
The email of this user.
- activeboolean, optional
The account status of this user.
- primary_group_idinteger, optional
The ID of the primary group of this user.
- citystring, optional
The city of this user.
- statestring, optional
The state of this user.
- time_zonestring, optional
The time zone of this user.
- initialsstring, optional
The initials of this user.
- departmentstring, optional
The department of this user.
- titlestring, optional
The title of this user.
- prefers_sms_otpboolean, optional
The preference for phone authorization of this user
- group_idslist, optional
An array of ids of all the groups this user is in.
- vpn_enabledboolean, optional
The availability of vpn for this user.
- sso_disabledboolean, optional
The availability of SSO for this user.
- otp_required_for_loginboolean, optional
The two factor authentication requirement for this user.
- exempt_from_org_sms_otp_disabledboolean, optional
Whether the user has SMS OTP enabled on an individual level. This field does not matter if the org does not have SMS OTP disabled.
- robotboolean, optional
Whether the user is a robot.
- phonestring, optional
The phone number of this user.
- passwordstring, optional
The password of this user.
- Returns
civis.response.Response
- idinteger
The ID of this user.
- userstring
The username of this user.
- namestring
The name of this user.
- emailstring
The email of this user.
- activeboolean
The account status of this user.
- primary_group_idinteger
The ID of the primary group of this user.
- groupslist::
An array of all the groups this user is in. - id : integer
The ID of this group.
- namestring
The name of this group.
- organization_idinteger
The ID of the organization associated with this group.
- organization_namestring
The name of the organization associated with this group.
- citystring
The city of this user.
- statestring
The state of this user.
- time_zonestring
The time zone of this user.
- initialsstring
The initials of this user.
- departmentstring
The department of this user.
- titlestring
The title of this user.
- github_usernamestring
The GitHub username of this user.
- prefers_sms_otpboolean
The preference for phone authorization of this user
- vpn_enabledboolean
The availability of vpn for this user.
- sso_disabledboolean
The availability of SSO for this user.
- otp_required_for_loginboolean
The two factor authentication requirement for this user.
- exempt_from_org_sms_otp_disabledboolean
Whether the user has SMS OTP enabled on an individual level. This field does not matter if the org does not have SMS OTP disabled.
- sms_otp_allowedboolean
Whether the user is allowed to receive two factor authentication codes via SMS.
- robotboolean
Whether the user is a robot.
- phonestring
The phone number of this user.
- organization_slugstring
The slug of the organization the user belongs to.
- organization_sso_disable_capableboolean
The user’s organization’s ability to disable sso for their users.
- organization_login_typestring
The user’s organization’s login type.
- organization_sms_otp_disabledboolean
Whether the user’s organization has SMS OTP disabled.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- created_atstring/date-time
The date and time when the user was created.
- updated_atstring/date-time
The date and time when the user was last updated.
- last_seen_atstring/date-time
The date and time when the user last visited Platform.
- suspendedboolean
Whether the user is suspended due to inactivity.
- created_by_idinteger
The ID of the user who created this user.
- last_updated_by_idinteger
The ID of the user who last updated this user.
- patch_me(*, preferences='DEFAULT', last_checked_announcements='DEFAULT')¶
Update info about the logged-in user
- Parameters
- preferencesdict, optional::
- app_index_order_fieldstring
This attribute is deprecated
- app_index_order_dirstring
This attribute is deprecated
- result_index_order_fieldstring
Order field for the results index page.
- result_index_order_dirstring
Order direction for the results index page.
- result_index_type_filterstring
Type filter for the results index page.
- result_index_author_filterstring
Author filter for the results index page.
- result_index_archived_filterstring
Archived filter for the results index page.
- import_index_order_fieldstring
Order field for the imports index page.
- import_index_order_dirstring
Order direction for the imports index page.
- import_index_type_filterstring
Type filter for the imports index page.
- import_index_author_filterstring
Author filter for the imports index page.
- import_index_dest_filterstring
Destination filter for the imports index page.
- import_index_status_filterstring
Status filter for the imports index page.
- import_index_archived_filterstring
Archived filter for the imports index page.
- export_index_order_fieldstring
Order field for the exports index page.
- export_index_order_dirstring
Order direction for the exports index page.
- export_index_type_filterstring
Type filter for the exports index page.
- export_index_author_filterstring
Author filter for the exports index page.
- export_index_status_filterstring
Status filter for the exports index page.
- model_index_order_fieldstring
Order field for the models index page.
- model_index_order_dirstring
Order direction for the models index page.
- model_index_author_filterstring
Author filter for the models index page.
- model_index_status_filterstring
Status filter for the models index page.
- model_index_archived_filterstring
Archived filter for the models index page.
- model_index_thumbnail_viewstring
Thumbnail view for the models index page.
- script_index_order_fieldstring
Order field for the scripts index page.
- script_index_order_dirstring
Order direction for the scripts index page.
- script_index_type_filterstring
Type filter for the scripts index page.
- script_index_author_filterstring
Author filter for the scripts index page.
- script_index_status_filterstring
Status filter for the scripts index page.
- script_index_archived_filterstring
Archived filter for the scripts index page.
- project_index_order_fieldstring
Order field for the projects index page.
- project_index_order_dirstring
Order direction for the projects index page.
- project_index_author_filterstring
Author filter for the projects index page.
- project_index_archived_filterstring
Archived filter for the projects index page.
- report_index_thumbnail_viewstring
Thumbnail view for the reports index page.
- project_detail_order_fieldstring
Order field for projects detail pages.
- project_detail_order_dirstring
Order direction for projects detail pages.
- project_detail_author_filterstring
Author filter for projects detail pages.
- project_detail_type_filterstring
Type filter for projects detail pages.
- project_detail_archived_filterstring
Archived filter for the projects detail pages.
- enhancement_index_order_fieldstring
Order field for the enhancements index page.
- enhancement_index_order_dirstring
Order direction for the enhancements index page.
- enhancement_index_author_filterstring
Author filter for the enhancements index page.
- enhancement_index_archived_filterstring
Archived filter for the enhancements index page.
- preferred_server_idinteger
ID of preferred server.
- civis_explore_skip_introboolean
Whether the user is shown steps for each exploration.
- registration_index_order_fieldstring
Order field for the registrations index page.
- registration_index_order_dirstring
Order direction for the registrations index page.
- registration_index_status_filterstring
Status filter for the registrations index page.
- upgrade_requestedstring
Whether a free trial upgrade has been requested.
- welcome_order_fieldstring
Order direction for the welcome page.
- welcome_order_dirstring
Order direction for the welcome page.
- welcome_author_filterstring
Status filter for the welcome page.
- welcome_status_filterstring
Status filter for the welcome page.
- welcome_archived_filterstring
Status filter for the welcome page.
- data_pane_widthstring
Width of the data pane when expanded.
- data_pane_collapsedstring
Whether the data pane is collapsed.
- notebook_order_fieldstring
Order field for the notebooks page.
- notebook_order_dirstring
Order direction for the notebooks page.
- notebook_author_filterstring
Author filter for the notebooks page.
- notebook_archived_filterstring
Archived filter for the notebooks page.
- notebook_status_filterstring
Status filter for the notebooks page.
- workflow_index_order_fieldstring
Order field for the workflows page.
- workflow_index_order_dirstring
Order direction for the workflows page.
- workflow_index_author_filterstring
Author filter for the workflows page.
- workflow_index_archived_filterstring
Archived filter for the workflows page.
- service_order_fieldstring
Order field for the services page.
- service_order_dirstring
Order direction for the services page.
- service_author_filterstring
Author filter for the services page.
- service_archived_filterstring
Archived filter for the services page.
- assume_role_historystring
JSON string of previously assumed roles.
- last_checked_announcementsstring/date-time, optional
The date and time at which the user last checked their announcements.
- Returns
civis.response.Response
- idinteger
The ID of this user.
- namestring
This user’s name.
- emailstring
This user’s email address.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- last_checked_announcementsstring/date-time
The date and time at which the user last checked their announcements.
- feature_flagsdict
The feature flag settings for this user.
- roleslist
The roles this user has, listed by slug.
- preferencesdict
This user’s preferences.
- custom_brandingstring
The branding of Platform for this user.
- primary_group_idinteger
The ID of the primary group of this user.
- groupslist::
An array of all the groups this user is in. - id : integer
The ID of this group.
- namestring
The name of this group.
- organization_idinteger
The ID of the organization associated with this group.
- organization_namestring
The name of the organization associated with this group.
- organization_namestring
The name of the organization the user belongs to.
- organization_slugstring
The slug of the organization the user belongs to.
- organization_default_theme_idinteger
The ID of the organizations’s default theme.
- created_atstring/date-time
The date and time when the user was created.
- sign_in_countinteger
The number of times the user has signed in.
- assuming_roleboolean
Whether the user is assuming a role or not.
- assuming_adminboolean
Whether the user is assuming admin.
- assuming_admin_expirationstring/date-time
When the user’s admin role is set to expire.
- superadmin_mode_expirationstring/date-time
The user is in superadmin mode when set to a DateTime. The user is not in superadmin mode when set to null.
- disable_non_compliant_fedramp_featuresboolean
Whether to disable non-compliant fedramp features.
- created_by_idinteger
The ID of the user who created this user.
- last_updated_by_idinteger
The ID of the user who last updated this user.
- post(name, email, primary_group_id, user, *, active='DEFAULT', city='DEFAULT', state='DEFAULT', time_zone='DEFAULT', initials='DEFAULT', department='DEFAULT', title='DEFAULT', prefers_sms_otp='DEFAULT', group_ids='DEFAULT', vpn_enabled='DEFAULT', sso_disabled='DEFAULT', otp_required_for_login='DEFAULT', exempt_from_org_sms_otp_disabled='DEFAULT', robot='DEFAULT', send_email='DEFAULT')¶
Create a new user (must be an admin or client user admin)
- Parameters
- namestring
The name of this user.
- emailstring
The email of this user.
- primary_group_idinteger
The ID of the primary group of this user.
- userstring
The username of this user.
- activeboolean, optional
The account status of this user.
- citystring, optional
The city of this user.
- statestring, optional
The state of this user.
- time_zonestring, optional
The time zone of this user.
- initialsstring, optional
The initials of this user.
- departmentstring, optional
The department of this user.
- titlestring, optional
The title of this user.
- prefers_sms_otpboolean, optional
The preference for phone authorization of this user
- group_idslist, optional
An array of ids of all the groups this user is in.
- vpn_enabledboolean, optional
The availability of vpn for this user.
- sso_disabledboolean, optional
The availability of SSO for this user.
- otp_required_for_loginboolean, optional
The two factor authentication requirement for this user.
- exempt_from_org_sms_otp_disabledboolean, optional
Whether the user has SMS OTP enabled on an individual level. This field does not matter if the org does not have SMS OTP disabled.
- robotboolean, optional
Whether the user is a robot.
- send_emailboolean, optional
Whether the user will receive a welcome email.
- Returns
civis.response.Response
- idinteger
The ID of this user.
- userstring
The username of this user.
- namestring
The name of this user.
- emailstring
The email of this user.
- activeboolean
The account status of this user.
- primary_group_idinteger
The ID of the primary group of this user.
- groupslist::
An array of all the groups this user is in. - id : integer
The ID of this group.
- namestring
The name of this group.
- organization_idinteger
The ID of the organization associated with this group.
- organization_namestring
The name of the organization associated with this group.
- citystring
The city of this user.
- statestring
The state of this user.
- time_zonestring
The time zone of this user.
- initialsstring
The initials of this user.
- departmentstring
The department of this user.
- titlestring
The title of this user.
- github_usernamestring
The GitHub username of this user.
- prefers_sms_otpboolean
The preference for phone authorization of this user
- vpn_enabledboolean
The availability of vpn for this user.
- sso_disabledboolean
The availability of SSO for this user.
- otp_required_for_loginboolean
The two factor authentication requirement for this user.
- exempt_from_org_sms_otp_disabledboolean
Whether the user has SMS OTP enabled on an individual level. This field does not matter if the org does not have SMS OTP disabled.
- sms_otp_allowedboolean
Whether the user is allowed to receive two factor authentication codes via SMS.
- robotboolean
Whether the user is a robot.
- phonestring
The phone number of this user.
- organization_slugstring
The slug of the organization the user belongs to.
- organization_sso_disable_capableboolean
The user’s organization’s ability to disable sso for their users.
- organization_login_typestring
The user’s organization’s login type.
- organization_sms_otp_disabledboolean
Whether the user’s organization has SMS OTP disabled.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
- created_atstring/date-time
The date and time when the user was created.
- updated_atstring/date-time
The date and time when the user was last updated.
- last_seen_atstring/date-time
The date and time when the user last visited Platform.
- suspendedboolean
Whether the user is suspended due to inactivity.
- created_by_idinteger
The ID of the user who created this user.
- last_updated_by_idinteger
The ID of the user who last updated this user.
- post_api_keys(id, expires_in, name, *, constraints='DEFAULT')¶
Create a new API key belonging to the logged-in user
- Parameters
- idstring
The ID of the user or ‘me’.
- expires_ininteger
The number of seconds the key should last for.
- namestring
The name of the API key.
- constraintslist, optional::
Constraints on the abilities of the created key. - constraint : string
The path matcher of the constraint.
- constraint_typestring
The type of constraint (exact/prefix/regex/verb).
- get_allowedboolean
Whether the constraint allows GET requests.
- head_allowedboolean
Whether the constraint allows HEAD requests.
- post_allowedboolean
Whether the constraint allows POST requests.
- put_allowedboolean
Whether the constraint allows PUT requests.
- patch_allowedboolean
Whether the constraint allows PATCH requests.
- delete_allowedboolean
Whether the constraint allows DELETE requests.
- Returns
civis.response.Response
- idinteger
The ID of the API key.
- namestring
The name of the API key.
- expires_atstring/date-time
The date and time when the key expired.
- created_atstring/date-time
The date and time when the key was created.
- revoked_atstring/date-time
The date and time when the key was revoked.
- last_used_atstring/date-time
The date and time when the key was last used.
- scopeslist
The scopes which the key is permissioned on.
- use_countinteger
The number of times the key has been used.
- expiredboolean
True if the key has expired.
- activeboolean
True if the key has neither expired nor been revoked.
- constraintslist::
Constraints on the abilities of the created key - constraint : string
The path matcher of the constraint.
- constraint_typestring
The type of constraint (exact/prefix/regex/verb).
- get_allowedboolean
Whether the constraint allows GET requests.
- head_allowedboolean
Whether the constraint allows HEAD requests.
- post_allowedboolean
Whether the constraint allows POST requests.
- put_allowedboolean
Whether the constraint allows PUT requests.
- patch_allowedboolean
Whether the constraint allows PATCH requests.
- delete_allowedboolean
Whether the constraint allows DELETE requests.
- tokenstring
The API key.
- post_me_favorites(object_id, object_type)¶
Favorite an item
- Parameters
- object_idinteger
The id of the object. If specified as a query parameter, must also specify object_type parameter.
- object_typestring
The type of the object that is favorited. Valid options: Project
- Returns
civis.response.Response
- idinteger
The id of the favorite.
- object_idinteger
The id of the object. If specified as a query parameter, must also specify object_type parameter.
- object_typestring
The type of the object that is favorited. Valid options: Project
- object_namestring
The name of the object that is favorited.
- created_atstring/time
The time this favorite was created.
- post_me_superadmin()¶
Enables Superadmin Mode for the current user
- Returns
civis.response.Response
- idinteger
The ID of this user.
- namestring
This user’s name.
- emailstring
This user’s email address.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- last_checked_announcementsstring/date-time
The date and time at which the user last checked their announcements.
- feature_flagsdict
The feature flag settings for this user.
- roleslist
The roles this user has, listed by slug.
- preferencesdict
This user’s preferences.
- custom_brandingstring
The branding of Platform for this user.
- primary_group_idinteger
The ID of the primary group of this user.
- groupslist::
An array of all the groups this user is in. - id : integer
The ID of this group.
- namestring
The name of this group.
- organization_idinteger
The ID of the organization associated with this group.
- organization_namestring
The name of the organization associated with this group.
- organization_namestring
The name of the organization the user belongs to.
- organization_slugstring
The slug of the organization the user belongs to.
- organization_default_theme_idinteger
The ID of the organizations’s default theme.
- created_atstring/date-time
The date and time when the user was created.
- sign_in_countinteger
The number of times the user has signed in.
- assuming_roleboolean
Whether the user is assuming a role or not.
- assuming_adminboolean
Whether the user is assuming admin.
- assuming_admin_expirationstring/date-time
When the user’s admin role is set to expire.
- superadmin_mode_expirationstring/date-time
The user is in superadmin mode when set to a DateTime. The user is not in superadmin mode when set to null.
- disable_non_compliant_fedramp_featuresboolean
Whether to disable non-compliant fedramp features.
- created_by_idinteger
The ID of the user who created this user.
- last_updated_by_idinteger
The ID of the user who last updated this user.
- post_unsuspend(id)¶
Unsuspends user
- Parameters
- idinteger
The ID of this user.
- Returns
civis.response.Response
- idinteger
The ID of this user.
- userstring
The username of this user.
- unlocked_atstring/date-time
The time the user’s account was unsuspended
Workflows¶
- class Workflows(session_kwargs, client, return_type='civis')¶
Examples
>>> import civis >>> client = civis.APIClient() >>> client.workflows.list(...)
Methods
delete_projects
(id, project_id)Remove a Workflow from a project
delete_shares_groups
(id, group_id)Revoke the permissions a group has on this object
delete_shares_users
(id, user_id)Revoke the permissions a user has on this object
get
(id)Get a Workflow
get_executions
(id, execution_id)Get a workflow execution
get_executions_tasks
(id, execution_id, task_name)Get a task of a workflow execution
get_git_commits
(id, commit_hash)Get file contents at git ref
list
(*[, hidden, archived, author, state, ...])List Workflows
list_dependencies
(id, *[, user_id])List dependent objects for this object
list_executions
(id, *[, limit, page_num, ...])List workflow executions
list_git
(id)Get the git metadata attached to an item
list_git_commits
(id)Get the git commits for an item on the current branch
list_projects
(id, *[, hidden])List the projects a Workflow belongs to
list_shares
(id)List users and groups permissioned on this object
patch
(id, *[, name, description, ...])Update some attributes of this Workflow
patch_git
(id, *[, git_ref, git_branch, ...])Update an attached git file
post
(name, *[, description, from_job_chain, ...])Create a Workflow
post_clone
(id, *[, clone_schedule, ...])Clone this Workflow
post_executions
(id, *[, target_task, input, ...])Execute a workflow
post_executions_cancel
(id, execution_id)Cancel a workflow execution
post_executions_resume
(id, execution_id)Resume a paused workflow execution
post_executions_retry
(id, execution_id, *[, ...])Retry a failed task, or all failed tasks in an execution
Checkout content that the existing git_ref points to and save to the object
Checkout latest commit on the current branch of a script or workflow
post_git_commits
(id, content, message, file_hash)Commit and push a new version of the file
put
(id, name, *[, description, definition, ...])Replace all attributes of this Workflow
put_archive
(id, status)Update the archive status of this object
put_git
(id, *[, git_ref, git_branch, ...])Attach an item to a file in a git repo
put_projects
(id, project_id)Add a Workflow to a project
put_shares_groups
(id, group_ids, ...[, ...])Set the permissions groups has on this object
put_shares_users
(id, user_ids, ...[, ...])Set the permissions users have on this object
put_transfer
(id, user_id, ...[, email_body, ...])Transfer ownership of this object to another user
- delete_projects(id, project_id)¶
Remove a Workflow from a project
- Parameters
- idinteger
The ID of the Workflow.
- project_idinteger
The ID of the project.
- Returns
- None
Response code 204: success
Revoke the permissions a group has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- group_idinteger
The ID of the group.
- Returns
- None
Response code 204: success
Revoke the permissions a user has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger
The ID of the user.
- Returns
- None
Response code 204: success
- get(id)¶
Get a Workflow
- Parameters
- idinteger
- Returns
civis.response.Response
- idinteger
The ID for this workflow.
- namestring
The name of this workflow.
- descriptionstring
A description of the workflow.
- definitionstring
The definition of the workflow in YAML format. Must not be specified if fromJobChain is specified.
- validboolean
The validity of the workflow definition.
- validation_errorsstring
The errors encountered when validating the workflow definition.
- file_idstring
The file id for the s3 file containing the workflow configuration.
- userdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- statestring
The state of the workflow. State is “running” if any execution is running, otherwise reflects most recent execution state.
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- allow_concurrent_executionsboolean
Whether the workflow can execute when already running.
- time_zonestring
The time zone of this workflow.
- next_execution_atstring/time
The time of the next scheduled execution.
- notificationsdict::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on
- failure_onboolean
If failure email notifications are on
- archivedstring
The archival status of the requested item(s).
- hiddenboolean
The hidden status of the item.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
created_at : string/time
updated_at : string/time
- get_executions(id, execution_id)¶
Get a workflow execution
- Parameters
- idinteger
The ID for the workflow.
- execution_idinteger
The ID for the workflow execution.
- Returns
civis.response.Response
- idinteger
The ID for this workflow execution.
- statestring
The state of this workflow execution.
- mistral_statestring
The state of this workflow as reported by mistral. One of running, paused, success, error, or cancelled
- mistral_state_infostring
The state info of this workflow as reported by mistral.
- userdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- definitionstring
The definition of the workflow for this execution.
- inputdict
Key-value pairs defined for this execution.
- included_taskslist
The subset of workflow tasks selected to execute.
- taskslist::
The tasks associated with this execution. - name : string
The name of the task.
- mistral_statestring
The state of this task. One of idle, waiting, running, delayed, success, error, or cancelled
- mistral_state_infostring
Extra info associated with the state of the task.
- runslist::
The runs associated with this task, in descending order by id. - id : integer
The ID of the run.
- job_idinteger
The ID of the job associated with the run.
- statestring
The state of the run.
- executionslist::
The executions run by this task, in descending order by id. - id : integer
The ID of the execution.
- workflow_idinteger
The ID of the workflow associated with the execution.
- started_atstring/time
The time this execution started.
- finished_atstring/time
The time this execution finished.
- created_atstring/time
The time this execution was created.
- updated_atstring/time
The time this execution was last updated.
- get_executions_tasks(id, execution_id, task_name)¶
Get a task of a workflow execution
- Parameters
- idinteger
The ID for the workflow.
- execution_idinteger
The ID for the workflow execution.
- task_namestring
The URL-encoded name of the task.
- Returns
civis.response.Response
- namestring
The name of the task.
- mistral_statestring
The state of this task. One of idle, waiting, running, delayed, success, error, or cancelled
- mistral_state_infostring
Extra info associated with the state of the task.
- runslist::
The runs associated with this task, in descending order by id. - id : integer
The ID of the run.
- job_idinteger
The ID of the job associated with the run.
- statestring
The state of the run.
- created_atstring/time
The time that the run was queued.
- started_atstring/time
The time that the run started.
- finished_atstring/time
The time that the run completed.
- executionslist::
The executions run by this task, in descending order by id. - id : integer
The ID of the execution.
- workflow_idinteger
The ID of the workflow associated with the execution.
- statestring
The state of this workflow execution.
- created_atstring/time
The time this execution was created.
- started_atstring/time
The time this execution started.
- finished_atstring/time
The time this execution finished.
- get_git_commits(id, commit_hash)¶
Get file contents at git ref
- Parameters
- idinteger
The ID of the file.
- commit_hashstring
The SHA (full or shortened) of the desired git commit.
- Returns
civis.response.Response
- contentstring
The file’s contents.
- typestring
The file’s type.
- sizeinteger
The file’s size.
- file_hashstring
The SHA of the file.
- list(*, hidden='DEFAULT', archived='DEFAULT', author='DEFAULT', state='DEFAULT', scheduled='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶
List Workflows
- Parameters
- hiddenboolean, optional
If specified to be true, returns hidden items. Defaults to false, returning non-hidden items.
- archivedstring, optional
The archival status of the requested item(s).
- authorstring, optional
If specified, return items from any of these authors. It accepts a comma- separated list of user IDs.
- statearray, optional
State of the most recent execution.One or more of queued, running, succeeded, failed, cancelled, idle, and scheduled.
- scheduledboolean, optional
If the workflow is scheduled.
- limitinteger, optional
Number of results to return. Defaults to 20. Maximum allowed is 50.
- page_numinteger, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstring, optional
The field on which to order the result set. Defaults to updated_at. Must be one of: updated_at, name, created_at.
- order_dirstring, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iteratorbool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
- Returns
civis.response.PaginatedResponse
- idinteger
The ID for this workflow.
- namestring
The name of this workflow.
- descriptionstring
A description of the workflow.
- validboolean
The validity of the workflow definition.
- file_idstring
The file id for the s3 file containing the workflow configuration.
- userdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- statestring
The state of the workflow. State is “running” if any execution is running, otherwise reflects most recent execution state.
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- allow_concurrent_executionsboolean
Whether the workflow can execute when already running.
- time_zonestring
The time zone of this workflow.
- next_execution_atstring/time
The time of the next scheduled execution.
- archivedstring
The archival status of the requested item(s).
created_at : string/time
updated_at : string/time
- list_dependencies(id, *, user_id='DEFAULT')¶
List dependent objects for this object
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger, optional
ID of target user
- Returns
civis.response.Response
- object_typestring
Dependent object type
- fco_typestring
Human readable dependent object type
- idinteger
Dependent object ID
- namestring
Dependent object name, or nil if the requesting user cannot read this object
- permission_levelstring
Permission level of target user (not user’s groups) for dependent object, or null if no target user
- shareableboolean
Whether or not the requesting user can share this object.
- list_executions(id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')¶
List workflow executions
- Parameters
- idinteger
The ID for this workflow.
- limitinteger, optional
Number of results to return. Defaults to 20. Maximum allowed is 50.
- page_numinteger, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstring, optional
The field on which to order the result set. Defaults to id. Must be one of: id, updated_at, created_at.
- order_dirstring, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iteratorbool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
- Returns
civis.response.PaginatedResponse
- idinteger
The ID for this workflow execution.
- statestring
The state of this workflow execution.
- mistral_statestring
The state of this workflow as reported by mistral. One of running, paused, success, error, or cancelled
- mistral_state_infostring
The state info of this workflow as reported by mistral.
- userdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- started_atstring/time
The time this execution started.
- finished_atstring/time
The time this execution finished.
- created_atstring/time
The time this execution was created.
- updated_atstring/time
The time this execution was last updated.
- list_git(id)¶
Get the git metadata attached to an item
- Parameters
- idinteger
The ID of the file.
- Returns
civis.response.Response
- git_refstring
A git reference specifying an unambiguous version of the file. Can be a branch name, tag or the full or shortened SHA of a commit.
- git_branchstring
The git branch that the file is on.
- git_pathstring
The path of the file in the repository.
- git_repodict::
- idinteger
The ID for this git repository.
- repo_urlstring
The URL for this git repository.
created_at : string/time
updated_at : string/time
- git_ref_typestring
Specifies if the file is versioned by branch or tag.
- pull_from_gitboolean
Automatically pull latest commit from git. Only works for scripts and workflows (assuming you have the feature enabled)
- list_git_commits(id)¶
Get the git commits for an item on the current branch
- Parameters
- idinteger
The ID of the file.
- Returns
civis.response.Response
- commit_hashstring
The SHA of the commit.
- author_namestring
The name of the commit’s author.
- datestring/time
The commit’s timestamp.
- messagestring
The commit message.
- list_projects(id, *, hidden='DEFAULT')¶
List the projects a Workflow belongs to
- Parameters
- idinteger
The ID of the Workflow.
- hiddenboolean, optional
If specified to be true, returns hidden items. Defaults to false, returning non-hidden items.
- Returns
civis.response.Response
- idinteger
The ID for this project.
- authordict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- namestring
The name of this project.
- descriptionstring
A description of the project.
- userslist::
Users who can see the project. - id : integer
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
auto_share : boolean
created_at : string/time
updated_at : string/time
- archivedstring
The archival status of the requested item(s).
List users and groups permissioned on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
- patch(id, *, name='DEFAULT', description='DEFAULT', definition='DEFAULT', schedule='DEFAULT', allow_concurrent_executions='DEFAULT', time_zone='DEFAULT', notifications='DEFAULT')¶
Update some attributes of this Workflow
- Parameters
- idinteger
The ID for this workflow.
- namestring, optional
The name of this workflow.
- descriptionstring, optional
A description of the workflow.
- definitionstring, optional
The definition of the workflow in YAML format. Must not be specified if fromJobChain is specified.
- scheduledict, optional::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- allow_concurrent_executionsboolean, optional
Whether the workflow can execute when already running.
- time_zonestring, optional
The time zone of this workflow.
- notificationsdict, optional::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on
- failure_onboolean
If failure email notifications are on
- Returns
civis.response.Response
- idinteger
The ID for this workflow.
- namestring
The name of this workflow.
- descriptionstring
A description of the workflow.
- definitionstring
The definition of the workflow in YAML format. Must not be specified if fromJobChain is specified.
- validboolean
The validity of the workflow definition.
- validation_errorsstring
The errors encountered when validating the workflow definition.
- file_idstring
The file id for the s3 file containing the workflow configuration.
- userdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- statestring
The state of the workflow. State is “running” if any execution is running, otherwise reflects most recent execution state.
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- allow_concurrent_executionsboolean
Whether the workflow can execute when already running.
- time_zonestring
The time zone of this workflow.
- next_execution_atstring/time
The time of the next scheduled execution.
- notificationsdict::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on
- failure_onboolean
If failure email notifications are on
- archivedstring
The archival status of the requested item(s).
- hiddenboolean
The hidden status of the item.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
created_at : string/time
updated_at : string/time
- patch_git(id, *, git_ref='DEFAULT', git_branch='DEFAULT', git_path='DEFAULT', git_repo_url='DEFAULT', git_ref_type='DEFAULT', pull_from_git='DEFAULT')¶
Update an attached git file
- Parameters
- idinteger
The ID of the file.
- git_refstring, optional
A git reference specifying an unambiguous version of the file. Can be a branch name, or the full or shortened SHA of a commit.
- git_branchstring, optional
The git branch that the file is on.
- git_pathstring, optional
The path of the file in the repository.
- git_repo_urlstring, optional
The URL of the git repository.
- git_ref_typestring, optional
Specifies if the file is versioned by branch or tag.
- pull_from_gitboolean, optional
Automatically pull latest commit from git. Only works for scripts.
- Returns
civis.response.Response
- git_refstring
A git reference specifying an unambiguous version of the file. Can be a branch name, tag or the full or shortened SHA of a commit.
- git_branchstring
The git branch that the file is on.
- git_pathstring
The path of the file in the repository.
- git_repodict::
- idinteger
The ID for this git repository.
- repo_urlstring
The URL for this git repository.
created_at : string/time
updated_at : string/time
- git_ref_typestring
Specifies if the file is versioned by branch or tag.
- pull_from_gitboolean
Automatically pull latest commit from git. Only works for scripts and workflows (assuming you have the feature enabled)
- post(name, *, description='DEFAULT', from_job_chain='DEFAULT', definition='DEFAULT', schedule='DEFAULT', allow_concurrent_executions='DEFAULT', time_zone='DEFAULT', notifications='DEFAULT', hidden='DEFAULT')¶
Create a Workflow
- Parameters
- namestring
The name of this workflow.
- descriptionstring, optional
A description of the workflow.
- from_job_chaininteger, optional
If specified, create a workflow from the job chain this job is in, and inherit the schedule from the root of the chain.
- definitionstring, optional
The definition of the workflow in YAML format. Must not be specified if fromJobChain is specified.
- scheduledict, optional::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- allow_concurrent_executionsboolean, optional
Whether the workflow can execute when already running.
- time_zonestring, optional
The time zone of this workflow.
- notificationsdict, optional::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on
- failure_onboolean
If failure email notifications are on
- hiddenboolean, optional
The hidden status of the item.
- Returns
civis.response.Response
- idinteger
The ID for this workflow.
- namestring
The name of this workflow.
- descriptionstring
A description of the workflow.
- definitionstring
The definition of the workflow in YAML format. Must not be specified if fromJobChain is specified.
- validboolean
The validity of the workflow definition.
- validation_errorsstring
The errors encountered when validating the workflow definition.
- file_idstring
The file id for the s3 file containing the workflow configuration.
- userdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- statestring
The state of the workflow. State is “running” if any execution is running, otherwise reflects most recent execution state.
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- allow_concurrent_executionsboolean
Whether the workflow can execute when already running.
- time_zonestring
The time zone of this workflow.
- next_execution_atstring/time
The time of the next scheduled execution.
- notificationsdict::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on
- failure_onboolean
If failure email notifications are on
- archivedstring
The archival status of the requested item(s).
- hiddenboolean
The hidden status of the item.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
created_at : string/time
updated_at : string/time
- post_clone(id, *, clone_schedule='DEFAULT', clone_notifications='DEFAULT')¶
Clone this Workflow
- Parameters
- idinteger
The ID for the workflow.
- clone_scheduleboolean, optional
If true, also copy the schedule to the new workflow.
- clone_notificationsboolean, optional
If true, also copy the notifications to the new workflow.
- Returns
civis.response.Response
- idinteger
The ID for this workflow.
- namestring
The name of this workflow.
- descriptionstring
A description of the workflow.
- definitionstring
The definition of the workflow in YAML format. Must not be specified if fromJobChain is specified.
- validboolean
The validity of the workflow definition.
- validation_errorsstring
The errors encountered when validating the workflow definition.
- file_idstring
The file id for the s3 file containing the workflow configuration.
- userdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- statestring
The state of the workflow. State is “running” if any execution is running, otherwise reflects most recent execution state.
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- allow_concurrent_executionsboolean
Whether the workflow can execute when already running.
- time_zonestring
The time zone of this workflow.
- next_execution_atstring/time
The time of the next scheduled execution.
- notificationsdict::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on
- failure_onboolean
If failure email notifications are on
- archivedstring
The archival status of the requested item(s).
- hiddenboolean
The hidden status of the item.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
created_at : string/time
updated_at : string/time
- post_executions(id, *, target_task='DEFAULT', input='DEFAULT', included_tasks='DEFAULT')¶
Execute a workflow
- Parameters
- idinteger
The ID for the workflow.
- target_taskstring, optional
For a reverse workflow, the name of the task to target.
- inputdict, optional
Key-value pairs to send to this execution as inputs.
- included_taskslist, optional
If specified, executes only the subset of workflow tasks included as specified by task name.
- Returns
civis.response.Response
- idinteger
The ID for this workflow execution.
- statestring
The state of this workflow execution.
- mistral_statestring
The state of this workflow as reported by mistral. One of running, paused, success, error, or cancelled
- mistral_state_infostring
The state info of this workflow as reported by mistral.
- userdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- definitionstring
The definition of the workflow for this execution.
- inputdict
Key-value pairs defined for this execution.
- included_taskslist
The subset of workflow tasks selected to execute.
- taskslist::
The tasks associated with this execution. - name : string
The name of the task.
- mistral_statestring
The state of this task. One of idle, waiting, running, delayed, success, error, or cancelled
- mistral_state_infostring
Extra info associated with the state of the task.
- runslist::
The runs associated with this task, in descending order by id. - id : integer
The ID of the run.
- job_idinteger
The ID of the job associated with the run.
- statestring
The state of the run.
- executionslist::
The executions run by this task, in descending order by id. - id : integer
The ID of the execution.
- workflow_idinteger
The ID of the workflow associated with the execution.
- started_atstring/time
The time this execution started.
- finished_atstring/time
The time this execution finished.
- created_atstring/time
The time this execution was created.
- updated_atstring/time
The time this execution was last updated.
- post_executions_cancel(id, execution_id)¶
Cancel a workflow execution
- Parameters
- idinteger
The ID for the workflow.
- execution_idinteger
The ID for the workflow execution.
- Returns
civis.response.Response
- idinteger
The ID for this workflow execution.
- statestring
The state of this workflow execution.
- mistral_statestring
The state of this workflow as reported by mistral. One of running, paused, success, error, or cancelled
- mistral_state_infostring
The state info of this workflow as reported by mistral.
- userdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- definitionstring
The definition of the workflow for this execution.
- inputdict
Key-value pairs defined for this execution.
- included_taskslist
The subset of workflow tasks selected to execute.
- taskslist::
The tasks associated with this execution. - name : string
The name of the task.
- mistral_statestring
The state of this task. One of idle, waiting, running, delayed, success, error, or cancelled
- mistral_state_infostring
Extra info associated with the state of the task.
- runslist::
The runs associated with this task, in descending order by id. - id : integer
The ID of the run.
- job_idinteger
The ID of the job associated with the run.
- statestring
The state of the run.
- executionslist::
The executions run by this task, in descending order by id. - id : integer
The ID of the execution.
- workflow_idinteger
The ID of the workflow associated with the execution.
- started_atstring/time
The time this execution started.
- finished_atstring/time
The time this execution finished.
- created_atstring/time
The time this execution was created.
- updated_atstring/time
The time this execution was last updated.
- post_executions_resume(id, execution_id)¶
Resume a paused workflow execution
- Parameters
- idinteger
The ID for the workflow.
- execution_idinteger
The ID for the workflow execution.
- Returns
civis.response.Response
- idinteger
The ID for this workflow execution.
- statestring
The state of this workflow execution.
- mistral_statestring
The state of this workflow as reported by mistral. One of running, paused, success, error, or cancelled
- mistral_state_infostring
The state info of this workflow as reported by mistral.
- userdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- definitionstring
The definition of the workflow for this execution.
- inputdict
Key-value pairs defined for this execution.
- included_taskslist
The subset of workflow tasks selected to execute.
- taskslist::
The tasks associated with this execution. - name : string
The name of the task.
- mistral_statestring
The state of this task. One of idle, waiting, running, delayed, success, error, or cancelled
- mistral_state_infostring
Extra info associated with the state of the task.
- runslist::
The runs associated with this task, in descending order by id. - id : integer
The ID of the run.
- job_idinteger
The ID of the job associated with the run.
- statestring
The state of the run.
- executionslist::
The executions run by this task, in descending order by id. - id : integer
The ID of the execution.
- workflow_idinteger
The ID of the workflow associated with the execution.
- started_atstring/time
The time this execution started.
- finished_atstring/time
The time this execution finished.
- created_atstring/time
The time this execution was created.
- updated_atstring/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
- idinteger
The ID for the workflow.
- execution_idinteger
The ID for the workflow execution.
- task_namestring, optional
If specified, the name of the task to be retried. If not specified, all failed tasks in the execution will be retried.
- Returns
civis.response.Response
- idinteger
The ID for this workflow execution.
- statestring
The state of this workflow execution.
- mistral_statestring
The state of this workflow as reported by mistral. One of running, paused, success, error, or cancelled
- mistral_state_infostring
The state info of this workflow as reported by mistral.
- userdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- definitionstring
The definition of the workflow for this execution.
- inputdict
Key-value pairs defined for this execution.
- included_taskslist
The subset of workflow tasks selected to execute.
- taskslist::
The tasks associated with this execution. - name : string
The name of the task.
- mistral_statestring
The state of this task. One of idle, waiting, running, delayed, success, error, or cancelled
- mistral_state_infostring
Extra info associated with the state of the task.
- runslist::
The runs associated with this task, in descending order by id. - id : integer
The ID of the run.
- job_idinteger
The ID of the job associated with the run.
- statestring
The state of the run.
- executionslist::
The executions run by this task, in descending order by id. - id : integer
The ID of the execution.
- workflow_idinteger
The ID of the workflow associated with the execution.
- started_atstring/time
The time this execution started.
- finished_atstring/time
The time this execution finished.
- created_atstring/time
The time this execution was created.
- updated_atstring/time
The time this execution was last updated.
- post_git_checkout(id)¶
Checkout content that the existing git_ref points to and save to the object
- Parameters
- idinteger
The ID of the file.
- Returns
civis.response.Response
- contentstring
The file’s contents.
- typestring
The file’s type.
- sizeinteger
The file’s size.
- file_hashstring
The SHA of the file.
- post_git_checkout_latest(id)¶
Checkout latest commit on the current branch of a script or workflow
- Parameters
- idinteger
The ID of the file.
- Returns
civis.response.Response
- contentstring
The file’s contents.
- typestring
The file’s type.
- sizeinteger
The file’s size.
- file_hashstring
The SHA of the file.
- post_git_commits(id, content, message, file_hash)¶
Commit and push a new version of the file
- Parameters
- idinteger
The ID of the file.
- contentstring
The contents to commit to the file.
- messagestring
A commit message describing the changes being made.
- file_hashstring
The full SHA of the file being replaced.
- Returns
civis.response.Response
- contentstring
The file’s contents.
- typestring
The file’s type.
- sizeinteger
The file’s size.
- file_hashstring
The SHA of the file.
- put(id, name, *, description='DEFAULT', definition='DEFAULT', schedule='DEFAULT', allow_concurrent_executions='DEFAULT', time_zone='DEFAULT', notifications='DEFAULT')¶
Replace all attributes of this Workflow
- Parameters
- idinteger
The ID for this workflow.
- namestring
The name of this workflow.
- descriptionstring, optional
A description of the workflow.
- definitionstring, optional
The definition of the workflow in YAML format. Must not be specified if fromJobChain is specified.
- scheduledict, optional::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- allow_concurrent_executionsboolean, optional
Whether the workflow can execute when already running.
- time_zonestring, optional
The time zone of this workflow.
- notificationsdict, optional::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on
- failure_onboolean
If failure email notifications are on
- Returns
civis.response.Response
- idinteger
The ID for this workflow.
- namestring
The name of this workflow.
- descriptionstring
A description of the workflow.
- definitionstring
The definition of the workflow in YAML format. Must not be specified if fromJobChain is specified.
- validboolean
The validity of the workflow definition.
- validation_errorsstring
The errors encountered when validating the workflow definition.
- file_idstring
The file id for the s3 file containing the workflow configuration.
- userdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- statestring
The state of the workflow. State is “running” if any execution is running, otherwise reflects most recent execution state.
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- allow_concurrent_executionsboolean
Whether the workflow can execute when already running.
- time_zonestring
The time zone of this workflow.
- next_execution_atstring/time
The time of the next scheduled execution.
- notificationsdict::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on
- failure_onboolean
If failure email notifications are on
- archivedstring
The archival status of the requested item(s).
- hiddenboolean
The hidden status of the item.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
created_at : string/time
updated_at : string/time
- put_archive(id, status)¶
Update the archive status of this object
- Parameters
- idinteger
The ID of the object.
- statusboolean
The desired archived status of the object.
- Returns
civis.response.Response
- idinteger
The ID for this workflow.
- namestring
The name of this workflow.
- descriptionstring
A description of the workflow.
- definitionstring
The definition of the workflow in YAML format. Must not be specified if fromJobChain is specified.
- validboolean
The validity of the workflow definition.
- validation_errorsstring
The errors encountered when validating the workflow definition.
- file_idstring
The file id for the s3 file containing the workflow configuration.
- userdict::
- idinteger
The ID of this user.
- namestring
This user’s name.
- usernamestring
This user’s username.
- initialsstring
This user’s initials.
- onlineboolean
Whether this user is online.
- statestring
The state of the workflow. State is “running” if any execution is running, otherwise reflects most recent execution state.
- scheduledict::
- scheduledboolean
If the item is scheduled.
- scheduled_dayslist
Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth
- scheduled_hourslist
Hours of the day it is scheduled on.
- scheduled_minuteslist
Minutes of the day it is scheduled on.
- scheduled_runs_per_hourinteger
Alternative to scheduled minutes, number of times to run per hour.
- scheduled_days_of_monthlist
Days of the month it is scheduled on, mutually exclusive with scheduledDays.
- allow_concurrent_executionsboolean
Whether the workflow can execute when already running.
- time_zonestring
The time zone of this workflow.
- next_execution_atstring/time
The time of the next scheduled execution.
- notificationsdict::
- urlslist
URLs to receive a POST request at job completion
- success_email_subjectstring
Custom subject line for success e-mail.
- success_email_bodystring
Custom body text for success e-mail, written in Markdown.
- success_email_addresseslist
Addresses to notify by e-mail when the job completes successfully.
- failure_email_addresseslist
Addresses to notify by e-mail when the job fails.
- stall_warning_minutesinteger
Stall warning emails will be sent after this amount of minutes.
- success_onboolean
If success email notifications are on
- failure_onboolean
If failure email notifications are on
- archivedstring
The archival status of the requested item(s).
- hiddenboolean
The hidden status of the item.
- my_permission_levelstring
Your permission level on the object. One of “read”, “write”, or “manage”.
created_at : string/time
updated_at : string/time
- put_git(id, *, git_ref='DEFAULT', git_branch='DEFAULT', git_path='DEFAULT', git_repo_url='DEFAULT', git_ref_type='DEFAULT', pull_from_git='DEFAULT')¶
Attach an item to a file in a git repo
- Parameters
- idinteger
The ID of the file.
- git_refstring, optional
A git reference specifying an unambiguous version of the file. Can be a branch name, or the full or shortened SHA of a commit.
- git_branchstring, optional
The git branch that the file is on.
- git_pathstring, optional
The path of the file in the repository.
- git_repo_urlstring, optional
The URL of the git repository.
- git_ref_typestring, optional
Specifies if the file is versioned by branch or tag.
- pull_from_gitboolean, optional
Automatically pull latest commit from git. Only works for scripts.
- Returns
civis.response.Response
- git_refstring
A git reference specifying an unambiguous version of the file. Can be a branch name, tag or the full or shortened SHA of a commit.
- git_branchstring
The git branch that the file is on.
- git_pathstring
The path of the file in the repository.
- git_repodict::
- idinteger
The ID for this git repository.
- repo_urlstring
The URL for this git repository.
created_at : string/time
updated_at : string/time
- git_ref_typestring
Specifies if the file is versioned by branch or tag.
- pull_from_gitboolean
Automatically pull latest commit from git. Only works for scripts and workflows (assuming you have the feature enabled)
- put_projects(id, project_id)¶
Add a Workflow to a project
- Parameters
- idinteger
The ID of the Workflow.
- project_idinteger
The ID of the project.
- Returns
- None
Response code 204: success
Set the permissions groups has on this object
- Parameters
- idinteger
The ID of the resource that is shared.
- group_idslist
An array of one or more group IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
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
- idinteger
The ID of the resource that is shared.
- user_idslist
An array of one or more user IDs.
- permission_levelstring
Options are: “read”, “write”, or “manage”.
- share_email_bodystring, optional
Custom body text for e-mail sent on a share.
- send_shared_emailboolean, optional
Send email to the recipients of a share.
- Returns
civis.response.Response
- readersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- writersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- ownersdict::
- userslist::
id : integer
name : string
- groupslist::
id : integer
name : string
- total_user_sharesinteger
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesinteger
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
- put_transfer(id, user_id, include_dependencies, *, email_body='DEFAULT', send_email='DEFAULT')¶
Transfer ownership of this object to another user
- Parameters
- idinteger
The ID of the resource that is shared.
- user_idinteger
ID of target user
- include_dependenciesboolean
Whether or not to give manage permissions on all dependencies
- email_bodystring, optional
Custom body text for e-mail sent on transfer.
- send_emailboolean, optional
Send email to the target user of the transfer?
- Returns
civis.response.Response
- dependencieslist::
Dependent objects for this object - object_type : string
Dependent object type
- fco_typestring
Human readable dependent object type
- idinteger
Dependent object ID
- namestring
Dependent object name, or nil if the requesting user cannot read this object
- permission_levelstring
Permission level of target user (not user’s groups) for dependent object, or null if no target user
- sharedboolean
Whether dependent object was successfully shared with target user