rollback_file

rollback_file: Restore Previous File Version

Reverts a file to a previous version.

def rollback_file(
    agent_name: str, 
    file_path: str,
    n: int,
    base_url: str = aios_kernel_url
) -> StorageResponse

Parameters:

  • agent_name: Identifier for the agent making the request

  • file_path: Path to the file to roll back

  • n: Number of versions to roll back (1 for previous version)

  • base_url: API endpoint URL

Returns:

  • StorageResponse object containing rollback status

Example:

# Roll back a configuration file to its previous version
response = rollback_file(
    "system_agent",
    "config/app_settings.json",
    n=1
)

print(response["response"]["response_message"])

Last updated