provenaclient.clients

Submodules

Classes

DatastoreClient

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

SearchClient

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

AuthClient

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

ProvClient

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

RegistryClient

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

JobAPIClient

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

IdServiceClient

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

Package Contents

class provenaclient.clients.DatastoreClient(auth: provenaclient.clients.client_helpers.AuthManager, config: provenaclient.clients.client_helpers.Config)[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.

review: DatasetReviewSubClient
_auth
_config
_build_endpoint(endpoint: DatastoreEndpoints) str[source]
async get_health_check() provenaclient.models.HealthCheckResponse[source]

Health check the API

Returns:

Response

Return type:

HealthCheckResponse

async validate_metadata(metadata_payload: ProvenaInterfaces.RegistryModels.CollectionFormat) provenaclient.utils.helpers.StatusResponse[source]

Validates provided dataset info with the datastore API.

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_metadata(handle_id: str, reason: str, metadata_payload: ProvenaInterfaces.RegistryModels.CollectionFormat) ProvenaInterfaces.DataStoreAPI.UpdateMetadataResponse[source]

Updates existing dataset metadata through datastore API.

Returns:

The updated metadata response from datastore.

Return type:

UpdateMetadataResponse

async revert_metadata(metadata_payload: provenaclient.models.RevertMetadata) provenaclient.utils.helpers.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 metadata setup is valid and correct.

Return type:

StatusResponse

async version_dataset(version_dataset_payload: ProvenaInterfaces.RegistryAPI.VersionRequest) ProvenaInterfaces.RegistryAPI.VersionResponse[source]
Creates a new versioning of an existing dataset within Provena

through the Datastore.

Parameters:

version_dataset_payload (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 list_datasets(list_request: ProvenaInterfaces.RegistryAPI.NoFilterSubtypeListRequest) ProvenaInterfaces.RegistryAPI.DatasetListResponse[source]

Gets datasets within the datastore in a paginated fashion.

Parameters:

list_request (NoFilterSubtypeListRequest) – Contains parameters for the specified sorting criteria, optional pagination key and amount of records to fetch.

Returns:

Response of fetching datasets from datastore API.

Return type:

ListRegistryResponse

async generate_presigned_url(presigned_url: ProvenaInterfaces.DataStoreAPI.PresignedURLRequest) ProvenaInterfaces.DataStoreAPI.PresignedURLResponse[source]

Generates a presigned url for an existing dataset within the datastore.

Parameters:

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

Returns:

A response containing the presigned url.

Return type:

PresignedURLResponse

async generate_read_access_credentials(read_access_credentials: ProvenaInterfaces.DataStoreAPI.CredentialsRequest) ProvenaInterfaces.DataStoreAPI.CredentialResponse[source]

Creates a read-access for a certain subdirectory of the S3 bucket.

Parameters:

read_access_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(write_access_credentials: ProvenaInterfaces.DataStoreAPI.CredentialsRequest) ProvenaInterfaces.DataStoreAPI.CredentialResponse[source]

Creates a write-access for a certain subdirectory of the S3 bucket.

Parameters:

write_access_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 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

Raises:
  • CustomTimeoutException – Raised if the request times out.

  • Exception – General exception for handling unexpected errors.

  • ValueError – Raised if there is an issue in parsing the response into the expected model.

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

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

Parameters:

dataset_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

Raises:
  • BadRequestException – Raised if the server returns a 400 status code, indicating a bad request.

  • CustomTimeoutException – Raised if the request times out.

  • Exception – General exception for handling unexpected errors.

  • ValueError – Raised if there is an issue in parsing the response into the expected model.

class provenaclient.clients.SearchClient(auth: provenaclient.clients.client_helpers.AuthManager, config: provenaclient.clients.client_helpers.Config)[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.

_auth
_config
_build_endpoint(endpoint: SearchEndpoints) str[source]
async search_registry(query: str, limit: provenaclient.clients.client_helpers.Optional[int], subtype_filter: provenaclient.clients.client_helpers.Optional[provenaclient.clients.client_helpers.ItemSubType]) ProvenaInterfaces.SearchAPI.QueryResults[source]

Searches registry using search API for given query, limit and subtype.

Parameters:
  • query (str) – The query

  • limit (Optional[int]) – The record result limit

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

Raises:

e – Generic exceptions as usual

Returns:

The results, not loaded.

Return type:

QueryResults

class provenaclient.clients.AuthClient(auth: provenaclient.clients.client_helpers.AuthManager, config: provenaclient.clients.client_helpers.Config)[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.

admin: AuthAdminSubClient
_auth
_config
_build_endpoint(endpoint: AuthEndpoints) str[source]
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) provenaclient.utils.helpers.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

class provenaclient.clients.ProvClient(auth: provenaclient.clients.client_helpers.AuthManager, config: provenaclient.clients.client_helpers.Config)[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.

admin: ProvAdminClient
_auth
_config
_build_endpoint(endpoint: ProvAPIEndpoints) str[source]
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 post_update_model_run(model_run_id: str, reason: str, record: ProvenaInterfaces.ProvenanceAPI.ModelRunRecord) ProvenaInterfaces.ProvenanceAPI.PostUpdateModelRunResponse[source]

Updates an existing model run in the system.

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

  • reason (str) – The reason for the update

  • record (ModelRunRecord) – The updated model run record

Returns:

The response containing the job session ID

Return type:

PostUpdateModelRunResponse

async explore_upstream(starting_id: str, depth: int) ProvenaInterfaces.ProvenanceAPI.LineageResponse[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 response containing the status, node count, and networkx serialised graph response.

Return type:

LineageResponse

async explore_downstream(starting_id: str, depth: int) ProvenaInterfaces.ProvenanceAPI.LineageResponse[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 response containing the status, node count, and networkx serialised graph response.

Return type:

LineageResponse

async get_contributing_datasets(starting_id: str, depth: int) ProvenaInterfaces.ProvenanceAPI.LineageResponse[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 response containing the status, node count, and networkx serialised graph response.

Return type:

LineageResponse

async get_effected_datasets(starting_id: str, depth: int) ProvenaInterfaces.ProvenanceAPI.LineageResponse[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 response containing the status, node count, and networkx serialised graph response.

Return type:

LineageResponse

async get_contributing_agents(starting_id: str, depth: int) ProvenaInterfaces.ProvenanceAPI.LineageResponse[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 response containing the status, node count, and networkx serialised graph response.

Return type:

LineageResponse

async get_effected_agents(starting_id: str, depth: int) ProvenaInterfaces.ProvenanceAPI.LineageResponse[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 response containing the status, node count, and networkx serialised graph response.

Return type:

LineageResponse

async register_batch_model_runs(model_run_batch_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) 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.

async convert_model_runs_to_csv(csv_file_contents: str) ProvenaInterfaces.ProvenanceAPI.ConvertModelRunsResponse[source]

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

Parameters:

csv_file_contents (str) – Contains the model run contents.

Returns:

Returns the model run information in an interactive python datatype.

Return type:

ConvertModelRunsResponse

async regenerate_csv_from_model_run_batch(batch_id: str) 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.

async generate_report(report_request: ProvenaInterfaces.ProvenanceAPI.GenerateReportRequest) provenaclient.clients.client_helpers.ByteString[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 format by making a POST request to the API.

Parameters:

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

Returns:

The raw byte content of the generated .docx file. The type of the returned content will be either bytes or bytearray, which can be directly saved to a file.

Return type:

ByteString

Raises:

AssertionError – If the response content is not found or is not in the expected bytes or bytearray format.

class provenaclient.clients.RegistryClient(auth: provenaclient.clients.client_helpers.AuthManager, config: provenaclient.clients.client_helpers.Config)[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.

admin: RegistryAdminClient
general: RegistryGeneralClient
_auth
_config
_build_subtype_endpoint(action: provenaclient.utils.registry_endpoints.RegistryAction, item_subtype: ProvenaInterfaces.RegistryAPI.ItemSubType) str[source]
_build_general_endpoint(endpoint: GenericRegistryEndpoints) str[source]
async get_health_check() provenaclient.models.general.HealthCheckResponse[source]

Health check the API

Returns:

Response

Return type:

HealthCheckResponse

async fetch_item(id: str, item_subtype: ProvenaInterfaces.RegistryAPI.ItemSubType, fetch_response_model: ProvenaInterfaces.RegistryAPI.Type[provenaclient.clients.client_helpers.BaseModelType], seed_allowed: ProvenaInterfaces.RegistryAPI.Optional[bool] = None) provenaclient.clients.client_helpers.BaseModelType[source]

Ascertains the correct endpoint based on the subtype provided, then runs the fetch operation, parsing the data as the specified model.

Parameters:
  • id (str) – The id of the item to fetch.

  • item_subtype (ItemSubType) – The subtype of the item to fetch.

  • fetch_response_model (Type[BaseModelType]) – The response pydantic model to parse as e.g. OrganisationFetchResponse

  • seed_allowed (Optional[bool], optional) – Should the endpoint throw an error if the item is a seed item? Defaults to None.

Returns:

The fetch response parsed as the specified model.

Return type:

BaseModelType

async update_item(id: str, reason: ProvenaInterfaces.RegistryAPI.Optional[str], item_subtype: ProvenaInterfaces.RegistryAPI.ItemSubType, domain_info: ProvenaInterfaces.RegistryAPI.DomainInfoBase, update_response_model: ProvenaInterfaces.RegistryAPI.Type[provenaclient.clients.client_helpers.BaseModelType]) provenaclient.clients.client_helpers.BaseModelType[source]

Ascertains the correct endpoint then runs the update operation on an existing item by providing new domain info.

Parameters:
  • id (str) – The id of item to update.

  • reason (Optional[str]) – The reason for updating, if any

  • item_subtype (ItemSubType) – The subtype to update

  • domain_info (DomainInfoBase) – The domain info to replace existing item with

  • update_response_model (Type[BaseModelType]) – The response model to parse e.g. StatusResponse

Returns:

The response model parsed

Return type:

BaseModelType

async list_items(list_items_payload: ProvenaInterfaces.RegistryAPI.GeneralListRequest, item_subtype: ProvenaInterfaces.RegistryAPI.ItemSubType, update_model_response: ProvenaInterfaces.RegistryAPI.Type[provenaclient.clients.client_helpers.BaseModelType]) provenaclient.clients.client_helpers.BaseModelType[source]

Lists items within the registry based on filter criteria.

Parameters:
  • list_items_payload (GeneralListRequest) – The request containing filter and sort criteria.

  • item_subtype (ItemSubType) – The subtype of the items to list.

  • update_model_response (Type[BaseModelType]) – The response model to parse.

Returns:

The response containing the list of items.

Return type:

BaseModelType

async seed_item(item_subtype: ProvenaInterfaces.RegistryAPI.ItemSubType, seed_model_response: ProvenaInterfaces.RegistryAPI.Type[provenaclient.clients.client_helpers.BaseModelType]) provenaclient.clients.client_helpers.BaseModelType[source]

Seeds an item in the registry.

Parameters:
  • item_subtype (ItemSubType) – The subtype of the item to seed.

  • seed_model_response (Type[BaseModelType]) – The response model to parse.

Returns:

The response containing the details of the seeded item.

Return type:

BaseModelType

async revert_item(revert_request: ProvenaInterfaces.RegistryAPI.ItemRevertRequest, item_subtype: ProvenaInterfaces.RegistryAPI.ItemSubType) ProvenaInterfaces.RegistryAPI.ItemRevertResponse[source]

Reverts an item in the registry.

Parameters:
  • revert_request (ItemRevertRequest) – The revert request.

  • item_subtype (ItemSubType) – The subtype of the item to revert.

Returns:

The revert response.

Return type:

ItemRevertResponse

async create_item(create_item_request: ProvenaInterfaces.RegistryAPI.DomainInfoBase, item_subtype: ProvenaInterfaces.RegistryAPI.ItemSubType, create_response_model: ProvenaInterfaces.RegistryAPI.Type[provenaclient.clients.client_helpers.BaseModelType]) provenaclient.clients.client_helpers.BaseModelType[source]

Creates an item in the registry.

Parameters:
  • create_item_request (DomainInfoBase) – The domain information required to create the item.

  • item_subtype (ItemSubType) – The subtype of the item to create.

  • create_response_model (Type[BaseModelType]) – The response model to parse.

Returns:

The response containing the details of the created item.

Return type:

BaseModelType

async get_schema(item_subtype: ProvenaInterfaces.RegistryAPI.ItemSubType) ProvenaInterfaces.RegistryAPI.JsonSchemaResponse[source]

Gets the schema for the item subtype.

Parameters:

item_subtype (ItemSubType) – The subtype of the item to get the schema for.

Returns:

The JSON schema response.

Return type:

JsonSchemaResponse

async validate_item(validate_request: ProvenaInterfaces.RegistryAPI.DomainInfoBase, item_subtype: ProvenaInterfaces.RegistryAPI.ItemSubType) ProvenaInterfaces.RegistryAPI.StatusResponse[source]

Validates an item in the registry.

Parameters:
  • validate_request (DomainInfoBase) – The domain information of the item to be validated.

  • item_subtype (ItemSubType) – The subtype of the item to validate.

Returns:

The status response indicating the result of the validation.

Return type:

StatusResponse

async evaluate_auth_access(id: str, item_subtype: ProvenaInterfaces.RegistryAPI.ItemSubType) ProvenaInterfaces.RegistryAPI.DescribeAccessResponse[source]

Evaluates the auth access for an item.

Parameters:
  • id (str) – The ID of the item to evaluate auth access for.

  • item_subtype (ItemSubType) – The subtype of the item to evaluate auth access for.

Returns:

The describe access response.

Return type:

DescribeAccessResponse

async get_auth_configuration(id: str, item_subtype: ProvenaInterfaces.RegistryAPI.ItemSubType) ProvenaInterfaces.RegistryAPI.AccessSettings[source]

Gets the auth configuration for an item.

Parameters:
  • id (str) – The ID of the item to get auth configuration for.

  • item_subtype (ItemSubType) – The subtype of the item to get auth configuration for.

Returns:

The access settings.

Return type:

AccessSettings

async modify_auth_configuration(id: str, auth_change_request: ProvenaInterfaces.RegistryAPI.AccessSettings, item_subtype: ProvenaInterfaces.RegistryAPI.ItemSubType) ProvenaInterfaces.RegistryAPI.StatusResponse[source]

Modifies the auth configuration for an item.

Parameters:
  • id (str) – The ID of the item to modify auth configuration for.

  • auth_change_request (AccessSettings) – The auth change request.

  • item_subtype (ItemSubType) – The subtype of the item to modify auth configuration for.

Returns:

The status response.

Return type:

StatusResponse

async get_auth_roles(item_subtype: ProvenaInterfaces.RegistryAPI.ItemSubType) ProvenaInterfaces.RegistryAPI.AuthRolesResponse[source]

Gets the auth roles for the item subtype.

Parameters:

item_subtype (ItemSubType) – The subtype of the item to get auth roles for.

Returns:

The auth roles response.

Return type:

AuthRolesResponse

async lock_resource(lock_resource_request: ProvenaInterfaces.RegistryAPI.LockChangeRequest, item_subtype: ProvenaInterfaces.RegistryAPI.ItemSubType) ProvenaInterfaces.RegistryAPI.StatusResponse[source]

Locks a resource in the registry.

Parameters:
  • lock_resource_request (LockChangeRequest) – The lock resource request.

  • item_subtype (ItemSubType) – The subtype of the resource to lock.

Returns:

The status response.

Return type:

StatusResponse

async unlock_resource(unlock_resource_request: ProvenaInterfaces.RegistryAPI.LockChangeRequest, item_subtype: ProvenaInterfaces.RegistryAPI.ItemSubType) ProvenaInterfaces.RegistryAPI.StatusResponse[source]

Unlocks a resource in the registry.

Parameters:
  • unlock_resource_request (LockChangeRequest) – The unlock resource request.

  • item_subtype (ItemSubType) – The subtype of the resource to unlock.

Returns:

The status response.

Return type:

StatusResponse

async get_lock_history(handle_id: str, item_subtype: ProvenaInterfaces.RegistryAPI.ItemSubType) ProvenaInterfaces.RegistryAPI.LockHistoryResponse[source]

Gets the lock history for an item.

Parameters:
  • handle_id (str) – The handle ID of the item to get lock history for.

  • item_subtype (ItemSubType) – The subtype of the item to get lock history for.

Returns:

The lock history response.

Return type:

LockHistoryResponse

async get_lock_status(id: str, item_subtype: ProvenaInterfaces.RegistryAPI.ItemSubType) ProvenaInterfaces.RegistryAPI.LockStatusResponse[source]

Gets the lock status for an item.

Parameters:
  • id (str) – The item ID.

  • item_subtype (ItemSubType) – The subtype of the item to get lock status for.

Returns:

The lock status response.

Return type:

LockStatusResponse

async version(version_request: ProvenaInterfaces.RegistryAPI.VersionRequest, item_subtype: ProvenaInterfaces.RegistryAPI.ItemSubType) ProvenaInterfaces.RegistryAPI.VersionResponse[source]

Versions an item in the registry.

Parameters:
  • version_request (VersionRequest) – The version request containing the version details.

  • item_subtype (ItemSubType) – The subtype of the item to version.

Returns:

The version response.

Return type:

VersionResponse

class provenaclient.clients.JobAPIClient(auth: provenaclient.clients.client_helpers.AuthManager, config: provenaclient.clients.client_helpers.Config)[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.

admin: JobAPIAdminSubClient
_auth
_config
_build_endpoint(endpoint: JobAPIEndpoints) str[source]
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

Parameters:

list_jobs_request (ListJobsRequest) – The request including details

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.

Parameters:

list_request (ListByBatchRequest) – The request including batch ID

Returns:

The response including list of jobs

Return type:

ListByBatchResponse

class provenaclient.clients.IdServiceClient(auth: provenaclient.clients.client_helpers.AuthManager, config: provenaclient.clients.client_helpers.Config)[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.

_auth
_config
_build_endpoint(endpoint: IdServiceEndpoints) str[source]
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