Skip to content

Instantly share code, notes, and snippets.

@zz
Forked from LoicMahieu/reminder.md
Last active December 17, 2016 07:32
Show Gist options
  • Save zz/2651e094bb0773e8811d1bccd8880b99 to your computer and use it in GitHub Desktop.
Save zz/2651e094bb0773e8811d1bccd8880b99 to your computer and use it in GitHub Desktop.
OVH Object Storage with cURL

Reminder for OVH Object storage API

OVH Part

  • GET /cloud/project
[
  "123"
]
  • GET /cloud/project/{serviceName}/storage

serviceName = 123

[
  {
    storedBytes: 186452
    region: "SBG1"
    name: "igloo-test"
    id: "123"
    storedObjects: 2
  }
]
  • GET /cloud/project/{serviceName}/storage/access

serviceName = 123

{
  token: "xyz"
  endpoints: [
    {
      url: "https://storage.sbg1.cloud.ovh.net/v1/AUTH_abc"
      region: "SBG1"
    }
  ]
}

Object Storage

List objects

curl -i \
  -H "X-Auth-Token: xyz" \
  -X GET \
  https://storage.sbg1.cloud.ovh.net/v1/AUTH_abc/igloo-test

Create object

$FILENAME : File name

curl -i \
  -H "X-Auth-Token: xyz" \
  -X PUT \
  --data @file.png \
  https://storage.sbg1.cloud.ovh.net/v1/AUTH_abc/igloo-test/$FILENAME

Delete object

$FILENAME : File name

curl -i \
  -H "X-Auth-Token: xyz" \
  -X DELETE \
  https://storage.sbg1.cloud.ovh.net/v1/AUTH_abc/igloo-test/$FILENAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment