Class: ForemanApi::Resources::Host

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

Class Method Summary (collapse)

Instance Method Summary (collapse)

Class Method Details

+ (Object) doc



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

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

Instance Method Details

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

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 (Hash)

    allowed keys are:

    • architecture_id [String]
    • domain_id [String]
    • environment_id [String]
    • hostgroup_id [String]
    • image_id [String]
    • medium_id [String]
    • model_id_id [String]
    • operatingsystem_id [String]
    • owner_id [String]
    • ptable_id [String]
    • puppet_ca_proxy_id [String]
    • puppet_proxy_id [String]
    • sp_subnet_id [String]
    • subnet_id [String]
    • host_parameters_attributes [String]
    • ip [String] Not required if using a subnet with dhcp proxy
    • mac [String] Not required if its a virtual machine
    • name [String]

Returns:

  • (Array)

    First item: parsed data; second item: raw body



53
54
55
# File 'lib/foreman_api/resources/host.rb', line 53

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

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

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)

Returns:

  • (Array)

    First item: parsed data; second item: raw body



91
92
93
# File 'lib/foreman_api/resources/host.rb', line 91

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

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

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):

  • order (String)

    Sort results

  • page (String)

    Paginate results

  • per_page (String)

    Number of entries per request

  • search (String)

    Filter results

Returns:

  • (Array)

    First item: parsed data; second item: raw body



16
17
18
# File 'lib/foreman_api/resources/host.rb', line 16

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

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

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)

Returns:

  • (Array)

    First item: parsed data; second item: raw body



25
26
27
# File 'lib/foreman_api/resources/host.rb', line 25

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

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

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)

Returns:

  • (Array)

    First item: parsed data; second item: raw body



100
101
102
# File 'lib/foreman_api/resources/host.rb', line 100

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

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

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)
  • host (Hash)

    allowed keys are:

    • architecture_id [String]
    • domain_id [String]
    • environment_id [String]
    • hostgroup_id [String]
    • image_id [String]
    • medium_id [String]
    • model_id_id [String]
    • operatingsystem_id [String]
    • owner_id [String]
    • ptable_id [String]
    • puppet_ca_proxy_id [String]
    • puppet_proxy_id [String]
    • sp_subnet_id [String]
    • subnet_id [String]
    • host_parameters_attributes [String]
    • ip [String] Not required if using a subnet with dhcp proxy
    • mac [String] Not required if its a virtual machine
    • name [String]

Returns:

  • (Array)

    First item: parsed data; second item: raw body



82
83
84
# File 'lib/foreman_api/resources/host.rb', line 82

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