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.



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

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
  @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.



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

def alerts
  @alerts
end

#dashboardsObject (readonly)

Returns the value of attribute dashboards.



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

def dashboards
  @dashboards
end

#eventypesObject (readonly)

Returns the value of attribute eventypes.



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

def eventypes
  @eventypes
end

#field_extractionsObject (readonly)

Returns the value of attribute field_extractions.



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

def field_extractions
  @field_extractions
end

#reportsObject (readonly)

Returns the value of attribute reports.



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

def reports
  @reports
end

#serviceObject (readonly)

Returns the value of attribute service.



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

def service
  @service
end

#tagsObject (readonly)

Returns the value of attribute tags.



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

def tags
  @tags
end

Instance Method Details

#save_allObject



36
37
38
39
40
41
42
43
44
45
# File 'lib/splunk/pickaxe/client.rb', line 36

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

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

#sync_allObject



27
28
29
30
31
32
33
34
# File 'lib/splunk/pickaxe/client.rb', line 27

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