Ops Manager API Reference (2.9)

Download OpenAPI specification:Download

Parallel Calls

This API does not support parallel API calls.

Parallel calls, even though unsuccessul, will not return an error code.

How to Authenticate

You must pass a token to each API endpoint. To get a token, and curl an API endpoint using that token, follow these instructions:

Installing uaac

  • From a command line with Ruby installed, install the cf-uaac gem:

    gem install cf-uaac

Obtaining a uaac token

  • Target your Ops Manager IP:

    > uaac target https://YOUR_OPSMAN_IP/uaa

  • Log in to your Ops Manager with the Client name "opsman" and empty Client secret:

      > uaac token owner get
    
      Client name: opsman
      Client secret: JUST_PRESS_ENTER
      User name: YOUR_USERNAME_HERE
      Password: YOUR_PASSWORD_HERE

Using uaac curl

  • uaac now has your token and you can now use uaac curl:

    > uaac curl <ENDPOINT>

    > uaac curl -X POST -H "Content-type: application/json" <ENDPOINT> -d '<JSON BODY>'

Using regular curl

  • Use uaac context and get the access_token:

    curl -H "Authorization: Bearer UAA_ACCESS_TOKEN" <ENDPOINT>

Advanced Mode

Enable/Disable Advanced Mode

Request Body schema: application/json
locked
boolean

Responses

200

OK

put /api/v0/staged/infrastructure/locked
/api/v0/staged/infrastructure/locked

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "locked": true
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "locked": true
}

Are you in Advanced Mode?

Determines whether you are in Advanced Mode or not

Responses

200

OK

get /api/v0/staged/infrastructure/locked
/api/v0/staged/infrastructure/locked

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "locked": false
}

Apply Changes

Commit a Staged Installation

Saves installation state as though the deployment was triggered with the "Apply Changes" button, without actually deploying. This prepares the installation manifest, but does not invoke BOSH.

After commit, each product's manifest can fetched using the /api/v0/deployed/product/{product_guid}/manifest endpoint.

If you see the commit endpoint return the following error:

This endpoint is currently disabled because one or more of the products
you are trying to upgrade have credentials to migrate to credhub.
See the Migrating Credentials to Credhub section of the API docs to enable this endpoint again.

This endpoint can be enabled again by following the steps described in the Migrating Credentials to Credhub section.

Request Body schema: application/json
ignore_warnings
boolean

When true, bypass warnings from ignorable verifiers

Responses

200

OK

put /api/v0/staged/installations/commit
/api/v0/staged/installations/commit

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "ignore_warnings": true
}

Streaming current Apply Change log

If there is no currently running Apply Changes then it returns 200 with an exit event of type no install in progress.

This endpoint streams the logs of the currently running Apply Changes using the Server Sent Events format.

It starts by streaming an event named step_info which includes an array of JSON data with the name and descriptions of each ordered install step. Next, it will stream all of the log which has already happened during this Apply Changes. Then, it will stream realtime events and logs as they happen.

Mixed in with lines of logs, it will send events for steps called step_started and step_finished, and an exit event at the end. The step_started and step_finished events have JSON data, that include an id key corresponding to the JSON sent in the step_info event.

The exit event has JSON data which includes the exit code of the last command from the Apply Changes.

A exit code of 0 means success, and any other exit code indicates failure.

When the Apply Changes ends, the server closes the client's connection.

Note: The example response included in this documentation has been abbreviated for the sake of brevity.

Responses

200

OK