sevenbridges.models package

Subpackages

Submodules

sevenbridges.models.actions module

class sevenbridges.models.actions.Actions(**kwargs)

Bases: sevenbridges.meta.resource.Resource

classmethod bulk_copy_files(files, destination_project, api=None)

Bulk copy of files. :param files: List containing files to be copied. :param destination_project: Destination project. :param api: Api instance. :return: MultiStatus copy result.

deepcopy()
equals(other)
classmethod send_feedback(type='IDEA', referrer=None, text=None, api=None)

Sends feedback to sevenbridges. :param type: FeedbackType wither IDEA, PROBLEM or THOUGHT. :param text: Feedback text. :param referrer: Feedback referrer. :param api: Api instance.

sevenbridges.models.app module

class sevenbridges.models.app.App(**kwargs)

Bases: sevenbridges.meta.resource.Resource

Central resource for managing apps.

copy(project, name=None)

Copies the current app. :param project: Destination project. :param name: Destination app name. :return: Copied App object.

classmethod create_revision(id, revision, raw, api=None)

Create a new app revision. :param id: App identifier. :param revision: App revision. :param raw: Raw cwl object. :param api: Api instance. :return: App object.

deepcopy()
equals(other)
classmethod get_revision(id, revision, api=None)

Get app revision. :param id: App identifier. :param revision: App revision :param api: Api instance. :return: App object.

href = None
id
classmethod install_app(id, raw, api=None)

Installs and app. :param id: App identifier. :param raw: Raw cwl data. :param api: Api instance. :return: App object.

name = None
project = None
classmethod query(project=None, visibility=None, q=None, id=None, offset=None, limit=None, api=None)

Query (List) apps. :param project: Source project. :param visibility: private|public for private or public apps. :param q: List containing search terms. :param id: List contains app ids. Fetch apps with specific ids. :param offset: Pagination offset. :param limit: Pagination limit. :param api: Api instance. :return: collection object

raw = None
revision = None
sync()

Syncs the parent app changes with the current app instance. :return: Synced App object.

sevenbridges.models.billing_breakdown module

class sevenbridges.models.billing_breakdown.BillingGroupBreakdown(**kwargs)

Bases: sevenbridges.meta.resource.Resource

Central resource for managing billing group breakdowns.

deepcopy()
equals(other)
href = None
project_breakdown
total_spending

sevenbridges.models.billing_group module

class sevenbridges.models.billing_group.BillingGroup(**kwargs)

Bases: sevenbridges.meta.resource.Resource

Central resource for managing billing groups.

balance
breakdown()

Get Billing group breakdown for the current billing group.

deepcopy()
disabled = None
equals(other)
href = None
id = None
name = None
owner = None
pending = None
classmethod query(offset=None, limit=None, api=None)

Query (List) billing group. :param offset: Pagination offset. :param limit: Pagination limit. :return: Collection object. :param api: Api instance.

type = None

sevenbridges.models.division module

class sevenbridges.models.division.Division(**kwargs)

Bases: sevenbridges.meta.resource.Resource

Central resource for managing divisions.

deepcopy()
equals(other)
classmethod get(id, api=None)
get_teams(offset=None, limit=None)
href = None
id = None
name = None
classmethod query(offset=None, limit=None, api=None)

Query (List) divisions.

Parameters:
  • offset – Pagination offset.
  • limit – Pagination limit.
  • api – Api instance.
Returns:

Collection object.

reload()

sevenbridges.models.endpoints module

class sevenbridges.models.endpoints.Endpoints(**kwargs)

Bases: sevenbridges.meta.resource.Resource

Central resource for managing Endpoints.

action_url = None
apps_url = None
billing_url = None
deepcopy()
equals(other)
files_url = None
classmethod get(api=None, **kwargs)

Get api links. :param api: Api instance. :return: Endpoints object.

projects_url = None
rate_limit_url = None
tasks_url = None
upload_url = None
user_url = None
users_url = None

sevenbridges.models.enums module

class sevenbridges.models.enums.FeedbackType

Bases: object

IDEA = 'IDEA'
PROBLEM = 'PROBLEM'
THOUGHT = 'THOUGHT'
class sevenbridges.models.enums.FileStorageType

Bases: object

PLATFORM = 'PLATFORM'
VOLUME = 'VOLUME'
class sevenbridges.models.enums.ImportExportState

Bases: object

COMPLETED = 'COMPLETED'
FAILED = 'FAILED'
PENDING = 'PENDING'
RUNNING = 'RUNNING'
class sevenbridges.models.enums.PartSize

Bases: object

DOWNLOAD_MINIMUM_PART_SIZE = 5242880
GB = 1073741824
KB = 1024
MAXIMUM_OBJECT_SIZE = 5497558138880
MAXIMUM_TOTAL_PARTS = 10000
MAXIMUM_UPLOAD_SIZE = 5368709120
MB = 1048576
TB = 1099511627776
UPLOAD_MINIMUM_PART_SIZE = 5242880
class sevenbridges.models.enums.TaskStatus

Bases: object

ABORTED = 'ABORTED'
COMPLETED = 'COMPLETED'
CREATING = 'CREATING'
DRAFT = 'DRAFT'
FAILED = 'FAILED'
QUEUED = 'QUEUED'
RUNNING = 'RUNNING'
class sevenbridges.models.enums.TransferState

Bases: object

ABORTED = 'ABORTED'
COMPLETED = 'COMPLETED'
FAILED = 'FAILED'
PAUSED = 'PAUSED'
PREPARING = 'PREPARING'
RUNNING = 'RUNNING'
STOPPED = 'STOPPED'
class sevenbridges.models.enums.VolumeAccessMode

Bases: object

READ_ONLY = 'RO'
READ_WRITE = 'RW'
class sevenbridges.models.enums.VolumeType

Bases: object

GOOGLE = 'GCS'
S3 = 'S3'

sevenbridges.models.execution_details module

class sevenbridges.models.execution_details.ExecutionDetails(**kwargs)

Bases: sevenbridges.meta.resource.Resource

Task execution details.

deepcopy()
end_time = None
equals(other)
href = None
jobs
message = None
start_time = None
status = None

sevenbridges.models.file module

class sevenbridges.models.file.File(**kwargs)

Bases: sevenbridges.meta.resource.Resource

Central resource for managing files.

content(path=None, overwrite=True)

Downloads file to the specified path or as temporary file and reads the file content in memory.

Should not be used on very large files.
Parameters:
  • path – Path for file download If omitted tmp file will be used.
  • overwrite – Overwrite file if exists locally
Returns:

File content.

copy(project, name=None)

Copies the current file. :param project: Destination project. :param name: Destination file name. :return: Copied File object.

created_on = None
deepcopy()
download(path, retry=5, timeout=10, chunk_size=5242880, wait=True, overwrite=False)

Downloads the file and returns a download handle. Download will not start until .start() method is invoked. :param path: Full path to the new file. :param retry: Number of retries if error occurs during download. :param timeout: Timeout for http requests. :param chunk_size: Chunk size in bytes. :param wait: If true will wait for download to complete. :param overwrite: If True will silently overwrite existing file. :return: Download handle.

download_info()

Fetches download information containing file url that can be used to download file. :return: Download info object.

equals(other)
href = None
id = None
metadata
modified_on = None
name = None
origin
project = None
classmethod query(project, names=None, metadata=None, origin=None, tags=None, offset=None, limit=None, api=None)

Query ( List ) projects :param project: Project id :param names: Name list :param metadata: Metadata query dict :param origin: Origin query dict :param tags: List of tags to filter on :param offset: Pagination offset :param limit: Pagination limit :param api: Api instance. :return: Collection object.

reload()

Refreshes the file with the data from the server.

save(obj, *args, **kwargs)
size = None
storage
stream(part_size=32768)

Creates an iterator which can be used to stream the file content. :param part_size: Size of the part in bytes. Default 32KB :return Iterator

tags = None
classmethod upload(path, project, file_name=None, overwrite=False, retry=5, timeout=10, part_size=5242880, wait=True, api=None)

Uploads a file using multipart upload and returns an upload handle if the wait parameter is set to False. If wait is set to True it will block until the upload is completed.

Parameters:
  • path – File path on local disc.
  • project – Project identifier
  • file_name – Optional file name.
  • overwrite – If true will overwrite the file on the server.
  • retry – Number of retries if error occurs during upload.
  • timeout – Timeout for http requests.
  • part_size – Part size in bytes.
  • wait – If true will wait for upload to complete.
  • api – Api instance.

sevenbridges.models.invoice module

class sevenbridges.models.invoice.Invoice(**kwargs)

Bases: sevenbridges.meta.resource.Resource

Central resource for managing invoices.

