Oracle Storage Cloud Service: Creating Containers Using the REST API

Introduction

imageLet’s define terms which Oracle uses in Oracle Cloud Services.

  • Block Storage – optimizes storage for IOPS and block-based access and provides POSIX-compliant file systems for Oracle Compute Cloud Service instances. This is just standard disk device. Sometimes it is only one drive, sometimes it is RAID device. But anyway application access it using standard disk operations
  • Object Storage – scalable storage which can store large binary objects with metadata and unique ID. Multiple storage nodes form a single, shared, horizontally scalable pool. Application can access data using REST API.

Oracle Storage Cloud Service provides a low cost, reliable, secure, and scalable object-storage solution for storing unstructured data and accessing it anytime from anywhere. It is ideal for data backup, archival, file sharing, and for storing large amounts of unstructured data like logs, sensor-generated data, and VM images.

Oracle Storage Cloud Service stores data as objects within a flat hierarchy of containers.

  • An object is most commonly created by uploading a file. It can also be created from ephemeral unstructured data. Objects are created within a container. A single object can hold up to 5 GB of data, but multiple objects can be linked together to hold more than 5 GB of contiguous data.
  • A container is a user-created resource, which can hold an unlimited number of objects, unless you specify a quota for the container. Note that containers cannot be nested.

Some of Oracle Cloud Services (like GoldenGate Cloud Service) require creating storage containers. Usually cloud service creates container by itself. However sometimes you need to create container on your own. Let’s discuss how to do this.

Requesting an Authentication Token

You should authenticate yourself to cloud before accessing and creating storage containers in Oracle Cloud Storage. Oracle has special authentication service to do this. I will use Advanced REST Client Extension for Google Chrome to make call. You can also use curl to do same things.

Key things you need to know – your identity domain ID, username and password.

1. Let’s do authentication. We will use REST API (https://docs.oracle.com/cloud/latest/storagecs_common/IDAPI/api-Identity.html)

You should get response “200 OK”

image

2. There are two interesting outcomes here: our authentication code and URL for our storage service

X-Auth-Token: AUTH_tk9036b45129394640e7abe8eXXXXXXXXX
X-Storage-Token: AUTH_tk9036b45129394640e7abe8eXXXXXXXXX
X-Storage-Url: https://storage.us2.oraclecloud.com/v1/Storage-XXXXXXX

We will use authentication token to authenticate us for each REST API call. Storage URL will be used to manage Oracle Storage Cloud Service.

Creating Storage container

We will use Storage REST API (https://docs.oracle.com/cloud/latest/storagecs_common/SSAPI/rest-endpoints.html).

1. First of all – let’s get list of storage containers. Access Storage Cloud Service REST Endpoint (https://storage.us2.oraclecloud.com/v1/Storage-XXXXXXX) using X-Auth-Token from previous step. You can see that I have 3 objects: GGCS_BKP_STG2, GGCS_BKP_STORAGE, GGStorage.

image

2.Let’s create new Storage container with name GGCS_BKP_STG3. To create it you should access Storage Cloud Service REST Endpoint  with container name in the end and method PUT. Something like
https://storage.us2.oraclecloud.com/v1/Storage-XXXXXXX/GGCS_BKP_STG3
 image

3. You should see answer: 201: Created.

4. Now you can list containers as we did in step 1. You will see created container (GGCS_BKP_STG3).

image

2 Comments

  1. Pingback: Oracle Database Cloud Service: Create database - Oracle Spatial, Mapviewer, Semantics и ГИС системы

  2. Pingback: GoldenGate Cloud Service (GGCS): Configure GoldenGate to replicate data - Oracle Spatial, Mapviewer, Semantics и ГИС системы

Leave a Reply

Your email address will not be published. Required fields are marked *