mr-provisioner API API Reference

Provision in style

Request Content-Types: application/json, multipart/form-data
Response Content-Types: application/json
Schemes: http, https
Version: 1.0

Authentication

Bearer

Send an authorization header with a bearer token. Set the value to Bearer <someToken>.

type
apiKey
name
Authorization
in
header

Machines

List machines

GET /machine

This endpoint returns a list of either all machines or all machines assigned to the user.

q
in query
string

If set, restrict machines to those matching the given query.

show_all
in query
boolean

If true, show all machines instead of just machines assigned to me.

200 OK

An array of machines

type
default

Unexpected error

Response Example (200 OK)
[
  {
    "id": "integer",
    "name": "string",
    "hostname": "string",
    "arch": "string",
    "initrd_id": "integer",
    "kernel_id": "integer",
    "kernel_opts": "string",
    "preseed_id": "integer",
    "netboot_enabled": "boolean"
  }
]
Response Example (default )
{
  "error_type": "string",
  "errors": [
    "string"
  ]
}

Reserve a machine matching a query

POST /machine/reservation

This endpoint assigns an unused machine, optionally matching criteria in a query, to the user.

undefined

Request Example
{
  "query": "string",
  "reason": "string"
}
200 OK

The newly assigned machine

404 Not Found

No machine matching the criteria is available

default

Unexpected error

Response Example (200 OK)
{
  "id": "integer",
  "name": "string",
  "hostname": "string",
  "arch": "string",
  "initrd_id": "integer",
  "kernel_id": "integer",
  "kernel_opts": "string",
  "preseed_id": "integer",
  "netboot_enabled": "boolean"
}
Response Example (404 Not Found)
{
  "error_type": "string",
  "errors": [
    "string"
  ]
}
Response Example (default )
{
  "error_type": "string",
  "errors": [
    "string"
  ]
}

Get machine

GET /machine/{machine_id}

This endpoint returns a machine.

machine_id
in path
integer

(no description)

200 OK

A machine

default

Unexpected error

Response Example (200 OK)
{
  "id": "integer",
  "name": "string",
  "hostname": "string",
  "arch": "string",
  "initrd_id": "integer",
  "kernel_id": "integer",
  "kernel_opts": "string",
  "preseed_id": "integer",
  "netboot_enabled": "boolean"
}
Response Example (default )
{
  "error_type": "string",
  "errors": [
    "string"
  ]
}

Modify machine

PUT /machine/{machine_id}

This endpoint modifies a machine's provisioning information.

undefined

machine_id
in path
integer

(no description)

Request Example
{
  "subarch": "string",
  "initrd_id": "integer",
  "kernel_id": "integer",
  "kernel_opts": "string",
  "preseed_id": "integer",
  "netboot_enabled": "boolean"
}
200 OK

The modified machine

default

Unexpected error

Response Example (200 OK)
{
  "id": "integer",
  "name": "string",
  "hostname": "string",
  "arch": "string",
  "initrd_id": "integer",
  "kernel_id": "integer",
  "kernel_opts": "string",
  "preseed_id": "integer",
  "netboot_enabled": "boolean"
}
Response Example (default )
{
  "error_type": "string",
  "errors": [
    "string"
  ]
}

Get machine power state

GET /machine/{machine_id}/power

This endpoint returns a machine's power state.

machine_id
in path
integer

(no description)

A machine power state

default

Unexpected error

Response Example (200 OK)
{
  "state": "string"
}
Response Example (default )
{
  "error_type": "string",
  "errors": [
    "string"
  ]
}

Change machine power state

POST /machine/{machine_id}/power

This endpoint changes a machine's power state.

machine_id
in path
integer

(no description)

Request Example
{
  "state": "string"
}
202 Accepted

Empty (Accepted)

default

Unexpected error

Response Example (default )
{
  "error_type": "string",
  "errors": [
    "string"
  ]
}

Get machine state

GET /machine/{machine_id}/state

This endpoint returns a machine's state.

machine_id
in path
integer

(no description)

200 OK

A machine state

default

Unexpected error

Response Example (200 OK)
{
  "state": "string"
}
Response Example (default )
{
  "error_type": "string",
  "errors": [
    "string"
  ]
}

Effect a machine state change

POST /machine/{machine_id}/state

This endpoint changes a machine's state:

  • provision: enables netboot on the machine, pxe-reboots it, and sets the state to provisioning.

