How to Provision an Oracle SOA Cloud Service Environment Using REST APIs

Provisioning a SOA CS environment via REST APIs

In a previous blog we have explained the steps required to provision OPC services such as: Database Cloud Service, Java Cloud Service, SOA Cloud Service (SOA, OSB, SOA & OSB, API Manager), etc. using the OPC Services Console web pages.

In this section we explain how to provision the same type of environments (in our case SOA + OSB), but this time we will use the Oracle Cloud Service REST APIs.
The REST APIs are very well documented for the vast portfolio of Oracle Cloud Services. For more information refer to http://docs.oracle.com/cloud.

These API’s allow us to to script, version and test the creation of environments via REST calls, and this can obviously facilitate the life cycle of not only software, but also environments, which is a crucial aspect in DevOps..

For more information specifically about the provisioning of SOA CS environment via a REST API, refer to: https://docs.oracle.com/cloud/latest/soacs_gs/SCSAP/op-instances-%7BidentityId%7D-post.html
What you need to know:

  1. The Provisioning of SOA CS environment is via a POST on /api/v1.1/instances/{identityId}
    – Where identityId is the name of the identity domain where you are willing to provision your environment.
  2. The REST API will be accompanied with a JSON payload, which will be referenced from within the API at the moment of invoking the API.
  3. Using CURL, this is the structure of the REST API to create a SOA instance:

    curl -i -X POST -u [OPC_USERNAME]:[OPC_PASSWORD] -d @config.json -H “Content-Type:application/vnd.com.oracle.oracloud.provisioning.Service+json” -H “X-ID-TENANT-NAME:[IDENTITY_DOMAIN]” https://%5BREGION_PREFIX%5D.oraclecloud.com/paas/service/soa/api/v1.1/instances/%5BIDENTITY_DOMAIN%5D

    Where

    [OPC_USERNAME] = Your OPC account username

    [OPC_PASSWORD] = Your OPC account password

    [IDENTITY_DOMAIN] = Your OPC identity domain where you want to provision the SOA environment.

    [REGION_PREFIX] = jaas for United States region, jcs.emea for EMEA region.

    This is what we used as the end result (please update the fields in blue
    according to your environment):

curl -i -X POST -u carlos.rodriguez.iturria@oracle.com:secret -d @config.json -H “Content-Type:application/json” -H “X-ID-TENANT-NAME:auoracle02747” https://jaas.oraclecloud.com/paas/service/soa/api/v1.1/instances/auoracle02747
  1. Notice that there is a mention for a “config.json” file.
    This is the Payload that you need to invoke as part of the REST API call payload which configures the environment depending on your needs.
    Make sure to modify the values depending on your needs.
{

“serviceName” : “DAFWASOAEnv”,

“level” : “PAAS”,

“topology” : “soaosb”,

“subscriptionType” : “MONTHLY”,

“description” : “This is the DAFWA SOA Environment used for Dev and Test”,

“provisionOTD” : true,

“cloudStorageContainer” : “Storage-auoracle02747/dafwaContainer1”,

“cloudStorageUser” : “carlos.rodriguez.iturria@oracle.com”,

“cloudStoragePassword” : “secret”,

“parameters” : [

{

“type” : “weblogic”,

“version” : “12.1.3”,

“managedServerCount” : “2”,

“adminUserName” : “weblogic”,

“adminPassword” : “secret”,

“dbServiceName” : “DAFWADB”,

“dbaName” : “SYS”,

“dbaPassword” : “secret”,

“shape” : “oc1m”,

“VMsPublicKey” : “ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAq4Vus422kiw71qbet…..
551BydN+WRPOaZVBjujliDKjdIe4Ps3bw+rBVsdIE8BxDYj6S+Utw== rsa-key-carlos”

},

{

“type” : “otd”,

“listenerPortsEnabled” : true,

“loadBalancingPolicy” : “round_robin”,

“shape” : “oc3”

}

]

}

Things that you need to be aware from this JSON file:

  • Make sure it is located on the same directory from which you are running the curl command. Otherwise modify the path in the curl command.
  • If you don’t specify the VMPublicKey for the OTD, by default it will take the same one as for the WebLogic cluster.
  • I used a soaosb
    topology, but you can create using other options eg just SOA, or OSB or API Manager.

These are the available options:

  • osb – Just OSB
  • soa – Just SOA
  • soaosb – SOA and OSB working together
  • apim – API Manager
  • mft – MFT *
  • soab2b – SOA and B2B*

    Notes:

    (*) – these two additional provisioning options (e and f) were recently added to the SOA Cloud Service. The nature of public cloud services is such that you need to regularly check for new capabilities that you can leverage for your innovation projects.

    Also before you provision using the above options you should consider the number of different domains you may end up with.

    2. Refer to the SOA CS API documentation for more information.

  • There are more parameters available to tune things further at the WebLogic level. Refer to the JCS API reference here.
  • When running the curl command. If you get an error, you can add a –v
    flag to make it verbose.
  1. Validate that you get a successful “202 Accepted” response

  • Now go to the SOA CS Console and validate that the SOA Environment is being provisioned.

After some time it will be fully provisioned and ready to go.

Advertisement

Author: David Reid

Cloud Platform Architect

One thought on “How to Provision an Oracle SOA Cloud Service Environment Using REST APIs”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: