Oracle PaaS Service Manager (PSM) provides a command line interface (CLI) with which you can manage the lifecycle of various services in Oracle Public Cloud. This opens the door for scripting (recurring) tasks – such as (re)deployment of applications on ACCS to provisioning new environments. PSM makes performing admin operations on the Oracle Public Cloud a lot easier and efficient, compared to using the the GUI.
Note that the CLI is a thin wrapper over PaaS REST APIs that invokes these APIs to support common PaaS features.
The steps for installing and configuring PSM are simple enough – and take about 6 minutes. I will briefly walk you through them. They are also documented just fine. Before I continue, I want to thank Abhijit Ramchandra Jere of Oracle for graciously helping me out with PSM.
1. Install Python (3.3+) and cURL
PSM is a Python based tool. To set it up and run it, you need to have Python set up on your machine.
2. Download PSM
The psmcli.zip can be downloaded from Cloud UI (as described here) or it can be fetched through cURL from the REST API (as described here):
curl -I -X GET -u “lucas.jellema:password” -H “X-ID-TENANT-NAME: cloud17” -H “Accept: application/json” https://psm.us.oraclecloud.com/paas/api/v1.1/instancemgmt/cloud17/services/cs/instances
3. Install PSM as a Python Package
With a simple statement, PSM is installed from the downloaded zip file (see here)
pip install -U psmcli.zip
This installs PSM into the Python Scripts directory:
Verify the result using
pip show psmcli
On Linux:
4. Configure PSM for the identity domain and the connection to the cloud
Run the setup for PSM and configure it for use with your identity domain (see docs). Note: this step assumes that the Python scripts directory that contains PSM is in the PATH environment variable.
psm setup
I am not sure if and how you can use PSM on your machine for multiple identity domains or user accounts. I have access to several Oracle Public Cloud identity domains – even in different data centers. I have now setup PSM for one of them. If I can do a setup for a second identity domain and then somehow be able to switch between the two is not yet clear to me.
EDIT: switching to a different identity domain is simply done by running psm setup again. I need to provide the identity domain, region and credentials to make the switch. Note: psm remembers the set up across restart of the operating system.
5. Start using PSM for inspecting and manipulating PaaS Services
PSM can be used with many PaaS Services – not yet all – for inspecting their health, stopping and (re)starting, scaling and performing many administrative activities. See docs for all of them.
Some examples:
List all applications on Application Container Cloud:
psm accs apps
List log details for a specific application on ACCS:
psm accs log -n|–app-name name -i|–instance-name name
psm accs log -n Artist-Enricher-API -i web.1
and the list of log files is presented
6. Update PSM
To get rid of the slightly annoying message about their being a later version of PSM available – and to get hold of the latest version, you simply type:
psm update
and wait for maybe 15 seconds.
Issues:
I ran into an issue, caused as it turned out by having multiple Python versions on my machine. PSM got installed as Python package with version 3.5 and I was trying to run PSM with Python 3.6 as first version in my PATH environment variable. Clearly, that failed.
The error I ran into: ModuleNotFoundError: No module named ‘opaascli’
The solution: I removed all but one Python version (3.5 because with 3.6 the installation did not go well because of missing pip) and then installed with that one version.
Resources
Documentation on PSM: http://docs.oracle.com/en/cloud/paas/java-cloud/pscli/abouit-paas-service-manager-command-line-interface.html
Documentation on Oracle PaaS REST APIs: https://apicatalog.oraclecloud.com/ui/