splunk-sdk-ruby 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. data/CHANGELOG.md +160 -0
  2. data/Gemfile +8 -0
  3. data/LICENSE +177 -0
  4. data/README.md +310 -0
  5. data/Rakefile +40 -0
  6. data/examples/1_connect.rb +51 -0
  7. data/examples/2_manage.rb +103 -0
  8. data/examples/3_blocking_searches.rb +82 -0
  9. data/examples/4_asynchronous_searches.rb +79 -0
  10. data/examples/5_stream_data_to_splunk.rb +79 -0
  11. data/lib/splunk-sdk-ruby.rb +47 -0
  12. data/lib/splunk-sdk-ruby/ambiguous_entity_reference.rb +28 -0
  13. data/lib/splunk-sdk-ruby/atomfeed.rb +323 -0
  14. data/lib/splunk-sdk-ruby/collection.rb +417 -0
  15. data/lib/splunk-sdk-ruby/collection/apps.rb +35 -0
  16. data/lib/splunk-sdk-ruby/collection/case_insensitive_collection.rb +58 -0
  17. data/lib/splunk-sdk-ruby/collection/configuration_file.rb +50 -0
  18. data/lib/splunk-sdk-ruby/collection/configurations.rb +80 -0
  19. data/lib/splunk-sdk-ruby/collection/jobs.rb +136 -0
  20. data/lib/splunk-sdk-ruby/collection/messages.rb +51 -0
  21. data/lib/splunk-sdk-ruby/context.rb +522 -0
  22. data/lib/splunk-sdk-ruby/entity.rb +260 -0
  23. data/lib/splunk-sdk-ruby/entity/index.rb +191 -0
  24. data/lib/splunk-sdk-ruby/entity/job.rb +339 -0
  25. data/lib/splunk-sdk-ruby/entity/message.rb +36 -0
  26. data/lib/splunk-sdk-ruby/entity/saved_search.rb +71 -0
  27. data/lib/splunk-sdk-ruby/entity/stanza.rb +45 -0
  28. data/lib/splunk-sdk-ruby/entity_not_ready.rb +26 -0
  29. data/lib/splunk-sdk-ruby/illegal_operation.rb +27 -0
  30. data/lib/splunk-sdk-ruby/namespace.rb +239 -0
  31. data/lib/splunk-sdk-ruby/resultsreader.rb +716 -0
  32. data/lib/splunk-sdk-ruby/service.rb +339 -0
  33. data/lib/splunk-sdk-ruby/splunk_http_error.rb +49 -0
  34. data/lib/splunk-sdk-ruby/synonyms.rb +50 -0
  35. data/lib/splunk-sdk-ruby/version.rb +27 -0
  36. data/lib/splunk-sdk-ruby/xml_shim.rb +117 -0
  37. data/splunk-sdk-ruby.gemspec +27 -0
  38. data/test/atom_test_data.rb +472 -0
  39. data/test/data/atom/atom_feed_with_message.xml +19 -0
  40. data/test/data/atom/atom_with_feed.xml +99 -0
  41. data/test/data/atom/atom_with_several_entries.xml +101 -0
  42. data/test/data/atom/atom_with_simple_entries.xml +30 -0
  43. data/test/data/atom/atom_without_feed.xml +248 -0
  44. data/test/data/export/4.2.5/export_results.xml +88 -0
  45. data/test/data/export/4.3.5/export_results.xml +87 -0
  46. data/test/data/export/5.0.1/export_results.xml +78 -0
  47. data/test/data/export/5.0.1/nonreporting.xml +232 -0
  48. data/test/data/results/4.2.5/results-empty.xml +0 -0
  49. data/test/data/results/4.2.5/results-preview.xml +255 -0
  50. data/test/data/results/4.2.5/results.xml +336 -0
  51. data/test/data/results/4.3.5/results-empty.xml +0 -0
  52. data/test/data/results/4.3.5/results-preview.xml +1057 -0
  53. data/test/data/results/4.3.5/results.xml +626 -0
  54. data/test/data/results/5.0.2/results-empty.xml +1 -0
  55. data/test/data/results/5.0.2/results-empty_preview.xml +1 -0
  56. data/test/data/results/5.0.2/results-preview.xml +448 -0
  57. data/test/data/results/5.0.2/results.xml +501 -0
  58. data/test/export_test_data.json +360 -0
  59. data/test/resultsreader_test_data.json +1119 -0
  60. data/test/services.server.info.xml +43 -0
  61. data/test/services.xml +111 -0
  62. data/test/test_atomfeed.rb +71 -0
  63. data/test/test_collection.rb +278 -0
  64. data/test/test_configuration_file.rb +124 -0
  65. data/test/test_context.rb +119 -0
  66. data/test/test_entity.rb +95 -0
  67. data/test/test_helper.rb +250 -0
  68. data/test/test_http_error.rb +52 -0
  69. data/test/test_index.rb +91 -0
  70. data/test/test_jobs.rb +319 -0
  71. data/test/test_messages.rb +17 -0
  72. data/test/test_namespace.rb +188 -0
  73. data/test/test_restarts.rb +49 -0
  74. data/test/test_resultsreader.rb +106 -0
  75. data/test/test_roles.rb +41 -0
  76. data/test/test_saved_searches.rb +119 -0
  77. data/test/test_service.rb +65 -0
  78. data/test/test_users.rb +33 -0
  79. data/test/test_xml_shim.rb +28 -0
  80. data/test/testfile.txt +1 -0
  81. metadata +200 -0
