accessing oracle cloud storage from command line

Note for the purposes of this blog entry, the world “c url” should be interpreted as one word and not two. Unfortunately, the blog editing software that we have prohibits this work and kicks the blog entry out if it is placed in the blog without the space. Can everyone say a collective “Good Grief” and move on. Unfortunately, you will need to delete the space to make everything work properly.

Now that we have the cost and use out of the way, let’s talk about how to
consume these services. Unfortunately, consuming raw blocks, either tape
or spinning disk, is difficult in the cloud. Amazon offers you an S3
interface and exposes the cloud services as an iSCSi interface through a
downloadable object or via REST api services. Azure offers something
similar with REST api services but offers SMB downloadable objects to
access the cloud storage. Oracle offers REST api services but offers NFS
downloadable objects to access the cloud storage. Let’s look at three
different ways of consuming the Oracle Cloud services.

The first way is to use the rest API. You can consume the services by
accessing the client libraries using Postman from Chrome or RESTClient
from Firefox. You can also access the service from the c url command line.

c url -v -X GET -H “X-Storage-User: Storage-metcsgse00026:cloud.admin”
-H “X-Storage-Pass: $OPASS”
https://metcsgse00026.storage.oraclecloud.com/auth/v1.0

In this example we are connecting to the identity domain metcsgse00026.
The username that we are using is cloud.admin. We store the password in an
environment variable OPASS and pull in the password when we execute the
c url command. On Linux or a Mac, this is done from the pre-installed c url
command. On Windows we had to install cygwin-64 to get the c url command
working. When we execute this c url command we get back and AUTH header
that can be passed in to the cloud service to create and consume storage
services. In our example above we received back X-Auth-Token:
AUTH_tk928cf3e4d59ddaa1c0a02a66e8078008 which is valid for 30 minutes. The
next step would be to create a storage container

c url -v -s -X PUT -H “X-Auth-Token:
AUTH_tk928cf3e4d59ddaa1c0a02a66e8078008”
https://storage.us2.oraclecloud.com/v1/Storage-
metcsgse00026/myFirstContainer

This will create myFirstContainer and allow us to store data either with
more REST api commands or tools like CloudBerry or NFS. More information
about how to use the REST api services can be found in an
online tutorial

The second way of accessing the storage services is through a program tool
that takes file requests on Windows and translates them to REST api
commands on the cloud storage. CloudBerry has an explorer that allows us
to do this. The user interface looks like and
is setup with the File -> Edit or New Accounts menu item. You need to fill
out the access to look like . Note
that the username is a combination of the identity domain (metcsgse00026)
and the username (cloud.admin). We could do something similar with PostMan
or RESTClient extensions to browsers. Internet Explorer does not have plug
ins that allow for REST api calls.

The third, and final way to access the storage services is through NFS.
Unfortunately, Windows does not offer NFS client software on desktop
machines so it is a little difficult to show this as a consumable service.
Mac and Linux offer these services as mounting an nfs server as a network
mount. Oracle currently does not offer SMB file shares to their cloud
services but it is on the roadmap in the future. We will not dive deep
into the Oracle Storage Cloud Appliance in this blog because it gets a
little complex with setting up a VM and installing the appliance software.
The documentation for this serviceM is a good place to
start.

In summary, there are a variety of ways to consume storage services from
Oracle. They are typically program interfaces and not file interfaces. The
service is cost advantageous when compared to purchasing spinning disks
from companies like Oracle, NetApp, or EMC. Using the storage appliance
gets rid of the latency issues that you typically face and difficulty in
accessing data from a user perspective. Overall, this service provides
higher reliability than on-premise storage, lower cost, and less
administration overhead.