GET /api/hosts/:host_id/interfaces
Vypsat všechna rozhraní hostitele

GET /api/domains/:domain_id/interfaces
Vypsat všechna rozhraní pro doménu

GET /api/subnets/:subnet_id/interfaces
Vypsat všechna rozhraní pro podsíť

Examples

GET /api/hosts/host727/interfaces
404
{
  "error": {
    "message": "Resource interface not found by id ''"
  }
}

Params

Param Name Description
location_id
Optional

Scope by locations

Validations:

  • Must be a Integer

organization_id
Optional

Scope by organizations

Validations:

  • Must be a Integer

host_id
Required

Identifikátor nebo název stroje

Validations:

  • Must be a String

domain_id
Optional

Identif. nebo název domény

Validations:

  • Must be a String

subnet_id
Optional

Identif. nebo název podsítě

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.


GET /api/hosts/:host_id/interfaces/:id
Zobrazit rozhraní pro stroj

Examples

GET /api/hosts/host2647/interfaces/19
200
{
  "subnet_id": null,
  "subnet_name": null,
  "subnet6_id": null,
  "subnet6_name": null,
  "domain_id": null,
  "domain_name": null,
  "created_at": "2019-09-11 14:58:36 UTC",
  "updated_at": "2019-09-11 14:58:36 UTC",
  "managed": true,
  "identifier": "eth852",
  "id": 19,
  "name": null,
  "ip": "0.0.0.203",
  "ip6": null,
  "mac": "00:33:45:ab:01:46",
  "mtu": null,
  "fqdn": null,
  "primary": false,
  "provision": false,
  "type": "interface",
  "virtual": false
}

Params

Param Name Description
location_id
Optional

Scope by locations

Validations:

  • Must be a Integer

organization_id
Optional

Scope by organizations

Validations:

  • Must be a Integer

host_id
Required

Identifikátor nebo název stroje

Validations:

  • Must be a String

id
Required

Identifikátor nebo název rozhraní

Validations:

  • Must be a String


POST /api/hosts/:host_id/interfaces
Vytvořit na stroji rozhraní

Examples

POST /api/hosts/host2642/interfaces
{
  "interface": {
    "name": "test.foreman.com",
    "ip": "10.0.1.1",
    "mac": "AA:AA:AA:AA:AA:AA",
    "username": "foo",
    "password": "bar",
    "provider": "IPMI",
    "type": "bmc",
    "ip6": "2001:db8::1"
  }
}
201
{
  "subnet_id": null,
  "subnet_name": null,
  "subnet6_id": null,
  "subnet6_name": null,
  "domain_id": null,
  "domain_name": null,
  "created_at": "2019-09-11 14:58:36 UTC",
  "updated_at": "2019-09-11 14:58:36 UTC",
  "managed": true,
  "identifier": null,
  "id": 5,
  "name": "test.foreman.com",
  "ip": "10.0.1.1",
  "ip6": "2001:db8::1",
  "mac": "aa:aa:aa:aa:aa:aa",
  "mtu": null,
  "fqdn": "test.foreman.com",
  "primary": false,
  "provision": false,
  "type": "bmc",
  "username": "foo",
  "password": "bar",
  "provider": "IPMI",
  "virtual": false
}

Params

Param Name Description
location_id
Optional

Scope by locations

Validations:

  • Must be a Integer

organization_id
Optional

Scope by organizations

Validations:

  • Must be a Integer

host_id
Required

Identifikátor nebo název stroje

Validations:

  • Must be a String

interface
Required

informace o rozhraní

Validations:

  • Must be a Hash

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

MAC address of interface. Required for managed interfaces on bare metal.

Validations:

  • Must be a String

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

IPv4 adresa rozhraní

Validations:

  • Must be a String

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

IPv6 adresa rozhraní

Validations:

  • Must be a String

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

Interface type, e.g. bmc. Default is interface

Validations:

  • Must be one of: interface, bmc, bond, bridge.

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

Interface’s DNS name

Validations:

  • Must be a String

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

Foreman subnet ID of IPv4 interface

Validations:

  • Must be a number.

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

Foreman subnet ID of IPv6 interface

Validations:

  • Must be a number.

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

Foreman domain ID of interface. Required for primary interfaces on managed hosts.

Validations:

  • Must be a number.

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

Identifikátor zařízení, např. eth0 nebo eth1.1

Validations:

  • Must be a String

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

Should this interface be managed via DHCP and DNS smart proxy and should it be configured during provisioning?

Validations:

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

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

Should this interface be used for constructing the FQDN of the host? Each managed hosts needs to have one primary interface.

Validations:

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

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

Should this interface be used for TFTP of PXELinux (or SSH for image-based hosts)? Each managed hosts needs to have one provision interface.

Validations:

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

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

Only for BMC interfaces.

Validations:

  • Must be a String

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

Only for BMC interfaces.

Validations:

  • Must be a String

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

Interface provider, e.g. IPMI. Only for BMC interfaces.

Validations:

  • Must be one of: IPMI, SSH.

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

Alias or VLAN device

Validations:

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

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

VLAN tag, this attribute has precedence over the subnet VLAN ID. Only for virtual interfaces.

Validations:

  • Must be a String

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

MTU, this attribute has precedence over the subnet MTU.

Validations:

  • Must be a Integer

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

Identifier of the interface to which this interface belongs, e.g. eth1. Only for virtual interfaces.

Validations:

  • Must be a String

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

Bond mode of the interface, e.g. balance-rr. Only for bond interfaces.