@@ -0,0 +1,117 @@
1
+ #--
2
+ # Copyright 2011-2013 Splunk, Inc.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License"): you may
5
+ # not use this file except in compliance with the License. You may obtain
6
+ # a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
+ # License for the specific language governing permissions and limitations
14
+ # under the License.
15
+ #++
16
+
17
+ # :enddoc:
18
+ ##
19
+ # Control which XML parsing library the Splunk SDK for Ruby uses.
20
+ #
21
+ # The Splunk SDK for Ruby can use either REXML (the default library that
22
+ # ships with Ruby 1.9) or Nokogiri (a binding around the C library +libxml2+).
23
+ # Which library it tries is determined by the +$defualt_xml_library+ global
24
+ # variable.
25
+ #
26
+ # By default, this module will try to set the library to Nokogiri, and, if
27
+ # that is unavailable, will fall back to REXML. The library can be selected
28
+ # explicitly (in which case it will not use the fail back behavior) by calling
29
+ # +require_xml_library+ (which you should use in preference to setting
30
+ # +$default_xml_library+ manually, since it also takes care of checking that
31
+ # the library loads properly).
32
+ #
33
+ # You can also specify the environment variable +$RUBY_XML_LIBRARY+ in the shell
34
+ # to choose the default library. The two values are +"rexml"+ and +"nokogiri"+
35
+ # (note that they are not case sensitive). If you specify this environment
36
+ # variable, the SDK will not attempt to fall back to REXML in the absence of
37
+ # Nokogiri.
38
+
39
+ module Splunk
40
+ ##
41
+ # Tell the Splunk SDK for Ruby to use _library_ for XML parsing.
42
+ #
43
+ # The only two supported libraries for now are Nokogiri (pass +:nokogiri+ as
44
+ # the _library_ parameter) and REXML (pass +:rexml+).
45
+ #
46
+ # Arguments:
47
+ # * _library_: (+:nokogiri+ or +:rexml:+) A symbol specifying the library.
48
+ #
49
+ # Raises:
50
+ # * +LoadError+ if the library requested cannot be loaded.
51
+ #
52
+ # Returns no value of interest.
53
+ #
54
+ def self.require_xml_library(library)
55
+ if library == :nokogiri
56
+ require 'nokogiri'
57
+ $splunk_xml_library = :nokogiri
58
+ else
59
+ require 'rexml/document'
60
+ require 'rexml/streamlistener'
61
+ $splunk_xml_library = :rexml
62
+ end
63
+ end
64
+
65
+ # In the absence of any other call to +require_xml_library+, we try to use
66
+ # Nokogiri, and if that doesn't work, we fall back to REXML, which is shipped
67
+ # with Ruby 1.9, and should always be there.
68
+ begin
69
+ require 'nokogiri'
70
+ $splunk_xml_library = :nokogiri
71
+ rescue LoadError
72
+ require 'rexml/document'
73
+ require 'rexml/streamlistener'
74
+ $splunk_xml_library = :rexml
75
+ end
76
+
77
+ ##
78
+ # Returns the text contained in the first element matching _xpath_ in _text_.
79
+ #
80
+ # Arguments:
81
+ # * _xpath_: (+String+) An XPath specifier. It should refer to an element
82
+ # containing only text, not additional XML elements.
83
+ # * _text_: (+String+) The text to search in.
84
+ #
85
+ # Returns: A +String+ containing the text in the first match of _xpath_,
86
+ # or +nil+ if there was no match.
87
+ #
88
+ # *Examples*:
89
+ #
90
+ # text_at_xpath("/set/entry", "<set><entry>Boris</entry></set>")
91
+ # == "Boris"
92
+ # text_at_xpath("/a", "<a>Alpha</a> <a>Beta</a>") == "Alpha"
93
+ # text_at_xpath("/a", "<b>Quill pen</b>") == nil
94
+ #
95
+ def self.text_at_xpath(xpath, text)
96
+ if text.nil? or text.length == 0
97
+ return nil
98
+ elsif $splunk_xml_library == :nokogiri
99
+ doc = Nokogiri::XML(text)
100
+ matches = doc.xpath(xpath)
101
+ if matches.empty?
102
+ return nil
103
+ else
104
+ return matches.last.content
105
+ end
106
+ else
107
+ doc = REXML::Document.new(text)
108
+ matches = doc.elements[xpath]
109
+ if matches
110
+ return matches[0].value
111
+ else
112
+ return nil
113
+ end
114
+ end
115
+ end
116
+ end
117
+
@@ -0,0 +1,27 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |gem|
4
+ gem.name = 'splunk-sdk-ruby'
5
+ gem.version = '0.1.0'
6
+
7
+ gem.authors = ['Splunk']
8
+ gem.email = ['devinfo@splunk.com']
9
+ gem.description = %q{Splunk SDK for Ruby}
10
+ gem.summary = %q{Ruby bindings to Splunk REST layer}
11
+ gem.homepage = 'http://dev.splunk.com'
12
+
13
+ gem.required_ruby_version = '>=1.9.2'
14
+ gem.add_dependency 'jruby-openssl', '~>0.7.7' if RUBY_PLATFORM == "java"
15
+ gem.add_dependency 'rake', '~>10'
16
+ gem.add_dependency 'test-unit'
17
+
18
+ gem.files = Dir['{lib,examples,test}/**/*',
19
+ 'CHANGELOG.md',
20
+ 'LICENSE',
21
+ 'README.md',
22
+ 'Gemfile',
23
+ 'Rakefile',
24
+ 'splunk-sdk-ruby.gemspec']
25
+ gem.test_files = Dir['test/**/*']
26
+ gem.require_paths = ['lib']
27
+ end
@@ -0,0 +1,472 @@
1
+ {
2
+ 'atom_with_feed' => {
3
+ :metadata => {
4
+ "title" => "localapps",
5
+ "id" => URI("https://localhost:8089/servicesNS/nobody/system/apps/local"),
6
+ "updated" => "2012-12-19T11:07:48-08:00",
7
+ "generator" => {"build" => "144175", "version" => "5.0.2"},
8
+ "author" => "Splunk",
9
+ "links" => {
10
+ "create" => URI("/servicesNS/nobody/system/apps/local/_new"),
11
+ "_reload" => URI("/servicesNS/nobody/system/apps/local/_reload")
12
+ },
13
+ "totalResults" => "1",
14
+ "itemsPerPage" => "30",
15
+ "startIndex" => "0",
16
+ "messages" => []
17
+ },
18
+ :entries => [
19
+ {
20
+ "title" => "gettingstarted",
21
+ "id" => URI("https://localhost:8089/servicesNS/nobody/system/apps/local/gettingstarted"),
22
+ "updated" => "2012-12-19T11:07:48-08:00",
23
+ "author" => "nobody",
24
+ "links" => {
25
+ "alternate" => URI("/servicesNS/nobody/system/apps/local/gettingstarted"),
26
+ "list" => URI("/servicesNS/nobody/system/apps/local/gettingstarted"),
27
+ "_reload" => URI("/servicesNS/nobody/system/apps/local/gettingstarted/_reload"),
28
+ "edit" => URI("/servicesNS/nobody/system/apps/local/gettingstarted"),
29
+ "remove" => URI("/servicesNS/nobody/system/apps/local/gettingstarted"),
30
+ "disable" => URI("/servicesNS/nobody/system/apps/local/gettingstarted/disable"),
31
+ "package" => URI("/servicesNS/nobody/system/apps/local/gettingstarted/package")
32
+ },
33
+ "content" => {
34
+ "author" => "Splunk",
35
+ "check_for_updates" => "1",
36
+ "configured" => "1",
37
+ "description" => "Get started with Splunk. This app introduces you to many of Splunk's features. You'll learn how to use Splunk to index data, search and investigate, add knowledge, monitor and alert, report and analyze.",
38
+ "disabled" => "0",
39
+ "eai:acl" => {
40
+ "app" => "system",
41
+ "can_change_perms" => "1",
42
+ "can_list" => "1",
43
+ "can_share_app" => "1",
44
+ "can_share_global" => "1",
45
+ "can_share_user" => "0",
46
+ "can_write" => "1",
47
+ "modifiable" => "1",
48
+ "owner" => "nobody",
49
+ "perms" => {
50
+ "read" => ["*"],
51
+ "write" => ["power"]
52
+ },
53
+ "removable" => "0",
54
+ "sharing" => "app"
55
+ },
56
+ "eai:attributes" => {
57
+ "optionalFields" => ["author", "check_for_updates",
58
+ "configured", "description",
59
+ "label", "manageable", "version",
60
+ "visible"],
61
+ "requiredFields" => [],
62
+ "wildcardFields" => []
63
+ },
64
+ "label" => "Getting started",
65
+ "manageable" => "1",
66
+ "state_change_requires_restart" => "0",
67
+ "version" => "1.0",
68
+ "visible" => "1"
69
+ }
70
+ }
71
+ ]
72
+ },
73
+ 'atom_without_feed' => {
74
+ :metadata => {},
75
+ :entries => [
76
+ {
77
+ "title" => "| metadata type=sources | search totalCount>0 | " +
78
+ "rename totalCount as Count recentTime as \"Last Update\" | " +
79
+ "table source Count \"Last Update\" | fieldformat " +
80
+ "Count=tostring(Count, \"commas\") | fieldformat " +
81
+ "\"Last Update\"=strftime('Last Update', \"%c\")",
82
+ "id" => URI("https://localhost:8089/services/search/jobs/rt_1355944187.129"),
83
+ "updated" => "2012-12-19T11:09:52.000-08:00",
84
+ "published" => "2012-12-19T11:09:47.000-08:00",
85
+ "links" => {
86
+ "alternate" => URI("/services/search/jobs/rt_1355944187.129"),
87
+ "search.log" => URI("/services/search/jobs/rt_1355944187.129/search.log"),
88
+ "events" => URI("/services/search/jobs/rt_1355944187.129/events"),
89
+ "results" => URI("/services/search/jobs/rt_1355944187.129/results"),
90
+ "results_preview" => URI("/services/search/jobs/rt_1355944187.129/results_preview"),
91
+ "timeline" => URI("/services/search/jobs/rt_1355944187.129/timeline"),
92
+ "summary" => URI("/services/search/jobs/rt_1355944187.129/summary"),
93
+ "control" => URI("/services/search/jobs/rt_1355944187.129/control")
94
+ },
95
+ "author" => "admin",
96
+ "content" => {
97
+ "cursorTime" => "1969-12-31T16:00:00.000-08:00",
98
+ "delegate" => "",
99
+ "diskUsage" => "49152",
100
+ "dispatchState" => "RUNNING",
101
+ "doneProgress" => "1.00000",
102
+ "dropCount" => "0",
103
+ "earliestTime" => "1969-12-31T16:00:00.000-08:00",
104
+ "eventAvailableCount" => "0",
105
+ "eventCount" => "0",
106
+ "eventFieldCount" => "0",
107
+ "eventIsStreaming" => "1",
108
+ "eventIsTruncated" => "1",
109
+ "eventSearch" => "",
110
+ "eventSorting" => "none",
111
+ "isDone" => "0",
112
+ "isFailed" => "0",
113
+ "isFinalized" => "0",
114
+ "isPaused" => "0",
115
+ "isPreviewEnabled" => "1",
116
+ "isRealTimeSearch" => "1",
117
+ "isRemoteTimeline" => "0",
118
+ "isSaved" => "0",
119
+ "isSavedSearch" => "0",
120
+ "isZombie" => "0",
121
+ "keywords" => "",
122
+ "label" => "",
123
+ "latestTime" => "1969-12-31T16:00:00.000-08:00",
124
+ "meanPreviewPeriod" => "1.708000",
125
+ "numPreviews" => "3",
126
+ "pid" => "11902",
127
+ "priority" => "5",
128
+ "remoteSearch" => "metadata gather=false type=sources update_period=0",
129
+ "reportSearch" => "metadata type=sources | search totalCount>0 " +
130
+ " | rename totalCount as Count recentTime as \"Last Update\" " +
131
+ " | table source Count \"Last Update\" ",
132
+ "resultCount" => "0",
133
+ "resultIsStreaming" => "0",
134
+ "resultPreviewCount" => "5",
135
+ "runDuration" => "5.124000",
136
+ "scanCount" => "0",
137
+ "sid" => "rt_1355944187.129",
138
+ "statusBuckets" => "0",
139
+ "ttl" => "599",
140
+ "performance" => {
141
+ "command.metadata" => {
142
+ "duration_secs" => "4.995000",
143
+ "invocations" => "9",
144
+ "input_count" => "0",
145
+ "output_count" => "6"
146
+ },
147
+ "command.metadata.execute_input" => {
148
+ "duration_secs" => "0.009000",
149
+ "invocations" => "9"
150
+ },
151
+ "dispatch.check_disk_usage" => {
152
+ "duration_secs" => "0.001000",
153
+ "invocations" => "1"
154
+ },
155
+ "dispatch.createProviderQueue" => {
156
+ "duration_secs" => "0.005000",
157
+ "invocations" => "1"
158
+ },
159
+ "dispatch.evaluate" => {
160
+ "duration_secs" => "0.028000",
161
+ "invocations" => "1"
162
+ },
163
+ "dispatch.evaluate.fieldformat" => {
164
+ "duration_secs" => "0.002000",
165
+ "invocations" => "2"
166
+ },
167
+ "dispatch.evaluate.metadata" => {
168
+ "duration_secs" => "0.003000",
169
+ "invocations" => "1"
170
+ },
171
+ "dispatch.evaluate.rename" => {
172
+ "duration_secs" => "0.001000",
173
+ "invocations" => "1"
174
+ },
175
+ "dispatch.evaluate.search" => {
176
+ "duration_secs" => "0.021000",
177
+ "invocations" => "1"
178
+ },
179
+ "dispatch.evaluate.table" => {
180
+ "duration_secs" => "0.001000",
181
+ "invocations" => "1"
182
+ },
183
+ "dispatch.fetch" => {
184
+ "duration_secs" => "4.996000",
185
+ "invocations" => "9"
186
+ },
187
+ "dispatch.preview" => {
188
+ "duration_secs" => "0.088000",
189
+ "invocations" => "3"
190
+ },
191
+ "dispatch.preview.command.rename" => {
192
+ "duration_secs" => "0.004000",
193
+ "invocations" => "3",
194
+ "input_count" => "15",
195
+ "output_count" => "15",
196
+ },
197
+ "dispatch.preview.command.search" => {
198
+ "duration_secs" => "0.057000",
199
+ "invocations" => "3",
200
+ "input_count" => "15",
201
+ "output_count" => "15"
202
+ },
203
+ "dispatch.preview.command.search.filter" => {
204
+ "duration_secs" => "0.003000",
205
+ "invocations" => "3"
206
+ },
207
+ "dispatch.preview.command.table" => {
208
+ "duration_secs" => "0.013000",
209
+ "invocations" => "3",
210
+ "input_count" => "15",
211
+ "output_count" => "30"
212
+ },
213
+ "dispatch.preview.metadata.execute_output" => {
214
+ "duration_secs" => "0.003000",
215
+ "invocations" => "3"
216
+ },
217
+ "dispatch.preview.write_results_to_disk" => {
218
+ "duration_secs" => "0.015000",
219
+ "invocations" => "3"
220
+ },
221
+ "dispatch.stream.local" => {
222
+ "duration_secs" => "4.996000",
223
+ "invocations" => "9"
224
+ },
225
+ "dispatch.writeStatus" => {
226
+ "duration_secs" => "0.013000",
227
+ "invocations" => "6"
228
+ },
229
+ "startup.handoff" => {
230
+ "duration_secs" => "0.138000",
231
+ "invocations" => "1"
232
+ }
233
+ },
234
+ "messages" => {},
235
+ "request" => {
236
+ "auto_cancel" => "90",
237
+ "earliest_time" => "rt",
238
+ "latest_time" => "rt",
239
+ "max_count" => "100000",
240
+ "search" => "| metadata type=sources | search totalCount>0 " +
241
+ "| rename totalCount as Count recentTime as \"Last Update\"" +
242
+ " | table source Count \"Last Update\" | fieldformat" +
243
+ " Count=tostring(Count, \"commas\") | fieldformat" +
244
+ " \"Last Update\"=strftime('Last Update', \"%c\")",
245
+ "status_buckets" => "0",
246
+ "time_format" => "%s.%Q",
247
+ "ui_dispatch_app" => "search",
248
+ "ui_dispatch_view" => "dashboard_live"
249
+ },
250
+ "eai:acl" => {
251
+ "perms" => {
252
+ "read" => ["admin"],
253
+ "write" => ["admin"],
254
+ },
255
+ "owner" => "admin",
256
+ "modifiable" => "1",
257
+ "sharing" => "global",
258
+ "app" => "search",
259
+ "can_write" => "1"
260
+ },
261
+ "searchProviders" => ["fross-mbp15.local"],
262
+ }
263
+ }
264
+ ]
265
+ },
266
+ 'atom_with_several_entries' => {
267
+ :metadata => {
268
+ "title" => "localapps",
269
+ "id" => URI("https://localhost:8089/services/apps/local"),
270
+ "updated" => "2012-12-19T15:27:58-08:00",
271
+ "generator" => {"version" => "140437"},
272
+ "author" => "Splunk",
273
+ "links" => {
274
+ "create" => URI("/services/apps/local/_new"),
275
+ "_reload" => URI("/services/apps/local/_reload")
276
+ },
277
+ "totalResults" => "12",
278
+ "itemsPerPage" => "30",
279
+ "startIndex" => "0",
280
+ "messages" => []
281
+ },
282
+ :entries => [
283
+ {
284
+ "title" => "gettingstarted",
285
+ "id" => URI("https://localhost:8089/services/apps/local/gettingstarted"),
286
+ "updated" => "2012-12-19T15:27:58-08:00",
287
+ "author" => "system",
288
+ "links" => {
289
+ "alternate" => URI("/services/apps/local/gettingstarted"),
290
+ "list" => URI("/services/apps/local/gettingstarted"),
291
+ "_reload" => URI("/services/apps/local/gettingstarted/_reload"),
292
+ "edit" => URI("/services/apps/local/gettingstarted"),
293
+ "remove" => URI("/services/apps/local/gettingstarted"),
294
+ "disable" => URI("/services/apps/local/gettingstarted/disable"),
295
+ "package" => URI("/services/apps/local/gettingstarted/package")
296
+ },
297
+ "content" => {
298
+ "author" => "Splunk",
299
+ "check_for_updates" => "1",
300
+ "configured" => "1",
301
+ "description" => "Get started with Splunk. This app " +
302
+ "introduces you to many of Splunk's features. You'll " +
303
+ "learn how to use Splunk to index data, search and " +
304
+ "investigate, add knowledge, monitor and alert, report " +
305
+ "and analyze.",
306
+ "disabled" => "0",
307
+ "eai:acl" => {
308
+ "app" => "",
309
+ "can_change_perms" => "1",
310
+ "can_list" => "1",
311
+ "can_share_app" => "1",
312
+ "can_share_global" => "1",
313
+ "can_share_user" => "0",
314
+ "can_write" => "1",
315
+ "modifiable" => "1",
316
+ "owner" => "system",
317
+ "perms" => {
318
+ "read" => ["*"],
319
+ "write" => ["power"]
320
+ },
321
+ "removable" => "0",
322
+ "sharing" => "app",
323
+ },
324
+ "label" => "Getting started",
325
+ "manageable" => "0",
326
+ "state_change_requires_restart" => "0",
327
+ "version" => "1.0",
328
+ "visible" => "1"
329
+ }
330
+ },
331
+
332
+ {
333
+ "title" => "launcher",
334
+ "id" => URI("https://localhost:8089/services/apps/local/launcher"),
335
+ "updated" => "2012-12-19T15:27:58-08:00",
336
+ "author" => "system",
337
+ "links" => {
338
+ "alternate" => URI("/services/apps/local/launcher"),
339
+ "list" => URI("/services/apps/local/launcher"),
340
+ "_reload" => URI("/services/apps/local/launcher/_reload"),
341
+ "edit" => URI("/services/apps/local/launcher"),
342
+ "remove" => URI("/services/apps/local/launcher"),
343
+ "package" => URI("/services/apps/local/launcher/package")
344
+ },
345
+ "content" => {
346
+ "check_for_updates" => "1",
347
+ "configured" => "1",
348
+ "disabled" => "0",
349
+ "eai:acl" => {
350
+ "app" => "",
351
+ "can_change_perms" => "1",
352
+ "can_list" => "1",
353
+ "can_share_app" => "1",
354
+ "can_share_global" => "1",
355
+ "can_share_user" => "0",
356
+ "can_write" => "1",
357
+ "modifiable" => "1",
358
+ "owner" => "system",
359
+ "perms" => {
360
+ "read" => ["*"],
361
+ "write" => ["power"]
362
+ },
363
+ "removable" => "0",
364
+ "sharing" => "app",
365
+ },
366
+ "label" => "Home",
367
+ "manageable" => "0",
368
+ "state_change_requires_restart" => "0",
369
+ "visible" => "1"
370
+ }
371
+ },
372
+
373
+ {
374
+ "title" => "learned",
375
+ "id" => URI("https://localhost:8089/services/apps/local/learned"),
376
+ "updated" => "2012-12-19T15:27:58-08:00",
377
+ "author" => "system",
378
+ "links" => {
379
+ "alternate" => URI("/services/apps/local/learned"),
380
+ "list" => URI("/services/apps/local/learned"),
381
+ "_reload" => URI("/services/apps/local/learned/_reload"),
382
+ "edit" => URI("/services/apps/local/learned"),
383
+ "remove" => URI("/services/apps/local/learned"),
384
+ "disable" => URI("/services/apps/local/learned/disable"),
385
+ "package" => URI("/services/apps/local/learned/package")
386
+ },
387
+ "content" => {
388
+ "check_for_updates" => "1",
389
+ "configured" => "0",
390
+ "disabled" => "0",
391
+ "eai:acl" => {
392
+ "app" => "",
393
+ "can_change_perms" => "1",
394
+ "can_list" => "1",
395
+ "can_share_app" => "1",
396
+ "can_share_global" => "1",
397
+ "can_share_user" => "0",
398
+ "can_write" => "1",
399
+ "modifiable" => "1",
400
+ "owner" => "system",
401
+ "perms" => {"read" => ["*"], "write" => ["*"]},
402
+ "removable" => "0",
403
+ "sharing" => "app"
404
+ },
405
+ "label" => "learned",
406
+ "manageable" => "1",
407
+ "state_change_requires_restart" => "0",
408
+ "visible" => "0"
409
+ }
410
+ }
411
+ ]
412
+ },
413
+ 'atom_with_simple_entries' => {
414
+ :metadata => {
415
+ "title" => "services",
416
+ "id" => URI("https://localhost:8089/services/"),
417
+ "updated" => "2012-12-20T09:48:01-08:00",
418
+ "generator" => {"version" => "140437"},
419
+ "author" => "Splunk",
420
+ "links" => {},
421
+ "messages" => []
422
+ },
423
+ :entries => [
424
+ {
425
+ "title" => "alerts",
426
+ "id" => URI("https://localhost:8089/services/alerts"),
427
+ "updated" => "2012-12-20T09:48:01-08:00",
428
+ "links" => {
429
+ "alternate" => URI("/services/alerts")
430
+ }
431
+ },
432
+ {
433
+ "title" => "apps",
434
+ "id" => URI("https://localhost:8089/services/apps"),
435
+ "updated" => "2012-12-20T09:48:01-08:00",
436
+ "links" => {
437
+ "alternate" => URI("/services/apps")
438
+ }
439
+ },
440
+ {
441
+ "title" => "auth",
442
+ "id" => URI("https://localhost:8089/services/auth"),
443
+ "updated" => "2012-12-20T09:48:01-08:00",
444
+ "links" => {
445
+ "alternate" => URI("/services/auth")
446
+ }
447
+ }
448
+ ]
449
+ },
450
+ "atom_feed_with_message" => {
451
+ :metadata => {
452
+ "title" => "roles",
453
+ "id" => URI("https://localhost:8089/services/authorization/roles"),
454
+ "updated" => "2013-01-22T08:52:24-08:00",
455
+ "generator" => {"build" => "146385", "version" => "5.0.2"},
456
+ "author" => "Splunk",
457
+ "links" => {
458
+ "create" => URI("/services/authorization/roles/_new")
459
+ },
460
+ "startIndex" => "0",
461
+ "totalResults" => "0",
462
+ "itemsPerPage" => "30",
463
+ "messages" => [
464
+ {
465
+ "type" => :WARN,
466
+ "message" => "This role will be disabled after the Enterprise Trial License expires"
467
+ }
468
+ ]
469
+ },
470
+ :entries => []
471
+ }
472
+ }