Class: Splunk::Pickaxe::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/splunk/pickaxe/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(service, environment, config, args) ⇒ Client

Returns a new instance of Client.



16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/splunk/pickaxe/client.rb', line 16

def initialize(service, environment, config, args)
  @service = service
  @args = args

  @alerts = Alerts.new service, environment, config
  @dashboards = Dashboards.new service, environment, config
  @eventtypes = EventTypes.new service, environment, config
  @macros = Macros.new service, environment, config
  @reports = Reports.new service, environment, config
  @tags = Tags.new service, environment, config
  @field_extractions = FieldExtractions.new service, environment, config
end

Instance Attribute Details

#alertsObject (readonly)

Returns the value of attribute alerts.



14
15
16
# File 'lib/splunk/pickaxe/client.rb', line 14

def alerts
  @alerts
end

#dashboardsObject (readonly)

Returns the value of attribute dashboards.



14
15
16
# File 'lib/splunk/pickaxe/client.rb', line 14

def dashboards
  @dashboards
end

#eventypesObject (readonly)

Returns the value of attribute eventypes.



14
15
16
# File 'lib/splunk/pickaxe/client.rb', line 14

def eventypes
  @eventypes
end

#field_extractionsObject (readonly)

Returns the value of attribute field_extractions.



14
15
16
# File 'lib/splunk/pickaxe/client.rb', line 14

def field_extractions
  @field_extractions
end

#macrosObject (readonly)

Returns the value of attribute macros.



14
15
16
# File 'lib/splunk/pickaxe/client.rb', line 14

def macros
  @macros
end

#reportsObject (readonly)

Returns the value of attribute reports.



14
15
16
# File 'lib/splunk/pickaxe/client.rb', line 14

def reports
  @reports
end

#serviceObject (readonly)

Returns the value of attribute service.



14
15
16
# File 'lib/splunk/pickaxe/client.rb', line 14

def service
  @service
end

#tagsObject (readonly)

Returns the value of attribute tags.



14
15
16
# File 'lib/splunk/pickaxe/client.rb', line 14

def tags
  @tags
end

Instance Method Details

#save_allObject



39
40
41
42
43
44
45
46
47
48
49
# File 'lib/splunk/pickaxe/client.rb', line 39

def save_all
  overwrite = @args.fetch(:overwrite, false)

  @alerts.save overwrite
  @dashboards.save overwrite
  @eventtypes.save overwrite
  @macros.save overwrite
  @reports.save overwrite
  # splunk-sdk doesn't seem to support iterating tags
  @field_extractions.save overwrite
end

#sync_allObject



29
30
31
32
33
34
35
36
37
# File 'lib/splunk/pickaxe/client.rb', line 29

def sync_all
  @alerts.sync
  @dashboards.sync
  @eventtypes.sync
  @macros.sync
  @reports.sync
  @tags.sync
  @field_extractions.sync
end