provenaclient.modules.registry
Created Date: Thursday June 6th 2024 +1000 Author: Peter Baker —– Last Modified: Thursday June 6th 2024 1:39:55 pm +1000 Modified By: Peter Baker —– Description: Registry API L3 module. —– HISTORY: Date By Comments ———- — ———————————————————
12-07-2024 | Parth Kulkarni | Adding some useful L3 methods to retrieve summarized info of registry items. 28-06-2024 | Parth Kulkarni | Completion of Registry L3 interface with General, Admin and Other endpoints. 18-06-2024 | Peter Baker | Initial proof of concept with fetch/update methods from L2. Sub Modules for each subtype.
Attributes
Classes
This class interface just captures that the client has an instantiated auth |
|
This class interface just captures that the client has an instantiated auth |
|
This class interface just captures that the client has an instantiated auth |
|
This class interface just captures that the client has an instantiated auth |
|
This class interface just captures that the client has an instantiated auth |
|
This class interface just captures that the client has an instantiated auth |
|
This class interface just captures that the client has an instantiated auth |
|
This class interface just captures that the client has an instantiated auth |
|
This class interface just captures that the client has an instantiated auth |
|
This class interface just captures that the client has an instantiated auth |
|
This class interface just captures that the client has an instantiated auth |
|
This class interface just captures that the client has an instantiated auth |
|
This class interface just captures that the client has an instantiated auth |
Module Contents
- provenaclient.modules.registry.DEFAULT_CONFIG_FILE_NAME = 'registry-api.env'
- class provenaclient.modules.registry.RegistryAdminClient(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
- _auth
- _config
- async export_items() ProvenaInterfaces.RegistryAPI.RegistryExportResponse [source]
Provides a mechanism for admins to dump the current contents of the registry table without any validation/parsing.
- Returns:
A status response including items in the payload
- Return type:
RegistryExportResponse
- async import_items(registry_import_request: ProvenaInterfaces.RegistryAPI.RegistryImportRequest) ProvenaInterfaces.RegistryAPI.RegistryImportResponse [source]
This admin only endpoint enables rapid restoration of items in into the registry table.
- Parameters:
registry_import_request (RegistryImportRequest) – Contains the import mode, more info can be found on API docs.
- Returns:
Returns an import response which includes status + statistics.
- Return type:
RegistryImportResponse
- async restore_items_from_dynamo_table(restore_request: ProvenaInterfaces.RegistryAPI.RegistryRestoreRequest) ProvenaInterfaces.RegistryAPI.RegistryImportResponse [source]
Provides an admin only mechanism for copying/restoring the contents from another dynamoDB table into the currently active registry table. This endpoint does not create any new tables - it just uses the items from a restored table (e.g. from a backup) as inputs to an import operation against the current registry table.
- Parameters:
restore_request (RegistryRestoreRequest) – The restore request settings - these will be used when propagating the items from the external table.
- Returns:
Returns information about the import, including status and statistics.
- Return type:
RegistryImportResponse
- async generate_config_file(required_only: bool = True, file_path: str | None = None, write_to_file: bool = False) str [source]
Generates a nicely formatted .env file of the current required/non supplied properties Used to quickly bootstrap a local environment or to understand currently deployed API.
- Parameters:
required_only (bool, optional) – By default True
file_path (str, optional) – The path you want to save the config file at WITH the file name. If you don’t specify a path this will be saved in a relative directory.
write_to_file (bool, By default False) – A boolean flag to indicate whether you want to save the config response to a file or not.
- Returns:
str
- Return type:
Response containing the config text.
- async delete(id: str, item_subtype: ProvenaInterfaces.RegistryAPI.ItemSubType | None = None) ProvenaInterfaces.RegistryAPI.StatusResponse [source]
Admin only endpoint for deleting item from registry. USE CAREFULLY!
- Parameters:
id (str) – ID of entity/item you want to delete.
item_subtype (Optional[ItemSubType]) – Subtype of item you want to delete (E.g ORGANISATION, PERSON, CREATE) If not provided, it will be fetched from the registry.
- Returns:
Response indicating the success/failure of your request.
- Return type:
StatusResponse
- class provenaclient.modules.registry.RegistryBaseClass(auth: provenaclient.modules.module_helpers.AuthManager, config: provenaclient.modules.module_helpers.Config, registry_client: provenaclient.clients.RegistryClient, item_subtype: ProvenaInterfaces.RegistryAPI.ItemSubType)[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
- _auth
- _config
- item_subtype
- async admin_delete(id: str) ProvenaInterfaces.RegistryAPI.StatusResponse [source]
Admin only endpoint for deleting item from registry. USE CAREFULLY!
- Parameters:
id (str) – ID of entity/item you want to delete.
- Returns:
Response indicating the success/failure of your request.
- Return type:
StatusResponse
- async revert_item(revert_request: ProvenaInterfaces.RegistryAPI.ItemRevertRequest) ProvenaInterfaces.RegistryAPI.ItemRevertResponse [source]
Reverts an item in the registry based on item subtype.
- Parameters:
revert_request (ItemRevertRequest) – The revert request
- Returns:
The revert response
- Return type:
ItemRevertResponse
- async get_schema() ProvenaInterfaces.RegistryAPI.JsonSchemaResponse [source]
Gets the schema for the item subtype
- Returns:
The JSON schema response
- Return type:
JsonSchemaResponse
- async evaluate_auth_access(id: str) ProvenaInterfaces.RegistryAPI.DescribeAccessResponse [source]
Evaluates the auth access for an item based on item subtype.
- Parameters:
id (str) – The item ID
- Returns:
The describe access response
- Return type:
DescribeAccessResponse
- async get_auth_configuration(id: str) ProvenaInterfaces.RegistryAPI.AccessSettings [source]
Gets the auth configuration for an item based on item subtype.
- Parameters:
id (str) – The item ID
- Returns:
The access settings
- Return type:
AccessSettings
- async modify_auth_configuration(id: str, auth_change_request: ProvenaInterfaces.RegistryAPI.AccessSettings) ProvenaInterfaces.RegistryAPI.StatusResponse [source]
Modifies the auth configuration for an item based on item subtype.
- Parameters:
id (str) – The item ID
auth_change_request (AccessSettings) – The auth change request
- Returns:
The status response
- Return type:
StatusResponse
- async get_auth_roles() ProvenaInterfaces.RegistryAPI.AuthRolesResponse [source]
Gets the auth roles for the item subtype.
- Returns:
The auth roles response
- Return type:
AuthRolesResponse
- async lock_resource(lock_resource_request: ProvenaInterfaces.RegistryAPI.LockChangeRequest) ProvenaInterfaces.RegistryAPI.StatusResponse [source]
Locks a resource in the registry based on item subtype.
- Parameters:
lock_resource_request (LockChangeRequest) – The lock resource request
- Returns:
The status response
- Return type:
StatusResponse
- async unlock_resource(unlock_resource_request: ProvenaInterfaces.RegistryAPI.LockChangeRequest) ProvenaInterfaces.RegistryAPI.StatusResponse [source]
Unlocks a resource in the registry based on item subtype.
- Parameters:
unlock_resource_request (LockChangeRequest) – The unlock resource request
- Returns:
The status response
- Return type:
StatusResponse
- class provenaclient.modules.registry.OrganisationClient(auth: provenaclient.modules.module_helpers.AuthManager, config: provenaclient.modules.module_helpers.Config, registry_client: provenaclient.clients.RegistryClient)[source]
Bases:
RegistryBaseClass
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
- async fetch(id: str, seed_allowed: bool | None = None) ProvenaInterfaces.RegistryAPI.OrganisationFetchResponse [source]
Fetches an organisation from the registry
- Parameters:
id (str) – The organisation ID
seed_allowed (Optional[bool], optional) – Allow seed items. Defaults to None.
- Returns:
The fetch response
- Return type:
OrganisationFetchResponse
- async update(id: str, domain_info: ProvenaInterfaces.RegistryAPI.OrganisationDomainInfo, reason: str | None) ProvenaInterfaces.RegistryAPI.StatusResponse [source]
Updates an organisation in the registry
- Parameters:
id (str) – The id of the organisation
domain_info (OrganisationDomainInfo) – The new domain info
reason (Optional[str]) – The reason if any
- Returns:
Status response
- Return type:
StatusResponse
- async list_items(list_items_payload: ProvenaInterfaces.RegistryAPI.GeneralListRequest) ProvenaInterfaces.RegistryAPI.OrganisationListResponse [source]
Lists all organisations within the registry based on filter criteria.
- Parameters:
list_items_payload (GeneralListRequest) – Payload containing the filter/sort criteria
- Returns:
OrganisationListResponse
- Return type:
The list response
- async seed_item() ProvenaInterfaces.RegistryAPI.OrganisationSeedResponse [source]
Seeds an organisation in the registry
- Returns:
OrganisationSeedResponse
- Return type:
The seed response
- async create_item(create_item_request: ProvenaInterfaces.RegistryAPI.OrganisationDomainInfo) ProvenaInterfaces.RegistryAPI.OrganisationCreateResponse [source]
Creates an organisation in the registry
- Parameters:
create_item_request (OrganisationDomainInfo) – The create item request
- Returns:
OrganisationCreateResponse
- Return type:
The create response
- async validate_item(validate_request: ProvenaInterfaces.RegistryAPI.OrganisationDomainInfo) ProvenaInterfaces.RegistryAPI.StatusResponse [source]
Validates an organisation in the registry
- Parameters:
validate_request (OrganisationDomainInfo) – The validate request
- Returns:
StatusResponse
- Return type:
The status response
- class provenaclient.modules.registry.PersonClient(auth: provenaclient.modules.module_helpers.AuthManager, config: provenaclient.modules.module_helpers.Config, registry_client: provenaclient.clients.RegistryClient)[source]
Bases:
RegistryBaseClass
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
- async fetch(id: str, seed_allowed: bool | None = None) ProvenaInterfaces.RegistryAPI.PersonFetchResponse [source]
Fetches a person from the registry
- Parameters:
id (str) – The person ID
seed_allowed (Optional[bool], optional) – Allow seed items. Defaults to None.
- Returns:
The fetch response
- Return type:
PersonFetch
- async update(id: str, domain_info: ProvenaInterfaces.RegistryAPI.PersonDomainInfo, reason: str | None) ProvenaInterfaces.RegistryAPI.StatusResponse [source]
Updates a person in the registry
- Parameters:
id (str) – The id of the organisation
domain_info (OrganisationDomainInfo) – The new domain info
reason (Optional[str]) – The reason if any
- Returns:
Status response
- Return type:
StatusResponse
- async list_items(list_items_payload: ProvenaInterfaces.RegistryAPI.GeneralListRequest) ProvenaInterfaces.RegistryAPI.PersonListResponse [source]
Lists all person(s) within registry based on filter criteria.
- Parameters:
list_items_payload (GeneralListRequest) – Payload contaning the filter/sort criteria
- async seed_item() ProvenaInterfaces.RegistryAPI.PersonSeedResponse [source]
Seeds a person in the registry
- Returns:
PersonSeedResponse
- Return type:
The seed response
- async create_item(create_item_request: ProvenaInterfaces.RegistryAPI.PersonDomainInfo) ProvenaInterfaces.RegistryAPI.PersonCreateResponse [source]
Creates a person in the registry
- Parameters:
create_item_request (OrganisationDomainInfo) – The create item request
- Returns:
PersonCreateResponse
- Return type:
The create response
- async validate_item(validate_request: ProvenaInterfaces.RegistryAPI.PersonDomainInfo) ProvenaInterfaces.RegistryAPI.StatusResponse [source]
Validates a person in the registry
- Parameters:
validate_request (PersonDomainInfo) – The validate request
- Returns:
StatusResponse
- Return type:
The status response
- class provenaclient.modules.registry.CreateActivityClient(auth: provenaclient.modules.module_helpers.AuthManager, config: provenaclient.modules.module_helpers.Config, registry_client: provenaclient.clients.RegistryClient)[source]
Bases:
RegistryBaseClass
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
- async fetch(id: str, seed_allowed: bool | None = None) ProvenaInterfaces.RegistryAPI.CreateFetchResponse [source]
Fetches a create activity item from the registry
- Parameters:
id (str) – The create activity item ID
seed_allowed (Optional[bool], optional) – Allow seed items. Defaults to None.
- Returns:
The fetch response
- Return type:
CreateFetchResponse
- async list_items(list_items_payload: ProvenaInterfaces.RegistryAPI.GeneralListRequest) ProvenaInterfaces.RegistryAPI.CreateListResponse [source]
Lists all create activity items within the registry based on filter criteria.
- Parameters:
list_items_payload (GeneralListRequest) – Payload containing the filter/sort criteria
- Returns:
CreateListResponse
- Return type:
The list response
- async validate_item(validate_request: ProvenaInterfaces.RegistryAPI.CreateDomainInfo) ProvenaInterfaces.RegistryAPI.StatusResponse [source]
Validates a create-item activity in the registry
- Parameters:
validate_request (CreateDomainInfo) – The validate request
- Returns:
StatusResponse
- Return type:
The status response
- class provenaclient.modules.registry.VersionActivityClient(auth: provenaclient.modules.module_helpers.AuthManager, config: provenaclient.modules.module_helpers.Config, registry_client: provenaclient.clients.RegistryClient)[source]
Bases:
RegistryBaseClass
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
- async fetch(id: str, seed_allowed: bool | None = None) ProvenaInterfaces.RegistryAPI.VersionFetchResponse [source]
Fetches a version activity item from the registry
- Parameters:
id (str) – The version activity item ID
seed_allowed (Optional[bool], optional) – Allow seed items. Defaults to None.
- Returns:
The fetch response
- Return type:
VersionFetchResponse
- async list_items(list_items_payload: ProvenaInterfaces.RegistryAPI.GeneralListRequest) ProvenaInterfaces.RegistryAPI.VersionListResponse [source]
Lists all version activity items within the registry based on filter criteria.
- Parameters:
list_items_payload (GeneralListRequest) – Payload containing the filter/sort criteria
- Returns:
VersionListResponse
- Return type:
The list response
- async validate_item(validate_request: ProvenaInterfaces.RegistryAPI.VersionDomainInfo) ProvenaInterfaces.RegistryAPI.StatusResponse [source]
Validates a version activity in the registry
- Parameters:
validate_request (VersionDomainInfo) – The validate request
- Returns:
StatusResponse
- Return type:
The status response
- class provenaclient.modules.registry.ModelRunActivityClient(auth: provenaclient.modules.module_helpers.AuthManager, config: provenaclient.modules.module_helpers.Config, registry_client: provenaclient.clients.RegistryClient)[source]
Bases:
RegistryBaseClass
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
- async fetch(id: str, seed_allowed: bool | None = None) ProvenaInterfaces.RegistryAPI.ModelRunFetchResponse [source]
Fetches a model run activity item from the registry
- Parameters:
id (str) – The model run activity item ID
seed_allowed (Optional[bool], optional) – Allow seed items. Defaults to None.
- Returns:
The fetch response
- Return type:
ModelRunFetchResponse
- async list_items(list_items_payload: ProvenaInterfaces.RegistryAPI.GeneralListRequest) ProvenaInterfaces.RegistryAPI.ModelRunListResponse [source]
Lists all model run activity items within the registry based on filter criteria.
- Parameters:
list_items_payload (GeneralListRequest) – Payload containing the filter/sort criteria
- Returns:
ModelRunListResponse
- Return type:
The list response
- async validate_item(validate_request: ProvenaInterfaces.RegistryAPI.ModelRunDomainInfo) ProvenaInterfaces.RegistryAPI.StatusResponse [source]
Validates a model run in the registry
- Parameters:
validate_request (ModelRunDomainInfo) – The validate request
- Returns:
StatusResponse
- Return type:
The status response
- class provenaclient.modules.registry.ModelClient(auth: provenaclient.modules.module_helpers.AuthManager, config: provenaclient.modules.module_helpers.Config, registry_client: provenaclient.clients.RegistryClient)[source]
Bases:
RegistryBaseClass
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
- async fetch(id: str, seed_allowed: bool | None = None) ProvenaInterfaces.RegistryAPI.ModelFetchResponse [source]
Fetches a model from the registry
- Parameters:
id (str) – The model ID
seed_allowed (Optional[bool], optional) – Allow seed items. Defaults to None.
- Returns:
The fetch response
- Return type:
ModelFetchResponse
- async update(id: str, domain_info: ProvenaInterfaces.RegistryAPI.ModelDomainInfo, reason: str | None) ProvenaInterfaces.RegistryAPI.StatusResponse [source]
Updates a model in the registry
- Parameters:
id (str) – The id of the model
domain_info (ModelDomainInfo) – The new domain info
reason (Optional[str]) – The reason if any
- Returns:
Status response
- Return type:
StatusResponse
- async list_items(list_items_payload: ProvenaInterfaces.RegistryAPI.GeneralListRequest) ProvenaInterfaces.RegistryAPI.ModelListResponse [source]
Lists all model(s) within registry based on filter criteria.
- Parameters:
list_items_payload (GeneralListRequest) – Payload contaning the filter/sort criteria
- async seed_item() ProvenaInterfaces.RegistryAPI.ModelSeedResponse [source]
Seeds a model in the registry
- Returns:
ModelSeedResponse
- Return type:
The seed response
- async create_item(create_item_request: ProvenaInterfaces.RegistryAPI.ModelDomainInfo) ProvenaInterfaces.RegistryAPI.ModelCreateResponse [source]
Creates a model in the registry
- Parameters:
create_item_request (ModelDomainInfo) – The create item request
- Returns:
ModelCreateResponse
- Return type:
The create response
- async validate_item(validate_request: ProvenaInterfaces.RegistryAPI.ModelDomainInfo) ProvenaInterfaces.RegistryAPI.StatusResponse [source]
Validates a model item in the registry
- Parameters:
validate_request (ModelDomainInfo) – The validate request
- Returns:
StatusResponse
- Return type:
The status response
- class provenaclient.modules.registry.ModelRunWorkFlowClient(auth: provenaclient.modules.module_helpers.AuthManager, config: provenaclient.modules.module_helpers.Config, registry_client: provenaclient.clients.RegistryClient)[source]
Bases:
RegistryBaseClass
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
- async fetch(id: str, seed_allowed: bool | None = None) ProvenaInterfaces.RegistryAPI.ModelRunWorkflowTemplateFetchResponse [source]
Fetches a model run workflow template from the registry
- Parameters:
id (str) – The model run workflow template ID
seed_allowed (Optional[bool], optional) – Allow seed items. Defaults to None.
- Returns:
The fetch response
- Return type:
ModelFetchResponse
- async update(id: str, domain_info: ProvenaInterfaces.RegistryAPI.ModelRunWorkflowTemplateDomainInfo, reason: str | None) ProvenaInterfaces.RegistryAPI.StatusResponse [source]
Updates a model in the registry
- Parameters:
id (str) – The id of the model
domain_info (ModelDomainInfo) – The new domain info
reason (Optional[str]) – The reason if any
- Returns:
Status response
- Return type:
StatusResponse
- async list_items(list_items_payload: ProvenaInterfaces.RegistryAPI.GeneralListRequest) ProvenaInterfaces.RegistryAPI.ModelRunWorkflowTemplateListResponse [source]
Lists all model(s) within registry based on filter criteria.
- Parameters:
list_items_payload (GeneralListRequest) – Payload contaning the filter/sort criteria
- async seed_item() ProvenaInterfaces.RegistryAPI.ModelRunWorkflowTemplateSeedResponse [source]
Seeds a model run workflow template in the registry
- Returns:
ModelRunWorkflowTemplateSeedResponse
- Return type:
The seed response
- async create_item(create_item_request: ProvenaInterfaces.RegistryAPI.ModelRunWorkflowTemplateDomainInfo) ProvenaInterfaces.RegistryAPI.ModelRunWorkflowTemplateCreateResponse [source]
Creates a model run workflow template in the registry
- Parameters:
create_item_request (ModelRunWorkflowTemplateDomainInfo) – The create item request
- Returns:
ModelRunWorkflowTemplateCreateResponse
- Return type:
The create response
- async validate_item(validate_request: ProvenaInterfaces.RegistryAPI.ModelRunWorkflowTemplateDomainInfo) ProvenaInterfaces.RegistryAPI.StatusResponse [source]
Validates a model run workflow template item in the registry
- Parameters:
validate_request (ModelRunWorkflowTemplateDomainInfo) – The validate request
- Returns:
StatusResponse
- Return type:
The status response
- async version_item(version_request: ProvenaInterfaces.RegistryAPI.VersionRequest) ProvenaInterfaces.RegistryAPI.VersionResponse [source]
Versions a model run workflow template in the registry
- Parameters:
version_request (VersionRequest) – The version request
- Returns:
VersionResponse
- Return type:
The version response
- class provenaclient.modules.registry.DatasetTemplateClient(auth: provenaclient.modules.module_helpers.AuthManager, config: provenaclient.modules.module_helpers.Config, registry_client: provenaclient.clients.RegistryClient)[source]
Bases:
RegistryBaseClass
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
- async fetch(id: str, seed_allowed: bool | None = None) ProvenaInterfaces.RegistryAPI.DatasetTemplateFetchResponse [source]
Fetches a dataset template from the registry
- Parameters:
id (str) – The dataset template ID
seed_allowed (Optional[bool], optional) – Allow seed items. Defaults to None.
- Returns:
The fetch response
- Return type:
DatasetTemplateFetchResponse
- async update(id: str, domain_info: ProvenaInterfaces.RegistryAPI.DatasetTemplateDomainInfo, reason: str | None) ProvenaInterfaces.RegistryAPI.StatusResponse [source]
Updates a dataset template in the registry
- Parameters:
id (str) – The id of the dataset template
domain_info (DatasetTemplateDomainInfo) – The new domain info
reason (Optional[str]) – The reason if any
- Returns:
Status response
- Return type:
StatusResponse
- async list_items(list_items_payload: ProvenaInterfaces.RegistryAPI.GeneralListRequest) ProvenaInterfaces.RegistryAPI.DatasetTemplateListResponse [source]
Lists all dataset templates within the registry based on filter criteria.
- Parameters:
list_items_payload (GeneralListRequest) – Payload containing the filter/sort criteria
- async seed_item() ProvenaInterfaces.RegistryAPI.DatasetTemplateSeedResponse [source]
Seeds a dataset template in the registry
- Returns:
DatasetTemplateSeedResponse
- Return type:
The seed response
- async create_item(create_item_request: ProvenaInterfaces.RegistryAPI.DatasetTemplateDomainInfo) ProvenaInterfaces.RegistryAPI.DatasetTemplateCreateResponse [source]
Creates a dataset template in the registry
- Parameters:
create_item_request (DatasetTemplateDomainInfo) – The create item request
- Returns:
DatasetTemplateCreateResponse
- Return type:
The create response
- async validate_item(validate_request: ProvenaInterfaces.RegistryAPI.DatasetTemplateDomainInfo) ProvenaInterfaces.RegistryAPI.StatusResponse [source]
Validates a dataset template item in the registry
- Parameters:
validate_request (DatasetTemplateDomainInfo) – The validate request
- Returns:
StatusResponse
- Return type:
The status response
- async version_item(version_request: ProvenaInterfaces.RegistryAPI.VersionRequest) ProvenaInterfaces.RegistryAPI.VersionResponse [source]
Versions a dataset template in the registry
- Parameters:
version_request (VersionRequest) – The version request
- Returns:
VersionResponse
- Return type:
The version response
- class provenaclient.modules.registry.DatasetClient(auth: provenaclient.modules.module_helpers.AuthManager, config: provenaclient.modules.module_helpers.Config, registry_client: provenaclient.clients.RegistryClient)[source]
Bases:
RegistryBaseClass
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
- async fetch(id: str, seed_allowed: bool | None = None) ProvenaInterfaces.RegistryAPI.DatasetFetchResponse [source]
Fetches a dataset from the registry
- Parameters:
id (str) – The dataset ID
seed_allowed (Optional[bool], optional) – Allow seed items. Defaults to None.
- Returns:
The fetch response
- Return type:
DatasetFetchResponse
- async list_items(list_items_payload: ProvenaInterfaces.RegistryAPI.GeneralListRequest) ProvenaInterfaces.RegistryAPI.DatasetListResponse [source]
Lists all datasets within the registry based on filter criteria.
- Parameters:
list_items_payload (GeneralListRequest) – Payload containing the filter/sort criteria
- Returns:
DatasetListResponse
- Return type:
The list response
- async validate_item(validate_request: ProvenaInterfaces.RegistryAPI.DatasetDomainInfo) ProvenaInterfaces.RegistryAPI.StatusResponse [source]
Validates a dataset item in the registry
- Parameters:
validate_request (DatasetDomainInfo) – The validate request
- Returns:
StatusResponse
- Return type:
The status response
- class provenaclient.modules.registry.StudyClient(auth: provenaclient.modules.module_helpers.AuthManager, config: provenaclient.modules.module_helpers.Config, registry_client: provenaclient.clients.RegistryClient)[source]
Bases:
RegistryBaseClass
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
- async fetch(id: str, seed_allowed: bool | None = None) ProvenaInterfaces.RegistryAPI.StudyFetchResponse [source]
Fetches a study from the registry
- Parameters:
id (str) – The study ID
seed_allowed (Optional[bool], optional) – Allow seed items. Defaults to None.
- Returns:
The fetch response
- Return type:
StudyFetchResponse
- async list_items(list_items_payload: ProvenaInterfaces.RegistryAPI.GeneralListRequest) ProvenaInterfaces.RegistryAPI.StudyListResponse [source]
Lists all studies within the registry based on filter criteria.
- Parameters:
list_items_payload (GeneralListRequest) – Payload containing the filter/sort criteria
- Returns:
StudyListResponse
- Return type:
The list response
- async seed_item() ProvenaInterfaces.RegistryAPI.StudySeedResponse [source]
Seeds a study in the registry
- Returns:
StudySeedResponse
- Return type:
The seed response
- async update(id: str, domain_info: ProvenaInterfaces.RegistryAPI.StudyDomainInfo, reason: str | None) ProvenaInterfaces.RegistryAPI.StatusResponse [source]
Updates a study in the registry
- Parameters:
id (str) – The id of the study
domain_info (StudyDomainInfo) – The new domain info
reason (Optional[str]) – The reason, if any
- Returns:
StatusResponse
- Return type:
Status response
- async create_item(create_item_request: ProvenaInterfaces.RegistryAPI.StudyDomainInfo) ProvenaInterfaces.RegistryAPI.StudyCreateResponse [source]
Creates a study in the registry
- Parameters:
create_item_request (StudyDomainInfo) – The create item request
- Returns:
StudyCreateResponse
- Return type:
The create response
- async validate_item(validate_request: ProvenaInterfaces.RegistryAPI.StudyDomainInfo) ProvenaInterfaces.RegistryAPI.StatusResponse [source]
Validates a study item in the registry
- Parameters:
validate_request (StudyDomainInfo) – The validate request
- Returns:
StatusResponse
- Return type:
The status response
- class provenaclient.modules.registry.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:
- 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]