undefined

machine_id
in path
integer

(no description)

Request Example
{
  "state": "string"
}
202 Accepted

New machine state

default

Unexpected error

Response Example (202 Accepted)
{
  "state": "string"
}
Response Example (default )
{
  "error_type": "string",
  "errors": [
    "string"
  ]
}

Change machine state without further side-effects

PUT /machine/{machine_id}/state

This endpoint changes a machine's state without further side-effects.

undefined

machine_id
in path
integer

(no description)

Request Example
{
  "state": "string"
}
200 OK

New machine state

default

Unexpected error

Response Example (200 OK)
{
  "state": "string"
}
Response Example (default )
{
  "error_type": "string",
  "errors": [
    "string"
  ]
}

Establish console connection credentials/information

POST /machine/{machine_id}/console

This endpoint creates ephemeral console connection credentials and provides connection details.

If the host field of the response is null, the websocket connection should be to the same host as the API call.

The websocket URL to connect to is built as follows: ws://[host or API host]:[port]/ws?token=[token], or using wss:// instead of ws:// if using secure sockets.

machine_id
in path
integer

(no description)

202 Accepted

Console connection information

default

Unexpected error

Response Example (202 Accepted)
{
  "host": "string",
  "port": "integer",
  "token": "string"
}
Response Example (default )
{
  "error_type": "string",
  "errors": [
    "string"
  ]
}

List machine interfaces

GET /machine/{machine_id}/interface

This endpoint returns a machine's interfaces.

machine_id
in path
integer

(no description)

A machine's interfaces

default

Unexpected error

Response Example (200 OK)
[
  {
    "id": "integer",
    "identifier": "string",
    "mac": "string",
    "network_name": "string",
    "subnetv4": "string",
    "netmaskv4": "string",
    "prefixlenv4": "string",
    "static_pool_v4": "string",
    "reserved_pool_v4": "string",
    "config_type_v4": "string",
    "configured_ipv4": "string",
    "lease_ipv4": "string",
    "last_seen_date": "string"
  }
]
Response Example (default )
{
  "error_type": "string",
  "errors": [
    "string"
  ]
}

Get a machine interface

GET /machine/{machine_id}/interface/{interface_id}

This endpoint returns a machine's interfaces.

machine_id
in path
integer

(no description)

interface_id
in path
integer

(no description)

A machine interface

default

Unexpected error

Response Example (200 OK)
{
  "id": "integer",
  "identifier": "string",
  "mac": "string",
  "network_name": "string",
  "subnetv4": "string",
  "netmaskv4": "string",
  "prefixlenv4": "string",
  "static_pool_v4": "string",
  "reserved_pool_v4": "string",
  "config_type_v4": "string",
  "configured_ipv4": "string",
  "lease_ipv4": "string",
  "last_seen_date": "string"
}
Response Example (default )
{
  "error_type": "string",
  "errors": [
    "string"
  ]
}

Modify machine interface

PUT /machine/{machine_id}/interface/{interface_id}

This endpoint modifies a machine interface.

machine_id
in path
integer

(no description)

interface_id
in path
integer

(no description)

Request Example
{
  "identifier": "string",
  "config_type_v4": "string",
  "configured_ipv4": "string"
}

The modified interface

409 Conflict

Unable to assign an IP automatically or conflicting identifier

default

Unexpected error

Response Example (200 OK)
{
  "id": "integer",
  "identifier": "string",
  "mac": "string",
  "network_name": "string",
  "subnetv4": "string",
  "netmaskv4": "string",
  "prefixlenv4": "string",
  "static_pool_v4": "string",
  "reserved_pool_v4": "string",
  "config_type_v4": "string",
  "configured_ipv4": "string",
  "lease_ipv4": "string",
  "last_seen_date": "string"
}
Response Example (409 Conflict)
{
  "error_type": "string",
  "errors": [
    "string"
  ]
}
Response Example (default )
{
  "error_type": "string",
  "errors": [
    "string"
  ]
}

List machine assignees

GET /machine/{machine_id}/assignee

This endpoint returns a machine's assignees.

machine_id
in path
integer

(no description)

A machine's assignees

default

Unexpected error

Response Example (200 OK)
[
  {
    "id": "integer",
    "user": "string",
    "reason": "string"
  }
]
Response Example (default )
{
  "error_type": "string",
  "errors": [
    "string"
  ]
}

Assign machine to a user (create a new assignment)

POST /machine/{machine_id}/assignee

This endpoint adds an assignee to a machine.

machine_id
in path
integer

(no description)

Request Example
{
  "user": "string",
  "reason": "string"
}
201 Created

The newly assigned assignee object

default

Unexpected error

Response Example (201 Created)
{
  "id": "integer",
  "user": "string",
  "reason": "string"
}
Response Example (default )
{
  "error_type": "string",
  "errors": [
    "string"
  ]
}

Get a machine assignee

GET /machine/{machine_id}/assignee/{assignee_id}

This endpoint returns a machine's assignee.

machine_id
in path
integer

(no description)

assignee_id
in path
integer

(no description)

A machine assignee

default

Unexpected error

Response Example (200 OK)
{
  "id": "integer",
  "user": "string",
  "reason": "string"
}
Response Example (default )
{
  "error_type": "string",
  "errors": [
    "string"
  ]
}

Modify machine assignee

PUT /machine/{machine_id}/assignee/{assignee_id}

This endpoint modifies a machine assignee.

machine_id
in path
integer

(no description)

assignee_id
in path
integer

(no description)

Request Example
{
  "reason": "string"
}

The modified assignee

default

Unexpected error

Response Example (200 OK)
{
  "id": "integer",
  "user": "string",
  "reason": "string"
}
Response Example (default )
{
  "error_type": "string",
  "errors": [
    "string"
  ]
}

Remove a machine assignee

DELETE /machine/{machine_id}/assignee/{assignee_id}

This endpoint removes a machine assignee.

machine_id
in path
integer

(no description)

assignee_id
in path
integer

(no description)

204 No Content

Empty

default

Unexpected error

Response Example (default )
{
  "error_type": "string",
  "errors": [
    "string"
  ]
}

Get own machine assignee

GET /machine/{machine_id}/assignee/self

This endpoint returns a machine's assignee if the caller is assigned to this particular machine.

machine_id
in path
integer

(no description)

Caller's assignment to this machine

default

Unexpected error

Response Example (200 OK)
{
  "id": "integer",
  "user": "string",
  "reason": "string"
}
Response Example (default )
{
  "error_type": "string",
  "errors": [
    "string"
  ]
}

Modify machine assignment when the caller of the call is the assignee

PUT /machine/{machine_id}/assignee/self

This endpoint modifies a machine assignee.

machine_id
in path
integer

(no description)

Request Example
{
  "reason": "string"
}

The modified assignee

default

Unexpected error

Response Example (200 OK)
{
  "id": "integer",
  "user": "string",
  "reason": "string"
}
Response Example (default )
{
  "error_type": "string",
  "errors": [
    "string"
  ]
}

Remove a machine from the caller's list of assignments

DELETE /machine/{machine_id}/assignee/self

This endpoint removes the caller of the endpoint from the assignees list of a machine.

machine_id
in path
integer

(no description)

204 No Content

Empty

default

Unexpected error

Response Example (default )
{
  "error_type": "string",
  "errors": [
    "string"
  ]
}

Images

List images

GET /image

This endpoint returns a list of either all machines or all machines assigned to the user.

show_all
in query
boolean

If true, show all machines instead of just my own images.

200 OK

An array of images

type
default

Unexpected error

Response Example (200 OK)
[
  {
    "id": "integer",
    "name": "string",
    "description": "string",
    "type": "string",
    "arch": "string",
    "upload_date": "string",
    "user": "string",
    "known_good": "boolean",
    "public": "boolean"
  }
]
Response Example (default )
{
  "error_type": "string",
  "errors": [
    "string"
  ]
}

Create image

POST /image

This endpoint creates a new image with a multipart file upload.

file
in formData
file

The file to upload.

q
in formData
string { "description": "Example image", "type": "Kernel", "public": false, "known_good": true }

JSON of ImageCreateOrModify type:

201 Created

The newly created image

default

Unexpected error

Response Example (201 Created)
{
  "id": "integer",
  "name": "string",
  "description": "string",
  "type": "string",
  "arch": "string",
  "upload_date": "string",
  "user": "string",
  "known_good": "boolean",
  "public": "boolean"
}
Response Example (default )
{
  "error_type": "string",
  "errors": [
    "string"
  ]
}

Get image

GET /image/{image_id}

This endpoint returns an image.

image_id
in path
integer

(no description)

200 OK

