Class: ForemanApi::Resources::SmartVariable

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

Constant Summary

Constants inherited from Base

Base::API_VERSION

Instance Attribute Summary

Attributes inherited from Base

#client, #config, #logger

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 ForemanApi::Base

Class Method Details

.docObject



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

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

Instance Method Details

#create(params = {}, headers = {}) ⇒ Array

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

  • smart_variable (Hash, nil)

    allowed keys are:

    • puppetclass_id [String, nil]

    • default_value [String, nil]

    • description [String, nil]

    • override_value_order [String, nil]

    • validator_rule [String, nil]

    • validator_type [String, nil]

    • variable [String]

    • variable_type [String, nil]

Returns:

  • (Array)

    First item: parsed data; second item: raw body



46
47
48
# File 'lib/foreman_api/resources/smart_variable.rb', line 46

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

#destroy(params = {}, headers = {}) ⇒ Array

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



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

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

#index(params = {}, headers = {}) ⇒ Array

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)
  • hostgroup_id (String)
  • puppetclass_id (String)
  • 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



19
20
21
# File 'lib/foreman_api/resources/smart_variable.rb', line 19

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

#show(params = {}, headers = {}) ⇒ Array

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



28
29
30
# File 'lib/foreman_api/resources/smart_variable.rb', line 28

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

#update(params = {}, headers = {}) ⇒ Array

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

    allowed keys are:

    • puppetclass_id [String, nil]

    • default_value [String, nil]

    • description [String, nil]

    • override_value_order [String, nil]

    • validator_rule [String, nil]

    • validator_type [String, nil]

    • variable [String]

    • variable_type [String, nil]

Returns:

  • (Array)

    First item: parsed data; second item: raw body



65
66
67
# File 'lib/foreman_api/resources/smart_variable.rb', line 65

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