Class: ForemanApi::Resources::Interface

Inherits:
Base
  • Object
show all
Defined in:
lib/foreman_api/resources/interface.rb

Class Method Summary (collapse)

Instance Method Summary (collapse)

Class Method Details

+ (Object) doc



4
5
6
# File 'lib/foreman_api/resources/interface.rb', line 4

def self.doc
  @doc ||= ForemanApi.doc['resources']["interfaces"]
end

Instance Method Details

- (Array) create(params = {}, headers = {})

Returns First item: parsed data; second item: raw body

Parameters:

  • params (Hash) (defaults to: {})

    a hash of params to be passed to the service

  • headers (Hash) (defaults to: {})

    additional http headers

Options Hash (params):

  • host_id (String)

    id or name of host

  • interface (Hash)

    interface information allowed keys are:

    • domain_id [Numeric] foreman domain id of interface

    • subnet_id [Numeric] foreman subnet id of interface

    • ip [String] ip address of interface

    • mac [String] mac address of interface

    • name [String] interface name

    • password [String]

    • provider [String] interface provider, i.e: ipmi

    • type [String] interface type, i.e: nic::bmc

    • username [String]

Returns:

  • (Array)

    First item: parsed data; second item: raw body



43
44
45
# File 'lib/foreman_api/resources/interface.rb', line 43

def create(params = {}, headers = {})
  perform_call(__method__, params, headers)
end

- (Array) destroy(params = {}, headers = {})

Returns First item: parsed data; second item: raw body

Parameters:

  • params (Hash) (defaults to: {})

    a hash of params to be passed to the service

  • headers (Hash) (defaults to: {})

    additional http headers

Options Hash (params):

  • id (String)

    id of interface

  • host_id (Object)

    Part of /api/hosts/:host_id/interfaces/:id path

Returns:

  • (Array)

    First item: parsed data; second item: raw body



74
75
76
# File 'lib/foreman_api/resources/interface.rb', line 74

def destroy(params = {}, headers = {})
  perform_call(__method__, params, headers)
end

- (Array) index(params = {}, headers = {})

Returns First item: parsed data; second item: raw body

Parameters:

  • params (Hash) (defaults to: {})

    a hash of params to be passed to the service

  • headers (Hash) (defaults to: {})

    additional http headers

Options Hash (params):

  • host_id (String)

    id or name of host

Returns:

  • (Array)

    First item: parsed data; second item: raw body



13
14
15
# File 'lib/foreman_api/resources/interface.rb', line 13

def index(params = {}, headers = {})
  perform_call(__method__, params, headers)
end

- (Array) show(params = {}, headers = {})

Returns First item: parsed data; second item: raw body

Parameters:

  • params (Hash) (defaults to: {})

    a hash of params to be passed to the service

  • headers (Hash) (defaults to: {})

    additional http headers

Options Hash (params):

  • id (String)

    id or name of interface

  • host_id (String)

    id or name of nested host

Returns:

  • (Array)

    First item: parsed data; second item: raw body



23
24
25
# File 'lib/foreman_api/resources/interface.rb', line 23

def show(params = {}, headers = {})
  perform_call(__method__, params, headers)
end

- (Array) update(params = {}, headers = {})

Returns First item: parsed data; second item: raw body

Parameters:

  • params (Hash) (defaults to: {})

    a hash of params to be passed to the service

  • headers (Hash) (defaults to: {})

    additional http headers

Options Hash (params):

  • id (Object)

    Part of /api/hosts/:host_id/interfaces/:id path

  • host_id (String)

    id or name of host

  • interface (Hash)

    interface information allowed keys are:

    • domain_id [Numeric] foreman domain id of interface

    • subnet_id [Numeric] foreman subnet id of interface

    • ip [String] ip address of interface

    • mac [String] mac address of interface

    • name [String] interface name

    • password [String]

    • provider [String] interface provider, i.e: ipmi

    • type [String] interface type, i.e: nic::bmc

    • username [String]

Returns:

  • (Array)

    First item: parsed data; second item: raw body



64
65
66
# File 'lib/foreman_api/resources/interface.rb', line 64

def update(params = {}, headers = {})
  perform_call(__method__, params, headers)
end