analysis_costs
deepcopy()
equals(other)
href = None
id = None
invoice_period
pending = None
classmethod query(offset=None, limit=None, api=None)

Query (List) invoices. :param offset: Pagination offset. :param limit: Pagination limit. :param api: Api instance. :return: Collection object.

storage_costs
total

sevenbridges.models.marker module

class sevenbridges.models.marker.Marker(**kwargs)

Bases: sevenbridges.meta.resource.Resource

chromosome = None
classmethod create(file, name, position, chromosome, private=True, api=None)

Create a marker on a file. :param file: File object or identifier. :param name: Marker name. :param position: Marker position object. :param chromosome: Chromosome number. :param private: Whether the marker is private or public. :param api: Api instance. :return: Marker object.

created_by = None
created_time = None
deepcopy()
delete()
equals(other)
file = None
href = None
id = None
name = None
position
classmethod query(file, offset=None, limit=None, api=None)

Queries genome markers on a file. :param file: Genome file - Usually bam file. :param offset: Pagination offset. :param limit: Pagination limit. :param api: Api instance. :return: Collection object.

reload()
save(obj, *args, **kwargs)

sevenbridges.models.member module

class sevenbridges.models.member.Member(**kwargs)

Bases: sevenbridges.meta.resource.Resource

Central resource for managing members. This resource is reused on both projects and volumes.

deepcopy()
email = None
equals(other)
href = None
id = None
permissions
save(obj, *args, **kwargs)
type = None
username = None

sevenbridges.models.project module

class sevenbridges.models.project.Project(**kwargs)

Bases: sevenbridges.meta.resource.Resource

Central resource for managing projects.

add_files(files)

Adds files to this project. :param files: List of files or a Collection object.

add_member(user, permissions)

Add a member to the project. :param user: Member username :param permissions: Permissions dictionary. :return: Member object.

add_member_division(division, permissions)

Add a member (team) to a project. :param division: Division object or division identifier. :param permissions: Permissions dictionary. :return: Member object.

add_member_email(email, permissions=None)

Add a member to the project using member email. :param email: Member email. :param permissions: Permissions dictionary. :return: Member object.

add_member_team(team, permissions)

Add a member (team) to a project. :param team: Team object or team identifier. :param permissions: Permissions dictionary. :return: Member object.

billing_group = None
classmethod create(name, billing_group=None, description=None, tags=None, settings=None, api=None)

Create a project. :param name: Project name. :param billing_group: Project billing group. :param description: Project description. :param tags: Project tags. :param settings: Project settings. :param api: Api instance. :return:

create_task(name, app, revision=None, batch_input=None, batch_by=None, inputs=None, description=None, run=False, disable_batch=False, interruptible=True)

Creates a task for this project.

Parameters:
  • name – Task name.
  • app – CWL app identifier.
  • revision – CWL app revision.
  • batch_input – Batch input.
  • batch_by – Batch criteria.
  • inputs – Input map.
  • description – Task description.
  • run – True if you want to run a task upon creation.
  • disable_batch – True if you want to disable batching.
  • interruptible – True if you want to use interruptible instances.
Returns:

Task object.

deepcopy()
description = None
equals(other)
get_apps(offset=None, limit=None)

Retrieves apps in this project. :param offset: Pagination offset. :param limit: Pagination limit. :return: Collection object.

get_exports(volume=None, state=None, offset=None, limit=None)

Fetches exports for this volume. :param volume: Optional volume identifier. :param state: Optional state. :param offset: Pagination offset. :param limit: Pagination limit. :return: Collection object.

get_files(offset=None, limit=None)

Retrieves files in this project. :param offset: Pagination offset. :param limit: Pagination limit. :return: Collection object.

get_imports(volume=None, state=None, offset=None, limit=None)

Fetches imports for this project. :param volume: Optional volume identifier. :param state: Optional state. :param offset: Pagination offset. :param limit: Pagination limit. :return: Collection object.

get_members(offset=None, limit=None)

Retrieves project members. :param offset: Pagination offset. :param limit: Pagination limit. :return: Collection object.

get_tasks(status=None, offset=None, limit=None)

Retrieves tasks in this project. :param status: Optional task status. :param offset: Pagination offset. :param limit: Pagination limit. :return: Collection object.

href = None
id = None
name = None
classmethod query(owner=None, offset=None, limit=None, api=None)