An image

default

Unexpected error

Response Example (200 OK)
{
  "id": "integer",
  "name": "string",
  "description": "string",
  "type": "string",
  "arch": "string",
  "upload_date": "string",
  "user": "string",
  "known_good": "boolean",
  "public": "boolean"
}
Response Example (default )
{
  "error_type": "string",
  "errors": [
    "string"
  ]
}

Modify image

PUT /image/{image_id}

This endpoint modifies an image's metadata.

image_id
in path
integer

(no description)

Request Example
{
  "description": "string",
  "type": "string",
  "arch": "string",
  "known_good": "boolean",
  "public": "boolean"
}
200 OK

The modified image

default

Unexpected error

Response Example (200 OK)
{
  "id": "integer",
  "name": "string",
  "description": "string",
  "type": "string",
  "arch": "string",
  "upload_date": "string",
  "user": "string",
  "known_good": "boolean",
  "public": "boolean"
}
Response Example (default )
{
  "error_type": "string",
  "errors": [
    "string"
  ]
}

Delete image

DELETE /image/{image_id}

This endpoint deletes an image.

image_id
in path
integer

(no description)

204 No Content

Empty

default

Unexpected error

Response Example (default )
{
  "error_type": "string",
  "errors": [
    "string"
  ]
}

Preseeds

List preseeds

GET /preseed

This endpoint returns a list of either all machines or all machines assigned to the user.

show_all
in query
boolean

If true, show all machines instead of just my own preseeds.

200 OK

An array of preseeds

type
default

Unexpected error

Response Example (200 OK)
[
  {
    "id": "integer",
    "name": "string",
    "description": "string",
    "type": "string",
    "content": "string",
    "user": "string",
    "known_good": "boolean",
    "public": "boolean"
  }
]
Response Example (default )
{
  "error_type": "string",
  "errors": [
    "string"
  ]
}

Create preseed

POST /preseed

This endpoint creates a new preseed.

Request Example
{
  "name": "string",
  "description": "string",
  "type": "string",
  "content": "string",
  "known_good": "boolean",
  "public": "boolean"
}
201 Created

The newly created preseed

default

Unexpected error

Response Example (201 Created)
{
  "id": "integer",
  "name": "string",
  "description": "string",
  "type": "string",
  "content": "string",
  "user": "string",
  "known_good": "boolean",
  "public": "boolean"
}
Response Example (default )
{
  "error_type": "string",
  "errors": [
    "string"
  ]
}

Get preseed

GET /preseed/{preseed_id}

This endpoint returns an preseed.

preseed_id
in path
integer

(no description)

200 OK

An preseed

default

Unexpected error

Response Example (200 OK)
{
  "id": "integer",
  "name": "string",
  "description": "string",
  "type": "string",
  "content": "string",
  "user": "string",
  "known_good": "boolean",
  "public": "boolean"
}
Response Example (default )
{
  "error_type": "string",
  "errors": [
    "string"
  ]
}

Modify preseed

PUT /preseed/{preseed_id}

This endpoint modifies an preseed's metadata.

preseed_id
in path
integer

(no description)

Request Example
{
  "name": "string",
  "description": "string",
  "type": "string",
  "content": "string",
  "known_good": "boolean",
  "public": "boolean"
}
200 OK

The modified preseed

default

Unexpected error

Response Example (200 OK)
{
  "id": "integer",
  "name": "string",
  "description": "string",
  "type": "string",
  "content": "string",
  "user": "string",
  "known_good": "boolean",
  "public": "boolean"
}
Response Example (default )
{
  "error_type": "string",
  "errors": [
    "string"
  ]
}

Delete preseed

DELETE /preseed/{preseed_id}

This endpoint deletes an preseed.

preseed_id
in path
integer

(no description)

204 No Content

Empty

default

Unexpected error

Response Example (default )
{
  "error_type": "string",
  "errors": [
    "string"
  ]
}

Schema Definitions

Machine: object

id: integer
name: string

Name

hostname: string

Hostname

arch: string

Architecture

initrd_id: integer

ID of initrd to use for netboot

kernel_id: integer

ID of kernel to use for netboot

kernel_opts: string

Kernel command line

preseed_id: integer

ID of preseed to use for installation/boot

netboot_enabled: boolean

Whether machine should netboot

