provenaclient.modules

Submodules

Classes

Datastore

This class interface just captures that the client has an instantiated auth

Search

This class interface just captures that the client has an instantiated auth

Auth

This class interface just captures that the client has an instantiated auth

Link

This class interface just captures that the client has an instantiated auth

Prov

This class interface just captures that the client has an instantiated auth

Registry

This class interface just captures that the client has an instantiated auth

IDService

This class interface just captures that the client has an instantiated auth

JobService

This class interface just captures that the client has an instantiated auth

Package Contents

class provenaclient.modules.Datastore(auth: provenaclient.modules.module_helpers.AuthManager, config: provenaclient.modules.module_helpers.Config, datastore_client: provenaclient.clients.DatastoreClient, search_client: provenaclient.clients.SearchClient)[source]

Bases: provenaclient.modules.module_helpers.ModuleService

This class interface just captures that the client has an instantiated auth manager which allows for helper functions abstracted for L3 clients.

_datastore_client: provenaclient.clients.DatastoreClient
_search_client: provenaclient.clients.SearchClient
review: ReviewSubModule
io: provenaclient.modules.submodules.IOSubModule
_auth
_config
async get_health_check() provenaclient.models.HealthCheckResponse[source]

Health check the API

Returns:

Response

Return type:

HealthCheckResponse

async fetch_dataset(id: str) ProvenaInterfaces.DataStoreAPI.RegistryFetchResponse[source]

Fetches a dataset from the datastore based on the provided ID.

Parameters:

id (str) – The unique identifier of the dataset to be retrieved. For example: “10378.1/1451860”

Returns:

A interactive python datatype of type RegistryFetchResponse containing the dataset details.

Return type:

RegistryFetchResponse

async mint_dataset(dataset_mint_info: ProvenaInterfaces.RegistryModels.CollectionFormat) ProvenaInterfaces.DataStoreAPI.MintResponse[source]

Creates a new dataset in the datastore with the provided dataset information.

Parameters:

dataset_mint_info (CollectionFormat) – A structured format containing all necessary information to register a new dataset, including associations, approvals, and dataset-specific information.

Returns:

A interactive python datatype of type MintResponse containing the newly created dataset details.

Return type:

MintResponse

async validate_dataset_metadata(metadata_payload: ProvenaInterfaces.RegistryModels.CollectionFormat) ProvenaInterfaces.DataStoreAPI.StatusResponse[source]

Validates the dataset metadata creation for testing and does not publish.

Parameters:

metadata_payload (CollectionFormat) – A structured format containing all necessary information to register a new dataset, including associations, approvals, and dataset-specific information.

Returns:

Response indicating whether your dataset metadata setup is valid and correct.

Return type:

StatusResponse

async update_dataset_metadata(handle_id: str, reason: str, metadata_payload: ProvenaInterfaces.RegistryModels.CollectionFormat) ProvenaInterfaces.DataStoreAPI.UpdateMetadataResponse[source]

Updates an existing dataset’s metadata.

Parameters:
  • handle_id (str) – The id of the dataset.

  • reason (str) – The reason for changing metadata of the dataset.

  • metadata_payload (CollectionFormat) – A structured format containing all necessary information to register a new dataset, including associations, approvals, and dataset-specific information.

Returns:

The updated metadata response

Return type:

UpdateMetadataResponse

async revert_dataset_metadata(metadata_payload: provenaclient.models.RevertMetadata) ProvenaInterfaces.DataStoreAPI.StatusResponse[source]

Reverts the metadata for a dataset to a previous identified historical version.

Parameters:

metadata_payload (RevertMetadata) – The revert request, passed through to the registry API and requires dataset id, history id and reason for reverting.

Returns:

Response indicating whether your dataset revert metadata request was correct.

Return type:

StatusResponse

async version_dataset(version_request: ProvenaInterfaces.RegistryAPI.VersionRequest) ProvenaInterfaces.RegistryAPI.VersionResponse[source]