Query (List) projects :param owner: Owner username. :param offset: Pagination offset. :param limit: Pagination limit. :param api: Api instance. :return: Collection object.

remove_member(user)

Remove member from the project. :param user: User to be removed.

save(obj, *args, **kwargs)
settings
tags = None
type = None

sevenbridges.models.rate_limit module

class sevenbridges.models.rate_limit.RateLimit(**kwargs)

Bases: sevenbridges.meta.resource.Resource

Rate limit resource contains info regarding request and computation rate limits.

deepcopy()
equals(other)
classmethod get(id=None, api=None)
instance_limit
rate

sevenbridges.models.storage_export module

class sevenbridges.models.storage_export.Export(**kwargs)

Bases: sevenbridges.meta.resource.Resource

Central resource for managing exports.

deepcopy()
destination
equals(other)
error
finished_on = None
href = None
id = None
overwrite = None
properties
classmethod query(volume=None, state=None, offset=None, limit=None, api=None)

Query (List) exports. :param volume: Optional volume identifier. :param state: Optional import sate. :param api: Api instance. :return: Collection object.

result
source
started_on = None
state = None
classmethod submit_export(file, volume, location, properties=None, overwrite=False, copy_only=False, api=None)

Submit new export job. :param file: File to be exported. :param volume: Volume identifier. :param location: Volume location. :param properties: Properties dictionary. :param overwrite: If true it will overwrite file if exists :param copy_only: If true files are kept on SevenBridges bucket. :param api: Api Instance. :return: Export object.

sevenbridges.models.storage_import module

class sevenbridges.models.storage_import.Import(**kwargs)

Bases: sevenbridges.meta.resource.Resource

Central resource for managing imports.

deepcopy()
destination
equals(other)
error
finished_on = None
href = None
id = None
overwrite = None
classmethod query(project=None, volume=None, state=None, offset=None, limit=None, api=None)

Query (List) imports. :param project: Optional project identifier. :param volume: Optional volume identifier. :param state: Optional import sate. :param api: Api instance. :return: Collection object.

result
source
started_on = None
state = None
classmethod submit_import(volume, location, project, name=None, overwrite=False, properties=None, api=None)

Submits new import job. :param volume: Volume identifier. :param location: Volume location. :param project: Project identifier. :param name: Optional file name. :param overwrite: If true it will overwrite file if exists. :param properties: Properties dictionary. :param api: Api instance. :return: Import object.

sevenbridges.models.task module

class sevenbridges.models.task.Task(**kwargs)

Bases: sevenbridges.meta.resource.Resource

Central resource for managing tasks.

abort(obj, *args, **kwargs)
app = None
batch = None
batch_by
batch_group
batch_input = None
classmethod create(name, project, app, revision=None, batch_input=None, batch_by=None, inputs=None, description=None, run=False, disable_batch=False, interruptible=True, api=None)

Creates a task on server. :param name: Task name. :param project: Project identifier. :param app: CWL app identifier. :param revision: CWL app revision. :param batch_input: Batch input. :param batch_by: Batch criteria. :param inputs: Input map. :param description: Task description. :param run: True if you want to run a task upon creation. :param disable_batch: If True disables batching of a batch task. :param interruptible: If True interruptible instance will be used. :param api: Api instance. :return: Task object. :raises: TaskValidationError if validation Fails. :raises: SbgError if any exception occurs during request.

created_by = None
created_time = None
deepcopy()
description = None
end_time = None
equals(other)
errors = None
executed_by = None
execution_status
get_batch_children()

Retrieves batch child tasks for this task if its a batch task. :return: Collection instance. :raises SbError if task is not a batch task.

get_execution_details()

Retrieves execution details for a task. :return: Execution details instance.

href = None
id = None
inputs
name = None
outputs
parent = None
price
project = None
classmethod query(project=None, status=None, batch=None, parent=None, created_from=None, created_to=None, started_from=None, started_to=None, ended_from=None, ended_to=None, offset=None, limit=None, api=None)

Query (List) tasks. Date parameters may be both strings and python date objects. :param project: Target project. optional. :param status: Task status. :param batch: Only batch tasks. :param parent: Parent batch task identifier. :param ended_to: All tasks that ended until this date. :param ended_from: All tasks that ended from this date. :param started_to: All tasks that were started until this date. :param started_from: All tasks that were started from this date. :param created_to: All tasks that were created until this date. :param created_from: All tasks that were created from this date. :param offset: Pagination offset. :param limit: Pagination limit. :param api: Api instance. :return: Collection object.

