ibm_aigov_facts_client.factsheet.utils module
- class Utils(facts_client: FactsClientAdapter)
Bases:
object- get_cloud_object_storage_instances() List[Dict]
Retrieves a list of cloud object storage instances.
This method queries and returns information about all cloud object storage instances available in IBM Cloud.
Warning
Note: This method is applicable only in IBM Cloud and is not available in the Watsonx Governance platform.
- Returns:
- List[Dict]: A list of dictionaries, where each dictionary represents a cloud object storage instance
with the following keys:
Name: The name of the cloud object storage instance.
GUID: The globally unique identifier (GUID) of the instance.
Created ID: The identifier of the creation event.
Creator Name: The name of the creator of the instance.
- Example:
>>> storage_instances = obj.get_cloud_object_storage_instances() >>> for instance in storage_instances: >>> print(instance['Name'], instance['GUID'])
- get_current_phase_master_copy(asset_id: str, catalog_id: str) Dict
Get the Current Phase of the Master Copy
This method retrieves the current phase information for a specific master copy based on the provided asset_id and catalog_id.
- Args:
asset_id (str): The unique identifier of the asset. This parameter is required for retrieving asset information.
catalog_id (str): The identifier for the container that holds the asset. This parameter is required for fetching the data.
- Returns:
dict: A dictionary containing the current phase information of the master copy.
- Example:
>>> current_phase = client.utilities.get_current_phase_master_copy(asset_id="asset_id", catalog_id="catalog_id") # Retrieve current phase for the specified asset and container
- Raises:
ClientError: If any required parameter is missing, or if the asset data or current phase data cannot be retrieved.
- set_current_phase_master_copy(asset_id: str, catalog_id: str, active_phase: str) Dict
Set the Current Phase of the Master Copy
This method sets the phase for a specific master copy asset, given an asset_id, catalog_id, and the desired active_phase.
- Args:
asset_id (str): The unique identifier of the asset.
catalog_id (str): The identifier for the container that holds the asset.
active_phase (str): The phase to set for the asset (e.g., “Develop”, “Validate”, “Operate”, “Decommissioned”).
- Returns:
A dictionary containing the response data.
- Example:
>>> response = client.utilities.set_inventory_phase(asset_id="asset_id", catalog_id="catalog_id", active_phase="Develop") # Sets the phase for the specified asset and catalog
- Raises:
ClientError: If any required parameter is missing, or if the request fails.
- get_all_master_copies(inventory_id: str) Dict
Get All Master Copies
Retrieves all master copies associated with the provided inventory ID.
- Args:
inventory_id (str): The unique identifier for the inventory.
- Returns:
Dict: A dictionary containing the master copies information.
- Example:
>>> master_copies = client.utilities.get_all_master_copies(inventory_id="inventory_id") # all master copies for the specified inventory
- Raises:
ClientError: If the parameter is missing, or if the request fails.
- get_external_model_governance_config_url() str
- get_master_copy_info(model_id: str, container_type: str = None, container_id: str = None)
Retrieves the master copy Id and Inventory Id from mastercopy information
- Returns:
master copy id , inventory id
- Example:
>>> client.utilities.get_master_copy_id
- Raises:
ClientError: If the master copy information is missing, or if the request fails.
- get_mastercopy_evaluations(mastercopy_id: str, inventory_id: str)
Retrieves all the evaluation results for all lifecycle phases from a master copy
- Returns:
dictionary containing the evaluation results for all phases
- Example:
>>> client.utilities.retrieve_mastercopy_evaluations
- Raises:
ClientError: If the master copy imformation is missing, or if the request fails.