Versioning operation which creates a new version from the specified ID.

Parameters:

version_request (VersionRequest) – The request which includes the item ID and reason for versioning.

Returns:

Response of the versioning of the dataset, containing new version ID and job session ID.

Return type:

VersionResponse

async for_all_datasets(list_dataset_request: ProvenaInterfaces.RegistryAPI.NoFilterSubtypeListRequest, total_limit: provenaclient.utils.exceptions.Optional[int] = None) AsyncGenerator[ProvenaInterfaces.DataStoreAPI.ItemDataset, None][source]
Fetches all datasets based on the provided datasets in datastore based on

the provided sorting criteria, pagination key and page size.

Parameters:
  • list_dataset_request (NoFilterSubtypeListRequest) – A request object configured with sorting options, pagination keys, and page size that defines how datasets are queried from the datastore.

  • total_limit (Optional[int], optional) – A maximum number of datasets to fetch. If specified, the generator will stop yielding datasets once this limit is reached. If None, it will fetch datasets until there are no more to fetch.

Returns:

An asynchronous generator yielding “ItemDataset” object which is an individual dataset from the datastore.

Return type:

AsyncGenerator[ItemDataset, None]

Yields:

Iterator[AsyncGenerator[ItemDataset, None]] – Each yield provides a “ItemDataset” containing an individual dataset.

async list_datasets(list_dataset_request: ProvenaInterfaces.RegistryAPI.NoFilterSubtypeListRequest) ProvenaInterfaces.RegistryAPI.DatasetListResponse[source]

Takes a specific dataset list request and returns the response.

Parameters:

list_dataset_request (NoFilterSubtypeListRequest) – A request object configured with sorting options, pagination keys, and page size that defines how datasets are queried from the datastore.

Returns:

Response containing the requested datasets in the datastore based on sort criteria and page size, and contains other attributes such as total_item_counts and optional pagination key.

Return type:

DatasetListResponse

async list_all_datasets(sort_criteria: provenaclient.utils.exceptions.Optional[ProvenaInterfaces.RegistryAPI.SortOptions] = None) List[ProvenaInterfaces.DataStoreAPI.ItemDataset][source]

Fetches all datasets from the datastore and you may provide your own sort criteria. By default uses display name sort criteria.

Parameters:

sort_criteria (Optional[SortOptions]) – An object configured with sorting options that you want when displaying all datasets within the datastore.

Returns:

A list of all datasets in the datastore, sorted as requested.

Return type:

List[ItemDataset]

async generate_dataset_presigned_url(dataset_presigned_request: ProvenaInterfaces.DataStoreAPI.PresignedURLRequest) ProvenaInterfaces.DataStoreAPI.PresignedURLResponse[source]

Generates a presigned url for an existing dataset.

Parameters:

dataset_presigned_request (PresignedURLRequest) – Contains the dataset id + file path + length of expiry of URL.

Returns:

A response with the presigned url.

Return type:

PresignedURLResponse

async generate_read_access_credentials(credentials: ProvenaInterfaces.DataStoreAPI.CredentialsRequest) ProvenaInterfaces.DataStoreAPI.CredentialResponse[source]
Given an S3 location, will attempt to generate programmatic access keys for

the storage bucket at this particular subdirectory.

Parameters:

credentials (CredentialsRequest) – Contains the dataset id + console session URL required flag (boolean)

Returns:

The AWS credentials creating read level access into the subset of the bucket requested in the S3 location object.

Return type:

CredentialResponse

async generate_write_access_credentials(credentials: ProvenaInterfaces.DataStoreAPI.CredentialsRequest) ProvenaInterfaces.DataStoreAPI.CredentialResponse[source]
Given an S3 location, will attempt to generate programmatic access keys for

the storage bucket at this particular subdirectory.

Parameters:

credentials (CredentialsRequest) – Contains the dataset id + console session URL required flag (boolean)

Returns:

