media_storage_delete.py
Run the Example
1
Set up your virtual environment
2
Install dependencies
3
Export environment variables
4
Configure AWS credentials
Configure the AWS SDK default credential chain with environment variables, a shared credentials file, or an IAM role.
5
Run the example
Save the code above as
media_storage_delete.py, then run:6
Attach and read a file
In another terminal with
curl and jq, attach a repository file, resolve its storage key from the session, and read it through AgentOS:7
Delete the session and request cleanup
Delete the rows and request the best-effort storage sweep. Verify the object separately in S3 when cleanup assurance matters: