Cloud Storage Introduction:
Cloud storage is a cloud computing model that stores data on the Internet through a cloud computing provider that manages and operates data storage as a service. It’s delivered on-demand with just-in-time capacity and costs and eliminates buying and managing your own data storage infrastructure. This gives you agility, global scale, and durability, with “anytime, anywhere” data access.
We will also try to explore some IBM COS use cases.
Types of Cloud Storage:

Storage as Service in Cloud
Data Storage as a Service — Object Storage

Few Examples:
File Storage: SMB ( Samba File Share ) , NFS — Do some kind of file and directory navigation. i.e location will look something similar to smb://path/to/file
Block Storage — SAN. Mounting file system using the mount command. Something like /dev/sda
Steps to create your COS storage (lite plan ) in IBM Cloud.
Step 1. Log in to IBM Cloud and Create Object Storage and few Buckets.
Step 2. use Go lang SDK to create Bucket.
Step 3. Use Python program to upload few images stored in a folder to the bucket.
Step 4. Use Django Program and View the image gallery in Browser.
login to cloud.ibm.com after creating an account and click on create resources (top right corner) as in Fig 3 :

Click on Object Storage as in Fig 4.

Select Lite Plan which provides you 25GB of free storage.

In the below figure Fig 4. The access key is apikey and the secret key is resource_instance_id. You can use these access keys and secret keys in your API.


The below figure shows the description of various types of access:

Access the objects using endpoint:
Go to Bucket->Configuration

Find Public endpoint:

Access object using below:
</endpoint>/<bucketname>/<objectname>
s3.us.cloud-object-storage.appdomain.cloud/bktfour/ob-1.png
Bucket Limitations
We can create a maximum of 100 buckets
Go Lang SDK for creating buckets:
Below is the main.go file, that I have used in the root directory of the above project.
Execute the below commands to run the main go code and create the bucket.
go build ./...go run main.go <bucketname>
Python Code for Uploading Images to Bucket:
Usage:
Export your access keys to add in the environment variable
Export your secret keys to add in the environment variable:
export MY_COS_IBM_KEY_TEMP=<your API key from service credentials>export export MY_SVC_IBM_INST_ID_TEMP=<service instance id >python cos_api.py <foldername> <bucketname>
e.g. python cos_api.py /Users/images mytestbucket
Below is the GitHub link for the Django UI for Media gallery:
Follow the README instruction to run your app:
Open the URL. i.e HTTP://127.0.0.1:8000 in the browser you will get the below image gallery:
Congratulations!! We have created an image gallery using IBM COS.
Much useful for photographers, OTT platform owners, Social Media.
