Services
- class Services(session_kwargs, client, return_type='raw')
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
Examples
>>> import civis >>> client = civis.APIClient() >>> client.services.list(...)
- delete_deployments(service_id: int, deployment_id: int)
Delete a Service deployment
- Parameters:
- service_idint
The ID of the owning Service
- deployment_idint
The ID for this deployment
- Returns:
- None
Response code 204: success
- delete_projects(id: int, project_id: int)
Remove a Service from a project
- Parameters:
- idint
The ID of the Service.
- project_idint
The ID of the project.
- Returns:
- None
Response code 204: success
Revoke the permissions a group has on this object
- Parameters:
- idint
The ID of the resource that is shared.
- group_idint
The ID of the group.
- Returns:
- None
Response code 204: success
Revoke the permissions a user has on this object
- Parameters:
- idint
The ID of the resource that is shared.
- user_idint
The ID of the user.
- Returns:
- None
Response code 204: success
- delete_tokens(id: int, token_id: int)
Revoke a token by id
- Parameters:
- idint
The ID of the service.
- token_idint
The ID of the token.
- Returns:
- None
Response code 204: success
- get(id: int)
Get a Service
- Parameters:
- idint
- Returns:
civis.response.Response
- idint
The ID for this Service.
- namestr
The name of this Service.
- descriptionstr
The description of this Service.
- userdict
- idint
The ID of this user.
- namestr
This user’s name.
- usernamestr
This user’s username.
- initialsstr
This user’s initials.
- onlinebool
Whether this user is online.
- typestr
The type of this Service
- docker_image_namestr
The name of the docker image to pull from DockerHub.
- docker_image_tagstr
The tag of the docker image to pull from DockerHub (default: latest).
- scheduledict
- runtime_planstr
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[dict]
List of day-hour combinations this item is scheduled for
- scheduled_daysList[int]
Days it is scheduled on, based on numeric value starting at 0 for Sunday
- scheduled_hoursList[int]
Hours it is scheduled on
time_zone : str
- replicasint
The number of Service replicas to deploy. When maxReplicas is set, this field defines the minimum number of replicas to deploy.
- max_replicasint
The maximum number of Service replicas to deploy. Defining this field enables autoscaling.
- instance_typestr
The EC2 instance type to deploy to.
- memoryint
The amount of memory allocated to each replica of the Service.
- cpuint
The amount of cpu allocated to each replica of the the Service.
created_at : str (time)
updated_at : str (time)
- credentialsList[int]
A list of credential IDs to pass to the Service.
- permission_set_idint
The ID of the associated permission set, if any.
- git_repo_urlstr
The url for the git repo where the Service code lives.
- git_repo_refstr
The git reference to use when pulling code from the repo.
- git_path_dirstr
The path to the Service code within the git repo. If unspecified, the root directory will be used.
- report_idint
The ID of the associated report.
- current_deploymentdict
- deployment_idint
The ID for this deployment.
- user_idint
The ID of the owner.
- hoststr
Domain of the deployment.
- namestr
Name of the deployment.
- docker_image_namestr
The name of the docker image to pull from DockerHub.
- docker_image_tagstr
The tag of the docker image to pull from DockerHub (default: latest).
- display_urlstr
A signed URL for viewing the deployed item.
- instance_typestr
The EC2 instance type requested for the deployment.
- memoryint
The memory allocated to the deployment, in MB.
- cpuint
The cpu allocated to the deployment, in millicores.
- statestr
The state of the deployment.
- state_messagestr
A detailed description of the state.
- max_memory_usagefloat (float)
If the deployment has finished, the maximum amount of memory used during the deployment, in MB.
- max_cpu_usagefloat (float)
If the deployment has finished, the maximum amount of cpu used during the deployment, in millicores.
created_at : str (time)
updated_at : str (time)
- service_idint
The ID of owning Service
- current_urlstr
The URL that the service is hosted at.
- environment_variablesdict
Environment Variables to be passed into the Service.
- notificationsdict
- failure_email_addressesList[str]
Addresses to notify by e-mail when the service fails.
- failure_onbool
If failure email notifications are on
- partition_labelstr
The partition label used to run this object.
- my_permission_levelstr
Your permission level on the object. One of “read”, “write”, or “manage”.
- archivedstr
The archival status of the requested item(s).
- hiddenbool
The hidden status of the item.
- get_deployments(service_id: int, deployment_id: int)
Get details about a Service deployment
- Parameters:
- service_idint
The ID of the owning Service
- deployment_idint
The ID for this deployment
- Returns:
civis.response.Response
- deployment_idint
The ID for this deployment.
- user_idint
The ID of the owner.
- hoststr
Domain of the deployment.
- namestr
Name of the deployment.
- docker_image_namestr
The name of the docker image to pull from DockerHub.
- docker_image_tagstr
The tag of the docker image to pull from DockerHub (default: latest).
- display_urlstr
A signed URL for viewing the deployed item.
- instance_typestr
The EC2 instance type requested for the deployment.
- memoryint
The memory allocated to the deployment, in MB.
- cpuint
The cpu allocated to the deployment, in millicores.
- statestr
The state of the deployment.
- state_messagestr
A detailed description of the state.
- max_memory_usagefloat (float)
If the deployment has finished, the maximum amount of memory used during the deployment, in MB.
- max_cpu_usagefloat (float)
If the deployment has finished, the maximum amount of cpu used during the deployment, in millicores.
created_at : str (time)
updated_at : str (time)
- service_idint
The ID of owning Service
- list(*, hidden: bool = None, archived: str = None, author: str = None, status: str = None, limit: int = None, page_num: int = None, order: str = None, order_dir: str = None, iterator: bool = None)
List Services
- Parameters:
- hiddenbool, optional
If specified to be true, returns hidden items. Defaults to false, returning non-hidden items.
- archivedstr, optional
The archival status of the requested item(s).
- authorstr, optional
If specified, return items from any of these authors. It accepts a comma- separated list of user IDs.
- statusstr, optional
If specified, returns Services with one of these statuses. It accepts a comma-separated list, possible values are ‘running’, ‘idle’.
- limitint, optional
Number of results to return. Defaults to 20. Maximum allowed is 50.
- page_numint, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstr, optional
The field on which to order the result set. Defaults to updated_at. Must be one of: updated_at, name, created_at.
- order_dirstr, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iteratorbool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
- Returns:
civis.response.PaginatedResponse
- idint
The ID for this Service.
- namestr
The name of this Service.
- descriptionstr
The description of this Service.
- userdict
- idint
The ID of this user.
- namestr
This user’s name.
- usernamestr
This user’s username.
- initialsstr
This user’s initials.
- onlinebool
Whether this user is online.
- typestr
The type of this Service
created_at : str (time)
updated_at : str (time)
- git_repo_urlstr
The url for the git repo where the Service code lives.
- git_repo_refstr
The git reference to use when pulling code from the repo.
- git_path_dirstr
The path to the Service code within the git repo. If unspecified, the root directory will be used.
- current_deploymentdict
- deployment_idint
The ID for this deployment.
- user_idint
The ID of the owner.
- hoststr
Domain of the deployment.
- namestr
Name of the deployment.
- docker_image_namestr
The name of the docker image to pull from DockerHub.
- docker_image_tagstr
The tag of the docker image to pull from DockerHub (default: latest).
- instance_typestr
The EC2 instance type requested for the deployment.
- memoryint
The memory allocated to the deployment, in MB.
- cpuint
The cpu allocated to the deployment, in millicores.
- statestr
The state of the deployment.
- state_messagestr
A detailed description of the state.
- max_memory_usagefloat (float)
If the deployment has finished, the maximum amount of memory used during the deployment, in MB.
- max_cpu_usagefloat (float)
If the deployment has finished, the maximum amount of cpu used during the deployment, in millicores.
created_at : str (time)
updated_at : str (time)
- service_idint
The ID of owning Service
- archivedstr
The archival status of the requested item(s).
- list_dependencies(id: int, *, user_id: int = None)
List dependent objects for this object
- Parameters:
- idint
The ID of the resource that is shared.
- user_idint, optional
ID of target user
- Returns:
civis.response.Response
- object_typestr
Dependent object type
- fco_typestr
Human readable dependent object type
- idint
Dependent object ID
- namestr
Dependent object name, or nil if the requesting user cannot read this object
- permission_levelstr
Permission level of target user (not user’s groups) for dependent object. Null if no target user or not shareable (e.g. a database table).
- descriptionstr
Additional information about the dependency, if relevant
- shareablebool
Whether or not the requesting user can share this object.
- list_deployments(service_id: int, *, deployment_id: int = None, limit: int = None, page_num: int = None, order: str = None, order_dir: str = None, iterator: bool = None)
List deployments for a Service
- Parameters:
- service_idint
The ID of the owning Service
- deployment_idint, optional
The ID for this deployment
- limitint, optional
Number of results to return. Defaults to 20. Maximum allowed is 50.
- page_numint, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstr, optional
The field on which to order the result set. Defaults to created_at. Must be one of: created_at.
- order_dirstr, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iteratorbool, optional
If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.
- Returns:
civis.response.PaginatedResponse
- deployment_idint
The ID for this deployment.
- user_idint
The ID of the owner.
- hoststr
Domain of the deployment.
- namestr
Name of the deployment.
- docker_image_namestr
The name of the docker image to pull from DockerHub.
- docker_image_tagstr
The tag of the docker image to pull from DockerHub (default: latest).
- instance_typestr
The EC2 instance type requested for the deployment.
- memoryint
The memory allocated to the deployment, in MB.
- cpuint
The cpu allocated to the deployment, in millicores.
- statestr
The state of the deployment.
- state_messagestr
A detailed description of the state.
- max_memory_usagefloat (float)
If the deployment has finished, the maximum amount of memory used during the deployment, in MB.
- max_cpu_usagefloat (float)
If the deployment has finished, the maximum amount of cpu used during the deployment, in millicores.
created_at : str (time)
updated_at : str (time)
- service_idint
The ID of owning Service
- list_deployments_logs(id: int, deployment_id: int, *, start_at: str = None, end_at: str = None, limit: int = None)
Get the logs for a Service deployment
- Parameters:
- idint
The ID of the owning Service.
- deployment_idint
The ID for this deployment.
- start_atstr, optional
Log entries with a lower timestamp will be omitted.
- end_atstr, optional
Log entries with a higher timestamp will be omitted.
- limitint, optional
The maximum number of log messages to return. Default of 10000.
- Returns:
civis.response.Response
- messagestr
The log message.
- streamstr
The stream of the log. One of “stdout”, “stderr”.
- created_atstr (date-time)
The time the log was created.
- sourcestr
The source of the log. One of “system”, “user”.
- list_projects(id: int, *, hidden: bool = None)
List the projects a Service belongs to
- Parameters:
- idint
The ID of the Service.
- hiddenbool, optional
If specified to be true, returns hidden items. Defaults to false, returning non-hidden items.
- Returns:
civis.response.Response
- idint
The ID for this project.
- authordict
- idint
The ID of this user.
- namestr
This user’s name.
- usernamestr
This user’s username.
- initialsstr
This user’s initials.
- onlinebool
Whether this user is online.
- namestr
The name of this project.
- descriptionstr
A description of the project.
- usersList[dict]
Users who can see the project.
- idint
The ID of this user.
- namestr
This user’s name.
- usernamestr
This user’s username.
- initialsstr
This user’s initials.
- onlinebool
Whether this user is online.
auto_share : bool
created_at : str (time)
updated_at : str (time)
- archivedstr
The archival status of the requested item(s).
List users and groups permissioned on this object
- Parameters:
- idint
The ID of the resource that is shared.
- Returns:
civis.response.Response
- readersdict
- usersList[dict]
id : int
name : str
- groupsList[dict]
id : int
name : str
- writersdict
- usersList[dict]
id : int
name : str
- groupsList[dict]
id : int
name : str
- ownersdict
- usersList[dict]
id : int
name : str
- groupsList[dict]
id : int
name : str
- total_user_sharesint
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesint
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
- list_tokens(id: int)
List tokens
- Parameters:
- idint
The ID of the service.
- Returns:
civis.response.Response
- idint
The ID of the token.
- namestr
The name of the token.
- userdict
- idint
The ID of this user.
- namestr
This user’s name.
- usernamestr
This user’s username.
- initialsstr
This user’s initials.
- onlinebool
Whether this user is online.
- machine_tokenbool
If true, this token is not tied to a particular user.
- expires_atstr (date-time)
The date and time when the token expires.
- created_atstr (time)
The date and time when the token was created.
- patch(id: int, *, name: str = None, description: str = None, docker_image_name: str = None, docker_image_tag: str = None, schedule: dict = None, replicas: int = None, max_replicas: int = None, instance_type: str = None, memory: int = None, cpu: int = None, credentials: List[int] = None, permission_set_id: int = None, git_repo_url: str = None, git_repo_ref: str = None, git_path_dir: str = None, environment_variables: dict = None, notifications: dict = None, partition_label: str = None)
Update some attributes of this Service
- Parameters:
- idint
The ID for this Service.
- namestr, optional
The name of this Service.
- descriptionstr, optional
The description of this Service.
- docker_image_namestr, optional
The name of the docker image to pull from DockerHub.
- docker_image_tagstr, optional
The tag of the docker image to pull from DockerHub (default: latest).
- scheduledict, optional
- runtime_planstr
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[dict]
List of day-hour combinations this item is scheduled for
- scheduled_daysList[int]
Days it is scheduled on, based on numeric value starting at 0 for Sunday
- scheduled_hoursList[int]
Hours it is scheduled on
- replicasint, optional
The number of Service replicas to deploy. When maxReplicas is set, this field defines the minimum number of replicas to deploy.
- max_replicasint, optional
The maximum number of Service replicas to deploy. Defining this field enables autoscaling.
- instance_typestr, optional
The EC2 instance type to deploy to.
- memoryint, optional
The amount of memory allocated to each replica of the Service.
- cpuint, optional
The amount of cpu allocated to each replica of the the Service.
- credentialsList[int], optional
A list of credential IDs to pass to the Service.
- permission_set_idint, optional
The ID of the associated permission set, if any.
- git_repo_urlstr, optional
The url for the git repo where the Service code lives.
- git_repo_refstr, optional
The git reference to use when pulling code from the repo.
- git_path_dirstr, 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[str]
Addresses to notify by e-mail when the service fails.
- failure_onbool
If failure email notifications are on
- partition_labelstr, optional
The partition label used to run this object.
- Returns:
civis.response.Response
- idint
The ID for this Service.
- namestr
The name of this Service.
- descriptionstr
The description of this Service.
- userdict
- idint
The ID of this user.
- namestr
This user’s name.
- usernamestr
This user’s username.
- initialsstr
This user’s initials.
- onlinebool
Whether this user is online.
- typestr
The type of this Service
- docker_image_namestr
The name of the docker image to pull from DockerHub.
- docker_image_tagstr
The tag of the docker image to pull from DockerHub (default: latest).
- scheduledict
- runtime_planstr
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[dict]
List of day-hour combinations this item is scheduled for
- scheduled_daysList[int]
Days it is scheduled on, based on numeric value starting at 0 for Sunday
- scheduled_hoursList[int]
Hours it is scheduled on
time_zone : str
- replicasint
The number of Service replicas to deploy. When maxReplicas is set, this field defines the minimum number of replicas to deploy.
- max_replicasint
The maximum number of Service replicas to deploy. Defining this field enables autoscaling.
- instance_typestr
The EC2 instance type to deploy to.
- memoryint
The amount of memory allocated to each replica of the Service.
- cpuint
The amount of cpu allocated to each replica of the the Service.
created_at : str (time)
updated_at : str (time)
- credentialsList[int]
A list of credential IDs to pass to the Service.
- permission_set_idint
The ID of the associated permission set, if any.
- git_repo_urlstr
The url for the git repo where the Service code lives.
- git_repo_refstr
The git reference to use when pulling code from the repo.
- git_path_dirstr
The path to the Service code within the git repo. If unspecified, the root directory will be used.
- report_idint
The ID of the associated report.
- current_deploymentdict
- deployment_idint
The ID for this deployment.
- user_idint
The ID of the owner.
- hoststr
Domain of the deployment.
- namestr
Name of the deployment.
- docker_image_namestr
The name of the docker image to pull from DockerHub.
- docker_image_tagstr
The tag of the docker image to pull from DockerHub (default: latest).
- display_urlstr
A signed URL for viewing the deployed item.
- instance_typestr
The EC2 instance type requested for the deployment.
- memoryint
The memory allocated to the deployment, in MB.
- cpuint
The cpu allocated to the deployment, in millicores.
- statestr
The state of the deployment.
- state_messagestr
A detailed description of the state.
- max_memory_usagefloat (float)
If the deployment has finished, the maximum amount of memory used during the deployment, in MB.
- max_cpu_usagefloat (float)
If the deployment has finished, the maximum amount of cpu used during the deployment, in millicores.
created_at : str (time)
updated_at : str (time)
- service_idint
The ID of owning Service
- current_urlstr
The URL that the service is hosted at.
- environment_variablesdict
Environment Variables to be passed into the Service.
- notificationsdict
- failure_email_addressesList[str]
Addresses to notify by e-mail when the service fails.
- failure_onbool
If failure email notifications are on
- partition_labelstr
The partition label used to run this object.
- my_permission_levelstr
Your permission level on the object. One of “read”, “write”, or “manage”.
- archivedstr
The archival status of the requested item(s).
- hiddenbool
The hidden status of the item.
- post(*, name: str = None, description: str = None, type: str = None, docker_image_name: str = None, docker_image_tag: str = None, schedule: dict = None, replicas: int = None, max_replicas: int = None, instance_type: str = None, memory: int = None, cpu: int = None, credentials: List[int] = None, permission_set_id: int = None, git_repo_url: str = None, git_repo_ref: str = None, git_path_dir: str = None, environment_variables: dict = None, notifications: dict = None, partition_label: str = None, hidden: bool = None)
Create a Service
- Parameters:
- namestr, optional
The name of this Service.
- descriptionstr, optional
The description of this Service.
- typestr, optional
The type of this Service
- docker_image_namestr, optional
The name of the docker image to pull from DockerHub.
- docker_image_tagstr, optional
The tag of the docker image to pull from DockerHub (default: latest).
- scheduledict, optional
- runtime_planstr
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[dict]
List of day-hour combinations this item is scheduled for
- scheduled_daysList[int]
Days it is scheduled on, based on numeric value starting at 0 for Sunday
- scheduled_hoursList[int]
Hours it is scheduled on
- replicasint, optional
The number of Service replicas to deploy. When maxReplicas is set, this field defines the minimum number of replicas to deploy.
- max_replicasint, optional
The maximum number of Service replicas to deploy. Defining this field enables autoscaling.
- instance_typestr, optional
The EC2 instance type to deploy to.
- memoryint, optional
The amount of memory allocated to each replica of the Service.
- cpuint, optional
The amount of cpu allocated to each replica of the the Service.
- credentialsList[int], optional
A list of credential IDs to pass to the Service.
- permission_set_idint, optional
The ID of the associated permission set, if any.
- git_repo_urlstr, optional
The url for the git repo where the Service code lives.
- git_repo_refstr, optional
The git reference to use when pulling code from the repo.
- git_path_dirstr, 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[str]
Addresses to notify by e-mail when the service fails.
- failure_onbool
If failure email notifications are on
- partition_labelstr, optional
The partition label used to run this object.
- hiddenbool, optional
The hidden status of the item.
- Returns:
civis.response.Response
- idint
The ID for this Service.
- namestr
The name of this Service.
- descriptionstr
The description of this Service.
- userdict
- idint
The ID of this user.
- namestr
This user’s name.
- usernamestr
This user’s username.
- initialsstr
This user’s initials.
- onlinebool
Whether this user is online.
- typestr
The type of this Service
- docker_image_namestr
The name of the docker image to pull from DockerHub.
- docker_image_tagstr
The tag of the docker image to pull from DockerHub (default: latest).
- scheduledict
- runtime_planstr
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[dict]
List of day-hour combinations this item is scheduled for
- scheduled_daysList[int]
Days it is scheduled on, based on numeric value starting at 0 for Sunday
- scheduled_hoursList[int]
Hours it is scheduled on
time_zone : str
- replicasint
The number of Service replicas to deploy. When maxReplicas is set, this field defines the minimum number of replicas to deploy.
- max_replicasint
The maximum number of Service replicas to deploy. Defining this field enables autoscaling.
- instance_typestr
The EC2 instance type to deploy to.
- memoryint
The amount of memory allocated to each replica of the Service.
- cpuint
The amount of cpu allocated to each replica of the the Service.
created_at : str (time)
updated_at : str (time)
- credentialsList[int]
A list of credential IDs to pass to the Service.
- permission_set_idint
The ID of the associated permission set, if any.
- git_repo_urlstr
The url for the git repo where the Service code lives.
- git_repo_refstr
The git reference to use when pulling code from the repo.
- git_path_dirstr
The path to the Service code within the git repo. If unspecified, the root directory will be used.
- report_idint
The ID of the associated report.
- current_deploymentdict
- deployment_idint
The ID for this deployment.
- user_idint
The ID of the owner.
- hoststr
Domain of the deployment.
- namestr
Name of the deployment.
- docker_image_namestr
The name of the docker image to pull from DockerHub.
- docker_image_tagstr
The tag of the docker image to pull from DockerHub (default: latest).
- display_urlstr
A signed URL for viewing the deployed item.
- instance_typestr
The EC2 instance type requested for the deployment.
- memoryint
The memory allocated to the deployment, in MB.
- cpuint
The cpu allocated to the deployment, in millicores.
- statestr
The state of the deployment.
- state_messagestr
A detailed description of the state.
- max_memory_usagefloat (float)
If the deployment has finished, the maximum amount of memory used during the deployment, in MB.
- max_cpu_usagefloat (float)
If the deployment has finished, the maximum amount of cpu used during the deployment, in millicores.
created_at : str (time)
updated_at : str (time)
- service_idint
The ID of owning Service
- current_urlstr
The URL that the service is hosted at.
- environment_variablesdict
Environment Variables to be passed into the Service.
- notificationsdict
- failure_email_addressesList[str]
Addresses to notify by e-mail when the service fails.
- failure_onbool
If failure email notifications are on
- partition_labelstr
The partition label used to run this object.
- my_permission_levelstr
Your permission level on the object. One of “read”, “write”, or “manage”.
- archivedstr
The archival status of the requested item(s).
- hiddenbool
The hidden status of the item.
- post_clone(id: int)
Clone this Service
- Parameters:
- idint
- Returns:
civis.response.Response
- idint
The ID for this Service.
- namestr
The name of this Service.
- descriptionstr
The description of this Service.
- userdict
- idint
The ID of this user.
- namestr
This user’s name.
- usernamestr
This user’s username.
- initialsstr
This user’s initials.
- onlinebool
Whether this user is online.
- typestr
The type of this Service
- docker_image_namestr
The name of the docker image to pull from DockerHub.
- docker_image_tagstr
The tag of the docker image to pull from DockerHub (default: latest).
- scheduledict
- runtime_planstr
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[dict]
List of day-hour combinations this item is scheduled for
- scheduled_daysList[int]
Days it is scheduled on, based on numeric value starting at 0 for Sunday
- scheduled_hoursList[int]
Hours it is scheduled on
time_zone : str
- replicasint
The number of Service replicas to deploy. When maxReplicas is set, this field defines the minimum number of replicas to deploy.
- max_replicasint
The maximum number of Service replicas to deploy. Defining this field enables autoscaling.
- instance_typestr
The EC2 instance type to deploy to.
- memoryint
The amount of memory allocated to each replica of the Service.
- cpuint
The amount of cpu allocated to each replica of the the Service.
created_at : str (time)
updated_at : str (time)
- credentialsList[int]
A list of credential IDs to pass to the Service.
- permission_set_idint
The ID of the associated permission set, if any.
- git_repo_urlstr
The url for the git repo where the Service code lives.
- git_repo_refstr
The git reference to use when pulling code from the repo.
- git_path_dirstr
The path to the Service code within the git repo. If unspecified, the root directory will be used.
- report_idint
The ID of the associated report.
- current_deploymentdict
- deployment_idint
The ID for this deployment.
- user_idint
The ID of the owner.
- hoststr
Domain of the deployment.
- namestr
Name of the deployment.
- docker_image_namestr
The name of the docker image to pull from DockerHub.
- docker_image_tagstr
The tag of the docker image to pull from DockerHub (default: latest).
- display_urlstr
A signed URL for viewing the deployed item.
- instance_typestr
The EC2 instance type requested for the deployment.
- memoryint
The memory allocated to the deployment, in MB.
- cpuint
The cpu allocated to the deployment, in millicores.
- statestr
The state of the deployment.
- state_messagestr
A detailed description of the state.
- max_memory_usagefloat (float)
If the deployment has finished, the maximum amount of memory used during the deployment, in MB.
- max_cpu_usagefloat (float)
If the deployment has finished, the maximum amount of cpu used during the deployment, in millicores.
created_at : str (time)
updated_at : str (time)
- service_idint
The ID of owning Service
- current_urlstr
The URL that the service is hosted at.
- environment_variablesdict
Environment Variables to be passed into the Service.
- notificationsdict
- failure_email_addressesList[str]
Addresses to notify by e-mail when the service fails.
- failure_onbool
If failure email notifications are on
- partition_labelstr
The partition label used to run this object.
- my_permission_levelstr
Your permission level on the object. One of “read”, “write”, or “manage”.
- archivedstr
The archival status of the requested item(s).
- hiddenbool
The hidden status of the item.
- post_deployments(service_id: int, *, deployment_id: int = None)
Deploy a Service
- Parameters:
- service_idint
The ID of the owning Service
- deployment_idint, optional
The ID for this deployment
- Returns:
civis.response.Response
- deployment_idint
The ID for this deployment.
- user_idint
The ID of the owner.
- hoststr
Domain of the deployment.
- namestr
Name of the deployment.
- docker_image_namestr
The name of the docker image to pull from DockerHub.
- docker_image_tagstr
The tag of the docker image to pull from DockerHub (default: latest).
- display_urlstr
A signed URL for viewing the deployed item.
- instance_typestr
The EC2 instance type requested for the deployment.
- memoryint
The memory allocated to the deployment, in MB.
- cpuint
The cpu allocated to the deployment, in millicores.
- statestr
The state of the deployment.
- state_messagestr
A detailed description of the state.
- max_memory_usagefloat (float)
If the deployment has finished, the maximum amount of memory used during the deployment, in MB.
- max_cpu_usagefloat (float)
If the deployment has finished, the maximum amount of cpu used during the deployment, in millicores.
created_at : str (time)
updated_at : str (time)
- service_idint
The ID of owning Service
- post_redeploy(service_id: int, *, deployment_id: int = None)
Redeploy a Service
- Parameters:
- service_idint
The ID of the owning Service
- deployment_idint, optional
The ID for this deployment
- Returns:
civis.response.Response
- deployment_idint
The ID for this deployment.
- user_idint
The ID of the owner.
- hoststr
Domain of the deployment.
- namestr
Name of the deployment.
- docker_image_namestr
The name of the docker image to pull from DockerHub.
- docker_image_tagstr
The tag of the docker image to pull from DockerHub (default: latest).
- display_urlstr
A signed URL for viewing the deployed item.
- instance_typestr
The EC2 instance type requested for the deployment.
- memoryint
The memory allocated to the deployment, in MB.
- cpuint
The cpu allocated to the deployment, in millicores.
- statestr
The state of the deployment.
- state_messagestr
A detailed description of the state.
- max_memory_usagefloat (float)
If the deployment has finished, the maximum amount of memory used during the deployment, in MB.
- max_cpu_usagefloat (float)
If the deployment has finished, the maximum amount of cpu used during the deployment, in millicores.
created_at : str (time)
updated_at : str (time)
- service_idint
The ID of owning Service
- post_tokens(id: int, name: str, *, machine_token: bool = None, expires_in: int = None)
Create a new long-lived service token
- Parameters:
- idint
The ID of the service.
- namestr
The name of the token.
- machine_tokenbool, optional
If true, create a compact token with no user information.
- expires_inint, optional
The number of seconds until the token should expire
- Returns:
civis.response.Response
- idint
The ID of the token.
- namestr
The name of the token.
- userdict
- idint
The ID of this user.
- namestr
This user’s name.
- usernamestr
This user’s username.
- initialsstr
This user’s initials.
- onlinebool
Whether this user is online.
- machine_tokenbool
If true, this token is not tied to a particular user.
- expires_atstr (date-time)
The date and time when the token expires.
- created_atstr (time)
The date and time when the token was created.
- tokenstr
The value of the token. Only returned when the token is first created.
- put(id: int, *, name: str = None, description: str = None, docker_image_name: str = None, docker_image_tag: str = None, schedule: dict = None, replicas: int = None, max_replicas: int = None, instance_type: str = None, memory: int = None, cpu: int = None, credentials: List[int] = None, permission_set_id: int = None, git_repo_url: str = None, git_repo_ref: str = None, git_path_dir: str = None, environment_variables: dict = None, notifications: dict = None, partition_label: str = None)
Replace all attributes of this Service
- Parameters:
- idint
The ID for this Service.
- namestr, optional
The name of this Service.
- descriptionstr, optional
The description of this Service.
- docker_image_namestr, optional
The name of the docker image to pull from DockerHub.
- docker_image_tagstr, optional
The tag of the docker image to pull from DockerHub (default: latest).
- scheduledict, optional
- runtime_planstr
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[dict]
List of day-hour combinations this item is scheduled for
- scheduled_daysList[int]
Days it is scheduled on, based on numeric value starting at 0 for Sunday
- scheduled_hoursList[int]
Hours it is scheduled on
- replicasint, optional
The number of Service replicas to deploy. When maxReplicas is set, this field defines the minimum number of replicas to deploy.
- max_replicasint, optional
The maximum number of Service replicas to deploy. Defining this field enables autoscaling.
- instance_typestr, optional
The EC2 instance type to deploy to.
- memoryint, optional
The amount of memory allocated to each replica of the Service.
- cpuint, optional
The amount of cpu allocated to each replica of the the Service.
- credentialsList[int], optional
A list of credential IDs to pass to the Service.
- permission_set_idint, optional
The ID of the associated permission set, if any.
- git_repo_urlstr, optional
The url for the git repo where the Service code lives.
- git_repo_refstr, optional
The git reference to use when pulling code from the repo.
- git_path_dirstr, 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[str]
Addresses to notify by e-mail when the service fails.
- failure_onbool
If failure email notifications are on
- partition_labelstr, optional
The partition label used to run this object.
- Returns:
civis.response.Response
- idint
The ID for this Service.
- namestr
The name of this Service.
- descriptionstr
The description of this Service.
- userdict
- idint
The ID of this user.
- namestr
This user’s name.
- usernamestr
This user’s username.
- initialsstr
This user’s initials.
- onlinebool
Whether this user is online.
- typestr
The type of this Service
- docker_image_namestr
The name of the docker image to pull from DockerHub.
- docker_image_tagstr
The tag of the docker image to pull from DockerHub (default: latest).
- scheduledict
- runtime_planstr
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[dict]
List of day-hour combinations this item is scheduled for
- scheduled_daysList[int]
Days it is scheduled on, based on numeric value starting at 0 for Sunday
- scheduled_hoursList[int]
Hours it is scheduled on
time_zone : str
- replicasint
The number of Service replicas to deploy. When maxReplicas is set, this field defines the minimum number of replicas to deploy.
- max_replicasint
The maximum number of Service replicas to deploy. Defining this field enables autoscaling.
- instance_typestr
The EC2 instance type to deploy to.
- memoryint
The amount of memory allocated to each replica of the Service.
- cpuint
The amount of cpu allocated to each replica of the the Service.
created_at : str (time)
updated_at : str (time)
- credentialsList[int]
A list of credential IDs to pass to the Service.
- permission_set_idint
The ID of the associated permission set, if any.
- git_repo_urlstr
The url for the git repo where the Service code lives.
- git_repo_refstr
The git reference to use when pulling code from the repo.
- git_path_dirstr
The path to the Service code within the git repo. If unspecified, the root directory will be used.
- report_idint
The ID of the associated report.
- current_deploymentdict
- deployment_idint
The ID for this deployment.
- user_idint
The ID of the owner.
- hoststr
Domain of the deployment.
- namestr
Name of the deployment.
- docker_image_namestr
The name of the docker image to pull from DockerHub.
- docker_image_tagstr
The tag of the docker image to pull from DockerHub (default: latest).
- display_urlstr
A signed URL for viewing the deployed item.
- instance_typestr
The EC2 instance type requested for the deployment.
- memoryint
The memory allocated to the deployment, in MB.
- cpuint
The cpu allocated to the deployment, in millicores.
- statestr
The state of the deployment.
- state_messagestr
A detailed description of the state.
- max_memory_usagefloat (float)
If the deployment has finished, the maximum amount of memory used during the deployment, in MB.
- max_cpu_usagefloat (float)
If the deployment has finished, the maximum amount of cpu used during the deployment, in millicores.
created_at : str (time)
updated_at : str (time)
- service_idint
The ID of owning Service
- current_urlstr
The URL that the service is hosted at.
- environment_variablesdict
Environment Variables to be passed into the Service.
- notificationsdict
- failure_email_addressesList[str]
Addresses to notify by e-mail when the service fails.
- failure_onbool
If failure email notifications are on
- partition_labelstr
The partition label used to run this object.
- my_permission_levelstr
Your permission level on the object. One of “read”, “write”, or “manage”.
- archivedstr
The archival status of the requested item(s).
- hiddenbool
The hidden status of the item.
- put_archive(id: int, status: bool)
Update the archive status of this object
- Parameters:
- idint
The ID of the object.
- statusbool
The desired archived status of the object.
- Returns:
civis.response.Response
- idint
The ID for this Service.
- namestr
The name of this Service.
- descriptionstr
The description of this Service.
- userdict
- idint
The ID of this user.
- namestr
This user’s name.
- usernamestr
This user’s username.
- initialsstr
This user’s initials.
- onlinebool
Whether this user is online.
- typestr
The type of this Service
- docker_image_namestr
The name of the docker image to pull from DockerHub.
- docker_image_tagstr
The tag of the docker image to pull from DockerHub (default: latest).
- scheduledict
- runtime_planstr
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[dict]
List of day-hour combinations this item is scheduled for
- scheduled_daysList[int]
Days it is scheduled on, based on numeric value starting at 0 for Sunday
- scheduled_hoursList[int]
Hours it is scheduled on
time_zone : str
- replicasint
The number of Service replicas to deploy. When maxReplicas is set, this field defines the minimum number of replicas to deploy.
- max_replicasint
The maximum number of Service replicas to deploy. Defining this field enables autoscaling.
- instance_typestr
The EC2 instance type to deploy to.
- memoryint
The amount of memory allocated to each replica of the Service.
- cpuint
The amount of cpu allocated to each replica of the the Service.
created_at : str (time)
updated_at : str (time)
- credentialsList[int]
A list of credential IDs to pass to the Service.
- permission_set_idint
The ID of the associated permission set, if any.
- git_repo_urlstr
The url for the git repo where the Service code lives.
- git_repo_refstr
The git reference to use when pulling code from the repo.
- git_path_dirstr
The path to the Service code within the git repo. If unspecified, the root directory will be used.
- report_idint
The ID of the associated report.
- current_deploymentdict
- deployment_idint
The ID for this deployment.
- user_idint
The ID of the owner.
- hoststr
Domain of the deployment.
- namestr
Name of the deployment.
- docker_image_namestr
The name of the docker image to pull from DockerHub.
- docker_image_tagstr
The tag of the docker image to pull from DockerHub (default: latest).
- display_urlstr
A signed URL for viewing the deployed item.
- instance_typestr
The EC2 instance type requested for the deployment.
- memoryint
The memory allocated to the deployment, in MB.
- cpuint
The cpu allocated to the deployment, in millicores.
- statestr
The state of the deployment.
- state_messagestr
A detailed description of the state.
- max_memory_usagefloat (float)
If the deployment has finished, the maximum amount of memory used during the deployment, in MB.
- max_cpu_usagefloat (float)
If the deployment has finished, the maximum amount of cpu used during the deployment, in millicores.
created_at : str (time)
updated_at : str (time)
- service_idint
The ID of owning Service
- current_urlstr
The URL that the service is hosted at.
- environment_variablesdict
Environment Variables to be passed into the Service.
- notificationsdict
- failure_email_addressesList[str]
Addresses to notify by e-mail when the service fails.
- failure_onbool
If failure email notifications are on
- partition_labelstr
The partition label used to run this object.
- my_permission_levelstr
Your permission level on the object. One of “read”, “write”, or “manage”.
- archivedstr
The archival status of the requested item(s).
- hiddenbool
The hidden status of the item.
- put_projects(id: int, project_id: int)
Add a Service to a project
- Parameters:
- idint
The ID of the Service.
- project_idint
The ID of the project.
- Returns:
- None
Response code 204: success
Set the permissions groups has on this object
- Parameters:
- idint
The ID of the resource that is shared.
- group_idsList[int]
An array of one or more group IDs.
- permission_levelstr
Options are: “read”, “write”, or “manage”.
- share_email_bodystr, optional
Custom body text for e-mail sent on a share.
- send_shared_emailbool, optional
Send email to the recipients of a share.
- Returns:
civis.response.Response
- readersdict
- usersList[dict]
id : int
name : str
- groupsList[dict]
id : int
name : str
- writersdict
- usersList[dict]
id : int
name : str
- groupsList[dict]
id : int
name : str
- ownersdict
- usersList[dict]
id : int
name : str
- groupsList[dict]
id : int
name : str
- total_user_sharesint
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesint
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
Set the permissions users have on this object
- Parameters:
- idint
The ID of the resource that is shared.
- user_idsList[int]
An array of one or more user IDs.
- permission_levelstr
Options are: “read”, “write”, or “manage”.
- share_email_bodystr, optional
Custom body text for e-mail sent on a share.
- send_shared_emailbool, optional
Send email to the recipients of a share.
- Returns:
civis.response.Response
- readersdict
- usersList[dict]
id : int
name : str
- groupsList[dict]
id : int
name : str
- writersdict
- usersList[dict]
id : int
name : str
- groupsList[dict]
id : int
name : str
- ownersdict
- usersList[dict]
id : int
name : str
- groupsList[dict]
id : int
name : str
- total_user_sharesint
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesint
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
- put_transfer(id: int, user_id: int, include_dependencies: bool, *, email_body: str = None, send_email: bool = None)
Transfer ownership of this object to another user
- Parameters:
- idint
The ID of the resource that is shared.
- user_idint
ID of target user
- include_dependenciesbool
Whether or not to give manage permissions on all dependencies
- email_bodystr, optional
Custom body text for e-mail sent on transfer.
- send_emailbool, optional
Send email to the target user of the transfer?
- Returns:
civis.response.Response
- dependenciesList[dict]
Dependent objects for this object
- object_typestr
Dependent object type
- fco_typestr
Human readable dependent object type
- idint
Dependent object ID
- namestr
Dependent object name, or nil if the requesting user cannot read this object
- permission_levelstr
Permission level of target user (not user’s groups) for dependent object. Null if no target user or not shareable (e.g. a database table).
- descriptionstr
Additional information about the dependency, if relevant
- sharedbool
Whether dependent object was successfully shared with target user