Class: KatelloApi::Resources::Host

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

Constant Summary

Constant Summary

Constants inherited from Base

Base::API_VERSION

Instance Attribute Summary

Attributes inherited from Base

#client, #config

Class Method Summary (collapse)

Instance Method Summary (collapse)

Methods inherited from Base

#http_call, #initialize, method_doc, #perform_call, #validate_params!, validation_hash

Constructor Details

This class inherits a constructor from KatelloApi::Base

Class Method Details

+ (Object) doc



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

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

Instance Method Details

- (Array) boot(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)
  • device (String)

    boot device, valid devices are disk, cdrom, pxe, bios

Returns:

  • (Array)

    First item: parsed data; second item: raw body



147
148
149
# File 'lib/katello_api/resources/host.rb', line 147

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

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

    allowed keys are:

    • architecture_id [String, nil]

    • compute_resource_id [String, nil]

    • domain_id [String, nil]

    • environment_id [String, nil]

    • hostgroup_id [String, nil]

    • image_id [String, nil]

    • medium_id [String, nil]

    • model_id [String, nil]

    • operatingsystem_id [String, nil]

    • owner_id [String, nil]

    • progress_report_id [String, nil] uuid to track orchestration tasks status, get /api/orchestration/:uuid/tasks

    • ptable_id [String, nil]

    • puppet_ca_proxy_id [String, nil]

    • puppet_class_ids [Array, nil]

    • puppet_proxy_id [String, nil]

    • sp_subnet_id [String, nil]

    • subnet_id [String, nil]

    • build [String, nil]

    • capabilities [String, nil]

    • compute_attributes [Hash, nil]

    • enabled [String, nil]

    • host_parameters_attributes [Array, nil]

    • ip [String, nil] not required if using a subnet with dhcp proxy

    • mac [String, nil] not required if its a virtual machine

    • managed [String, nil]

    • name [String]

    • provision_method [String, nil]

Returns:

  • (Array)

    First item: parsed data; second item: raw body



62
63
64
# File 'lib/katello_api/resources/host.rb', line 62

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)

Returns:

  • (Array)

    First item: parsed data; second item: raw body



109
110
111
# File 'lib/katello_api/resources/host.rb', line 109

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

- (Array) facts(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):

  • certname (String)

    optional: certname of the host

  • facts (Hash)

    hash containing the facts for the host

  • name (String)

    hostname of the host

  • type (String)

    optional: the sti type of host to create

Returns:

  • (Array)

    First item: parsed data; second item: raw body



159
160
161
# File 'lib/katello_api/resources/host.rb', line 159

def facts(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):

  • 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/katello_api/resources/host.rb', line 16

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

- (Array) power(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)
  • power_action (String)

    power action, valid actions are (‘on’, ‘start’)’, (‘off’, ‘stop’), (‘soft’, ‘reboot’), (‘cycle’, ‘reset’), (‘state’, ‘status’)

Returns:

  • (Array)

    First item: parsed data; second item: raw body



137
138
139
# File 'lib/katello_api/resources/host.rb', line 137

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

- (Array) puppetrun(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)

Returns:

  • (Array)

    First item: parsed data; second item: raw body



127
128
129
# File 'lib/katello_api/resources/host.rb', line 127

def puppetrun(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)

Returns:

  • (Array)

    First item: parsed data; second item: raw body



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

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

- (Array) status(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)

Returns:

  • (Array)

    First item: parsed data; second item: raw body



118
119
120
# File 'lib/katello_api/resources/host.rb', line 118

def status(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 (String)
  • host (Hash, nil)

    allowed keys are:

    • architecture_id [String, nil]

    • compute_resource_id [String, nil]

    • domain_id [String, nil]

    • environment_id [String, nil]

    • hostgroup_id [String, nil]

    • image_id [String, nil]

    • medium_id [String, nil]

    • model_id [String, nil]

    • operatingsystem_id [String, nil]

    • owner_id [String, nil]

    • progress_report_id [String, nil] uuid to track orchestration tasks status, get /api/orchestration/:uuid/tasks

    • ptable_id [String, nil]

    • puppet_ca_proxy_id [String, nil]

    • puppet_class_ids [Array, nil]

    • puppet_proxy_id [String, nil]

    • sp_subnet_id [String, nil]

    • subnet_id [String, nil]

    • build [String, nil]

    • capabilities [String, nil]

    • compute_attributes [Hash, nil]

    • enabled [String, nil]

    • host_parameters_attributes [Array, nil]

    • ip [String, nil] not required if using a subnet with dhcp proxy

    • mac [String, nil] not required if its a virtual machine

    • managed [String, nil]

    • name [String]

    • provision_method [String, nil]

Returns:

  • (Array)

    First item: parsed data; second item: raw body



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

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