The AWS credentials creating write level access into the subset of the bucket requested in the S3 location object.

Return type:

CredentialResponse

async search_datasets(query: str, limit: int = DEFAULT_SEARCH_LIMIT) provenaclient.models.LoadedSearchResponse[source]

Utilises the L2 search client to search for datasets with the specified query.

Loads all datasets in the result payload from the data store and sorts based on auth, or other exceptions if not successful.

Parameters:
  • query (str) – The query to make limit (int, optional): The result

  • DEFAULT_SEARCH_LIMIT. (count limit. Defaults to)

Returns:

The loaded items incl errors.

Return type:

LoadedSearchResponse

async interactive_dataset(dataset_id: str) InteractiveDataset[source]

Creates an interactive “session” with a dataset that allows you to perform further operations without re-supplying dataset id and creating objects required for other methods.

Parameters:

dataset_id (str) – The unique identifier of the dataset to be retrieved. For example: “10378.1/1451860”

Returns:

An instance that allows you to perform various operations on the provided dataset.

Return type:

InteractiveDataset

class provenaclient.modules.Search(auth: provenaclient.clients.client_helpers.AuthManager, config: provenaclient.clients.client_helpers.Config, search_client: provenaclient.clients.SearchClient)[source]

Bases: provenaclient.clients.client_helpers.ClientService

This class interface just captures that the client has an instantiated auth manager which allows for helper functions abstracted for L2 clients.

_search_client: provenaclient.clients.SearchClient
_auth
_config
async search_registry(query: str, limit: int | None, subtype_filter: ProvenaInterfaces.RegistryModels.ItemSubType | None) ProvenaInterfaces.SearchAPI.QueryResults[source]

Searches the registry for given query, limit and subtype.

Parameters:
  • query (str) – The query to make

  • limit (Optional[int]) – The query limit

  • subtype_filter (Optional[ItemSubType]) – The subtype to filter by if any

Returns:

Results - ids and scores

Return type:

QueryResults

class provenaclient.modules.Auth(auth: provenaclient.modules.module_helpers.AuthManager, config: provenaclient.modules.module_helpers.Config, auth_client: provenaclient.clients.AuthClient)[source]

Bases: provenaclient.modules.module_helpers.ModuleService

This class interface just captures that the client has an instantiated auth manager which allows for helper functions abstracted for L3 clients.

_auth_client: provenaclient.clients.AuthClient
admin: AdminAuthSubModule
_auth
_config
async get_health_check() provenaclient.models.HealthCheckResponse[source]

Health check the API

Returns:

Response

Return type:

HealthCheckResponse

async get_user_request_history() ProvenaInterfaces.AuthAPI.AccessRequestList[source]

Gets the users access request history

Returns:

The list of requests

Return type:

AccessRequestList

async post_user_request_change(body: ProvenaInterfaces.AuthAPI.AccessReport, send_email: bool) ProvenaInterfaces.AuthAPI.StatusResponse[source]

Requests a change by diffing access models

Parameters:
  • body (AccessReport) – The new access desired

  • send_email (bool) – Email alert

Returns:

Ok?

Return type:

StatusResponse

async get_user_pending_request_history() ProvenaInterfaces.AuthAPI.AccessRequestList[source]

Gets only pending requests from history

Returns:

The list

Return type:

AccessRequestList

async get_user_generate_access_report() ProvenaInterfaces.AuthAPI.AccessReportResponse[source]

Generates an access report detailing system access.

Returns:

The response

Return type:

AccessReportResponse

async get_list_groups() ProvenaInterfaces.AuthAPI.ListGroupsResponse[source]

Lists all groups

Returns:

List of groups

Return type:

ListGroupsResponse

async get_describe_group(group_id: str) ProvenaInterfaces.AuthAPI.DescribeGroupResponse[source]

Describes a specific gruop

Parameters:

group_id (str) – The id of group

Returns:

Response with details

Return type:

DescribeGroupResponse

