### SwiftProxy Configuration File Examples Source: https://context7.com/bouncestorage/swiftproxy/llms.txt Examples of SwiftProxy configuration files for different storage backends. ```APIDOC ## SwiftProxy Configuration File Examples ### Basic configuration for in-memory transient storage (testing) ```properties swiftproxy.endpoint=http://127.0.0.1:8080 jclouds.provider=transient jclouds.identity=test:tester jclouds.credential=testing ``` ### Configuration for Amazon S3 backend ```properties swiftproxy.endpoint=http://0.0.0.0:8080 jclouds.provider=aws-s3 jclouds.identity=AWS_ACCESSKEY jclouds.credential=AWS_CREDENTIAL jclouds.region=us-west-2 ``` ### Configuration for local filesystem backend ```properties swiftproxy.endpoint=http://127.0.0.1:8080 jclouds.provider=filesystem jclouds.identity=test:tester jclouds.credential=testing jclouds.filesystem.basedir=/tmp/swiftproxy ``` ### Configuration for OpenStack Swift backend ```properties swiftproxy.endpoint=http://127.0.0.1:8080 jclouds.provider=openstack-swift jclouds.endpoint=http://swift-server:8080/auth/v1.0 jclouds.keystone.credential-type=tempAuthCredentials jclouds.identity=test:tester jclouds.credential=testing ``` ``` -------------------------------- ### Configure SwiftProxy with Local Filesystem Source: https://github.com/bouncestorage/swiftproxy/blob/master/README.md Example properties file to configure SwiftProxy to use the local filesystem as the backing store. Specifies the endpoint and base directory for storage. ```properties swiftproxy.endpoint=http://127.0.0.1:8080 jclouds.provider=filesystem jclouds.identity=test:tester jclouds.credential=testing jclouds.filesystem.basedir=/tmp/swiftproxy ``` -------------------------------- ### Configure SwiftProxy with Amazon S3 Source: https://github.com/bouncestorage/swiftproxy/blob/master/README.md Example properties file to configure SwiftProxy to use Amazon S3 as the backing store. Includes endpoint, AWS credentials, and region. ```properties swiftproxy.endpoint=http://0.0.0.0:8080 jclouds.provider=aws-s3 jclouds.identity=AWS_ACCESSKEY jclouds.credential=AWS_CREDENTIAL jclouds.region=us-west-2 ``` -------------------------------- ### Get DLO Manifest Only Source: https://context7.com/bouncestorage/swiftproxy/llms.txt Retrieve only the manifest of a Dynamic Large Object (DLO), not the assembled object content. Use the ?multipart-manifest=get query parameter. ```bash curl -H "X-Auth-Token: $AUTH_TOKEN" \ "http://127.0.0.1:8080/v1/AUTH_test:tester/mycontainer/largefile.bin?multipart-manifest=get" ``` -------------------------------- ### Get Object Metadata Source: https://context7.com/bouncestorage/swiftproxy/llms.txt Retrieve metadata for a specific object using the HEAD method. ```bash curl -I -H "X-Auth-Token: $AUTH_TOKEN" \ http://127.0.0.1:8080/v1/AUTH_test:tester/mycontainer/myfile.bin ``` -------------------------------- ### Get SLO Manifest JSON Source: https://context7.com/bouncestorage/swiftproxy/llms.txt Retrieve the JSON manifest of a Static Large Object (SLO) using the ?multipart-manifest=get query parameter. ```bash curl -H "X-Auth-Token: $AUTH_TOKEN" \ "http://127.0.0.1:8080/v1/AUTH_test:tester/mycontainer/slo-file.bin?multipart-manifest=get" ``` -------------------------------- ### Build and Run SwiftProxy Source: https://context7.com/bouncestorage/swiftproxy/llms.txt Commands to compile the project and execute the server with a specific configuration file. ```bash # Build the project mvn package # Run SwiftProxy with a configuration file java -jar target/swift-proxy-1.2.0-SNAPSHOT-jar-with-dependencies.jar --properties swiftproxy.conf # Check version java -jar target/swift-proxy-1.2.0-SNAPSHOT-jar-with-dependencies.jar --version ``` -------------------------------- ### Run SwiftProxy Source: https://github.com/bouncestorage/swiftproxy/blob/master/README.md Execute SwiftProxy using a specified properties file for configuration. Requires Java 8. ```bash java -jar ./swift-proxy-1.0.0-jar-with-dependencies.jar --properties swiftproxy.conf ``` -------------------------------- ### Configure SwiftProxy Backends Source: https://context7.com/bouncestorage/swiftproxy/llms.txt Properties file configurations for different storage providers. ```properties # Basic configuration for in-memory transient storage (testing) swiftproxy.endpoint=http://127.0.0.1:8080 jclouds.provider=transient jclouds.identity=test:tester jclouds.credential=testing ``` ```properties # Configuration for Amazon S3 backend swiftproxy.endpoint=http://0.0.0.0:8080 jclouds.provider=aws-s3 jclouds.identity=AWS_ACCESSKEY jclouds.credential=AWS_CREDENTIAL jclouds.region=us-west-2 ``` ```properties # Configuration for local filesystem backend swiftproxy.endpoint=http://127.0.0.1:8080 jclouds.provider=filesystem jclouds.identity=test:tester jclouds.credential=testing jclouds.filesystem.basedir=/tmp/swiftproxy ``` ```properties # Configuration for OpenStack Swift backend swiftproxy.endpoint=http://127.0.0.1:8080 jclouds.provider=openstack-swift jclouds.endpoint=http://swift-server:8080/auth/v1.0 jclouds.keystone.credential-type=tempAuthCredentials jclouds.identity=test:tester jclouds.credential=testing ``` -------------------------------- ### List containers with Swift CLI Source: https://github.com/bouncestorage/swiftproxy/wiki/SwiftProxy-compatibility-list Use the Swift command-line interface to interact with the proxy by specifying the authentication endpoint, username, and credential. ```bash swift -A http://127.0.0.1:8080/auth/v1.0 -U identity -K credential list ``` -------------------------------- ### Configure Local Filesystem Backend Source: https://context7.com/bouncestorage/swiftproxy/llms.txt Configure SwiftProxy to use the local filesystem as its storage backend. Specify the base directory for storing data. ```properties # Local filesystem jclouds.provider=filesystem jclouds.filesystem.basedir=/var/data/swiftproxy ``` -------------------------------- ### Retrieve Server Info Source: https://context7.com/bouncestorage/swiftproxy/llms.txt Fetch server configuration and operational limits. ```bash # Get server configuration curl http://127.0.0.1:8080/info # Response: # { # "swift": { # "account_listing_limit": 10000, # "container_listing_limit": 10000, # "max_container_name_length": 256, # "max_file_size": 5368709122, # "max_object_name_length": 1024, # "max_meta_count": 90, # "max_meta_name_length": 128, # "max_meta_value_length": 256 # }, # "slo": { "max_manifest_segments": 1000 }, # "tempauth": { "token_life": 85400 } # } ``` -------------------------------- ### Configure Google Cloud Storage Backend Source: https://context7.com/bouncestorage/swiftproxy/llms.txt Configure SwiftProxy to use Google Cloud Storage. The credential should be the path to your service account JSON key file. ```properties # Google Cloud Storage (credential is path to JSON key file) jclouds.provider=google-cloud-storage jclouds.identity=project-id jclouds.credential=/path/to/service-account-key.json ``` -------------------------------- ### Configure Rackspace Cloud Files Backend Source: https://context7.com/bouncestorage/swiftproxy/llms.txt Use these properties to connect SwiftProxy to Rackspace Cloud Files. Provide your Rackspace username and API key. ```properties # Rackspace Cloud Files jclouds.provider=rackspace-cloudfiles-us jclouds.identity=username jclouds.credential=api-key ``` -------------------------------- ### Configure In-Memory Transient Backend Source: https://context7.com/bouncestorage/swiftproxy/llms.txt Use the transient provider for in-memory storage, ideal for testing purposes. Data will be lost when the service stops. ```properties # In-memory transient (for testing) jclouds.provider=transient ``` -------------------------------- ### Create DLO Manifest Source: https://context7.com/bouncestorage/swiftproxy/llms.txt Create a Dynamic Large Object (DLO) manifest by uploading an empty object with the X-Object-Manifest header pointing to the segment prefix. Content-Length must be 0. ```bash curl -X PUT -H "X-Auth-Token: $AUTH_TOKEN" \ -H "X-Object-Manifest: segments/largefile/" \ -H "Content-Length: 0" \ http://127.0.0.1:8080/v1/AUTH_test:tester/mycontainer/largefile.bin ``` -------------------------------- ### Configure Microsoft Azure Blob Storage Backend Source: https://context7.com/bouncestorage/swiftproxy/llms.txt Set up SwiftProxy to use Microsoft Azure Blob Storage. Provide your storage account name and key. ```properties # Microsoft Azure Blob Storage jclouds.provider=azureblob jclouds.identity=storage-account-name jclouds.credential=storage-account-key ``` -------------------------------- ### Create SLO Manifest Source: https://context7.com/bouncestorage/swiftproxy/llms.txt Create a Static Large Object (SLO) manifest by PUTting a JSON array containing explicit references to segments, including their paths, ETags, and sizes. Use the ?multipart-manifest=put query parameter. ```bash curl -X PUT -H "X-Auth-Token: $AUTH_TOKEN" \ -H "Content-Type: application/json" \ "http://127.0.0.1:8080/v1/AUTH_test:tester/mycontainer/slo-file.bin?multipart-manifest=put" \ -d \ '[ {"path": "/segments/part1", "etag": "abc123def456789", "size_bytes": 5242880}, {"path": "/segments/part2", "etag": "def456abc789012", "size_bytes": 3145728} ]' ``` -------------------------------- ### List Containers Source: https://context7.com/bouncestorage/swiftproxy/llms.txt Retrieve a list of containers in an account using an auth token. ```bash # List all containers (plain text) curl -H "X-Auth-Token: $AUTH_TOKEN" \ http://127.0.0.1:8080/v1/AUTH_test:tester # List containers as JSON curl -H "X-Auth-Token: $AUTH_TOKEN" \ "http://127.0.0.1:8080/v1/AUTH_test:tester?format=json" ``` -------------------------------- ### Authenticate with V1 TempAuth Source: https://context7.com/bouncestorage/swiftproxy/llms.txt Methods to obtain an authentication token using V1 headers. ```bash # Authenticate and get auth token curl -i -H "X-Auth-User: test:tester" \ -H "X-Auth-Key: testing" \ http://127.0.0.1:8080/auth/v1.0 # Response headers include: # X-Auth-Token: AUTH_tk # X-Storage-Url: http://127.0.0.1:8080/v1/AUTH_test:tester # X-Storage-Token: AUTH_tk ``` ```bash # Alternative headers (X-Storage-User and X-Storage-Pass) curl -i -H "X-Storage-User: test:tester" \ -H "X-Storage-Pass: testing" \ http://127.0.0.1:8080/auth/v1.0 ``` -------------------------------- ### SwiftProxy Server Operations Source: https://context7.com/bouncestorage/swiftproxy/llms.txt Commands for building, running, and checking the version of the SwiftProxy server. ```APIDOC ## SwiftProxy Server Operations ### Build the project ```bash mvn package ``` ### Run SwiftProxy with a configuration file ```bash java -jar target/swift-proxy-1.2.0-SNAPSHOT-jar-with-dependencies.jar --properties swiftproxy.conf ``` ### Check version ```bash java -jar target/swift-proxy-1.2.0-SNAPSHOT-jar-with-dependencies.jar --version ``` ``` -------------------------------- ### Configure EMC Atmos Backend Source: https://context7.com/bouncestorage/swiftproxy/llms.txt Set up SwiftProxy to use EMC Atmos object storage. Specify the endpoint, identity (subtenant/uid), and shared secret. ```properties # EMC Atmos jclouds.provider=atmos jclouds.endpoint=https://atmos.example.com jclouds.identity=subtenant/uid jclouds.credential=shared-secret ``` -------------------------------- ### Configure OpenStack Swift Backend Source: https://context7.com/bouncestorage/swiftproxy/llms.txt Configure SwiftProxy to use an OpenStack Swift cluster as its backend. Specify the endpoint and authentication credentials. ```properties # OpenStack Swift (as backend) jclouds.provider=openstack-swift jclouds.endpoint=http://swift-server:5000/v2.0 jclouds.identity=tenant:user jclouds.credential=password ``` -------------------------------- ### Manage Containers Source: https://context7.com/bouncestorage/swiftproxy/llms.txt Perform operations on containers including creation, deletion, metadata retrieval, and listing objects. ```bash curl -X PUT -H "X-Auth-Token: $AUTH_TOKEN" \ http://127.0.0.1:8080/v1/AUTH_test:tester/mycontainer ``` ```bash curl -X DELETE -H "X-Auth-Token: $AUTH_TOKEN" \ http://127.0.0.1:8080/v1/AUTH_test:tester/mycontainer ``` ```bash curl -I -H "X-Auth-Token: $AUTH_TOKEN" \ http://127.0.0.1:8080/v1/AUTH_test:tester/mycontainer ``` ```bash curl -H "X-Auth-Token: $AUTH_TOKEN" \ http://127.0.0.1:8080/v1/AUTH_test:tester/mycontainer ``` ```bash curl -H "X-Auth-Token: $AUTH_TOKEN" \ "http://127.0.0.1:8080/v1/AUTH_test:tester/mycontainer?format=json" ``` ```bash curl -H "X-Auth-Token: $AUTH_TOKEN" \ "http://127.0.0.1:8080/v1/AUTH_test:tester/mycontainer?prefix=photos/&delimiter=/" ``` ```bash curl -H "X-Auth-Token: $AUTH_TOKEN" \ "http://127.0.0.1:8080/v1/AUTH_test:tester/mycontainer?path=documents" ``` -------------------------------- ### Configure Apache jclouds for SwiftProxy Source: https://github.com/bouncestorage/swiftproxy/wiki/SwiftProxy-compatibility-list Set the credential type to tempAuthCredentials and provide the endpoint URL when building the BlobStoreContext. ```java Properties properties = new Properties(); properties.setProperty("jclouds.keystone.credential-type", "tempAuthCredentials"); BlobStoreContext context = ContextBuilder .newBuilder("openstack-swift") .credentials(identity, credential) .endpoint("http://127.0.0.1:8080/auth/v1.0") .overrides(properties) .buildView(BlobStoreContext.class); ``` -------------------------------- ### Configure HP Cloud Object Storage Backend Source: https://context7.com/bouncestorage/swiftproxy/llms.txt Configure SwiftProxy to use HP Cloud Object Storage. You will need to provide your tenant and user credentials. ```properties # HP Cloud Object Storage jclouds.provider=hpcloud-objectstorage jclouds.identity=tenant:user jclouds.credential=password ``` -------------------------------- ### Copy Object with Fresh Metadata Source: https://context7.com/bouncestorage/swiftproxy/llms.txt Copy an object and replace all existing metadata with new metadata by setting X-Fresh-Metadata to true and providing new X-Object-Meta-* headers. ```bash curl -X COPY -H "X-Auth-Token: $AUTH_TOKEN" \ -H "Destination: /newcontainer/copied-file.bin" \ -H "X-Fresh-Metadata: true" \ -H "X-Object-Meta-NewKey: NewValue" \ http://127.0.0.1:8080/v1/AUTH_test:tester/mycontainer/myfile.bin ``` -------------------------------- ### Update Object Metadata (POST) Source: https://context7.com/bouncestorage/swiftproxy/llms.txt Use the POST method to update an object's metadata. Ensure the X-Auth-Token is valid. ```bash curl -X POST -H "X-Auth-Token: $AUTH_TOKEN" \ -H "X-Object-Meta-Status: reviewed" \ -H "X-Object-Meta-Reviewer: Jane Smith" \ http://127.0.0.1:8080/v1/AUTH_test:tester/mycontainer/myfile.bin ``` -------------------------------- ### Download Complete SLO Source: https://context7.com/bouncestorage/swiftproxy/llms.txt Download a Static Large Object (SLO). The system retrieves and assembles the segments based on the manifest. ```bash curl -H "X-Auth-Token: $AUTH_TOKEN" \ http://127.0.0.1:8080/v1/AUTH_test:tester/mycontainer/slo-file.bin \ -o complete-slo.bin ``` -------------------------------- ### List Account Containers Source: https://context7.com/bouncestorage/swiftproxy/llms.txt Retrieve a list of containers associated with an account using various filtering and pagination options. ```bash curl -H "X-Auth-Token: $AUTH_TOKEN" \ -H "Accept: application/xml" \ http://127.0.0.1:8080/v1/AUTH_test:tester ``` ```bash curl -H "X-Auth-Token: $AUTH_TOKEN" \ "http://127.0.0.1:8080/v1/AUTH_test:tester?marker=container1&limit=10" ``` ```bash curl -H "X-Auth-Token: $AUTH_TOKEN" \ "http://127.0.0.1:8080/v1/AUTH_test:tester?prefix=backup-" ``` ```bash curl -I -H "X-Auth-Token: $AUTH_TOKEN" \ http://127.0.0.1:8080/v1/AUTH_test:tester ``` -------------------------------- ### Copy Object with Additional Metadata Source: https://context7.com/bouncestorage/swiftproxy/llms.txt Copy an object and merge new metadata with existing metadata by providing X-Object-Meta-* headers without X-Fresh-Metadata. ```bash curl -X COPY -H "X-Auth-Token: $AUTH_TOKEN" \ -H "Destination: /newcontainer/copied-file.bin" \ -H "X-Object-Meta-CopiedOn: 2024-01-15" \ http://127.0.0.1:8080/v1/AUTH_test:tester/mycontainer/myfile.bin ``` -------------------------------- ### Server Info Endpoint Source: https://context7.com/bouncestorage/swiftproxy/llms.txt Retrieve server configuration and limits from the info endpoint. ```APIDOC ## Server Info Endpoint ### Get server configuration ```bash curl http://127.0.0.1:8080/info ``` Response: ```json { "swift": { "account_listing_limit": 10000, "container_listing_limit": 10000, "max_container_name_length": 256, "max_file_size": 5368709122, "max_object_name_length": 1024, "max_meta_count": 90, "max_meta_name_length": 128, "max_meta_value_length": 256 }, "slo": { "max_manifest_segments": 1000 }, "tempauth": { "token_life": 85400 } } ``` ``` -------------------------------- ### Access Amazon S3 via SwiftProxy Source: https://github.com/bouncestorage/swiftproxy/blob/master/README.md Command to list buckets in Amazon S3 using the Swift CLI, authenticated through SwiftProxy. Assumes the SwiftProxy is configured with AWS credentials. ```bash $ swift -A http://127.0.0.1:8080/auth/v1.0 -U AWS_ACCESSKEY -K AWS_CREDENTIAL list ``` -------------------------------- ### Copy Object using PUT with X-Copy-From Source: https://context7.com/bouncestorage/swiftproxy/llms.txt Copy an object by using the PUT method with the X-Copy-From header. This method requires Content-Length to be 0. ```bash curl -X PUT -H "X-Auth-Token: $AUTH_TOKEN" \ -H "X-Copy-From: /mycontainer/myfile.bin" \ -H "Content-Length: 0" \ http://127.0.0.1:8080/v1/AUTH_test:tester/newcontainer/copied-file.bin ``` -------------------------------- ### Download Complete DLO Source: https://context7.com/bouncestorage/swiftproxy/llms.txt Download a Dynamic Large Object (DLO). The system automatically assembles the segments into the complete object. ```bash curl -H "X-Auth-Token: $AUTH_TOKEN" \ http://127.0.0.1:8080/v1/AUTH_test:tester/mycontainer/largefile.bin \ -o complete-largefile.bin ``` -------------------------------- ### Swift CLI Client Operations Source: https://context7.com/bouncestorage/swiftproxy/llms.txt Common administrative and object management tasks using the standard Swift command-line interface. ```bash # List containers swift -A http://127.0.0.1:8080/auth/v1.0 -U test:tester -K testing list # Create a container swift -A http://127.0.0.1:8080/auth/v1.0 -U test:tester -K testing post mycontainer # Upload a file swift -A http://127.0.0.1:8080/auth/v1.0 -U test:tester -K testing upload mycontainer myfile.bin # Download a file swift -A http://127.0.0.1:8080/auth/v1.0 -U test:tester -K testing download mycontainer myfile.bin # List objects in a container swift -A http://127.0.0.1:8080/auth/v1.0 -U test:tester -K testing list mycontainer # Delete an object swift -A http://127.0.0.1:8080/auth/v1.0 -U test:tester -K testing delete mycontainer myfile.bin # Get container stats swift -A http://127.0.0.1:8080/auth/v1.0 -U test:tester -K testing stat mycontainer ``` -------------------------------- ### Upload Objects Source: https://context7.com/bouncestorage/swiftproxy/llms.txt Upload files to containers with support for custom metadata, ETag verification, and chunked encoding. ```bash curl -X PUT -H "X-Auth-Token: $AUTH_TOKEN" \ -H "Content-Type: application/octet-stream" \ -T myfile.bin \ http://127.0.0.1:8080/v1/AUTH_test:tester/mycontainer/myfile.bin ``` ```bash curl -X PUT -H "X-Auth-Token: $AUTH_TOKEN" \ -H "Content-Type: image/jpeg" \ -H "X-Object-Meta-Author: John Doe" \ -H "X-Object-Meta-Project: Documentation" \ -T photo.jpg \ http://127.0.0.1:8080/v1/AUTH_test:tester/mycontainer/photos/photo.jpg ``` ```bash curl -X PUT -H "X-Auth-Token: $AUTH_TOKEN" \ -H "ETag: d41d8cd98f00b204e9800998ecf8427e" \ -T myfile.bin \ http://127.0.0.1:8080/v1/AUTH_test:tester/mycontainer/myfile.bin ``` ```bash curl -X PUT -H "X-Auth-Token: $AUTH_TOKEN" \ -H "Transfer-Encoding: chunked" \ -T largefile.bin \ http://127.0.0.1:8080/v1/AUTH_test:tester/mycontainer/largefile.bin ``` -------------------------------- ### Apache jclouds Java Client Integration Source: https://context7.com/bouncestorage/swiftproxy/llms.txt Programmatic access to SwiftProxy using the jclouds BlobStore API. ```java import org.jclouds.ContextBuilder; import org.jclouds.blobstore.BlobStore; import org.jclouds.blobstore.BlobStoreContext; import org.jclouds.blobstore.domain.Blob; import org.jclouds.blobstore.domain.StorageMetadata; import java.util.Properties; public class SwiftProxyClient { public static void main(String[] args) { // Configure jclouds to connect to SwiftProxy Properties properties = new Properties(); properties.setProperty("jclouds.keystone.credential-type", "tempAuthCredentials"); BlobStoreContext context = ContextBuilder .newBuilder("openstack-swift") .credentials("test:tester", "testing") .endpoint("http://127.0.0.1:8080/auth/v1.0") .overrides(properties) .buildView(BlobStoreContext.class); BlobStore blobStore = context.getBlobStore(); // Create a container blobStore.createContainerInLocation(null, "mycontainer"); // Upload an object Blob blob = blobStore.blobBuilder("myfile.txt") .payload("Hello, SwiftProxy!") .contentType("text/plain") .build(); blobStore.putBlob("mycontainer", blob); // List containers for (StorageMetadata container : blobStore.list()) { System.out.println("Container: " + container.getName()); } // Download an object Blob downloaded = blobStore.getBlob("mycontainer", "myfile.txt"); System.out.println("Content: " + downloaded.getPayload().getRawContent()); // Delete the object blobStore.removeBlob("mycontainer", "myfile.txt"); // Delete the container blobStore.deleteContainer("mycontainer"); context.close(); } } ``` -------------------------------- ### V2 Authentication (Keystone-compatible) Source: https://context7.com/bouncestorage/swiftproxy/llms.txt Authenticate using the Keystone-compatible V2 API with a JSON payload. ```APIDOC ## V2 Authentication (Keystone-compatible) ### V2 Authentication with JSON payload ```bash curl -X POST http://127.0.0.1:8080/v2.0/tokens \ -H "Content-Type: application/json" \ -d '{ "auth": { "tenantName": "test", "passwordCredentials": { "username": "tester", "password": "testing" } } }' ``` Response includes access token and service catalog: ```json { "access": { "token": { "id": "AUTH_tk...", "expires": "2024-01-01T12:00:00Z", "tenant": { "id": "AUTH_test", "name": "AUTH_test" } }, "serviceCatalog": [{ "endpoints": [{ "publicURL": "http://127.0.0.1:8080/v1/AUTH_test" }], "type": "object-store" }] } } ``` ``` -------------------------------- ### Download Objects Source: https://context7.com/bouncestorage/swiftproxy/llms.txt Download objects using range requests or conditional headers like If-None-Match and If-Modified-Since. ```bash curl -H "X-Auth-Token: $AUTH_TOKEN" \ http://127.0.0.1:8080/v1/AUTH_test:tester/mycontainer/myfile.bin \ -o myfile.bin ``` ```bash curl -H "X-Auth-Token: $AUTH_TOKEN" \ -H "Range: bytes=0-1023" \ http://127.0.0.1:8080/v1/AUTH_test:tester/mycontainer/myfile.bin ``` ```bash curl -H "X-Auth-Token: $AUTH_TOKEN" \ -H "Range: bytes=-1000" \ http://127.0.0.1:8080/v1/AUTH_test:tester/mycontainer/myfile.bin ``` ```bash curl -H "X-Auth-Token: $AUTH_TOKEN" \ -H "If-None-Match: d41d8cd98f00b204e9800998ecf8427e" \ http://127.0.0.1:8080/v1/AUTH_test:tester/mycontainer/myfile.bin ``` ```bash curl -H "X-Auth-Token: $AUTH_TOKEN" \ -H "If-Modified-Since: Wed, 15 Jan 2024 10:00:00 GMT" \ http://127.0.0.1:8080/v1/AUTH_test:tester/mycontainer/myfile.bin ``` -------------------------------- ### Configure Amazon S3 Backend Source: https://context7.com/bouncestorage/swiftproxy/llms.txt Use these properties to configure SwiftProxy to use Amazon S3 as the backend storage. Ensure you provide valid AWS access key and secret key. ```properties # Amazon S3 jclouds.provider=aws-s3 jclouds.identity=ACCESS_KEY jclouds.credential=SECRET_KEY jclouds.region=us-east-1 ``` -------------------------------- ### V1 Authentication (TempAuth) Source: https://context7.com/bouncestorage/swiftproxy/llms.txt Authenticate with SwiftProxy using V1 TempAuth to obtain an auth token and storage URL. ```APIDOC ## V1 Authentication (TempAuth) ### Authenticate and get auth token ```bash curl -i -H "X-Auth-User: test:tester" \ -H "X-Auth-Key: testing" \ http://127.0.0.1:8080/auth/v1.0 ``` Response headers include: ``` X-Auth-Token: AUTH_tk X-Storage-Url: http://127.0.0.1:8080/v1/AUTH_test:tester X-Storage-Token: AUTH_tk ``` ### Alternative headers (X-Storage-User and X-Storage-Pass) ```bash curl -i -H "X-Storage-User: test:tester" \ -H "X-Storage-Pass: testing" \ http://127.0.0.1:8080/auth/v1.0 ``` ``` -------------------------------- ### Account Operations Source: https://context7.com/bouncestorage/swiftproxy/llms.txt List and manage containers in an account. ```APIDOC ## Account Operations ### List all containers (plain text) ```bash curl -H "X-Auth-Token: $AUTH_TOKEN" \ http://127.0.0.1:8080/v1/AUTH_test:tester ``` ### List containers as JSON ```bash curl -H "X-Auth-Token: $AUTH_TOKEN" \ "http://127.0.0.1:8080/v1/AUTH_test:tester?format=json" ``` ``` -------------------------------- ### Object Operations - Download Source: https://context7.com/bouncestorage/swiftproxy/llms.txt Downloads objects from a container, supporting range requests and conditional headers. ```APIDOC ## Download Object ### Description Downloads an object from a specified container. ### Method GET ### Endpoint `/v1/{account}/{container}/{object}` ### Headers - **Range** (string) - Optional - Specifies a byte range for partial download (e.g., `bytes=0-1023`). - **If-None-Match** (string) - Optional - Downloads only if the ETag does not match the provided value. - **If-Modified-Since** (string) - Optional - Downloads only if the object has been modified since the specified date. ### Request Example (Full Download) ```bash curl -H "X-Auth-Token: $AUTH_TOKEN" \ http://127.0.0.1:8080/v1/AUTH_test:tester/mycontainer/myfile.bin \ -o myfile.bin ``` ### Request Example (Range Request) ```bash curl -H "X-Auth-Token: $AUTH_TOKEN" \ -H "Range: bytes=0-1023" \ http://127.0.0.1:8080/v1/AUTH_test:tester/mycontainer/myfile.bin ``` ### Request Example (Suffix Range) ```bash curl -H "X-Auth-Token: $AUTH_TOKEN" \ -H "Range: bytes=-1000" \ http://127.0.0.1:8080/v1/AUTH_test:tester/mycontainer/myfile.bin ``` ### Request Example (Conditional Download - If-None-Match) ```bash curl -H "X-Auth-Token: $AUTH_TOKEN" \ -H "If-None-Match: d41d8cd98f00b204e9800998ecf8427e" \ http://127.0.0.1:8080/v1/AUTH_test:tester/mycontainer/myfile.bin ``` ### Response Example (Conditional Download) - **304 Not Modified**: Returned if the ETag matches the `If-None-Match` header. ### Request Example (Conditional Download - If-Modified-Since) ```bash curl -H "X-Auth-Token: $AUTH_TOKEN" \ -H "If-Modified-Since: Wed, 15 Jan 2024 10:00:00 GMT" \ http://127.0.0.1:8080/v1/AUTH_test:tester/mycontainer/myfile.bin ``` ``` -------------------------------- ### Static Large Objects (SLO) Source: https://context7.com/bouncestorage/swiftproxy/llms.txt Create and manage static large objects using manifests with explicit segment references. ```APIDOC ## Static Large Objects (SLO) ### Description Allows creation of large objects by uploading individual segments and then creating a manifest file that explicitly lists each segment, its ETag, and size. This provides more control over the segments compared to DLOs. ### Uploading Segments #### Method PUT #### Endpoint `/v1/{account}/{container}/{segment_name}` #### Headers - **X-Auth-Token** (string) - Required - Authentication token. #### Request Example ```bash curl -X PUT -H "X-Auth-Token: $AUTH_TOKEN" \ -T part1.bin \ http://127.0.0.1:8080/v1/AUTH_test:tester/segments/part1 ``` ### Creating SLO Manifest #### Method PUT #### Endpoint `/v1/{account}/{container}/{manifest_object_name}?multipart-manifest=put` #### Headers - **X-Auth-Token** (string) - Required - Authentication token. - **Content-Type** (string) - Required - Set to `application/json`. #### Request Body - **manifest_entries** (array) - Required - A JSON array where each object represents a segment. - **path** (string) - Required - The path to the segment object. - **etag** (string) - Required - The ETag of the segment object. - **size_bytes** (integer) - Required - The size of the segment in bytes. #### Request Example ```bash curl -X PUT -H "X-Auth-Token: $AUTH_TOKEN" \ -H "Content-Type: application/json" \ "http://127.0.0.1:8080/v1/AUTH_test:tester/mycontainer/slo-file.bin?multipart-manifest=put" \ -d '[ {"path": "/segments/part1", "etag": "abc123def456789", "size_bytes": 5242880}, {"path": "/segments/part2", "etag": "def456abc789012", "size_bytes": 3145728} ]' ``` ### Downloading the Complete SLO #### Method GET #### Endpoint `/v1/{account}/{container}/{manifest_object_name}` #### Headers - **X-Auth-Token** (string) - Required - Authentication token. #### Request Example ```bash curl -H "X-Auth-Token: $AUTH_TOKEN" \ http://127.0.0.1:8080/v1/AUTH_test:tester/mycontainer/slo-file.bin \ -o complete-slo.bin ``` ### Retrieving the Manifest JSON #### Method GET #### Endpoint `/v1/{account}/{container}/{manifest_object_name}?multipart-manifest=get` #### Headers - **X-Auth-Token** (string) - Required - Authentication token. #### Request Example ```bash curl -H "X-Auth-Token: $AUTH_TOKEN" \ "http://127.0.0.1:8080/v1/AUTH_test:tester/mycontainer/slo-file.bin?multipart-manifest=get" ``` ### Deleting SLO and All Segments #### Method DELETE #### Endpoint `/v1/{account}/{container}/{manifest_object_name}?multipart-manifest=delete` #### Headers - **X-Auth-Token** (string) - Required - Authentication token. #### Request Example ```bash curl -X DELETE -H "X-Auth-Token: $AUTH_TOKEN" \ "http://127.0.0.1:8080/v1/AUTH_test:tester/mycontainer/slo-file.bin?multipart-manifest=delete" ``` ``` -------------------------------- ### Authenticate with V2 Keystone Source: https://context7.com/bouncestorage/swiftproxy/llms.txt Perform V2 authentication using a JSON payload. ```bash # V2 Authentication with JSON payload curl -X POST http://127.0.0.1:8080/v2.0/tokens \ -H "Content-Type: application/json" \ -d '{ "auth": { "tenantName": "test", "passwordCredentials": { "username": "tester", "password": "testing" } } }' # Response includes access token and service catalog: # { # "access": { # "token": { # "id": "AUTH_tk...", # "expires": "2024-01-01T12:00:00Z", # "tenant": { "id": "AUTH_test", "name": "AUTH_test" } # }, # "serviceCatalog": [{ # "endpoints": [{ "publicURL": "http://127.0.0.1:8080/v1/AUTH_test" }], # "type": "object-store" # }] # } # } ``` -------------------------------- ### Copy Object using COPY Method Source: https://context7.com/bouncestorage/swiftproxy/llms.txt Copy an object to a new location within the same or different container using the COPY HTTP method. The Destination header specifies the new path. ```bash curl -X COPY -H "X-Auth-Token: $AUTH_TOKEN" \ -H "Destination: /newcontainer/copied-file.bin" \ http://127.0.0.1:8080/v1/AUTH_test:tester/mycontainer/myfile.bin ``` -------------------------------- ### Upload Segments for SLO Source: https://context7.com/bouncestorage/swiftproxy/llms.txt Upload individual segments for a Static Large Object (SLO) to any location. Note the ETag and size for each segment. ```bash curl -X PUT -H "X-Auth-Token: $AUTH_TOKEN" \ -T part1.bin \ http://127.0.0.1:8080/v1/AUTH_test:tester/segments/part1 ``` ```bash curl -X PUT -H "X-Auth-Token: $AUTH_TOKEN" \ -T part2.bin \ http://127.0.0.1:8080/v1/AUTH_test:tester/segments/part2 ``` -------------------------------- ### Bulk Delete Objects Source: https://context7.com/bouncestorage/swiftproxy/llms.txt Perform a bulk delete of multiple objects by sending a POST request with a text/plain body listing the object paths. The response is in JSON format. ```bash curl -X POST -H "X-Auth-Token: $AUTH_TOKEN" \ -H "Content-Type: text/plain" \ "http://127.0.0.1:8080/v1/AUTH_test:tester?bulk-delete" \ -d '/mycontainer/file1.bin /mycontainer/file2.bin /mycontainer/photos/photo1.jpg' ``` -------------------------------- ### Upload Segments for DLO Source: https://context7.com/bouncestorage/swiftproxy/llms.txt Upload individual segments of a large object using sequential naming. Each segment is uploaded as a separate object. ```bash curl -X PUT -H "X-Auth-Token: $AUTH_TOKEN" \ -T segment1.bin \ http://127.0.0.1:8080/v1/AUTH_test:tester/segments/largefile/00001 ``` ```bash curl -X PUT -H "X-Auth-Token: $AUTH_TOKEN" \ -T segment2.bin \ http://127.0.0.1:8080/v1/AUTH_test:tester/segments/largefile/00002 ``` ```bash curl -X PUT -H "X-Auth-Token: $AUTH_TOKEN" \ -T segment3.bin \ http://127.0.0.1:8080/v1/AUTH_test:tester/segments/largefile/00003 ``` -------------------------------- ### Container Operations Source: https://context7.com/bouncestorage/swiftproxy/llms.txt Operations for managing containers, including creation, deletion, listing objects, and retrieving metadata. ```APIDOC ## Create Container ### Description Creates a new container within an account. ### Method PUT ### Endpoint `/v1/{account}/{container}` ### Response - **201 Created**: Container created successfully. - **202 Accepted**: Container already exists. ### Request Example ```bash curl -X PUT -H "X-Auth-Token: $AUTH_TOKEN" \ http://127.0.0.1:8080/v1/AUTH_test:tester/mycontainer ``` ## Delete Container ### Description Deletes a container. The container must be empty. ### Method DELETE ### Endpoint `/v1/{account}/{container}` ### Response - **204 No Content**: Container deleted successfully. - **409 Conflict**: Container is not empty. ### Request Example ```bash curl -X DELETE -H "X-Auth-Token: $AUTH_TOKEN" \ http://127.0.0.1:8080/v1/AUTH_test:tester/mycontainer ``` ## Get Container Metadata ### Description Retrieves metadata for a specific container. ### Method HEAD ### Endpoint `/v1/{account}/{container}` ### Response Headers (Success) - **X-Container-Object-Count** (integer) - The number of objects in the container. - **X-Container-Bytes-Used** (integer) - The total bytes used by objects in the container. ### Request Example ```bash curl -I -H "X-Auth-Token: $AUTH_TOKEN" \ http://127.0.0.1:8080/v1/AUTH_test:tester/mycontainer ``` ## List Objects in Container ### Description Lists objects within a container. Supports various filtering and formatting options. ### Method GET ### Endpoint `/v1/{account}/{container}` ### Query Parameters - **format** (string) - Optional - Specifies the output format. `json` for JSON output with details. - **prefix** (string) - Optional - Filters objects whose names start with this prefix. - **delimiter** (string) - Optional - Used for directory-like listing. Objects after the delimiter are considered subdirectories. - **path** (string) - Optional - Filters objects based on a path. ### Response Example (Plain Text) ```bash curl -H "X-Auth-Token: $AUTH_TOKEN" \ http://127.0.0.1:8080/v1/AUTH_test:tester/mycontainer ``` ### Response Example (JSON with Details) ```bash curl -H "X-Auth-Token: $AUTH_TOKEN" \ "http://127.0.0.1:8080/v1/AUTH_test:tester/mycontainer?format=json" ``` ### Response Body Example (JSON) ```json [ { "name": "document.pdf", "hash": "d41d8cd98f00b204e9800998ecf8427e", "bytes": 1024, "content_type": "application/pdf", "last_modified": "2024-01-15T10:30:00.000000" } ] ``` ### Request Example (Prefix and Delimiter) ```bash curl -H "X-Auth-Token: $AUTH_TOKEN" \ "http://127.0.0.1:8080/v1/AUTH_test:tester/mycontainer?prefix=photos/&delimiter=/" ``` ### Request Example (Path) ```bash curl -H "X-Auth-Token: $AUTH_TOKEN" \ "http://127.0.0.1:8080/v1/AUTH_test:tester/mycontainer?path=documents" ``` ``` -------------------------------- ### Object Operations - Upload Source: https://context7.com/bouncestorage/swiftproxy/llms.txt Uploads objects to a container with various options including metadata, content type, and ETag verification. ```APIDOC ## Upload Object ### Description Uploads an object to a specified container. ### Method PUT ### Endpoint `/v1/{account}/{container}/{object}` ### Headers - **Content-Type** (string) - Optional - The MIME type of the object. - **X-Object-Meta-{key}** (string) - Optional - Custom metadata for the object. - **ETag** (string) - Optional - Verifies the object's integrity using its MD5 hash. - **Transfer-Encoding** (string) - Optional - Use `chunked` for large files. ### Request Example (Basic Upload) ```bash curl -X PUT -H "X-Auth-Token: $AUTH_TOKEN" \ -H "Content-Type: application/octet-stream" \ -T myfile.bin \ http://127.0.0.1:8080/v1/AUTH_test:tester/mycontainer/myfile.bin ``` ### Response Example - **201 Created**: Object uploaded successfully. ### Response Headers (Success) - **ETag** (string) - The MD5 hash of the uploaded object. ### Request Example (Custom Metadata) ```bash curl -X PUT -H "X-Auth-Token: $AUTH_TOKEN" \ -H "Content-Type: image/jpeg" \ -H "X-Object-Meta-Author: John Doe" \ -H "X-Object-Meta-Project: Documentation" \ -T photo.jpg \ http://127.0.0.1:8080/v1/AUTH_test:tester/mycontainer/photos/photo.jpg ``` ### Request Example (ETag Verification) ```bash curl -X PUT -H "X-Auth-Token: $AUTH_TOKEN" \ -H "ETag: d41d8cd98f00b204e9800998ecf8427e" \ -T myfile.bin \ http://127.0.0.1:8080/v1/AUTH_test:tester/mycontainer/myfile.bin ``` ### Request Example (Chunked Transfer) ```bash curl -X PUT -H "X-Auth-Token: $AUTH_TOKEN" \ -H "Transfer-Encoding: chunked" \ -T largefile.bin \ http://127.0.0.1:8080/v1/AUTH_test:tester/mycontainer/largefile.bin ``` ```