Validations:

  • Must be one of: balance-rr, active-backup, balance-xor, broadcast, 802.3ad, balance-tlb, balance-alb.

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

Identifiers of attached interfaces, e.g. ['eth1', 'eth2']. For bond interfaces those are the slaves. Only for bond and bridges interfaces.

Validations:

  • Must be an array of any type

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

Space separated options, e.g. miimon=100. Only for bond interfaces.

Validations:

  • Must be a String

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

Additional compute resource specific attributes for the interface.

Validations:

  • Must be a Hash


PUT /api/hosts/:host_id/interfaces/:id
Aktualizovat rozhraní stroje

Examples

PUT /api/hosts/host2643/interfaces/7
{
  "interface": {
    "name": "wuhebbfueg"
  }
}
200
{
  "subnet_id": null,
  "subnet_name": null,
  "subnet6_id": null,
  "subnet6_name": null,
  "domain_id": null,
  "domain_name": null,
  "created_at": "2019-09-11 14:58:36 UTC",
  "updated_at": "2019-09-11 14:58:36 UTC",
  "managed": true,
  "identifier": "eth844",
  "id": 7,
  "name": "wuhebbfueg",
  "ip": "0.0.0.195",
  "ip6": null,
  "mac": "00:33:45:ab:01:3e",
  "mtu": null,
  "fqdn": "wuhebbfueg",
  "primary": false,
  "provision": false,
  "type": "interface",
  "virtual": false
}

Params

Param Name Description
location_id
Optional

Scope by locations

Validations:

  • Must be a Integer

organization_id
Optional

Scope by organizations

Validations:

  • Must be a Integer

host_id
Required

Identifikátor nebo název stroje

Validations:

  • Must be a String

id
Required

Identifikátor rozhraní

Validations:

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

interface
Required

informace o rozhraní

Validations:

  • Must be a Hash

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

MAC address of interface. Required for managed interfaces on bare metal.

Validations:

  • Must be a String

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

IPv4 adresa rozhraní

Validations:

  • Must be a String

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

IPv6 adresa rozhraní

Validations:

  • Must be a String

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

Interface type, e.g. bmc. Default is interface

Validations:

  • Must be one of: interface, bmc, bond, bridge.

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

Interface’s DNS name

Validations:

  • Must be a String

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

Foreman subnet ID of IPv4 interface

Validations:

  • Must be a number.

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

Foreman subnet ID of IPv6 interface

Validations:

  • Must be a number.

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

Foreman domain ID of interface. Required for primary interfaces on managed hosts.

Validations:

  • Must be a number.

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

Identifikátor zařízení, např. eth0 nebo eth1.1

Validations:

  • Must be a String

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

Should this interface be managed via DHCP and DNS smart proxy and should it be configured during provisioning?

Validations:

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

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

Should this interface be used for constructing the FQDN of the host? Each managed hosts needs to have one primary interface.

Validations:

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

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

Should this interface be used for TFTP of PXELinux (or SSH for image-based hosts)? Each managed hosts needs to have one provision interface.

Validations:

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

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

Only for BMC interfaces.

Validations:

  • Must be a String

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

Only for BMC interfaces.

Validations:

  • Must be a String

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

Interface provider, e.g. IPMI. Only for BMC interfaces.

Validations:

  • Must be one of: IPMI, SSH.

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

Alias or VLAN device

Validations:

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

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

VLAN tag, this attribute has precedence over the subnet VLAN ID. Only for virtual interfaces.

Validations:

  • Must be a String

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

MTU, this attribute has precedence over the subnet MTU.

Validations:

  • Must be a Integer

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

Identifier of the interface to which this interface belongs, e.g. eth1. Only for virtual interfaces.

Validations:

  • Must be a String

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

Bond mode of the interface, e.g. balance-rr. Only for bond interfaces.

Validations:

  • Must be one of: balance-rr, active-backup, balance-xor, broadcast, 802.3ad, balance-tlb, balance-alb.

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

Identifiers of attached interfaces, e.g. ['eth1', 'eth2']. For bond interfaces those are the slaves. Only for bond and bridges interfaces.

Validations:

  • Must be an array of any type

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

Space separated options, e.g. miimon=100. Only for bond interfaces.

Validations:

  • Must be a String

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

Additional compute resource specific attributes for the interface.

Validations:

  • Must be a Hash


DELETE /api/hosts/:host_id/interfaces/:id
Smazat rozhraní stroje

Examples

DELETE /api/hosts/host2645/interfaces/13
{
  "interface": {}
}
200
{
  "id": 13,
  "mac": "00:33:45:ab:01:42",
  "ip": "0.0.0.199",
  "name": null,
  "host_id": 5,
  "subnet_id": null,
  "domain_id": null,
  "attrs": {},
  "created_at": "2019-09-11T14:58:36.301Z",
  "updated_at": "2019-09-11T14:58:36.301Z",
  "provider": null,
  "username": null,
  "password": null,
  "virtual": false,
  "link": true,
  "identifier": "eth848",
  "tag": "",
  "attached_to": "",
  "managed": true,
  "mode": "balance-rr",
  "attached_devices": "",
  "bond_options": "",
  "primary": false,
  "provision": false,
  "compute_attributes": {},
  "ip6": null,
  "subnet6_id": null
}

Params

Param Name Description
location_id
Optional

Scope by locations

Validations:

  • Must be a Integer

organization_id
Optional

Scope by organizations

Validations:

  • Must be a Integer

host_id
Required

Identifikátor nebo název stroje

Validations:

  • Must be a String

id
Required

Identifikátor rozhraní

Validations:

  • Must be a String