Esempi

POST /api/hosts/26/interfaces
{
  "interface": {
    "name": "谚喪駏篬庿濱麢鐨耼孞",
    "ip": "10.0.1.1",
    "mac": "AA:AA:AA:AA:AA:AA",
    "username": "foo",
    "password": "bar",
    "provider": "IPMI",
    "type": "bmc",
    "ip6": "2001:db8::1"
  }
}
422
{
  "error": {
    "id": null,
    "errors": {
      "name": [
        "hostname can contain only lowercase letters, numbers, dashes and dots according to RFC921, RFC952 and RFC1123"
      ]
    },
    "full_messages": [
      "Name hostname can contain only lowercase letters, numbers, dashes and dots according to RFC921, RFC952 and RFC1123"
    ]
  }
}

Parametri

Nome parametro Descrizione
location_id
opzionale

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
opzionale

Set the current organization context for the request

Validations:

  • Must be a Integer

host_id
richiesto

ID o nome dell’host

Validations:

  • Must be a String

interface
richiesto

informazioni sull’interfaccia

Validations:

  • Must be a Hash

interface[mac]
opzionale , consentito nil

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

Validations:

  • Must be a String

interface[ip]
opzionale , consentito nil

IPv4 address of interface

Validations:

  • Must be a String

interface[ip6]
opzionale , consentito nil

IPv6 address of interface

Validations:

  • Must be a String

interface[type]
opzionale , consentito nil

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

Validations:

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

interface[name]
opzionale , consentito nil

Interface’s DNS name

Validations:

  • Must be a String

interface[subnet_id]
opzionale , consentito nil

Foreman subnet ID of IPv4 interface

Validations:

  • Must be a number.

interface[subnet6_id]
opzionale , consentito nil

Foreman subnet ID of IPv6 interface

Validations:

  • Must be a number.

interface[domain_id]
opzionale , consentito nil

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

Validations:

  • Must be a number.

interface[identifier]
opzionale , consentito nil

Identificatore del dispositivo, es. eth0 o eth1.1

Validations:

  • Must be a String

interface[managed]
opzionale , consentito nil

L’interfaccia deve essere gestita tramite DHCP e DNS smart proxy e può essere configurarta durante il provisioning?

Validations:

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

interface[primary]
opzionale , consentito nil

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]
opzionale , consentito nil

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]
opzionale , consentito nil

Solo per interfacce BMC.

Validations:

  • Must be a String

interface[password]
opzionale , consentito nil

Solo per interfacce BMC.

Validations:

  • Must be a String

interface[provider]
opzionale , consentito nil

Provider dell’interfaccia, es IPMI. Solo per le interfacce BMC.

Validations:

  • Must be one of: IPMI, SSH.

interface[virtual]
opzionale , consentito nil

Dispositivo VLAN o Alias

Validations:

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

interface[tag]
opzionale , consentito nil

VLAN tag, questo attributo ha la precedenza rispetto a VLAN ID. Solo per interfacce virtuali.

Validations:

  • Must be a String

interface[mtu]
opzionale , consentito nil

MTU, this attribute has precedence over the subnet MTU.

Validations:

  • Must be a Integer

interface[attached_to]
opzionale , consentito nil

Identificatore dell’interfaccia alla quale appartiene questa interfaccia, es. eth1. Solo per interfacce virtuali.

Validations:

  • Must be a String

interface[mode]
opzionale , consentito nil

Modalità associazione dell’interfaccia, es balance-rr. Solo per interfacce di aggregazione.

Validations:

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

interface[attached_devices]
opzionale , consentito nil

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]
opzionale , consentito nil

Opzioni separate da spazi, es. miimon=100. Solo per interfacce di aggregazione.

Validations:

  • Must be a String

interface[compute_attributes]
opzionale , consentito nil

Additional compute resource specific attributes for the interface.

Validations:

  • Must be a Hash