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, refer to the Allow Additional Users to Access the Pivotal Healthwatch UI documentation.

Healthwatch API Status

Test the availability of the Healthwatch API by hitting the /info endpoint with a simple GET request:

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

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

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.

Creating and updating 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\":8192, \"deployment\":\"prod-isolation-segment\",\"type\":\"memory\"}"

Where:

  • The value property is required.

  • The type property is required. You must set it to either memory or disk.

  • The deployment property is optional. If you exclude the property, the global free chunk configuration is updated.

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.