GET /api/ptables
Vypsat všechny tabulky rozdělení úložiště

GET /api/operatingsystems/:operatingsystem_id/ptables
Vypsat všechny tabulky rozdělení úložiště pro operační systém

GET /api/locations/:location_id/ptables
List all partition tables per location

GET /api/organizations/:organization_id/ptables
List all partition tables per organization

Examples

GET /api/ptables
200
{
  "total": 2,
  "subtotal": 2,
  "page": 1,
  "per_page": 20,
  "search": null,
  "sort": {
    "by": null,
    "order": null
  },
  "results": [
    {
      "description": null,
      "os_family": null,
      "created_at": "2019-11-07 09:06:52 UTC",
      "updated_at": "2019-11-07 09:06:52 UTC",
      "name": "Example partition table",
      "id": 615088209
    },
    {
      "description": null,
      "os_family": "Redhat",
      "created_at": "2019-11-07 09:07:17 UTC",
      "updated_at": "2019-11-07 09:07:17 UTC",
      "name": "ptable813",
      "id": 1007981737
    }
  ]
}

Params

Param Name Description
operatingsystem_id
Optional

Identifikátor operačního systému

Validations:

  • Must be a String

location_id
Optional

Scope by locations

Validations:

  • Must be a Integer

organization_id
Optional

Scope by organizations

Validations:

  • Must be a Integer

search
Optional

výsledky filtru

Validations:

  • Must be a String

order
Optional

Sort field and order, eg. ‘id DESC’

Validations:

  • Must be a String

page
Optional

Číslo stránky, začíná od jedničky

Validations:

  • Must be a number.

per_page
Optional

Number of results per page to return

Validations:

  • Must be a number.

Search fields

Název kolonky Typ Možné hodnoty
default true, false
family string
layout text
location string
location_id integer
locked true, false
name string
organization string
organization_id integer
snippet true, false
template text
vendor string

GET /api/ptables/:id
Zobrazit tabulku rozdělení úložiště

Examples

GET /api/ptables/1007981743-ptable819
200
{
  "layout": "zerombr\\nclearpart --all    --initlabel\\npart /boot --fstype ext3 --size=<%= 10 * 10 %> --asprimary\\npart /     --f   stype ext3 --size=1024 --grow\\npart swap  --recommended",
  "locked": false,
  "description": null,
  "os_family": "Redhat",
  "created_at": "2019-11-07 09:07:17 UTC",
  "updated_at": "2019-11-07 09:07:17 UTC",
  "name": "ptable819",
  "id": 1007981743,
  "operatingsystems": [],
  "locations": [
    {
      "id": 255093256,
      "name": "Location 1",
      "title": "Location 1",
      "description": null
    }
  ],
  "organizations": [
    {
      "id": 447626438,
      "name": "Organization 1",
      "title": "Organization 1",
      "description": null
    }
  ]
}

Params

Param Name Description
location_id
Optional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
Optional

Set the current organization context for the request

Validations:

  • Must be a Integer

id
Required

Validations:

  • Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hypen(-) with no leading or trailing space.


POST /api/ptables
Vytvořit tabulku rozdělení úložiště

Examples

POST /api/ptables
{
  "ptable": {
    "name": "",
    "layout": "d-i partman-auto/disk"
  }
}
422
{
  "error": {
    "id": null,
    "errors": {
      "name": [
        "can't be blank"
      ]
    },
    "full_messages": [
      "Name can't be blank"
    ]
  }
}

Params

Param Name Description
location_id
Optional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
Optional

Set the current organization context for the request

Validations:

  • Must be a Integer

ptable
Required

Validations:

  • Must be a Hash

ptable[name]
Required

Validations:

  • Must be a String

ptable[description]
Optional , <span class="translation_missing" title="translation missing: cs-CZ.apipie.nil_allowed">Nil Allowed</span>

Validations:

  • Must be a String

ptable[layout]
Required

Validations:

  • Must be a String

ptable[snippet]
Optional , <span class="translation_missing" title="translation missing: cs-CZ.apipie.nil_allowed">Nil Allowed</span>

Validations:

  • Must be one of: true, false, 1, 0.

ptable[audit_comment]
Optional , <span class="translation_missing" title="translation missing: cs-CZ.apipie.nil_allowed">Nil Allowed</span>

Validations:

  • Must be a String

ptable[locked]
Optional , <span class="translation_missing" title="translation missing: cs-CZ.apipie.nil_allowed">Nil Allowed</span>

Zda šablona je či není uzamčena pro úpravy

Validations:

  • Must be one of: true, false, 1, 0.

