We just covered in previous blogs how to provision environments with components such as: Database Cloud Service, Java Cloud Service, SOA Cloud Service (SOA, OSB, SOA & OSB, API Manager), etc. via the various Cloud Services Console web pages.
In this section I am going to demonstrate how to provision the same type of environments, this time a SOA CS environment with SOA and OSB, but this time using REST APIs. REST APIs are very well documented for the vast portfolio of Oracle Cloud Services. For more information refer to http://docs.oracle.com/cloud
Notice that being able to script, version and test the creation of environments via REST APIs, can 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:
- 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.
- 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.
-
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 the ending result (update the fields in blue
accordingly):
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 |
- 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 AAAAB3NzaC1yc2EAAAABJQAAAQEAq4Vus4 22kiw71qbetKsiKPesJJUgV5PdUkrw1Bzo 1bissllEXMLVArM5u13MWPy16kTX95aAIp+RpIZX5+YpFFrFlnDj9Ja3Y/nNbc9U WTihlXMTZ4+JAd3JTnGNnjQDz6OM+/ tMQVD7Ro5cpZZ/xyjqdb2EEQtpRKSTJA3ydPjl3QyHqds/SZ1I7mt/O/h8ESWXd5 m9d/6Fq9RycdOJfElZKbNHNzaA+5l2u 20IPew8UHC32GhzDJq+UQOcWrGA1yELkQtZAI5J3A7xV2xA+wXsjOlyrXLn0551 BydN+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 if you can create just SOA, 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
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.
-
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.
Load Balancer Console
Behind the scenes, by default, any JCS or SOACS environment will be a WebLogic cluster, even if there is only one node, in which case it is optional to use a Load Balancer (OTD). However at the moment the cluster contains multiple nodes, automatically the option to use Load Balancer will become mandatory.
At the moment of provisioning a multi-node environment via the web console, only the load balancer “policy” and load balancer “compute shape” can be configured. However at the REST API level the following configurations are available for a Load Balancer:
- Admin User Name – If not specified it defaults to the WebLogic Server admin username
- Admin Password – If not specified it defaults to the WebLogic Server admin password
- Listener Ports Enabled – If not specified it defaults to true
- Listener Port – If not specified it defaults to 8080
- Listener Type – If not specified it defaults to http
-
Load Balancing Policy
- Least Connection count
- Least Response time
- Round Robin
- Secured Listener Port – If not specified it defaults to 8081
- Admin Port – If not specified it defaults to 8989
-
Compute shape
- oc3: 1 OCPU, 7.5 GB memory
- oc4: 2 OCPUs, 15 GB memory
- oc5: 4 OCPUs, 30 GB memory
- oc6: 8 OCPUs, 15 GB memory
- VM Public Key – If not specified it defaults to the one used for WebLogic Managed Servers
Notice that fields are added regularly. In order to see the full and up-to-date list, refer to the JCS/SOACS REST API documentation.
At the moment of provisioning any JCS/SOACS environment with a Load Balancer, Oracle Cloud Compute will fully configure all the network rules required to allow the Load Balancer to be publically available on the “listener port” indicated during provisioning (8080 by default), as well as all the network rules required to allow access to the Load Balancer to all the Managed Servers in the WebLogic Cluster, so that it can starting balancing the load.
After some time it will be fully provisioned and ready to go. Pretty easy, huh?