async get_list_membership() ProvenaInterfaces.AuthAPI.ListUserMembershipResponse[source]

Gets the list of groups user is member of

Returns:

List and details

Return type:

ListUserMembershipResponse

async get_list_group_members(group_id: str) ProvenaInterfaces.AuthAPI.ListMembersResponse[source]

Lists the members of a given group

Parameters:

group_id (str) – The group to lookup

Returns:

Members

Return type:

ListMembersResponse

async get_check_membership(group_id: str) ProvenaInterfaces.AuthAPI.CheckMembershipResponse[source]

Checks if user is in specific group

Parameters:

group_id (str) – The group to check

Returns:

In group?

Return type:

CheckMembershipResponse

Looks up either current user or specified user

Parameters:

username (Optional[str], optional) – The username if not current user. Defaults to None.

Returns:

The response indicating link

Return type:

UserLinkUserLookupResponse

Assigns link to current user.

Parameters:

body (UserLinkUserAssignRequest) – The link to assign

Returns:

The response indicating success

Return type:

UserLinkUserAssignResponse

Validates link before making it.

Parameters:

body (UserLinkUserAssignRequest) – The link to assign

Returns:

Valid?

Return type:

UserLinkUserValidateResponse

Bases: provenaclient.modules.module_helpers.ModuleService

This class interface just captures that the client has an instantiated auth manager which allows for helper functions abstracted for L3 clients.

_auth_client: provenaclient.clients.AuthClient
_auth
_config
async get_linked_person() None[source]
class provenaclient.modules.Prov(auth: provenaclient.modules.module_helpers.AuthManager, config: provenaclient.modules.module_helpers.Config, prov_client: provenaclient.clients.ProvClient)[source]

Bases: provenaclient.modules.module_helpers.ModuleService

This class interface just captures that the client has an instantiated auth manager which allows for helper functions abstracted for L3 clients.

_prov_client: provenaclient.clients.ProvClient
_auth
_config
_prov_api_client
admin
async get_health_check() provenaclient.models.general.HealthCheckResponse[source]

Checks the health status of the PROV-API.

Returns:

Response containing the PROV-API health information.

Return type:

HealthCheckResponse

async update_model_run(model_run_id: str, reason: str, record: ProvenaInterfaces.ProvenanceAPI.ModelRunRecord) ProvenaInterfaces.ProvenanceAPI.PostUpdateModelRunResponse[source]

Updates an existing model run with new information.

This function triggers an asynchronous update of a model run. The update is processed as a job, and the job session ID is returned for tracking the update progress.

Parameters:
  • model_run_id (str) – The ID of the model run to update

  • reason (str) – The reason for updating the model run

  • record (ModelRunRecord) – The new model run record details

Returns:

Response containing the job session ID tracking the update

Return type:

PostUpdateModelRunResponse

Example

```python response = await prov_api.update_model_run(

model_run_id=”10378.1/1234567”, reason=”Updating input dataset information”, record=updated_model_run_record

) # Get the session ID to track progress session_id = response.session_id ```

async explore_upstream(starting_id: str, depth: int = PROV_API_DEFAULT_SEARCH_DEPTH) provenaclient.models.general.CustomLineageResponse[source]

Explores in the upstream direction (inputs/associations) starting at the specified node handle ID. The search depth is bounded by the depth parameter which has a default maximum of 100.

Parameters:
  • starting_id (str) – The ID of the entity to start at.

  • depth (int, optional) – The depth to traverse in the upstream direction, by default 100.

Returns:

A typed response containing the status, node count, and networkx serialised graph response.

Return type:

CustomLineageResponse

async explore_downstream(starting_id: str, depth: int = PROV_API_DEFAULT_SEARCH_DEPTH) provenaclient.models.general.CustomLineageResponse[source]

Explores in the downstream direction (inputs/associations) starting at the specified node handle ID. The search depth is bounded by the depth parameter which has a default maximum of 100.

