Inventory Methods
This section provides details on the various methods available for managing inventory items.These methods include retrieving inventory information, updating inventory details, and deleting inventory items.
- get_info(self) None
Retrieve and display information related to the Inventory.
This method does not take any parameters
- Example:
>>> inventory.get_info()
- get_id(self) str
Retrieve the Inventory ID.
This method does not take any parameters and returns the Inventory ID.
- Returns:
str: The ID of the inventory.
- Example:
>>> inventory_id = inventory.get_id()
- set_detail(self, name: str = None, description: str = None)
set details of an inventory item.
It allows updating the name and/or description of the inventory.
- Parameters:
name (str, optional): The new name to set for the inventory. If not provided, the name will not be changed.
description (str, optional): The new description to set for the inventory. If not provided, the description will not be changed.
- Example:
>>> innventory.set_detail(name="New Name", description="Updated description")
- delete_inventory(self, force_delete: bool = False)
Delete the inventory.
This method also deletes the associated bucket created in IBM Cloud. Use this function with caution, as deletion is irreversible.
- Args:
force_delete (bool): If True, forces the deletion without checking for assets. Default is False.
- Example:
>>> inventory.delete_inventory(force_delete=True)