GET /api/hosts/host222/interfaces
200
{
"total": 3,
"subtotal": 3,
"page": 1,
"per_page": 20,
"search": null,
"sort": {
"by": null,
"order": null
},
"results": [
{
"subnet_id": null,
"subnet_name": null,
"subnet6_id": null,
"subnet6_name": null,
"domain_id": null,
"domain_name": null,
"created_at": "2018-11-15 19:02:12 UTC",
"updated_at": "2018-11-15 19:02:12 UTC",
"managed": true,
"identifier": null,
"id": 1,
"name": "host222",
"ip": null,
"ip6": null,
"mac": null,
"mtu": null,
"fqdn": "host222",
"primary": true,
"provision": true,
"type": "interface",
"virtual": false
},
{
"subnet_id": null,
"subnet_name": null,
"subnet6_id": null,
"subnet6_name": null,
"domain_id": null,
"domain_name": null,
"created_at": "2018-11-15 19:02:12 UTC",
"updated_at": "2018-11-15 19:02:12 UTC",
"managed": true,
"identifier": "eth37",
"id": 2,
"name": null,
"ip": "0.0.0.27",
"ip6": null,
"mac": "00:33:45:ab:00:1b",
"mtu": null,
"fqdn": null,
"primary": false,
"provision": false,
"type": "interface",
"virtual": false
},
{
"subnet_id": null,
"subnet_name": null,
"subnet6_id": null,
"subnet6_name": null,
"domain_id": null,
"domain_name": null,
"created_at": "2018-11-15 19:02:12 UTC",
"updated_at": "2018-11-15 19:02:12 UTC",
"managed": true,
"identifier": "eth38",
"id": 3,
"name": null,
"ip": "0.0.0.28",
"ip6": null,
"mac": "00:33:45:ab:00:1c",
"mtu": null,
"fqdn": null,
"primary": false,
"provision": false,
"type": "bond",
"mode": "balance-rr",
"attached_devices": "",
"bond_options": "",
"virtual": true
}
]
}
| Param name | Description |
|---|---|
|
location_id optional |
Scope by locations Validations:
|
|
organization_id optional |
Scope by organizations Validations:
|
|
host_id required |
ID or name of host Validations:
|
|
domain_id optional |
ID or name of domain Validations:
|
|
subnet_id optional |
ID or name of subnet Validations:
|
|
page optional |
paginate results Validations:
|
|
per_page optional |
number of entries per request Validations:
|
GET /api/hosts/host220/interfaces/2
200
{
"subnet_id": null,
"subnet_name": null,
"subnet6_id": null,
"subnet6_name": null,
"domain_id": null,
"domain_name": null,
"created_at": "2018-11-15 19:02:11 UTC",
"updated_at": "2018-11-15 19:02:11 UTC",
"managed": true,
"identifier": "eth33",
"id": 2,
"name": null,
"ip": "0.0.0.23",
"ip6": null,
"mac": "00:33:45:ab:00:17",
"mtu": null,
"fqdn": null,
"primary": false,
"provision": false,
"type": "interface",
"virtual": false
}
| Param name | Description |
|---|---|
|
location_id optional |
Scope by locations Validations:
|
|
organization_id optional |
Scope by organizations Validations:
|
|
host_id required |
ID or name of host Validations:
|
|
id required |
ID or name of interface Validations:
|
POST /api/hosts/host213/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": "Nic::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": "2018-11-15 19:02:11 UTC",
"updated_at": "2018-11-15 19:02:11 UTC",
"managed": true,
"identifier": null,
"id": 4,
"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
}
| Param name | Description |
|---|---|
|
location_id optional |
Scope by locations Validations:
|
|
organization_id optional |
Scope by organizations Validations:
|
|
host_id required |
ID or name of host Validations:
|
|
interface required |
interface information Validations:
|
|
interface[mac] optional , nil allowed |
MAC address of interface. Required for managed interfaces on bare metal. Validations:
|
|
interface[ip] optional , nil allowed |
IPv4 address of interface Validations:
|
|
interface[ip6] optional , nil allowed |
IPv6 address of interface Validations:
|
|
interface[type] optional , nil allowed |
Interface type, e.g. bmc. Default is interface Validations:
|
|
interface[name] optional , nil allowed |
Interface’s DNS name Validations:
|
|
interface[subnet_id] optional , nil allowed |
Foreman subnet ID of IPv4 interface Validations:
|
|
interface[subnet6_id] optional , nil allowed |
Foreman subnet ID of IPv6 interface Validations:
|
|
interface[domain_id] optional , nil allowed |
Foreman domain ID of interface. Required for primary interfaces on managed hosts. Validations:
|
|
interface[identifier] optional , nil allowed |
Device identifier, e.g. eth0 or eth1.1 Validations:
|
|
interface[managed] optional , nil allowed |
Should this interface be managed via DHCP and DNS smart proxy and should it be configured during provisioning? Validations:
|
|
interface[primary] optional , nil allowed |
Should this interface be used for constructing the FQDN of the host? Each managed hosts needs to have one primary interface. Validations:
|
|
interface[provision] optional , nil allowed |
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:
|
|
interface[username] optional , nil allowed |
Only for BMC interfaces. Validations:
|
|
interface[password] optional , nil allowed |
Only for BMC interfaces. Validations:
|
|
interface[provider] optional , nil allowed |
Interface provider, e.g. IPMI. Only for BMC interfaces. Validations:
|
|
interface[virtual] optional , nil allowed |
Alias or VLAN device Validations:
|
|
interface[tag] optional , nil allowed |
VLAN tag, this attribute has precedence over the subnet VLAN ID. Only for virtual interfaces. Validations:
|
|
interface[mtu] optional , nil allowed |
MTU, this attribute has precedence over the subnet MTU. Validations:
|
|
interface[attached_to] optional , nil allowed |
Identifier of the interface to which this interface belongs, e.g. eth1. Only for virtual interfaces. Validations:
|
|
interface[mode] optional , nil allowed |
Bond mode of the interface, e.g. balance-rr. Only for bond interfaces. Validations:
|
|
interface[attached_devices] optional , nil allowed |
Identifiers of attached interfaces, e.g. Validations:
|
|
interface[bond_options] optional , nil allowed |
Space separated options, e.g. miimon=100. Only for bond interfaces. Validations:
|
|
interface[compute_attributes] optional , nil allowed |
Additional compute resource specific attributes for the interface. Validations:
|
POST /api/hosts/host210/interfaces/3
{
"interface": {
"name": "test.foreman.com",
"ip": "10.0.1.1",
"mac": "AA:AA:AA:AA:AA:AA",
"username": "foo",
"password": "bar",
"provider": "IPMI",
"type": null,
"ip6": "2001:db8::1"
}
}
422
{
"error": {
"id": 3,
"errors": {
"type": [
"can't be changed once the interface is saved"
]
},
"full_messages": [
"Type can't be changed once the interface is saved"
]
}
}
| Param name | Description |
|---|---|
|
location_id optional |
Scope by locations Validations:
|
|
organization_id optional |
Scope by organizations Validations:
|
|
host_id required |
ID or name of host Validations:
|
|
id required |
ID of interface Validations:
|
|
interface required |
interface information Validations:
|
|
interface[mac] optional , nil allowed |
MAC address of interface. Required for managed interfaces on bare metal. Validations:
|
|
interface[ip] optional , nil allowed |
IPv4 address of interface Validations:
|
|
interface[ip6] optional , nil allowed |
IPv6 address of interface Validations:
|
|
interface[type] optional , nil allowed |
Interface type, e.g. bmc. Default is interface Validations:
|
|
interface[name] optional , nil allowed |
Interface’s DNS name Validations:
|
|
interface[subnet_id] optional , nil allowed |
Foreman subnet ID of IPv4 interface Validations:
|
|
interface[subnet6_id] optional , nil allowed |
Foreman subnet ID of IPv6 interface Validations:
|
|
interface[domain_id] optional , nil allowed |
Foreman domain ID of interface. Required for primary interfaces on managed hosts. Validations:
|
|
interface[identifier] optional , nil allowed |
Device identifier, e.g. eth0 or eth1.1 Validations:
|
|
interface[managed] optional , nil allowed |
Should this interface be managed via DHCP and DNS smart proxy and should it be configured during provisioning? Validations:
|
|
interface[primary] optional , nil allowed |
Should this interface be used for constructing the FQDN of the host? Each managed hosts needs to have one primary interface. Validations:
|
|
interface[provision] optional , nil allowed |
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:
|
|
interface[username] optional , nil allowed |
Only for BMC interfaces. Validations:
|
|
interface[password] optional , nil allowed |
Only for BMC interfaces. Validations:
|
|
interface[provider] optional , nil allowed |
Interface provider, e.g. IPMI. Only for BMC interfaces. Validations:
|
|
interface[virtual] optional , nil allowed |
Alias or VLAN device Validations:
|
|
interface[tag] optional , nil allowed |
VLAN tag, this attribute has precedence over the subnet VLAN ID. Only for virtual interfaces. Validations:
|
|
interface[mtu] optional , nil allowed |
MTU, this attribute has precedence over the subnet MTU. Validations:
|
|
interface[attached_to] optional , nil allowed |
Identifier of the interface to which this interface belongs, e.g. eth1. Only for virtual interfaces. Validations:
|
|
interface[mode] optional , nil allowed |
Bond mode of the interface, e.g. balance-rr. Only for bond interfaces. Validations:
|
|
interface[attached_devices] optional , nil allowed |
Identifiers of attached interfaces, e.g. Validations:
|
|
interface[bond_options] optional , nil allowed |
Space separated options, e.g. miimon=100. Only for bond interfaces. Validations:
|
|
interface[compute_attributes] optional , nil allowed |
Additional compute resource specific attributes for the interface. Validations:
|
DELETE /api/hosts/host212/interfaces/2
{
"interface": {}
}
200
{
"id": 2,
"mac": "00:33:45:ab:00:07",
"ip": "0.0.0.7",
"name": null,
"host_id": 1,
"subnet_id": null,
"domain_id": null,
"attrs": {},
"created_at": "2018-11-15T19:02:11.332Z",
"updated_at": "2018-11-15T19:02:11.332Z",
"provider": null,
"username": null,
"password": null,
"virtual": false,
"link": true,
"identifier": "eth17",
"tag": "",
"attached_to": "",
"managed": true,
"mode": "balance-rr",
"attached_devices": "",
"bond_options": "",
"primary": false,
"provision": false,
"compute_attributes": {},
"ip6": null,
"subnet6_id": null
}
| Param name | Description |
|---|---|
|
location_id optional |
Scope by locations Validations:
|
|
organization_id optional |
Scope by organizations Validations:
|
|
host_id required |
ID or name of host Validations:
|
|
id required |
ID of interface Validations:
|