X

@OracleIMC Partner Resources & Training: Discover your Modernization options + Reach new potential through Innovation

Managing Oracle PaaS Cloud Services with PaaS Service Manager

Guest Author

I am happy to let you know that Oracle is keeping
the way of continuously improvement of Oracle Cloud Platform and released a wonderful
and handy tool to manage PaaS Cloud services - PaaS
Service Manager Tool
(PSM). Oracle PSM provides a command line interface
(CLI) which you can use to manage the lifecycle of various services in Oracle
Public Cloud. Personally I was looking forward the release of this tool because
of from my perspective this is something what we lacked for Cloud automation. In
fact, CLI is a thin wrapper over PaaS REST APIs that invokes these APIs to
support common PaaS features, so you can use it in your cloud automation
scripts. For the time being PSM supports the following cloud services:

- Oracle MySQL
Cloud Service

- Oracle Application Container Cloud
Service

- Oracle Database Cloud Service

- Oracle GoldenGate Cloud
Service

- Oracle Java Cloud Service

PSM CLI also supports
Oracle
Cloud Stack Manager
, a PaaS tool that automates the provisioning and
deletion of cloud environments.

To start using PSM
tool you need to download,
install
and configure
it. This workflow is pretty easy. Basically you will need a cURL tool to download PSM using you cloud identity
domain details and user credentials. To install PSM you will need to have
installed and configured Python and pip in you
system. Pip is package management system to install and manage software
packages developed in Python. In fact you will need to install PSM tool as
Python package in your system. The final step is PSM configuration where you
need to configure your connection to Oracle Cloud. You can do this using
psm
setup
command.

How to use PSM tool?

Let’s consider several examples of PSM
usage. The full command line reference you can find in PSM official
documentation
.

You can start
with PSM using
psm
help
command as an
entry point. You will get information about the available services.

$ psm help


...

AVAILABLE SERVICES
  o MySQLCS
       Oracle Oracle MySQL Cloud Service
  o accs
       Oracle Application Container Cloud Service
  o dbcs
       Oracle Database Cloud Service
  o ggcs
       Oracle GoldenGate Cloud Service
  o jcs
       Oracle Java Cloud Service
  o stack
       Cloud Stack Manager
  o setup
       Configure psm client options
  o update
       Update psm client to latest version
  o log
       View or update psm client log level
  o help
       Show help
...

Use help (or h) parameter to view the available
commands for a service or available parameters for a specific command.

Getting the list of available commands
to manage Application Container Cloud Service:

$ psm accs help

Getting the description, synopsis,
examples of
backup command for Database Cloud Service:

$ psm dbcs backup help

Let’s consider
a couple of examples of managing Application Container Cloud Service (AcCS) using
PSM CLI.

To deploy
your application to AcCS you can use
psm
accs push
command:

$ psm accs push -n Tomcat-Sample-App -r java -s monthly -d
deployment.json -u TomcatApp/tomcat.sample.tgz -t "Initial
deployment" -of json

{
    "identityDomain":"xxxxxxxx",
    "appId":"949cbf3e-ac5c-48b5-ab84-ec80ed21712f",
    "name":"Tomcat-Sample-App",
    "status":"NEW",
    "createdBy":"user@email.com",
    "creationTime":"2016-09-09T11:50:30.276+0000",
    "lastModifiedTime":"2016-09-09T11:50:30.231+0000",
    "subscriptionType":"MONTHLY",
    "instances":[],
    "lastestDeployment":{
        "deploymentId":"16b50b66-a9f5-4e68-986d-15ec0f5827db",
        "deploymentStatus":"READY",
        "deploymentURL":"https://psm.europe.oraclecloud.com/paas/service/apaas/api/v1.1/apps/xxxxxxxx/Tomcat-Sample-App/deployments/16b50b66-a9f5-4e68-986d-15ec0f5827db"
    },
    "currentOngoingActivity":"Creating Application",
    "appURL":"https://psm.europe.oraclecloud.com/paas/service/apaas/api/v1.1/apps/xxxxxxxx/Tomcat-Sample-App",
    "message":[]
}
Job ID : 2090906

Note the Job ID 2090906 at
the end of the response above. You can use Job ID to check the status of the
operation using psm
accs operation-status
command:

$ psm accs operation-status -j 2090906 -of json

{
    "activityLogId":1082806,
    "serviceName":"Tomcat-Sample-App",
    "serviceType":"apaas",
    "identityDomain":"xxxxxxxx",
    "serviceId":56122,
    "jobId":2090906,
    "startDate":"2016-09-09T11:50:30.331+0000",
    "status":"RUNNING",
    "operationId":56122,
    "operationType":"CREATE_SERVICE",
    "summaryMessage":"CREATE_SERVICE",
    "authDomain":"xxxxxxxx",
    "authUser":"user@email.com",
    "initiatedBy":"USER",
    "messages":[
        {
            "activityDate":"2016-09-09T11:50:30.331+0000",
            "message":"Activity Submitted"
        },
        {
            "activityDate":"2016-09-09T11:50:30.404+0000",
            "message":"Activity Started"
        },
        {
            "activityDate":"2016-09-09T11:50:41.070+0000",
            "message":"Initialized application creation..."
        },
        {
            "activityDate":"2016-09-09T11:50:43.480+0000",
            "message":"Acquired resources for instance(1G) web.1..."
        }
    ]
}

Scaling of existing AcCS application
is possible using the psm
accs scale
command. Below we scale out our AcCS application up to 2
instances and 2GB of memory:

$ psm accs
scale -n Tomcat-Sample-App -m 2G -i 2 -of json

{
    "processes":[
        {
            "processName":"web",
            "instances":[
                {
                    "name":"web.1",
                    "status":"RUNNING",
                    "memory":"1G",
                    "instanceURI":"https://psm.europe.oraclecloud.com/paas/service/apaas/api/v1.1/apps/xxxxxxxx/Tomcat-Sample-App/instances/web.1"
                }
            ]
        }
    ],
    "identityDomain":"xxxxxxxx",
    "applicationDetails":"Tomcat-Sample-App"
}
Job ID : 2092588

To summarize this article, we have
ensured that PaaS Service Manager is powerful and handy tool to automate the
management tasks of Oracle PaaS Cloud Services.

Stay tuned with us to get the latest Oracle Cloud Platform updates!


Twitter LinkedIn Google+ Facebook Bit.ly Email

Join the discussion

Comments ( 1 )
  • Ryan Kuan Friday, October 20, 2017
    This is an awesome tool for service orchestration. I would like to see we can also move into more granular service orchestration, similar to AWS Lambda Serverless computing.
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.