Class: Splunk::ConfigurationFile

Inherits:
Collection show all
Defined in:
lib/splunk-sdk-ruby/collection/configuration_file.rb

Overview

ConfigurationFile is a collection containing configuration stanzas.

This class’s API is identical to Collection, so a user should not have to be aware of its existence.

Instance Attribute Summary collapse

Attributes inherited from ReadOnlyCollection

#entity_class, #resource, #service

Instance Method Summary collapse

Methods inherited from Collection

#delete, #delete_if

Methods inherited from ReadOnlyCollection

#assoc, #atom_entry_to_entity, #each, #each_key, #each_pair, #each_value, #empty?, #fetch, #has_key?, #keys, #length, #values

Constructor Details

#initialize(service, name, namespace = nil) ⇒ ConfigurationFile

This class is unusual: it is the element of a collection itself, and its elements are entities.



34
35
36
37
38
# File 'lib/splunk-sdk-ruby/collection/configuration_file.rb', line 34

def initialize(service, name, namespace=nil)
  super(service, ["configs", "conf-#{name}"], entity_class=Stanza)
  @name = name
  @namespace = namespace || service.namespace
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



48
49
50
# File 'lib/splunk-sdk-ruby/collection/configuration_file.rb', line 48

def name
  @name
end

Instance Method Details

#create(name, args = {}) ⇒ Object



40
41
42
43
44
45
46
# File 'lib/splunk-sdk-ruby/collection/configuration_file.rb', line 40

def create(name, args={})
  body_args = args.clone()
  if !args.has_key?(:namespace)
    body_args[:namespace] = @namespace
  end
  super(name, body_args)
end