OpenStack Swift icon

OpenStack Swift

Interact with OpenStack Swift

object → Delete Object

AI-generated

Summary

Delete a Swift object from a specified container

Inputs

  • containerName (required) — Name of the container holding the object to delete.
  • objectName (required) — Name (or key) of the object to delete.

Output shape

success/failure only (no response body)

Returns no body on success; an error is raised if the request fails.

Examples

Example 1: Delete a single object

containerName = "myContainer", objectName = "myFile.txt"

Example 2: Delete multiple objects in a loop

iteration over a list where each item sets containerName and objectName before deleteObject

Example 3: Delete an empty container (if allowed)

containerName = "temp", objectName = "" (will error if object does not exist)

Discussion