Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Note

If you are using Gateway instead of a Swarm Stroage Storage node, remove the --post301 --location-trusted cURL options and you must add -u '<gateway username>:<password>' for Gateway authentication [link to Gateway auth].

This document provides instructions for using curl cURLcommands to interact with SWARM Storage. Commands are organized into categories for creating and managing domains, buckets, objects, and configurations.

Note

Caution

Replace placeholder terms like hostname and domain with your actual values when executing these commands.

Creating Domains and Buckets

...

Code Block
languagebash
curl -i --location-trusted --post301 --data-binary "" "http://hostnameipaddress/api?domain=yourDomainNamedomain&createdomain"
  • Notes: Replace yourDomainName domain with the desired domain name.

...

Code Block
languagebash
curl -i --location-trusted --post301 -XPOST --data-binary "" "http://hostnameipaddress/api/testbucket?domain=yourDomainNamedomain"
  • Notes: Replace yourDomainName domain with the appropriate domain and testbucket with the bucket name.

...

Code Block
languagebash
for i in {1..10}; do curl -i --location-trusted -XPOST --post301 --data-binary @yourFileName "http://hostnameipaddress/api/testbucket/NamedObject-$i.txt?domain=yourDomainNamedomain" -u "admin:admin"; done
  • Notes: Replace yourFileName with the file you are uploading, and yourDomainName domain with the domain. Adjust the number of iterations ({1..10}) as needed.

...

Code Block
languagebash
curl -i --location-trusted --post301 -XPOST --data-binary @yourFileName "http://hostnameipaddress/api/testbucket/NamedObject.txt?domain=yourDomainNamedomain"
  • Notes: Replace yourFileName with the file you are uploading, and yourDomainName with the domain.

Setting Cluster and Node Configurations

Update Cluster Setting

To update a cluster setting, such as erasure coding conversion percentage:

Code Block
languagebash
curl -X PUT --header "Content-Type: application/json" --header "Accept: text/plain" -d "{}" "http://hostname:port/api/storage/clusters/_self/settings/ec.conversionPercentage?value=40" --digest -u "admin:password"
  • Notes: Replace 40 with the desired percentage, and hostname:port with your cluster's address.

Configure Node Setting

To configure node-level settings, such as health limits:

Code Block
languagebash
curl -i --location-trusted -X PUT --header "Content-Type: application/json" --header "Accept: text/plain" -d "{}" "http://hostname:port/api/storage/nodes/_self/settings/health.neonatalAgeLimit?value=30" -u "admin:password"
  • Notes: Replace 30 with the desired limit, and hostname:port with the node's address.

  • domain with the domain.

Managing Objects and Domains

...

Code Block
languagebash
curl -i --location-trusted -XPUT --post301 --data-binary '' -H "Policy-Versioning: enabled" "http://hostnameipaddress/api?domain=yourDomainNamedomain&replicate=immediate&admin" -u "admin:password"
  • Notes: Replace yourDomainName domain with the target domain.

Check Object Integrity

...

Code Block
languagebash
curl -i --location-trusted "http://hostnameipaddress/api/testbucket/ObjectName.txt?domain=yourDomainNamedomain&checkintegrity"
  • Notes: Replace ObjectName.txt with the object's name, and yourDomainName domain with the domain.

Capture Manifest of a Version

...

Code Block
languagebash
curl -i --location-trusted "http://hostnameipaddress/api/testbucket/ObjectName.txt?domain=yourDomainNamedomain&readmanifest&version=versionID"

...

Code Block
languagebash
curl -i --location-trusted "http://hostnameipaddress/api/testbucket?domain=yourDomainNamedomain&format=json&name=ObjectName.txt&versions&field=all"
  • Notes: Replace ObjectName.txt with the object's name, and yourDomainName domain with the domain.

Setting Cluster and Node Configurations

Update Cluster Setting

To update a cluster setting, such as erasure coding conversion percentage:

Code Block
languagebash
curl -X PUT --header "Content-Type: application/json" --header "Accept: text/plain" -d "{}" "http://ipaddress:port/api/storage/clusters/_self/settings/ec.conversionPercentage?value=40" --digest -u "admin:password"
  • Notes: Replace ec.conversionPercentage?value=40 with the desired setting and its value, and ipaddress:port with your cluster's address.

Configure Node Setting

To configure node-level settings, such as health limits:

Code Block
languagebash
curl -i --location-trusted -X PUT --header "Content-Type: application/json" --header "Accept: text/plain" -d "{}" "http://ipaddress:port/api/storage/nodes/_self/settings/health.neonatalAgeLimit?value=30" -u "admin:password"
  • Notes: Replace health.neonatalAgeLimit?value=30 with the desired cluster setting and its value, and ipaddress:port with the node's address.

Additional Operations

Change Admin Password

...

Code Block
languagebash
curl -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' 'http://hostnameipaddress:port/api/storage/clusters/_self/administrators/admin?password=newPassword' -u admin:oldPassword

...

Code Block
languagebash
curl -v --post301 -XPOST -H 'Content-type: text/html' -H 'lifepoint: [Date] reps=2, deletable=False, [] delete' --location-trusted 'http://hostnameipaddress/api/bucket/lifePointObject?domain=yourDomainNamedomain'
  • Notes: Replace [Date] with the desired date and yourDomainName format like [Wed, 20 Oct 2025 11:08:00 GMT] and domain with the domain.

Delete a Bucket

...

Code Block
languagebash
curl -i --location-trusted -XDELETE "http://hostnameipaddress/api/testbucket?domain=yourDomainNamedomain&recursive=now"
  • Notes: Replace yourDomainName domain with the domain.

Create an EC Object

...

Code Block
languagebash
curl -i --location-trusted --post301 --data-binary @yourFileName "http://hostnameipaddress/api/testbucket/ec-named-1.txt?domain=yourDomainNamedomain&erasurecoded=yes&encoding=2:2"
  • Notes: Replace yourFileName with the file to be used and yourDomainName domain with the domain.

General Tips

  • Replace Placeholders: Always replace hostname ipaddress, domain, yourFileName, and other placeholders with actual values relevant to your environment.

  • Permissions: Ensure that you have the necessary permissions for performing these operations.

  • Security: Use secure methods for handling sensitive information like passwords.

This document provides a structured approach to managing SWARM Storage and Gateway using curl cURL commands. For further details or troubleshooting, refer to the SWARM Storage documentation or your internal support resources.

Info

For Waggle API documentation, please refer to https://docs.cloud.caringo.com/internal/swarm-storage-api.html