run(obj, *args, **kwargs)
save(obj, *args, **kwargs)
start_time = None
status = None
type = None
use_interruptible_instances = None
warnings = None

sevenbridges.models.team module

class sevenbridges.models.team.Team(**kwargs)

Bases: sevenbridges.meta.resource.Resource

Central resource for managing teams.

add_member(user)

Add member to team :param user: User object or user’s username :return: Added user.

classmethod create(name, division, api=None)

Create team within a division :param name: Team name. :param division: Parent division. :param api: Api instance. :return: Team object.

deepcopy()
delete()
equals(other)
classmethod get(id, api=None)
get_members(offset=None, limit=None)

Fetch team members for current team. :param offset: Pagination offset. :param limit: Pagination limit. :return: Collection object.

href = None
id = None
name = None
classmethod query(division, offset=None, limit=None, api=None)
reload()
remove_member(user)

Remove member from the team. :param user: User to be removed.

save(obj, *args, **kwargs)

sevenbridges.models.team_member module

class sevenbridges.models.team_member.TeamMember(**kwargs)

Bases: sevenbridges.meta.resource.Resource

Central resource for managing team members.

deepcopy()
equals(other)
href = None
id = None
role = None
username = None

sevenbridges.models.user module

class sevenbridges.models.user.User(**kwargs)

Bases: sevenbridges.meta.resource.Resource

Central resource for managing tasks.

address = None
affiliation = None
city = None
country = None
deepcopy()
email = None
equals(other)
first_name = None
classmethod get(user, api=None)
href = None
last_name = None
classmethod me(api=None)

Retrieves current user information. :param api: Api instance. :return: User object.

phone = None
state = None
username = None
zip_code = None

sevenbridges.models.volume module

class sevenbridges.models.volume.Volume(**kwargs)

Bases: sevenbridges.meta.resource.Resource

Central resource for managing volumes.

access_mode = None
active = None
add_member(user, permissions)

Add a member to the volume. :param user: Member username :param permissions: Permissions dictionary. :return: Member object.

add_member_division(division, permissions)

Add a member (team) to a volume. :param division: Division object or division identifier. :param permissions: Permissions dictionary. :return: Member object.

add_member_team(team, permissions)

Add a member (team) to a volume. :param team: Team object or team identifier. :param permissions: Permissions dictionary. :return: Member object.

classmethod create_google_volume(name, bucket, client_email, private_key, access_mode, description=None, prefix=None, properties=None, api=None)

Create s3 volume. :param name: Volume name. :param bucket: Referenced bucket. :param client_email: Google client email. :param private_key: Google client private key. :param access_mode: Access Mode. :param description: Volume description. :param prefix: Volume prefix. :param properties: Volume properties. :param api: Api instance. :return: Volume object.

classmethod create_s3_volume(name, bucket, access_key_id, secret_access_key, access_mode, description=None, prefix=None, properties=None, api=None)

Create s3 volume. :param name: Volume name. :param bucket: Referenced bucket. :param access_key_id: Amazon access key identifier. :param secret_access_key: Amazon secret access key. :param access_mode: Access Mode. :param description: Volume description. :param prefix: Volume prefix. :param properties: Volume properties. :param api: Api instance. :return: Volume object.

created_on = None
deepcopy()
description = None
equals(other)
get_exports(state=None, offset=None, limit=None)

Fetches exports for this volume. :param state: Optional state. :param offset: Pagination offset. :param limit: Pagination limit. :return: Collection object.

get_imports(project=None, state=None, offset=None, limit=None)

Fetches imports for this volume. :param project: Optional project identifier. :param state: Optional state. :param offset: Pagination offset. :param limit: Pagination limit. :return: Collection object.

get_members(offset=None, limit=None)

Retrieves volume members. :param offset: Pagination offset. :param limit: Pagination limit. :return: Collection object.

get_volume_object_info(location)

Fetches information about single volume object - usually file :param location: object location :return:

href = None
id = None
list(prefix=None, limit=50)
modified_on = None
name = None
classmethod query(offset=None, limit=None, api=None)

Query (List) volumes. :param offset: Pagination offset. :param limit: Pagination limit. :param api: Api instance. :return: Collection object.

remove_member(user)

Remove member from the volume. :param user: User to be removed.

save(obj, *args, **kwargs)
service