Deploy to Application Container Cloud from Oracle's Storage Cloud via REST API

vinay kumar
Aug 22, 2017 · 3 min read

As mentioned in my previous post about Application container cloud. We can use two options to upload application archive to ACSS

  • UI Console (already covered in previous post)
  • From Storage Cloud via REST API

In this post, we will talk about upload archive via Storage Cloud using REST API. There are two steps for that:

  1. Store archive on Storage Cloud service
  2. Deploy archive to ACCS

Information credentials for cloud account should be handy as identity, domain, password for using in REST API. Using cURL scripts to upload your application to the storage service.

Before uploading in Storage cloud, We need to build container in Storage Cloud Service. Either you can via Storage cloud UI console. Building using UI console is pretty easy and straightforward.

We will create container via curl command.

  1. Below Script will create storage container.
# CREATE STORAGE CONTAINERcurl -i -X PUT \ -u User-Name:Password \ https://hostname/v1/Storage-Identity-Domain/App-Name

2. Now upload your application archive to the storage container.

# PUT ARCHIVE IN STORAGE CONTAINER 
curl -i -X PUT \-u User-Name:Password \ https://hostname/v1/Storage-Identity-Domain/App-Name/Archive-File-Name -T Path-to-local-file/Archive-File-Name

For example use following script to upload it -

curl -i -X PUT \ -u sampleUserName:samplePassword \ https://storage.oraclecloud.com/v1/Storagecontainer/DeveloperSkillsApp/SpringBootJpaDev-1.0-dist.zip -T target/SpringBootJpaDev-1.0-dist.zip

After running these script, it is uploaded to Storage cloud container.

Deploy Archive to ACCS

After uploading archive to Storage cloud servicee, ACC’s deployment procedure can be invoked. We need to provide standard set of information while deploying. Sample schema of script should be as follows

# Mock Deployment Script 
curl -i -X POST \
-u User-Name:Password \
-H "X-ID-TENANT-NAME:Identity-Domain" \
-H "Content-Type: multipart/form-data" \
-F "name=App-Name" \
-F "runtime=java" \
-F "subscription=Monthly" \
-F "deployment=@deployment.json" \
-F "archiveURL=App-name/Archive-File-Name" \
-F "notes=Your Notes here" \
https://hostname/paas/service/apaas/api/v1.1/apps/Identity-Domain

Trying to upload with following script –

curl -v -u "USERNAME:PASSWORD” -X POST -H "X-ID-TENANT-NAME: IDENTITY_DOMAIN" -H "Content-Type: multipart/form-data" -F "name=person-data-service" -F "runtime=java" -F "subscription=Monthly" -F "archiveURL= Storagecontainer/SpringBootJpaDev-1.0-dist.zip " -F "notes=Developer Skills Service Deployment" https://apaas.REGION.oraclecloud.com/paas/service/apaas/api/v1.1/apps/IDENTITY_DOMAIN

When you deploy your application, you can reference a deployment.json file. Information about deployment like memory , instances etc. can be pass via deployment.json.

You can automate these two process using maven. You can also configured this by maven plugin in Oracle Developer cloud services.

That’s all for now. Happy Oracle Cloud learning.


Originally published at www.techartifact.com.

Oracle Developers

Aggregation of articles from Oracle & partners engineers, Groundbreaker ambassadors & the developer community on all things Oracle Cloud and its technologies. The views expressed are those of authors solely and do not necessarily reflect Oracle's. Contact @jimgris or @brhubart

)

vinay kumar

Written by

Oracle ACE in Oracle FMW and Oracle Cloud. Author ,Blogger #oraclecloud #adf #webcenter #elasticsearch #kafka http://www.techartifact.com

Oracle Developers

Aggregation of articles from Oracle & partners engineers, Groundbreaker ambassadors & the developer community on all things Oracle Cloud and its technologies. The views expressed are those of authors solely and do not necessarily reflect Oracle's. Contact @jimgris or @brhubart

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade