Skip to content

Latest commit

 

History

History
185 lines (135 loc) · 4.58 KB

API_Documentation.md

File metadata and controls

185 lines (135 loc) · 4.58 KB

Diskspace Monitor API

The Diskspace Monitor API is a RESTful API which is build around 3 CORE RESOURCES.

System Component

A SystemComponent represents a component of the build system we would like to monitor. A SystemComponent is created (with a name and available storage) any time an agent registered a new component in the monitoring system.

An example of a SystemComponent might be a CrashDumpStore with 400G of storage.

endpoints
POST /v1/system_components Create System Component
GET /v1/system_components/:name Retrieve System Component
PATCH /v1/system_components/:name Update System Component
DELETE /v1/system_components/:name Delete System Component
GET /v1/system_components List System Components

The System Component Object:

name: unique name for the system component.

total_available_storage: the total storage (in Gigabits) available to the component.

storage_limit: the upper limit on total storage useage (as a percentage of 100).

current_storage_useage: the amount of the components storage (in Gigabits) currently being used.

{
  "name": "CrashDumpStore",
  "total_available_storage": 400,
  "storage_limit": 90,
  "current_storage_useage": 0
}



Component Events

A ComponentEvent is a data point related a given SystemComponents storage useage one moment in time. These are automatically generated when new components are registered in the system and when storage limits and useages change.

endpoints
GET /v1/component_events/:name Get latestest useage for component
GET /v1/component_events/:name/history Get historic useages for component
GET /v1/component_components Get latestest useage for all components

Component Event Object:

id: unique identifier for the object.

timestamp: the date and time at which the event was captured.

component_snapshot: a nested SystemComponent object including all details about the compnent at the timestamp of the event.

{
  "event_id": "ecaac8db-e9de-4eb8-b445-a4f5bb00bb0e",
  "timestamp": "01.23.2022 22:36:27",
  "component_snapshot": {
      "component_name": "CrashDump",
      "total_available_storage": 400,
      "storage_limit": 90,
      "current_storage_useage": 100
    }
}



Resource Warnings

A ResourceWarning is a warning registered when a SystemComponent reports a storage useage above, or close to, its upper limit.

endpoints
GET /v1/resource_warnings List all resource warnings

Resource Warning Object:

id: unique identifier for the object.

warning_type: the type of warning issued by the system (out of memory or close to memory limit).

component_event: a nested ComponentEvent object holding a SystemComponent object at a given timestamp.

{
  "warning_id": "4dc9a9af-d050-42a5-a1c6-ccf11f9b5e84",
  "warning_type": "over memory limit",
  "component_event": {
        "event_id": "8ac60ebf-eb1d-4277-b293-accccc8b252f",
        "timestamp": "01.23.2022 23:41:11",
        "component_snapshot": {
            "name": "CrashDumpStore",
            "total_available_storage": 400,
            "storage_limit": 90,
            "current_storage_useage": 395
          }
    }
}