TAGS

Recent Posts

Archives

How to Use PSM to Control Your Oracle Analytics Cloud Environment
Posted on January 7, 2020
Author: Doug Ross, Performance Architects

Oracle Analytics Cloud (OAC) provides a complete enterprise-level analytics environment that encompasses all of an organization’s requirements including self-service data ingestion and visualization, curated data models that can access on-premise data warehouses via Remote Data Gateway, augmented analytics through built-in machine learning functions, and natural language insights into data.

OAC provides administrators browser based tools to provision and manage OAC instances. In addition, Oracle provides a tool called PaaS Service Manager (PSM) that offers command-line (CLI) level access to a variety of Oracle Cloud services to manage the full lifecycle of cloud instances. The CLI is a program that serves as a wrapper over Oracle PaaS REST APIs. From a command line, a number of functions are available to invoke the APIs to execute various tasks. This provides an easy way to script activities or run them from a scheduler.  PSM supports a number of Oracle platform offerings, however, this blog post will focus solely on using it with Oracle Analytics Cloud.

One possible use case for PSM with OAC would be where a customer has purchased Universal Credits to pay for their OAC instances. In a typical configuration, there would be at least two instances: DEV and PROD. It is now possible with OAC to “stop” an instance – more accurately “suspend” it as it will be inaccessible to users but still be able to be restarted quickly. While the instance is in a stopped state, the amount of Universal Credits used per hour is reduced to approximately 15% of the cost of a running instance. So, in a typical case where the DEV environment is not used on weekends, it is possible to save credits by stopping the DEV instance on Friday evening and restarting it on Monday morning. This can be done manually from the Oracle Cloud dashboard. However, with PSM, it would be possible to script and schedule that same stop/start activity to have it executed each week automatically.

Using PSM with OAC requires the following steps:

  1. Performing prerequisite tasks for the Command Line Interface
  2. Downloading the Command Line Interface
  3. Installing the Command Line Interface
  4. Configuring the Command Line Interface
  5. Use the Command Line Interface with OAC

Step One: Performing prerequisite tasks for the Command Line Interface

Below are the prerequisite steps for installing cURL and Python, if necessary.

cURL is an open source, command-line tool for transferring data with URL syntax, and supporting various protocols including HTTP and HTTPs.

  1. In your browser, navigate to the cURL home page at http://curl.haxx.se and click “Download” in the navigation menu.
  2. On the cURL Releases and Downloads page, locate the SSL-enabled version of the cURL software that corresponds to your operating system, click the link to download the ZIP file, and extract the executable to the desired folder.

If you are running Windows, follow these steps to install Python 3.3 or later:

  1. Launch a Windows command prompt.
  2. Determine the version of Python you currently have installed on your machine using the command:

“python –version”

  1. If your current version is below 3.3, then download and install the Python Windows installation executable from python.org

Step Two: Downloading the Command Line Interface

To install PSM, a zip file is downloaded from Oracle Cloud and then installed from the command line using the following steps:

  1. On Oracle Cloud Console, look at the top right, click the profile icon and select “Service User Console”.
  2. On the Cloud My Home page, select your service.
  3. Click the user icon in the top right corner to open the context menu.
  4. Select Help and then select “Download Center”.

Figure 1 – A screenshot that illustrates how to get to the Download Center in OAC

The Download Center dialog appears. The CLI option is indicated by the CLI icon (CLI icon).

  1. Click the download button next to the CLI description text

Figure 2 – A screenshot that illustrates the Download Center dialog

Step Three: Installing the Command Line Interface

The psmcli.zip file downloads to your machine and is ready for installation. Install the PaaS CLI as a Python package.  Use the PIP tool pip3 to install the CLI Python package.

  1. On Windows, from the command line:

      pip3 install -U psmcli.zip”

You will now be able to execute PSM commands from the command line.

Step Four: Configuring the Command Line Interface

The first step in using PSM is to set up the configuration details to connect to a particular Oracle Cloud environment.  At a minimum, an Oracle Cloud username, password, and identity domain will be required. Use the psm setup command to do this:

Figure 3 – A screenshot illustrating the “psm setup” command

Figure 4 – An example of the psm setup steps

Step Five: Using the Command Line Interface with OAC

After successfully setting up the configuration for PSM, the following commands are available to manage the service from the command line:

Figure 5 – An example of the commands that are available to manage the service from the command line

Each command uses “autoanalyticsinst” to identify the Oracle Cloud PaaS environment followed by a specific command.  If a command applies to a particular instance of OAC, the “-s servicename” qualifier is added to the command.

Below are some examples of PSM commands and their output:

  1. The services command lists all OAC instances in the environment
  2. The service command with a specific servicename shows the details of that service
  3. The activities command displays recent actions taken on a particular service

Figure 6 – Examples of PSM commands and their outputs

As mentioned earlier, it is possible to stop and start an OAC instance from PSM using these commands:

“psm autoanalyticsinst stop-service -s servicename”

and

“psm autoanalyticsinst start-service -s servicename”

Adding these commands to a script file would allow for scheduling the script to execute as needed to stop and start the instances.

For further detailed information on PSM and how to use it with OAC, review the Oracle documentation located here. If you have further questions about setting up PSM to control your OAC environment, send us an email at communications@performancearchitects.com

 

Share
© Performance Architects, Inc. and Performance Architects Blog, 2006 - present. Unauthorized use and/or duplication of this material without express and written permission from this blog's author and/or owner is strictly prohibited. Excerpts and links may be used, provided that full and clear credit is given to Performance Architects, Inc. and Performance Architects Blog with appropriate and specific direction to the original content.

Leave a Reply

Your email address will not be published. Required fields are marked *