Parameters:
  • starting_id (str) – The ID of the entity to start at.

  • depth (int, optional) – The depth to traverse in the downstream direction, by default 100

Returns:

A typed response containing the status, node count, and networkx serialised graph response.

Return type:

CustomLineageResponse

async get_contributing_datasets(starting_id: str, depth: int = PROV_API_DEFAULT_SEARCH_DEPTH) provenaclient.models.general.CustomLineageResponse[source]

Fetches datasets (inputs) which involved in a model run naturally in the upstream direction.

Parameters:
  • starting_id (str) – The ID of the entity to start at.

  • depth (int, optional) – The depth to traverse in the upstream direction, by default 100

Returns:

A typed response containing the status, node count, and networkx serialised graph response.

Return type:

CustomLineageResponse

async get_effected_datasets(starting_id: str, depth: int = PROV_API_DEFAULT_SEARCH_DEPTH) provenaclient.models.general.CustomLineageResponse[source]

Fetches datasets (outputs) which are derived from the model run naturally in the downstream direction.

Parameters:
  • starting_id (str) – The ID of the entity to start at.

  • depth (int, optional) – The depth to traverse in the downstream direction, by default 100.

Returns:

A typed response containing the status, node count, and networkx serialised graph response.

Return type:

CustomLineageResponse

async get_contributing_agents(starting_id: str, depth: int = PROV_API_DEFAULT_SEARCH_DEPTH) provenaclient.models.general.CustomLineageResponse[source]

Fetches agents (organisations or peoples) that are involved or impacted by the model run. naturally in the upstream direction.

Parameters:
  • starting_id (str) – The ID of the entity to start at.

  • depth (int, optional) – The depth to traverse in the upstream direction, by default 100.

Returns:

A typed response containing the status, node count, and networkx serialised graph response.

Return type:

CustomLineageResponse

async get_effected_agents(starting_id: str, depth: int = PROV_API_DEFAULT_SEARCH_DEPTH) provenaclient.models.general.CustomLineageResponse[source]

Fetches agents (organisations or peoples) that are involved or impacted by the model run. naturally in the downstream direction.

Parameters:
  • starting_id (str) – The ID of the entity to start at.

  • depth (int, optional) – The depth to traverse in the downstream direction, by default 100.

Returns:

A typed response containing the status, node count, and networkx serialised graph response.

Return type:

CustomLineageResponse

async register_batch_model_runs(batch_model_run_payload: ProvenaInterfaces.ProvenanceAPI.RegisterBatchModelRunRequest) ProvenaInterfaces.ProvenanceAPI.RegisterBatchModelRunResponse[source]

This function allows you to register multiple model runs in one go (batch) asynchronously.

Note: You can utilise the returned session ID to poll on the JOB API to check status of the model run registration(s).

Parameters:

batch_model_run_payload (RegisterBatchModelRunRequest) – A list of model runs (ModelRunRecord objects)

Returns:

The job session id derived from job-api for the model-run batch.

Return type:

RegisterBatchModelRunResponse

async register_model_run(model_run_payload: ProvenaInterfaces.ProvenanceAPI.ModelRunRecord) ProvenaInterfaces.ProvenanceAPI.RegisterModelRunResponse[source]

Asynchronously registers a single model run.

Note: You can utilise the returned session ID to poll on the JOB API to check status of the model run registration.

Parameters:

model_run_payload (ModelRunRecord) – Contains information needed for the model run such as workflow template, inputs, outputs, description etc.

Returns:

The job session id derived from job-api for the model-run.

Return type:

RegisterModelRunResponse

async generate_csv_template(workflow_template_id: str, file_path: provenaclient.utils.exceptions.Optional[str] = None, write_to_csv: bool = False) str[source]

Generates a model run csv template to be utilised for creating model runs through csv format..