Example
{
  "id": "integer",
  "name": "string",
  "hostname": "string",
  "arch": "string",
  "initrd_id": "integer",
  "kernel_id": "integer",
  "kernel_opts": "string",
  "preseed_id": "integer",
  "netboot_enabled": "boolean"
}

MachineModify: object

subarch: string

Name of a subarchitecture of the machine's architecture

initrd_id: integer

ID of initrd to use for netboot

kernel_id: integer

ID of kernel to use for netboot

kernel_opts: string

Kernel command line

preseed_id: integer

ID of preseed to use for installation/boot

netboot_enabled: boolean

Whether machine should netboot

Example
{
  "subarch": "string",
  "initrd_id": "integer",
  "kernel_id": "integer",
  "kernel_opts": "string",
  "preseed_id": "integer",
  "netboot_enabled": "boolean"
}

MachineInterface: object

id: integer
identifier: string
mac: string
network_name: string
subnetv4: string
netmaskv4: string
prefixlenv4: string
static_pool_v4: string
reserved_pool_v4: string
config_type_v4: string static, dynamic-reserved, dynamic
configured_ipv4: string
lease_ipv4: string
last_seen_date: string
Example
{
  "id": "integer",
  "identifier": "string",
  "mac": "string",
  "network_name": "string",
  "subnetv4": "string",
  "netmaskv4": "string",
  "prefixlenv4": "string",
  "static_pool_v4": "string",
  "reserved_pool_v4": "string",
  "config_type_v4": "string",
  "configured_ipv4": "string",
  "lease_ipv4": "string",
  "last_seen_date": "string"
}

MachineInterfaceModify: object

identifier: string
config_type_v4: string static, dynamic-reserved, dynamic
configured_ipv4: string
Example
{
  "identifier": "string",
  "config_type_v4": "string",
  "configured_ipv4": "string"
}

MachineAssignee: object

id: integer
user: string
reason: string
Example
{
  "id": "integer",
  "user": "string",
  "reason": "string"
}

MachineAssigneeCreate: object

user: string
reason: string
Example
{
  "user": "string",
  "reason": "string"
}

MachineAssigneeModify: object

reason: string
Example
{
  "reason": "string"
}

MachinePowerState: object

state: string on, off, unknown
Example
{
  "state": "string"
}

MachinePowerStateModify: object

state: string on, off, reboot, pxe_reboot, bios_reboot, disk_reboot
Example
{
  "state": "string"
}

MachineState: object

state: string ready, provisioning, error, unknown
Example
{
  "state": "string"
}

MachineStatePost: object

state: string provision
Example
{
  "state": "string"
}

MachineStateModify: object

state: string ready, error, unknown
Example
{
  "state": "string"
}

MachineReservation: object

query: string

A valid query, e.g. (= bmc_type "moonshot") or null to match any machine.

reason: string
Example
{
  "query": "string",
  "reason": "string"
}

ConsoleConnection: object

host: string
port: integer
token: string
Example
{
  "host": "string",
  "port": "integer",
  "token": "string"
}

Image: object

id: integer
name: string
description: string
type: string Kernel, Initrd, bootloader
arch: string
upload_date: string
user: string
known_good: boolean
public: boolean
Example
{
  "id": "integer",
  "name": "string",
  "description": "string",
  "type": "string",
  "arch": "string",
  "upload_date": "string",
  "user": "string",
  "known_good": "boolean",
  "public": "boolean"
}

ImageCreateOrModify: object

description: string
type: string Kernel, Initrd
arch: string
known_good: boolean
public: boolean
Example
{
  "description": "string",
  "type": "string",
  "arch": "string",
  "known_good": "boolean",
  "public": "boolean"
}

Preseed: object

id: integer
name: string
description: string
type: string preseed, kickstart, autoyast
content: string
user: string
known_good: boolean
public: boolean
Example
{
  "id": "integer",
  "name": "string",
  "description": "string",
  "type": "string",
  "content": "string",
  "user": "string",
  "known_good": "boolean",
  "public": "boolean"
}

PreseedCreateOrModify: object

name: string
description: string
type: string preseed, kickstart, autoyast
content: string
known_good: boolean
public: boolean
Example
{
  "name": "string",
  "description": "string",
  "type": "string",
  "content": "string",
  "known_good": "boolean",
  "public": "boolean"
}

Error: object

error_type: string

Short error type

errors: string[]

Error messages

Example
{
  "error_type": "string",
  "errors": [
    "string"
  ]
}