---------------------------------------------------------------------- This is the API documentation for the gdtest_stress_everything library. ---------------------------------------------------------------------- ## Core API Main functions create_resource(name: str, kind: str = 'default') -> dict Create a new resource with the given name and kind. Initializes a resource and registers it in the internal registry. Uses :py:func:`validate_input` to check the name and :py:class:`ResourceManager` for lifecycle management. .. versionadded:: 2.0 .. note:: This replaces the deprecated ``make_resource`` function. Parameters ---------- name : str The name of the resource. Must be non-empty and contain only alphanumeric characters and hyphens. kind : str, optional The type of resource to create. One of ``"default"``, ``"premium"``, or ``"ephemeral"``. Defaults to ``"default"``. Returns ------- dict A dictionary with the following keys: - ``"name"`` — the resource name (str). - ``"kind"`` — the resource kind (str). - ``"id"`` — the assigned resource ID (int). Raises ------ ValueError If ``name`` is empty or ``kind`` is not recognized. Notes ----- Resources created with ``kind="ephemeral"`` are automatically garbage-collected after 24 hours. The cleanup runs on a background timer managed by :py:class:`ResourceManager`. The resource ID is assigned sequentially using an atomic counter, so IDs are guaranteed to be unique within a single process. See Also -------- ResourceManager : Manages resource lifecycle. validate_input : Validates resource names. Examples -------- Create a default resource: >>> res = create_resource("my-item") >>> res["kind"] 'default' Create a premium resource: >>> res = create_resource("premium-item", kind="premium") >>> res["name"] 'premium-item' ResourceManager(namespace: str) Manages the lifecycle of resources. Provides methods for creating, reading, updating, deleting, listing, and reporting on resources. Parameters ---------- namespace : str The namespace for this manager instance. Examples -------- >>> mgr = ResourceManager("production") >>> mgr.list_resources() [] ## Utilities Helpers format_output(result: dict) -> str Format a result dictionary as a readable string. Parameters ---------- result : dict The result dictionary to format. Returns ------- str A formatted string representation. See Also -------- validate_input : Validates input before processing. Examples -------- >>> format_output({"name": "test", "id": 1}) 'name=test, id=1' validate_input(name: str) -> bool Validate a resource name. Parameters ---------- name : str The resource name to validate. Returns ------- bool True if the name is valid. Raises ------ ValueError If the name is empty or contains invalid characters. Examples -------- >>> validate_input("my-resource") True >>> validate_input("") Traceback (most recent call last): ... ValueError: name must not be empty ---------------------------------------------------------------------- This is the User Guide documentation for the package. ---------------------------------------------------------------------- ## Basics # Introduction Welcome to the Everything Stress Test package. # Installation Install the package using pip. ## Advanced # Advanced Usage Advanced topics for power users.