Friday, 4 November 2016

Using PaaS Service Manager (PSM) for Oracle Cloud under Windows

With the PaaS Service Manager (PSM), Oracle delivers a command line interface (CLI) for the Oracle Cloud PaaS services. It requires cURL and Phython, which needs to be set up in advance. On Linux systems, this can easily done by using the package manager of your distribution. Under Windows, a few manual steps are required. Unfortunately the official documentation is missing a point. This tutorial will show how it works.
For the installation of cURL and Python for Windows, start with the URL's from the Oracle Documentation 'Performing Prerequisite Tasks for the Command Line Interface' to download and install both tools. The Python installer gives you the option to add Python to the PATH variable, for cURL this has to be done manually in the Windows System Settings.


A quick test with python --version and curl --version should be successful as shown above


Now we need the PSM binaries. Log into your Oracle Cloud services and open the service console of any PaaS service.


Click on your username, then help|Download Center.


Download the PSM from here, which should give you a psmcli.zip. Now here is the point, that is missing in the official documentation. To install psmcli.zip you need pip.exe or pip3.exe, but that is not part of the standard installation. Here is how to get it:


Go to https://pip.pypa.io/en/stable/installing/ and click on get-pip.py. Choose Open with Python.


Wait until the installer windos closes, now you have pip.


It is located in python/Scripts, so unfortunately no in your path. For easy access, you could change your PATH again, or create a shortcut ...


... and move that into your python directory (which should be in the PATH).


Starting pip from anywhere should now return some instructions


Now you can continue with the official documentation, so install psm by running


pip install -U psmcli.zip

from the directory, where you downloaded psm.


Then enter your credentials.


And try psm help, to see if it works.


If psm works, try to query your cloud services, eg.


psm jcs services

As shown above, if anything is set up correctly, the information should be returned, Thats is, psm is ready to use.