Configuring Free Chunk Sizes

This topic describes how to use the Pivotal Healthwatch API to retrieve and configure Available Free Chunks of Memory and Available Free Chunks of Disk.

Currently, two main types of free chunk configurations are supported: Global and Deployment-specific. Through this API, consumers can do the following:

  • View current free chunk configurations
  • Update the Global free chunk size for memory and disk
  • Create deployment-specific free chunk configurations
    • Applicable for customers isolating Compute (Diego Cells) into Isolation Segments, where different threshold values of concern may be needed

Prerequisites and Assumptions

The steps in this document assume you can generate bearer tokens for a UAA client with the healthwatch.read (GET only) and healthwatch.admin (both GET and POST) scopes. For detailed instructions on how to add these scopes, see Allow Additional Users to Access the Pivotal Healthwatch UI in Installing Pivotal Healthwatch.

Healthwatch API Status

To test the availability of the Healthwatch API, send a GET request to the /info endpoint:

curl https://healthwatch-api.SYSTEM-DOMAIN/info

Where SYSTEM-DOMAIN is the system domain URL configured in the TAS for VMs tile. For example, sys.example.com.

The expected response is a 200/OK with the message "HAPI is happy".

View All Free Chunk Configurations

GET /v1/free-chunks

To view a list of free chunk configurations, send a GET request to the /v1/free-chunks endpoint:

uaac curl https://healthwatch-api.SYSTEM-DOMAIN/v1/free-chunks

Where SYSTEM-DOMAIN is the URL configured in the TAS for VMs tile. For example, sys.example.com.

This returns a JSON array of free chunk configurations:

[
  {
    "id": 1,
    "deployment": "healthwatch-default",
    "value": 4096,
    "type": "memory"
  }
]

Note: the value returned in the Pivotal Healthwatch API is in megabytes, but the Pivotal Healthwatch UI displays the value in gigabytes.

Create or Update Free Chunk Configurations

POST /v1/free-chunks

To create or update a free chunk configuration, make a POST request to the /v1/free-chunks endpoint with the following structure:

uaac curl -X POST "https://healthwatch-api.SYSTEM-DOMAIN/v1/free-chunks" \
      -H "Content-Type: application/json" \
      --data "{\"value\":VALUE, \"deployment\":\"DEPLOYMENT-NAME\",\"type\":\"FREE-CHUNK-CONFIGURATION-TYPE\"}"

Where:

  • SYSTEM-DOMAIN is the system domain URL configured in the TAS for VMs tile. For example, sys.example.com.

  • FREE-CHUNK-CONFIGURATION-VALUE is the value of the free chunk configuration you want to set.

  • FREE-CHUNK-CONFIGURATION-TYPE is the free chunk configuration type you want to set. You must set the type property to either memory or disk.

  • (Optional) DEPLOYMENT-NAME is the name of the deployment for which you want to create or update a free chunk type configuration. If you exclude the deployment property, the POST request updates the global free chunk configuration.

Possible successful HTTP response codes:

  • 200: A record was updated
  • 201: A new record was created
  • 400: Invalid parameters

Note: The value supplied to the Pivotal Healthwatch API is in megabytes, but the Pivotal Healthwatch UI displays the value in gigabytes.