Boot Environments

A Boot Environment allows you to create checkpoints on the system drive which allow you to roll back to previous configurations if required.

Basic Operations

Basic operations of Create, List, Get, Activate, and Destroy are available

List all Boot Environments

Call to /be to get all boot environments

Request Object

+ URL
  /api/v2/be

+ Method
  GET

+ Headers
  Content-Type: application/json
  token: ThisIsNotARealTokenGenerateYourOwnToken

+ Body
  {}

Response Object

Sending this should get you back a valid response, an array with each boot environment in the system.

+ Headers
  X-Powered-By: OpenDrives
  Access-Control-Allow-Origin: *
  Content-Type: application/json; charset=utf-8

+ Body
  [
    {
      "name": "OpenDrives-quartz-2.1.11",
      "active": {
        "now": true,
        "reboot": true
      },
      "mountpoint": "/",
      "space": "25.2G",
      "created": "2020-09-08 19:16"
    }
  ]

View one Boot Environments

Call to /be/$NAME to get a specific boot environments

Request Object

+ URL
  /api/v2/be/$BE_NAME

+ Method
  GET

+ Parameters
  boot environment name (string, required, URL param) - the name of the boot environment you'd like back

+ Headers
  Content-Type: application/json
  token: ThisIsNotARealTokenGenerateYourOwnToken

+ Body
  {}

Response Object

Sending this should get you back a valid response, an array with the boot environment you requested.

+ Headers
  X-Powered-By: OpenDrives
  Access-Control-Allow-Origin: *
  Content-Type: application/json; charset=utf-8

+ Body
  [
    {
      "name": "OpenDrives-quartz-2.1.11",
      "active": {
        "now": true,
        "reboot": true
      },
      "mountpoint": "/",
      "space": "25.2G",
      "created": "2020-09-08 19:16"
    }
  ]

Create a new Boot Environment

Creating a Boot Environment allows you to make a 'checkpoint' that you can return to.

Request Object

+ URL
  /api/v2/job/create

+ Method
  POST

+ Parameters
  name (string, required, BODY) - the name you'd like to give to the boot environment

+ Headers
  Content-Type: application/json
  token: ThisIsNotARealTokenGenerateYourOwnToken

+ Body
  {
    "name": "coolBootEnv1",
  }

Response Object

Sending this should get you back a valid response, the output of the creation command.

+ Headers
  X-Powered-By: OpenDrives
  Access-Control-Allow-Origin: *
  Content-Type: application/json; charset=utf-8

+ Body
  "GRUB configuration updated successfully\nGRUB configuration updated successfully\nCreated successfully\n"

Activate a Boot Environment

To activate a boot environemt, simply call the route with the job’s ID and updated fields

Request Object

+ URL
  /api/v2/be/$BE_NAME/activate

+ Method
  GET

+ Parameters
  boot environment name (string, required, URL params) - the name of the boot environment to activate

+ Headers
  Content-Type: application/json
  token: ThisIsNotARealTokenGenerateYourOwnToken

+ Body
  {}

Response Object

Sending this should get you back a valid response, an echo of successful command execution

+ Headers
  X-Powered-By: OpenDrives
  Access-Control-Allow-Origin: *
  Content-Type: application/json; charset=utf-8

+ Body
  "GRUB configuration updated successfully\nActivated successfully\n"

Destroy a Boot Environment

To destroy a boot environment, call the route with the boot environment’s name

Request Object

+ URL
  /api/v2/be/$BE_NAME/destroy

+ Method
  POST

+ Parameters
  boot environment name (string, required, URL params) - the name of the boot environment to activate

+ Headers
  Content-Type: application/json
  token: ThisIsNotARealTokenGenerateYourOwnToken

+ Body
  {}

Response Object

Sending this should get you back a valid response, an echo of successful command execution

+ Headers
  X-Powered-By: OpenDrives
  Access-Control-Allow-Origin: *
  Content-Type: application/json; charset=utf-8

+ Body
  "GRUB configuration updated successfully\nDestroyed successfully\n"