Sunday, June 19, 2016

Oracle Storage Cloud Service - Using cURL to creating storage containers

A container is a storage compartment that provides a way to organize the data stored in Oracle Storage Cloud Service. Containers are similar to directories, but with a key distinction; unlike directories, containers cannot be nested.

Requesting an Authentication Token

curl -v -X GET \
-H "X-Storage-User: Storage-identityDomain:fname.lname@identityDomain.com" \
-H "X-Storage-Pass: password" \
https://IdentityDomain.storage.oraclecloud.com/auth/v1.0


Example

curl -v -X GET -H "X-Storage-User: Storage-identityDomain:service.admin@identityDomain.com" -H "X-Storage-Pass: password" https://identityDomain.storage.oraclecloud.com/auth/v1.0


You need to record the X-Auth-Token returned in the output.

Creating a Container

curl -v -X PUT \
-H "X-Auth-Token: token" \
accountURL/containerName


Example

curl -v -X PUT -H "X-Auth-Token: AUTH_tk1d16see6f140635ffe0d05c64bf8b022" https://identityDomain.storage.oraclecloud.com/v1/Storage-identityDomain/new_container


You should see the "HTTP/1.1 201 Created" in the output returned.

Listing Containers

curl -v -X GET \
-H "X-Auth-Token: AUTH_tk1d162f96f140635ffe0d05c64bf8b022" \
https://identityDomain.storage.oraclecloud.com/v1/Storage-identityDomain


Example


curl -v -X GET -H "X-Auth-Token: AUTH_tk1d162f96f140635ffe0d05c64bf8b022" https://identityDomain.storage.oraclecloud.com/v1/Storage-identityDomain


Deleting a container

curl -v -X DELETE \
-H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b" \
https://identityDomain.storage.oraclecloud.com/v1/Storage-identityDomain/new_container


Example


curl -v -X DELETE -H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b" https://identityDomain.storage.oraclecloud.com/v1/Storage-identityDomain/new_container

******************************************
keywords: Cloud curl
******************************************
rdbms version:
******************************************

No comments: