Friday, April 3, 2015

How to create a JCS Instance using REST APIs?

The following shows how to create an Oracle Java Cloud Service instance using the REST API:

1.Create a JSON script (create.json)
This document defines the details of the service instance.
For example :
{
"serviceName" : "JCSRESTInstance",
"level" : "PAAS",
"subscriptionType" : "HOURLY",
"description" : "Example - REST APIs",
"provisionOTD" : false,
"cloudStorageContainer" : "Storage-froraclejpp/wls_container",
"cloudStorageUser" : "jpp_user",
"cloudStoragePassword" : "JPP_PASSWORD",
"parameters" : [
{
"type" : "weblogic",
"version" : "12.1.3.0.2",
"edition" : "EE",
"domainMode" : "PRODUCTION",
"managedServerCount" : "2",
"adminPort" : "7001",
"deploymentChannelPort" : "9001",
"securedAdminPort" : "7002",
"contentPort" : "7003",
"securedContentPort" : "7004",
"domainName" : "ExampleDomain",
"clusterName" : "ExampleCluster",
"adminUserName" : "weblogic",
"adminPassword" : "OracleM12#",
"nodeManagerPort" : "6555",
"nodeManagerUserName" : "nodeMangerAdmin",
"nodeManagerPassword" : "Manager12#",
"dbServiceName" : "JPP-DB12c-EE",
"dbaName" : "SYS",
"dbaPassword" : "OracleM12#",
"shape" : "oc3",
"domainVolumeSize" : "10G",
"backupVolumeSize" : "50G",
"VMsPublicKey" : "ssh-rsa AAAAB3NzaC1yc2EAAAABJ= rsa-key-20150105"
}
]
}

2. Invoke the script

curl -i -X POST -u user:password
-d
@create.json -H "Content-Type:application/vnd.com.oracle.oracloud.provisioning.Service+json"
-H "X-ID-TENANT-NAME:
IdentityDomain"
https://jaas.oraclecloud.com/jaas/api/v1.1/instances/
IdentityDomain




3. Check the creation process from the JCS Overview page



4. the new JCS Instance is now Up and Running