ptable[os_family]
Optional , <span class="translation_missing" title="translation missing: cs-CZ.apipie.nil_allowed">Nil Allowed</span>

Validations:

  • Must be a String

ptable[operatingsystem_ids]
Optional , <span class="translation_missing" title="translation missing: cs-CZ.apipie.nil_allowed">Nil Allowed</span>

Array of operating system IDs to associate with the partition table

Validations:

  • Must be an array of any type

ptable[host_ids]
Optional , <span class="translation_missing" title="translation missing: cs-CZ.apipie.nil_allowed">Nil Allowed</span>

Array of host IDs to associate with the partition table

Validations:

  • Must be an array of any type

ptable[hostgroup_ids]
Optional , <span class="translation_missing" title="translation missing: cs-CZ.apipie.nil_allowed">Nil Allowed</span>

Array of host group IDs to associate with the partition table

Validations:

  • Must be an array of any type

ptable[location_ids]
Optional , <span class="translation_missing" title="translation missing: cs-CZ.apipie.nil_allowed">Nil Allowed</span>

REPLACE locations with given ids

Validations:

  • Must be an array of any type

ptable[organization_ids]
Optional , <span class="translation_missing" title="translation missing: cs-CZ.apipie.nil_allowed">Nil Allowed</span>

REPLACE organizations with given ids.

Validations:

  • Must be an array of any type


POST /api/ptables/import
Import a provisioning template

Examples

POST /api/ptables/import
{
  "ptable": {
    "name": "ptable824",
    "template": "b"
  }
}
201
{
  "template": "b",
  "name": "ptable824",
  "id": 1007981749,
  "snippet": false,
  "description": null,
  "template_kind_id": null,
  "created_at": "2019-11-07T09:07:18.340Z",
  "updated_at": "2019-11-07T09:07:18.356Z",
  "locked": false,
  "default": false,
  "vendor": null,
  "os_family": "Redhat"
}

Params

Param Name Description
location_id
Optional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
Optional

Set the current organization context for the request

Validations:

  • Must be a Integer

ptable
Required

Validations:

  • Must be a Hash

ptable[name]
Optional

název šablony

Validations:

  • Must be a String

ptable[template]
Optional

obsahy šablony včetně metadat

Validations:

  • Must be a String

ptable[location_ids]
Optional , <span class="translation_missing" title="translation missing: cs-CZ.apipie.nil_allowed">Nil Allowed</span>

REPLACE locations with given ids

Validations:

  • Must be an array of any type

ptable[organization_ids]
Optional , <span class="translation_missing" title="translation missing: cs-CZ.apipie.nil_allowed">Nil Allowed</span>

REPLACE organizations with given ids.

Validations:

  • Must be an array of any type

options
Optional

Validations:

  • Must be a Hash

options[force]
Optional , <span class="translation_missing" title="translation missing: cs-CZ.apipie.nil_allowed">Nil Allowed</span>

use if you want update locked templates

Validations:

  • Must be one of: true, false, 1, 0.

options[associate]
Optional , <span class="translation_missing" title="translation missing: cs-CZ.apipie.nil_allowed">Nil Allowed</span>

determines when the template should associate objects based on metadata, new means only when new template is being created, always means both for new and existing template which is only being updated, never ignores metadata

Validations:

  • Must be one of: new, always, never.

options[lock]
Optional , <span class="translation_missing" title="translation missing: cs-CZ.apipie.nil_allowed">Nil Allowed</span>

lock imported templates (false by default)

Validations:

  • Must be one of: true, false, 1, 0.

options[default]
Optional , <span class="translation_missing" title="translation missing: cs-CZ.apipie.nil_allowed">Nil Allowed</span>

makes the template default meaning it will be automatically associated with newly created organizations and locations (false by default)

Validations:

  • Must be one of: true, false, 1, 0.


GET /api/ptables/revision

Params

Param Name Description
location_id
Optional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
Optional

Set the current organization context for the request

Validations:

  • Must be a Integer

version
Optional

verze šablony

Validations:

  • Must be a String


PUT /api/ptables/:id
Aktualizovat tabulku rozdělení úložiště

Examples

PUT /api/ptables/1007981738
{
  "ptable": {
    "layout": "new ptable layout"
  }
}
200
{
  "layout": "new ptable layout",
  "locked": false,
  "description": null,
  "os_family": "Redhat",
  "created_at": "2019-11-07 09:07:17 UTC",
  "updated_at": "2019-11-07 09:07:17 UTC",
  "name": "ptable814",
  "id": 1007981738,
  "operatingsystems": [],
  "locations": [
    {
      "id": 255093256,
      "name": "Location 1",
      "title": "Location 1",
      "description": null
    }
  ],
  "organizations": [
    {
      "id": 447626438,
      "name": "Organization 1",
      "title": "Organization 1",
      "description": null
    }
  ]
}

Params

Param Name Description
location_id
Optional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
Optional

Set the current organization context for the request

Validations:

  • Must be a Integer

id
Required

Validations:

  • Must be a String

ptable
Required

Validations:

  • Must be a Hash

ptable[name]
Optional

Validations:

  • Must be a String

ptable[description]
Optional , <span class="translation_missing" title="translation missing: cs-CZ.apipie.nil_allowed">Nil Allowed</span>

Validations:

  • Must be a String

ptable[layout]
Optional

Validations:

  • Must be a String

ptable[snippet]
Optional , <span class="translation_missing" title="translation missing: cs-CZ.apipie.nil_allowed">Nil Allowed</span>

Validations:

  • Must be one of: true, false, 1, 0.

ptable[audit_comment]
Optional , <span class="translation_missing" title="translation missing: cs-CZ.apipie.nil_allowed">Nil Allowed</span>

Validations:

  • Must be a String

ptable[locked]
Optional , <span class="translation_missing" title="translation missing: cs-CZ.apipie.nil_allowed">Nil Allowed</span>

Zda šablona je či není uzamčena pro úpravy

Validations:

  • Must be one of: true, false, 1, 0.

ptable[os_family]
Optional , <span class="translation_missing" title="translation missing: cs-CZ.apipie.nil_allowed">Nil Allowed</span>

Validations:

  • Must be a String

ptable[operatingsystem_ids]
Optional , <span class="translation_missing" title="translation missing: cs-CZ.apipie.nil_allowed">Nil Allowed</span>

Array of operating system IDs to associate with the partition table

Validations:

  • Must be an array of any type

ptable[host_ids]
Optional , <span class="translation_missing" title="translation missing: cs-CZ.apipie.nil_allowed">Nil Allowed</span>

Array of host IDs to associate with the partition table

Validations:

  • Must be an array of any type

ptable[hostgroup_ids]
Optional , <span class="translation_missing" title="translation missing: cs-CZ.apipie.nil_allowed">Nil Allowed</span>

Array of host group IDs to associate with the partition table

Validations:

  • Must be an array of any type

ptable[location_ids]
Optional , <span class="translation_missing" title="translation missing: cs-CZ.apipie.nil_allowed">Nil Allowed</span>

REPLACE locations with given ids

Validations:

  • Must be an array of any type

ptable[organization_ids]
Optional , <span class="translation_missing" title="translation missing: cs-CZ.apipie.nil_allowed">Nil Allowed</span>

REPLACE organizations with given ids.

Validations:

  • Must be an array of any type


DELETE /api/ptables/:id
Smazat tabulku rozdělení úložiště

Examples

DELETE /api/ptables/1007981740-ptable816
{
  "ptable": {}
}
422
{
  "error": {
    "id": 1007981740,
    "errors": {
      "base": [
        "ptable816 is used by host2478"
      ]
    },
    "full_messages": [
      "ptable816 is used by host2478"
    ]
  }
}

Params

Param Name Description
location_id
Optional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
Optional

Set the current organization context for the request

Validations:

  • Must be a Integer

id
Required

Validations:

  • Must be a String


POST /api/ptables/:id/clone
Klonovat šablonu

Examples

POST /api/ptables/1007981736-ptable812/clone
{
  "ptable": {
    "name": ""
  }
}
422
{
  "error": {
    "id": 1007981736,
    "errors": {
      "name": [
        "can't be blank"
      ]
    },
    "full_messages": [
      "Name can't be blank"
    ]
  }
}

Params

Param Name Description
location_id
Optional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
Optional

Set the current organization context for the request

Validations:

  • Must be a Integer

id
Required

Validations:

  • Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hypen(-) with no leading or trailing space.

ptable
Required

Validations:

  • Must be a Hash

ptable[name]
Required

název šablony

Validations:

  • Must be a String


GET /api/ptables/:id/export
Export a partition template to ERB

Examples

GET /api/ptables/1007981755-ptable829/export
200
zerombr\nclearpart --all    --initlabel\npart /boot --fstype ext3 --size=<%= 10 * 10 %> --asprimary\npart /     --f   stype ext3 --size=1024 --grow\npart swap  --recommended
<%#
name: ptable829
snippet: false
model: Ptable
os_family: Redhat
organizations:
- Organization 1
locations:
- Location 1
%>

Params

Param Name Description
location_id
Optional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
Optional

Set the current organization context for the request

Validations:

  • Must be a Integer

id
Required

Validations:

  • Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hypen(-) with no leading or trailing space.