Parameters:
  • workflow_template_id (str) – An ID of a created and existing model run workflow template.

  • path_to_save_csv (str, optional) – The path you want to save the csv file at WITH csv file name. If you don’t specify a path this will be saved in a relative directory.

  • write_to_csv (bool, By default False) – A boolean flag to indicate whether you want to save the template to a csv file or not.

Returns:

str

Return type:

Response containing the csv template text (encoded in a csv format).

async convert_model_runs(model_run_content: str) ProvenaInterfaces.ProvenanceAPI.ConvertModelRunsResponse[source]

Converts model run with model_run_content provided as a string.

Parameters:

model_run_content (str) – The model run information containing the necessary parameters for model run lodge.

Returns:

Returns the model run information in an interactive python datatype.

Return type:

ConvertModelRunsResponse

Raises:

Exception – Exception raised when converting string to bytes.

async convert_model_runs_to_csv_with_file(file_path: str) ProvenaInterfaces.ProvenanceAPI.ConvertModelRunsResponse[source]

Reads a CSV file, and it’s defined model run contents and lodges a model run.

Parameters:

file_path (str) – The path of an existing created CSV file containing the necessary parameters for model run lodge.

Returns:

Returns the model run information in an interactive python datatype.

Return type:

ConvertModelRunsResponse

async regenerate_csv_from_model_run_batch(batch_id: str, file_path: provenaclient.utils.exceptions.Optional[str] = None, write_to_csv: bool = False) str[source]

Regenerate/create a csv file containing model run information from a model run batch job.

The batch id must exist in the system.

Parameters:
  • batch_id (str) – Obtained from creating a batch model run.

  • file_path (str, optional) – The path you want to save the csv file at WITH CSV file name. If you don’t specify a path this will be saved in a relative directory.

  • write_to_csv (bool, By default False) – A boolean flag to indicate whether you want to save the template to a csv file or not.

Returns:

str

Return type:

Response containing the model run information (encoded in csv format).

async generate_report(report_request: ProvenaInterfaces.ProvenanceAPI.GenerateReportRequest, file_path: str = DEFAULT_RELATIVE_FILE_PATH) None[source]

Generates a provenance report from a Study or Model Run Entity containing the associated inputs, model runs and outputs involved.

The report is generated in .docx and saved at relative directory level.

Parameters:

report_request (GenerateReportRequest) – The request object containing the parameters for generating the report, including the id, item_subtype, and depth.

class provenaclient.modules.Registry(auth: provenaclient.modules.module_helpers.AuthManager, config: provenaclient.modules.module_helpers.Config, registry_client: provenaclient.clients.RegistryClient)[source]

Bases: provenaclient.modules.module_helpers.ModuleService

This class interface just captures that the client has an instantiated auth manager which allows for helper functions abstracted for L3 clients.

_registry_client: provenaclient.clients.RegistryClient
admin: RegistryAdminClient
organisation: OrganisationClient
person: PersonClient
model: ModelClient
model_run_workflow: ModelRunWorkFlowClient
dataset_template: DatasetTemplateClient
dataset: DatasetClient
study: StudyClient
create_activity: CreateActivityClient
version_acitvity: VersionActivityClient
model_run: ModelRunActivityClient
_auth
_config
async get_health_check() provenaclient.models.general.HealthCheckResponse[source]

Health check the API

Returns:

Response

Return type:

HealthCheckResponse

async list_general_registry_items(general_list_request: ProvenaInterfaces.RegistryAPI.GeneralListRequest) ProvenaInterfaces.RegistryAPI.PaginatedListResponse[source]

Lists general registry items based on filter criteria.

Parameters:

general_list_request (GeneralListRequest) – The request containing filter and sort criteria.

Returns:

The response containing the paginated list of registry items.

Return type:

PaginatedListResponse

async list_registry_items_with_count() ProvenaInterfaces.RegistryAPI.Dict[str, int][source]

Retrieves a count of items in the registry, grouped by their subtypes.

This method sends requests to list items in the registry and counts the number of items for each subtype. It handles pagination to ensure all items are counted.

Returns:

A dictionary where the keys are item subtypes(string) and the values are the count of items for each subtype.

Return type:

Dict[str, int]

async general_fetch_item(id: str) ProvenaInterfaces.RegistryAPI.UntypedFetchResponse[source]

Fetches a general item from the registry.

Parameters:

id (str) – The ID of the item to fetch.

Returns:

The fetch response containing the item details.

Return type:

UntypedFetchResponse

async get_current_provena_version() ProvenaInterfaces.RegistryAPI.VersionResponse[source]

Gets the current Provena version deployed on your domain.

Returns:

The response containing the current Provena version.

Return type:

VersionResponse

class provenaclient.modules.IDService(auth: provenaclient.modules.module_helpers.AuthManager, config: provenaclient.modules.module_helpers.Config, id_service_client: provenaclient.clients.IdServiceClient)[source]

Bases: provenaclient.modules.module_helpers.ModuleService

This class interface just captures that the client has an instantiated auth manager which allows for helper functions abstracted for L3 clients.

_id_service_client: provenaclient.clients.IdServiceClient
_auth
_config
id_service_client
async mint(body: ProvenaInterfaces.HandleAPI.MintRequest) ProvenaInterfaces.HandleAPI.Handle[source]

Mints a new handle with given properties.

Parameters:

body (MintRequest) – The payload

Returns:

The resulting handle object

Return type:

Handle

async add_value(body: ProvenaInterfaces.HandleAPI.AddValueRequest) ProvenaInterfaces.HandleAPI.Handle[source]

Adds value to a handle.

Parameters:

body (AddValueRequest) – The value to add

Returns:

The handle object

Return type:

Handle

async add_value_by_index(body: ProvenaInterfaces.HandleAPI.AddValueIndexRequest) ProvenaInterfaces.HandleAPI.Handle[source]

Adds a value at specified index

Parameters:

body (AddValueIndexRequest) – The value to add

Returns:

The handle object

Return type:

Handle

async list() ProvenaInterfaces.HandleAPI.ListResponse[source]

Lists all handles under domain.

Returns:

The response list

Return type:

ListResponse

async modify_by_index(body: ProvenaInterfaces.HandleAPI.ModifyRequest) ProvenaInterfaces.HandleAPI.Handle[source]

Modifies existing handle value at specified index

Parameters:

body (ModifyRequest) – The request to modify

Returns:

The handle object

Return type:

Handle

async remove_by_index(body: ProvenaInterfaces.HandleAPI.RemoveRequest) ProvenaInterfaces.HandleAPI.Handle[source]

Removes value at specified index

Parameters:

body (RemoveRequest) – The removal request

Returns:

The handle object

Return type:

Handle

class provenaclient.modules.JobService(auth: provenaclient.modules.module_helpers.AuthManager, config: provenaclient.modules.module_helpers.Config, job_api_client: provenaclient.clients.JobAPIClient)[source]

Bases: provenaclient.modules.module_helpers.ModuleService

This class interface just captures that the client has an instantiated auth manager which allows for helper functions abstracted for L3 clients.

_job_api_client: provenaclient.clients.JobAPIClient
admin: JobAdminSubService
_auth
_config
async get_health_check() provenaclient.models.HealthCheckResponse[source]

Health check the API

Returns:

Response

Return type:

HealthCheckResponse

async fetch_job(session_id: str) ProvenaInterfaces.AsyncJobAPI.GetJobResponse[source]

Fetches a job by session id

Parameters:

session_id (str) – The session ID

Returns:

The job fetched

Return type:

GetJobResponse

async list_jobs(list_jobs_request: ProvenaInterfaces.AsyncJobAPI.ListJobsRequest) ProvenaInterfaces.AsyncJobAPI.ListJobsResponse[source]

Lists all jobs for the given user

Can return pagination if page size exceeded

Parameters:

list_jobs_request (ListJobsRequest) – The request including details

Returns:

The list of jobs

Return type:

