Using Ops Manager Programmatically and from the Command Line

Page last updated:

This topic introduces three tools for running Ops Manager operations programmatically and from the command line, rather than from the Ops Manager GUI: The Ops Manager API, the om command-line interface (CLI), and Platform Automation (Beta) tasks.

Overview

Pivotal Cloud Foundry (PCF) includes three related tools that let you run Ops Manager operations programmatically and from the command line, rather than from the Ops Manager GUI:

  • The Ops Manager API. For more information, see the Ops Manager API documentation.
  • The om command-line interface (CLI). For more information about om, see the om repository.
  • Platform Automation (Beta) tasks. For more information, see the Platform Automation documentation.

These three tools control the Ops Manager VM at different levels of abstraction. Platform operators and tile developers use them as described below.

For more information about tile development, see the PCF Tile Developer Guide.

Ops Manager API

The Ops Manager API offers the most granular control of the Ops Manager VM, The API enables users to do the following:

  • Automate component-level testing of PCF product tiles
  • Manage Ops Manager user accounts
  • Develop and debug product tiles
  • Access product property values that are not exposed in a product tile GUI
  • Otherwise control the Ops Manager VM directly, programmatically or manually, bypassing the Ops Manager UI. For more information about the Ops Manager interface, see Using the Ops Manager interface

For information about getting started with the Ops Manager API, see Access the Ops Manager API in the Using the Ops Manager API topic.

Your Ops Manager serves a local copy of the complete Ops Manager API documentation at https://YOUR-OPS-MANAGER-FQDN/docs.

Ops Manager CLI (om)

The Ops Manager CLI, om, calls the Ops Manager API to do the following:

  • Perform Ops Manager operations from the command line or scripts
  • Manage credentials from the command line or scripts
  • Generate configuration files from, and apply saved configurations to, staged product tiles.

For information, including how to install om and a usage example, see the om repository.

Platform Automation (Beta)

Platform Automation tasks call the om CLI to do the following:

  • Serve as building blocks for Continous Integration (CI) pipelines that automate installation and updating of PCF foundations
  • Within pipelines, store and retrieve product configuration values from secrets vaults like CredHub and code repositories like GitHub.

For a complete list of Platform Automation tasks, see the Concourse Tasks topic in the Platform Automation documentation.

Examples of Equivalent Operations

The following table lists some common operations using the Ops Manager UI, Ops Manager API, om CLI, and Platform Automation tasks, as examples of how different Ops Manager interfaces relate to one another.

For complete lists of operations, consult the references in above.

UI Action API Command om Command Platform Automation (Beta) Task
Manually configure the BOSH Director tile Multiple commands; see Configure the BOSH Director in the Using the Ops Manager API topic om configure-director configure-director
Click IMPORT A PRODUCT POST product file to /available_products om upload-product upload-product
Click the + symbol next to a product listing left of Installation Dashboard POST product name and version to /staged/products om stage-product stage-product
Manually configure a product tile Multiple commands; see Configure a Product in the Using the Ops Manager API topic om configure-product configure-product
Click STEMCELL LIBRARY > IMPORT STEMCELL POST stemcell file to /stemcells om upload-stemcell upload-stemcell
Click Apply Changes POST specified products (or all) and errand lists to /installations om apply-changes apply-changes