GET /api/ptables
Alle Partitionstabellen auflisten

GET /api/operatingsystems/:operatingsystem_id/ptables
Alle Partitionstabellen für ein Betriebssystem auflisten

GET /api/locations/:location_id/ptables
Alle Partitionstabellen pro Standort auflisten

GET /api/organizations/:organization_id/ptables
Alle Partitionstabellen pro Organisation auflisten

Beispiele

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
    }
  ]
}

Parameter

Parametername Beschreibung
operatingsystem_id
optional

Kennung des Betriebssystems

Validations:

  • Must be a String

location_id
optional

Scope nach Standorten

Validations:

  • Must be a Integer

organization_id
optional

Scope nach Organisationen

Validations:

  • Must be a Integer

search
optional

Ergebnisse filtern

Validations:

  • Must be a String

order
optional

Feld und Reihenfolge sortieren, z.B. ‘id DESC’

Validations:

  • Must be a String

page
optional

Seitennummer, beginnend bei 1

Validations:

  • Must be a number.

per_page
optional

Anzahl der angezeigten Ergebnisse pro Seite

Validations:

  • Must be a number.

Suchfelder

Feld Name Typ Mögliche Werte
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
Partitionstabelle anzeigen

Beispiele

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
    }
  ]
}

Parameter

Parametername Beschreibung
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
verpflichtend

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
Partitionstabelle erstellen

Beispiele

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"
    ]
  }
}

Parameter

Parametername Beschreibung
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
verpflichtend

Validations:

  • Must be a Hash

ptable[name]
verpflichtend

Validations:

  • Must be a String

ptable[description]
optional , nil erlaubt

Validations:

  • Must be a String

ptable[layout]
verpflichtend

Validations:

  • Must be a String

ptable[snippet]
optional , nil erlaubt

Validations:

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

ptable[audit_comment]
optional , nil erlaubt

Validations:

  • Must be a String

ptable[locked]
optional , nil erlaubt

Ob die Vorlage für die Bearbeitung gesperrt ist oder nicht

Validations:

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

ptable[os_family]
optional , nil erlaubt

Validations:

  • Must be a String

ptable[operatingsystem_ids]
optional , nil erlaubt

Abfolge von Betriebssystem-Kennungen, die der Partitionstabelle zugeordnet werden sollen

Validations:

  • Must be an array of any type

ptable[host_ids]
optional , nil erlaubt

Abfolge von Host-Kennungen, die der Partitionstabelle zugeordnet werden sollen

Validations:

  • Must be an array of any type

ptable[hostgroup_ids]
optional , nil erlaubt

Abfolge von Hostgruppen-Kennungen, die der Partitionstabelle zugeordnet werden sollen

Validations:

  • Must be an array of any type

ptable[location_ids]
optional , nil erlaubt

Standorte durch angegebene Kennungen ERSETZEN

Validations:

  • Must be an array of any type

ptable[organization_ids]
optional , nil erlaubt

Organisationen durch angegebene Kennungen ERSETZEN

Validations:

  • Must be an array of any type


POST /api/ptables/import
Import einer Bereitstellungsvorlage

Beispiele

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"
}

Parameter

Parametername Beschreibung
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
verpflichtend

Validations:

  • Must be a Hash

ptable[name]
optional

Vorlagenname

Validations:

  • Must be a String

ptable[template]
optional

Vorlagen-Inhalte die Meta-Daten enthalten

Validations:

  • Must be a String

ptable[location_ids]
optional , nil erlaubt

Standorte durch angegebene Kennungen ERSETZEN

Validations:

  • Must be an array of any type

ptable[organization_ids]
optional , nil erlaubt

Organisationen durch angegebene Kennungen ERSETZEN

Validations:

  • Must be an array of any type

options
optional

Validations:

  • Must be a Hash

options[force]
optional , nil erlaubt

Nutzen, wenn sie gesperrte Vorlagen aktualisieren wollen

Validations:

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

options[associate]
optional , nil erlaubt

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 , nil erlaubt

Importierte Templates sperren (Standardwert: false)

Validations:

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

options[default]
optional , nil erlaubt

macht eine Vorlage zur Standardvorlage. Standardvorlagen werden automatisch zu neuen Organisationen und Standorten hinzugefügt. (Standardmäßig falsch)

Validations:

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


GET /api/ptables/revision

Parameter

Parametername Beschreibung
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

Vorlagenversion

Validations:

  • Must be a String


PUT /api/ptables/:id
Partitionstabelle aktualisieren

Beispiele

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
    }
  ]
}

Parameter

Parametername Beschreibung
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
verpflichtend

Validations:

  • Must be a String

ptable
verpflichtend

Validations:

  • Must be a Hash

ptable[name]
optional

Validations:

  • Must be a String

ptable[description]
optional , nil erlaubt

Validations:

  • Must be a String

ptable[layout]
optional

Validations:

  • Must be a String

ptable[snippet]
optional , nil erlaubt

Validations:

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

ptable[audit_comment]
optional , nil erlaubt

Validations:

  • Must be a String

ptable[locked]
optional , nil erlaubt

Ob die Vorlage für die Bearbeitung gesperrt ist oder nicht

Validations:

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

ptable[os_family]
optional , nil erlaubt

Validations:

  • Must be a String

ptable[operatingsystem_ids]
optional , nil erlaubt

Abfolge von Betriebssystem-Kennungen, die der Partitionstabelle zugeordnet werden sollen

Validations:

  • Must be an array of any type

ptable[host_ids]
optional , nil erlaubt

Abfolge von Host-Kennungen, die der Partitionstabelle zugeordnet werden sollen

Validations:

  • Must be an array of any type

ptable[hostgroup_ids]
optional , nil erlaubt

Abfolge von Hostgruppen-Kennungen, die der Partitionstabelle zugeordnet werden sollen

Validations:

  • Must be an array of any type

ptable[location_ids]
optional , nil erlaubt

Standorte durch angegebene Kennungen ERSETZEN

Validations:

  • Must be an array of any type

ptable[organization_ids]
optional , nil erlaubt

Organisationen durch angegebene Kennungen ERSETZEN

Validations:

  • Must be an array of any type


DELETE /api/ptables/:id
Partitionstabelle löschen

Beispiele

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

Parameter

Parametername Beschreibung
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
verpflichtend

Validations:

  • Must be a String


POST /api/ptables/:id/clone
Vorlage klonen

Beispiele

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"
    ]
  }
}

Parameter

Parametername Beschreibung
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
verpflichtend

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
verpflichtend

Validations:

  • Must be a Hash

ptable[name]
verpflichtend

Vorlagenname

Validations:

  • Must be a String


GET /api/ptables/:id/export
Export einer Partitionsvorlage nach ERB

Beispiele

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
%>

Parameter

Parametername Beschreibung
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
verpflichtend

Validations:

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