ListJobsResponse

async list_all_jobs(list_jobs_request: ProvenaInterfaces.AsyncJobAPI.ListJobsRequest, limit: ProvenaInterfaces.AsyncJobAPI.Optional[int] = None) List[ProvenaInterfaces.AsyncJobAPI.JobStatusTable][source]

Lists all jobs for the given user.

Will automatically paginate until list is exhausted.

Parameters:
  • list_jobs_request (ListJobsRequest) – The request including details

  • limit (Optional[int]) – Total record limit to enforce, if any

Returns:

The list of jobs

Return type:

ListJobsResponse

async for_all_jobs(list_jobs_request: ProvenaInterfaces.AsyncJobAPI.ListJobsRequest, limit: ProvenaInterfaces.AsyncJobAPI.Optional[int] = None) AsyncGenerator[ProvenaInterfaces.AsyncJobAPI.JobStatusTable, None][source]

Lists all jobs for the given user.

Returns lazy generator for use in for loops.

Will automatically paginate until list is exhausted.

Parameters:
  • list_jobs_request (ListJobsRequest) – The request including details

  • limit (Optional[int]) – Total record limit to enforce, if any

Returns:

The list of jobs

Return type:

ListJobsResponse

async list_jobs_in_batch(list_request: ProvenaInterfaces.AsyncJobAPI.ListByBatchRequest) ProvenaInterfaces.AsyncJobAPI.ListByBatchResponse[source]

Gets all jobs within a batch.

Can return pagination if page size exceeded

Parameters:

list_request (ListByBatchRequest) – The request including batch ID

Returns:

The response including list of jobs

Return type:

ListByBatchResponse

async list_all_jobs_in_batch(list_request: ProvenaInterfaces.AsyncJobAPI.ListByBatchRequest, limit: ProvenaInterfaces.AsyncJobAPI.Optional[int] = None) List[ProvenaInterfaces.AsyncJobAPI.JobStatusTable][source]

Lists all jobs for the given user. Will automatically paginate all entries to exhaust list

NOTE this could return more than limit - but figure it may as well return data fetched for efficiency reasons

Parameters:
  • list_jobs_request (ListJobsRequest) – The request including details

  • limit (Optional[int]) – Total record limit to enforce, if any

Returns:

The list of jobs

Return type:

ListJobsResponse

async for_all_jobs_in_batch(list_request: ProvenaInterfaces.AsyncJobAPI.ListByBatchRequest, limit: ProvenaInterfaces.AsyncJobAPI.Optional[int] = None) AsyncGenerator[ProvenaInterfaces.AsyncJobAPI.JobStatusTable, None][source]

Lists all jobs for the given user. Will automatically paginate all entries to exhaust list

NOTE this could return more than limit - but figure it may as well return data fetched for efficiency reasons

Parameters:
  • list_jobs_request (ListJobsRequest) – The request including details

  • limit (Optional[int]) – Total record limit to enforce, if any

Returns:

The list of jobs

Return type:

ListJobsResponse

async await_job_completion(session_id: str, settings: provenaclient.models.AsyncAwaitSettings = DEFAULT_AWAIT_SETTINGS) ProvenaInterfaces.AsyncJobAPI.JobStatusTable[source]

Awaits completion of a given job then provides the job info.

Completion is defined as a job status which is not pending or in progress.

Parameters:

session_id (str) – The ID of the job to monitor and await completion.

Returns:

The entry at the latest point.

Return type:

JobStatusTable

async await_successful_job_completion(session_id: str, settings: provenaclient.models.AsyncAwaitSettings = DEFAULT_AWAIT_SETTINGS) ProvenaInterfaces.AsyncJobAPI.JobStatusTable[source]

Awaits successful completion of a given job then provides the job info.

Completion is defined as a job status which is not pending or in progress.

Parameters:

session_id (str) – The ID of the job to monitor and await completion.

Returns:

The entry at the latest point.

Return type:

JobStatusTable