Pivotal Knowledge Base


How to Download and Upload Pivotal Cloud Foundry® Products via API


Pivotal Cloud Foundry® (PCF) Ops Manager versions 1.6, 1.7, 1.8, and 1.9


This article illustrates how users can download and upload PCF products via API.


  1. Log on to network.pivotal.io.
  2. Click on your name tab and select "Edit Profile" to get your "API TOKEN" keys. You'll need to use the keys to download any products using "wget".
  3. Click on the "PRODUCTS" tab and look for the release you want to download. 
  4. Click on the letter "i" icon next to the product file name to get the "File Name" and "API Download" URL.

For example:

File Name- cf-1.6.17.pivotal
API URL- https://network.pivotal.io/api/v2/products/elastic-runtime/releases/1530/product_files/3974/download


Before you're authorized to download a product release from Pivotal Network, you must first accept a product release EULA.  You only need to accept the EULA one time, the first you download a product release.

To accept the EULA, you can click on a product release download link, and click "Agree" on a product release's EULA popup page or you can accept a product release's EULA via POST /api/v2/products/:product_slug/releases/:release_id/eula_acceptance.

For example: 

$ curl -i -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Token <TOKEN_KEYS_FROM_STEP2>" -X POST https://network.pivotal.io/api/v2/products/:product_slug/releases/:release_id/eula_acceptance

For complete reference on Accept EULA, see Pivotal Network Download API https://network.pivotal.io/docs/file_download_api

5.  SSH into Ops Manager and download a PCF file using REST API with wget.

$ wget --post-data="" --header="Authorization: Token <TOKEN_KEYS_FROM_STEP2>" https://network.pivotal.io/api/v2/products/elastic-runtime/releases/1530/product_files/3974/download -O "cf-1.6.17.pivotal"

On Ops Manager 1.6.x

Upload (Import) cf-1.6.17.pivotal file to Ops Manager 1.6 using REST API with curl command:

$ curl -v -k "https://localhost/api/products" -F 'product[file]=@/path/to/cf-1.6.17.pivotal' -X POST -u ops-manager-admin:password 


    • The @ sign is required when specifying the path to the product file.  
    • The -k option is only required if you need to skip SSL certification validation when the server is using a signed certificate.
    • Once the upload is completed, it will be available on the Ops Manager Web UI to be added.
    • Change the URL from localhost to Ops Manager DNS name, if you are not running the curl command from the Ops Manager VM.

On Ops Manager 1.7.x and greater

Ops Manager 1.7 authentication is now done via UAA.  The API with curl command is different from Ops Manager 1.6 that's using the Basic Auth, an additional step is required to upload the product tile.

First, you need to obtain the UAA <access_token> string with the following curl command:

$ curl -s -k -H 'Accept: application/json;charset=utf-8' -d 'grant_type=password' -d 'username=<web-ui-username>' -d 'password=<web-ui-pass>' -u 'opsman:' https://localhost/uaa/oauth/token


Once you have the access token string, you can upload (Import) the product tile to Ops Manager using the following API with curl command:

$ curl -vv -H 'Authorization: bearer <access_token>' -k -X POST https://localhost/api/v0/available_products -F 'product[file]=@<path-to-product-tile>


      • Replace <path-to-tile> with the full path to your PCF tile file.
      • Replace <web-ui-username> and <web-ui-pass> with your Ops Manager Web UI login username and password.
      • Replace <access_token> with a single long string of access_token obtained from the curl command in the red text for example.
      • Change the URL from localhost to Ops Manager DNS name, if you are not running the curl command from the Ops Manager VM.

Additional Information

For complete API documentation, check your Ops Manager installation docs https://<om-dns-name>/docs

For third party python tool to download files from Pivotal Network and upload them to Ops Manager 1.6, check out https://github.com/mreider/gng. The tool does not support Ops Manager Version 1.7 or above.

Note that the API with curl command for uploading stemcell and release files for Ops Manager 1.6 are as follows:

    • Stemcell:  curl -k "https://<om-dns-name>/api/stemcells" -F "stemcell[file]=@<path-to-stemcell-file>" -X POST -u <ops-manager-admin>:<password>
      • When uploading stemcells, you need to do this first before you select a tile to install with Ops Manager.
    • Release:  curl -k "https://<om-dns-name>/api/releases" -F "release[file]=@<path-to-release-file>" -X POST -u <ops-manager-admin>:<password>


Powered by Zendesk