ironic.api.controllers.v1.runbook module

class ironic.api.controllers.v1.runbook.RunbookTraitsController(*args, **kwargs)[source]

Bases: RestController

REST controller for runbook traits.

delete(trait=None)[source]

Remove one or all traits from a runbook.

Parameters:

trait – String value; trait to remove from the runbook, or None. If None, all traits are removed.

get_all()[source]

List runbook traits.

put(trait=None, body=None)[source]

Add a trait to a runbook, or replace all traits.

Parameters:
  • trait – String value; trait to add to the runbook, or None. Mutually exclusive with ‘traits’. If not None, adds this trait to the runbook.

  • body – dict with ‘traits’ key; if provided, replaces all traits. Mutually exclusive with ‘trait’.

class ironic.api.controllers.v1.runbook.RunbooksController(*args, **kwargs)[source]

Bases: RestController

REST controller for runbooks.

delete(runbook_ident)[source]

Delete a runbook.

Parameters:

runbook_ident – UUID or logical name of a runbook.

get_all(marker=None, limit=None, sort_key='id', sort_dir='asc', fields=None, detail=None, project=None)[source]

Retrieve a list of runbooks.

Parameters:
  • marker – pagination marker for large data sets.

  • limit – maximum number of resources to return in a single result. This value cannot be larger than the value of max_limit in the [api] section of the ironic configuration, or only max_limit resources will be returned.

  • project – Optional string value that set the project whose runbooks are to be returned.

  • sort_key – column to sort results by. Default: id.

  • sort_dir – direction to sort. “asc” or “desc”. Default: asc.

  • fields – Optional, a list with a specified set of fields of the resource to be returned.

  • detail – Optional, boolean to indicate whether retrieve a list of runbooks with detail.

get_one(runbook_ident, fields=None)[source]

Retrieve information about the given runbook.

Parameters:
  • runbook_ident – UUID or logical name of a runbook.

  • fields – Optional, a list with a specified set of fields of the resource to be returned.

invalid_sort_key_list = ['extra', 'steps', 'traits']
patch(runbook_ident, patch=None)[source]

Update an existing runbook.

Parameters:
  • runbook_ident – UUID or logical name of a runbook.

  • patch – a json PATCH document to apply to this runbook.

post(runbook)[source]

Create a new runbook.

Parameters:

runbook – a runbook within the request body.

Add links to the runbook.

ironic.api.controllers.v1.runbook.runbook_sanitize(runbook, fields)[source]

Removes sensitive and unrequested data.

Will only keep the fields specified in the fields parameter.

Parameters:

fields (list of str) – list of fields to preserve, or None to preserve them all

ironic.api.controllers.v1.runbook.step_sanitize(step)[source]