esp_sdk 1.1.0 → 2.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (199) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +0 -2
  3. data/.rubocop.yml +53 -6
  4. data/.ruby-version +1 -1
  5. data/.travis.yml +8 -2
  6. data/Gemfile.lock +171 -0
  7. data/Guardfile +47 -0
  8. data/README.md +230 -5
  9. data/Rakefile +14 -1
  10. data/assets/logo.png +0 -0
  11. data/bin/esp_console +71 -0
  12. data/esp_sdk.gemspec +27 -18
  13. data/lib/esp/exceptions.rb +3 -0
  14. data/lib/esp/extensions/active_resource/formats/json_api_format.rb +105 -0
  15. data/lib/esp/extensions/active_resource/paginated_collection.rb +198 -0
  16. data/lib/esp/extensions/active_resource/validations.rb +45 -0
  17. data/lib/esp/resources/alert.rb +135 -0
  18. data/lib/esp/resources/cloud_trail_event.rb +45 -0
  19. data/lib/esp/resources/concerns/stat_totals.rb +79 -0
  20. data/lib/esp/resources/contact_request.rb +42 -0
  21. data/lib/esp/resources/custom_signature.rb +224 -0
  22. data/lib/esp/resources/dashboard.rb +31 -0
  23. data/lib/esp/resources/external_account.rb +89 -0
  24. data/lib/esp/resources/organization.rb +61 -0
  25. data/lib/esp/resources/region.rb +46 -0
  26. data/lib/esp/resources/report.rb +100 -0
  27. data/lib/esp/resources/resource.rb +66 -0
  28. data/lib/esp/resources/service.rb +31 -0
  29. data/lib/esp/resources/signature.rb +106 -0
  30. data/lib/esp/resources/stat.rb +124 -0
  31. data/lib/esp/resources/stat_custom_signature.rb +121 -0
  32. data/lib/esp/resources/stat_region.rb +121 -0
  33. data/lib/esp/resources/stat_service.rb +121 -0
  34. data/lib/esp/resources/stat_signature.rb +121 -0
  35. data/lib/esp/resources/sub_organization.rb +69 -0
  36. data/lib/esp/resources/suppression/region.rb +99 -0
  37. data/lib/esp/resources/suppression/signature.rb +107 -0
  38. data/lib/esp/resources/suppression/unique_identifier.rb +60 -0
  39. data/lib/esp/resources/suppression.rb +86 -0
  40. data/lib/esp/resources/tag.rb +45 -0
  41. data/lib/esp/resources/team.rb +79 -0
  42. data/lib/esp/resources/user.rb +46 -0
  43. data/lib/esp/version.rb +3 -0
  44. data/lib/esp.rb +95 -0
  45. data/lib/esp_sdk.rb +9 -45
  46. data/lib/tasks/rubocop.rake +2 -0
  47. data/lib/tasks/testing.rake +3 -0
  48. data/rdoc/ActiveResource/Formats.html +176 -0
  49. data/rdoc/ActiveResource/PaginatedCollection.html +910 -0
  50. data/rdoc/ActiveResource.html +180 -0
  51. data/rdoc/ESP/Alert.html +771 -0
  52. data/rdoc/ESP/CloudTrailEvent.html +375 -0
  53. data/rdoc/ESP/ContactRequest.html +366 -0
  54. data/rdoc/ESP/CustomSignature.html +746 -0
  55. data/rdoc/ESP/Dashboard.html +355 -0
  56. data/rdoc/ESP/ExternalAccount.html +565 -0
  57. data/rdoc/ESP/Organization.html +590 -0
  58. data/rdoc/ESP/Region.html +399 -0
  59. data/rdoc/ESP/Report.html +622 -0
  60. data/rdoc/ESP/Service.html +380 -0
  61. data/rdoc/ESP/Signature.html +555 -0
  62. data/rdoc/ESP/Stat.html +1778 -0
  63. data/rdoc/ESP/StatCustomSignature.html +1599 -0
  64. data/rdoc/ESP/StatRegion.html +1598 -0
  65. data/rdoc/ESP/StatService.html +1598 -0
  66. data/rdoc/ESP/StatSignature.html +1598 -0
  67. data/rdoc/ESP/SubOrganization.html +540 -0
  68. data/rdoc/ESP/Suppression/Region.html +454 -0
  69. data/rdoc/ESP/Suppression/Signature.html +470 -0
  70. data/rdoc/ESP/Suppression/UniqueIdentifier.html +417 -0
  71. data/rdoc/ESP/Suppression.html +649 -0
  72. data/rdoc/ESP/Tag.html +371 -0
  73. data/rdoc/ESP/Team.html +584 -0
  74. data/rdoc/ESP/User.html +483 -0
  75. data/rdoc/ESP.html +546 -0
  76. data/rdoc/README_md.html +501 -0
  77. data/rdoc/created.rid +30 -0
  78. data/rdoc/images/add.png +0 -0
  79. data/rdoc/images/arrow_up.png +0 -0
  80. data/rdoc/images/brick.png +0 -0
  81. data/rdoc/images/brick_link.png +0 -0
  82. data/rdoc/images/bug.png +0 -0
  83. data/rdoc/images/bullet_black.png +0 -0
  84. data/rdoc/images/bullet_toggle_minus.png +0 -0
  85. data/rdoc/images/bullet_toggle_plus.png +0 -0
  86. data/rdoc/images/date.png +0 -0
  87. data/rdoc/images/delete.png +0 -0
  88. data/rdoc/images/find.png +0 -0
  89. data/rdoc/images/loadingAnimation.gif +0 -0
  90. data/rdoc/images/macFFBgHack.png +0 -0
  91. data/rdoc/images/package.png +0 -0
  92. data/rdoc/images/page_green.png +0 -0
  93. data/rdoc/images/page_white_text.png +0 -0
  94. data/rdoc/images/page_white_width.png +0 -0
  95. data/rdoc/images/plugin.png +0 -0
  96. data/rdoc/images/ruby.png +0 -0
  97. data/rdoc/images/tag_blue.png +0 -0
  98. data/rdoc/images/tag_green.png +0 -0
  99. data/rdoc/images/transparent.png +0 -0
  100. data/rdoc/images/wrench.png +0 -0
  101. data/rdoc/images/wrench_orange.png +0 -0
  102. data/rdoc/images/zoom.png +0 -0
  103. data/rdoc/index.html +134 -0
  104. data/rdoc/js/darkfish.js +155 -0
  105. data/rdoc/js/jquery.js +4 -0
  106. data/rdoc/js/navigation.js +142 -0
  107. data/rdoc/js/search.js +94 -0
  108. data/rdoc/js/search_index.js +1 -0
  109. data/rdoc/js/searcher.js +228 -0
  110. data/rdoc/rdoc.css +595 -0
  111. data/rdoc/table_of_contents.html +927 -0
  112. data/test/esp/extensions/active_resource/formats/json_api_format_test.rb +109 -0
  113. data/test/esp/extensions/active_resource/paginated_collection_test.rb +435 -0
  114. data/test/esp/extensions/active_resource/validations_test.rb +59 -0
  115. data/test/esp/resources/alert_test.rb +263 -0
  116. data/test/esp/resources/cloud_trail_event_test.rb +98 -0
  117. data/test/esp/resources/contact_request_test.rb +73 -0
  118. data/test/esp/resources/custom_signature_test.rb +241 -0
  119. data/test/esp/resources/dashboard_test.rb +71 -0
  120. data/test/esp/resources/external_account_test.rb +125 -0
  121. data/test/esp/resources/organization_test.rb +175 -0
  122. data/test/esp/resources/region_test.rb +84 -0
  123. data/test/esp/resources/report_test.rb +180 -0
  124. data/test/esp/resources/resource_test.rb +183 -0
  125. data/test/esp/resources/service_test.rb +64 -0
  126. data/test/esp/resources/signature_test.rb +177 -0
  127. data/test/esp/resources/stat_custom_signature_test.rb +115 -0
  128. data/test/esp/resources/stat_region_test.rb +114 -0
  129. data/test/esp/resources/stat_service_test.rb +114 -0
  130. data/test/esp/resources/stat_signature_test.rb +115 -0
  131. data/test/esp/resources/stat_test.rb +159 -0
  132. data/test/esp/resources/sub_organization_test.rb +127 -0
  133. data/test/esp/resources/suppression/region_test.rb +115 -0
  134. data/test/esp/resources/suppression/signature_test.rb +117 -0
  135. data/test/esp/resources/suppression/unique_identifier_test.rb +79 -0
  136. data/test/esp/resources/suppression_test.rb +226 -0
  137. data/test/esp/resources/tag_test.rb +98 -0
  138. data/test/esp/resources/team_test.rb +140 -0
  139. data/test/esp/resources/user_test.rb +113 -0
  140. data/test/esp_test.rb +139 -0
  141. data/test/factories/alerts.rb +234 -0
  142. data/test/factories/cloud_trail_events.rb +16 -0
  143. data/test/factories/contact_requests.rb +14 -0
  144. data/test/factories/custom_signatures.rb +30 -0
  145. data/test/factories/dashboards.rb +91 -0
  146. data/test/factories/errors.rb +24 -0
  147. data/test/factories/external_accounts.rb +44 -0
  148. data/test/factories/organizations.rb +48 -0
  149. data/test/factories/regions.rb +9 -0
  150. data/test/factories/reports.rb +56 -0
  151. data/test/factories/services.rb +12 -0
  152. data/test/factories/signatures.rb +28 -0
  153. data/test/factories/stat_custom_signatures.rb +97 -0
  154. data/test/factories/stat_regions.rb +97 -0
  155. data/test/factories/stat_services.rb +97 -0
  156. data/test/factories/stat_signautures.rb +97 -0
  157. data/test/factories/stats.rb +129 -0
  158. data/test/factories/sub_organizations.rb +34 -0
  159. data/test/factories/suppression/regions.rb +90 -0
  160. data/test/factories/suppression/signatures.rb +117 -0
  161. data/test/factories/suppression/unique_identifiers.rb +111 -0
  162. data/test/factories/suppressions.rb +71 -0
  163. data/test/factories/tags.rb +12 -0
  164. data/test/factories/teams.rb +32 -0
  165. data/test/factories/users.rb +54 -0
  166. data/test/json_strategy.rb +25 -0
  167. data/test/test_helper.rb +44 -5
  168. metadata +387 -119
  169. data/bin/esp_repl +0 -60
  170. data/lib/esp_sdk/api.rb +0 -33
  171. data/lib/esp_sdk/client.rb +0 -62
  172. data/lib/esp_sdk/configure.rb +0 -40
  173. data/lib/esp_sdk/end_points/base.rb +0 -102
  174. data/lib/esp_sdk/end_points/contact_requests.rb +0 -6
  175. data/lib/esp_sdk/end_points/custom_signatures.rb +0 -41
  176. data/lib/esp_sdk/end_points/dashboard.rb +0 -35
  177. data/lib/esp_sdk/end_points/external_accounts.rb +0 -9
  178. data/lib/esp_sdk/end_points/organizations.rb +0 -6
  179. data/lib/esp_sdk/end_points/reports.rb +0 -6
  180. data/lib/esp_sdk/end_points/services.rb +0 -6
  181. data/lib/esp_sdk/end_points/signatures.rb +0 -39
  182. data/lib/esp_sdk/end_points/sub_organizations.rb +0 -6
  183. data/lib/esp_sdk/end_points/teams.rb +0 -6
  184. data/lib/esp_sdk/end_points/users.rb +0 -6
  185. data/lib/esp_sdk/exceptions.rb +0 -8
  186. data/lib/esp_sdk/extensions/rest_client/request.rb +0 -9
  187. data/lib/esp_sdk/repl.rb +0 -61
  188. data/lib/esp_sdk/version.rb +0 -3
  189. data/test/esp_sdk/api_test.rb +0 -36
  190. data/test/esp_sdk/client_test.rb +0 -129
  191. data/test/esp_sdk/configure_test.rb +0 -65
  192. data/test/esp_sdk/end_points/.keep +0 -0
  193. data/test/esp_sdk/end_points/base_test.rb +0 -230
  194. data/test/esp_sdk/end_points/custom_signatures_test.rb +0 -90
  195. data/test/esp_sdk/end_points/dashboard_test.rb +0 -55
  196. data/test/esp_sdk/end_points/external_accounts_test.rb +0 -20
  197. data/test/esp_sdk/end_points/signatures_test.rb +0 -83
  198. data/test/esp_sdk/exceptions_test.rb +0 -41
  199. data/test/esp_sdk_test.rb +0 -70
@@ -0,0 +1,48 @@
1
+ FactoryGirl.define do
2
+ factory :organization, class: 'ESP::Organization' do
3
+ skip_create
4
+
5
+ sequence(:id) { |n| n }
6
+ type "organizations"
7
+ created_at { Time.current }
8
+ name "Test Org"
9
+ updated_at { Time.current }
10
+ relationships do
11
+ { sub_organizations: {
12
+ data: [
13
+ {
14
+ type: "sub_organizations",
15
+ id: "24"
16
+ },
17
+ {
18
+ type: "sub_organizations",
19
+ id: "2"
20
+ }
21
+ ],
22
+ links: {
23
+ related: "http://localhost:3000/api/v2/sub_organizations.json?q%5Borganization_id_eq%5D=2"
24
+ }
25
+ },
26
+ teams: {
27
+ data: [
28
+ {
29
+ type: "teams",
30
+ id: "2"
31
+ },
32
+ {
33
+ type: "teams",
34
+ id: "20"
35
+ },
36
+ {
37
+ type: "teams",
38
+ id: "21"
39
+ }
40
+ ],
41
+ links: {
42
+ related: "http://localhost:3000/api/v2/teams.json?q%5Borganization_id_eq%5D=2"
43
+ }
44
+ }
45
+ }
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,9 @@
1
+ FactoryGirl.define do
2
+ factory :region, class: 'ESP::Region' do
3
+ skip_create
4
+
5
+ sequence(:id) { |n| n }
6
+ type "services"
7
+ code "us_east_test_1"
8
+ end
9
+ end
@@ -0,0 +1,56 @@
1
+ FactoryGirl.define do
2
+ factory :report, class: 'ESP::Report' do
3
+ skip_create
4
+
5
+ sequence(:id) { |n| n }
6
+ type "reports"
7
+ created_at { Time.current }
8
+ status "complete"
9
+ updated_at { Time.current }
10
+ relationships do
11
+ { organization: {
12
+ data: {
13
+ type: "organizations",
14
+ id: "1"
15
+ },
16
+ links: {
17
+ related: "http://localhost:3000/api/v2/organizations/1.json"
18
+ }
19
+ },
20
+ sub_organization: {
21
+ data: {
22
+ type: "sub_organizations",
23
+ id: "1"
24
+ },
25
+ links: {
26
+ related: "http://localhost:3000/api/v2/sub_organizations/1.json"
27
+ }
28
+ },
29
+ team: {
30
+ data: {
31
+ type: "teams",
32
+ id: "1"
33
+ },
34
+ links: {
35
+ related: "http://localhost:3000/api/v2/teams/1.json"
36
+ }
37
+ },
38
+ alerts: {
39
+ data: [
40
+ {
41
+ type: "alerts",
42
+ id: "41989"
43
+ },
44
+ {
45
+ type: "alerts",
46
+ id: "41988"
47
+ }
48
+ ],
49
+ links: {
50
+ related: "http://localhost:3000/api/v2/reports/55/alerts.json"
51
+ }
52
+ }
53
+ }
54
+ end
55
+ end
56
+ end
@@ -0,0 +1,12 @@
1
+ FactoryGirl.define do
2
+ factory :service, class: 'ESP::Service' do
3
+ skip_create
4
+
5
+ sequence(:id) { |n| n }
6
+ type "services"
7
+ code "S1"
8
+ created_at { Time.current }
9
+ name "SSS"
10
+ updated_at nil
11
+ end
12
+ end
@@ -0,0 +1,28 @@
1
+ FactoryGirl.define do
2
+ factory :signature, class: 'ESP::Signature' do
3
+ skip_create
4
+
5
+ sequence(:id) { |n| n }
6
+ type "signatures"
7
+ created_at { Time.current }
8
+ description "Some description for some test"
9
+ identifier "1 Unique ID"
10
+ name "1_test_signature"
11
+ resolution "Turn on some setting"
12
+ risk_level "High"
13
+ updated_at nil
14
+ relationships do
15
+ {
16
+ service: {
17
+ data: {
18
+ type: "services",
19
+ id: "1"
20
+ },
21
+ links: {
22
+ related: "http://test.host/api/v2/services/1.json"
23
+ }
24
+ }
25
+ }
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,97 @@
1
+ FactoryGirl.define do
2
+ factory :stat_custom_signature, class: 'ESP::StatCustomSignature' do
3
+ skip_create
4
+
5
+ sequence(:id) { |n| n }
6
+ type "stat_custom_signatures"
7
+
8
+ new_1h_high_pass 3
9
+ new_1d_high_pass 0
10
+ new_1w_high_pass 4
11
+ old_high_pass 1
12
+ new_1h_high_fail 3
13
+ new_1d_high_fail 3
14
+ new_1w_high_fail 2
15
+ old_high_fail 4
16
+ new_1h_high_warn 1
17
+ new_1d_high_warn 0
18
+ new_1w_high_warn 3
19
+ old_high_warn 4
20
+ new_1h_high_error 1
21
+ new_1d_high_error 0
22
+ new_1w_high_error 4
23
+ old_high_error 0
24
+ new_1h_medium_pass 4
25
+ new_1d_medium_pass 3
26
+ new_1w_medium_pass 0
27
+ old_medium_pass 2
28
+ new_1h_medium_fail 4
29
+ new_1d_medium_fail 3
30
+ new_1w_medium_fail 3
31
+ old_medium_fail 3
32
+ new_1h_medium_warn 3
33
+ new_1d_medium_warn 1
34
+ new_1w_medium_warn 4
35
+ old_medium_warn 3
36
+ new_1h_medium_error 0
37
+ new_1d_medium_error 2
38
+ new_1w_medium_error 3
39
+ old_medium_error 4
40
+ new_1h_low_pass 4
41
+ new_1d_low_pass 2
42
+ new_1w_low_pass 3
43
+ old_low_pass 4
44
+ new_1h_low_fail 3
45
+ new_1d_low_fail 4
46
+ new_1w_low_fail 4
47
+ old_low_fail 1
48
+ new_1h_low_warn 0
49
+ new_1d_low_warn 3
50
+ new_1w_low_warn 1
51
+ old_low_warn 0
52
+ new_1h_low_error 4
53
+ new_1d_low_error 1
54
+ new_1w_low_error 3
55
+ old_low_error 0
56
+ suppressed_high_pass 2
57
+ suppressed_high_fail 2
58
+ suppressed_high_warn 2
59
+ suppressed_high_error 3
60
+ suppressed_medium_pass 4
61
+ suppressed_medium_fail 2
62
+ suppressed_medium_warn 4
63
+ suppressed_medium_error 4
64
+ suppressed_low_pass 0
65
+ suppressed_low_fail 4
66
+ suppressed_low_warn 0
67
+ suppressed_low_error 4
68
+ new_1h_high_info 1
69
+ new_1d_high_info 4
70
+ new_1w_high_info 0
71
+ old_high_info 0
72
+ new_1h_medium_info 0
73
+ new_1d_medium_info 2
74
+ new_1w_medium_info 1
75
+ old_medium_info 2
76
+ new_1h_low_info 0
77
+ new_1d_low_info 2
78
+ new_1w_low_info 1
79
+ old_low_info 1
80
+ suppressed_high_info 0
81
+ suppressed_medium_info 2
82
+ suppressed_low_info 1
83
+ relationships do
84
+ { custom_signature: {
85
+ data:
86
+ {
87
+ id: "1",
88
+ type: "custom_signatures"
89
+ },
90
+ links: {
91
+ related: "http://test.host/api/v2/custom_signatures/1.json"
92
+ }
93
+ }
94
+ }
95
+ end
96
+ end
97
+ end
@@ -0,0 +1,97 @@
1
+ FactoryGirl.define do
2
+ factory :stat_region, class: 'ESP::StatRegion' do
3
+ skip_create
4
+
5
+ sequence(:id) { |n| n }
6
+ type "stat_regions"
7
+
8
+ new_1h_high_pass 3
9
+ new_1d_high_pass 0
10
+ new_1w_high_pass 4
11
+ old_high_pass 1
12
+ new_1h_high_fail 3
13
+ new_1d_high_fail 3
14
+ new_1w_high_fail 2
15
+ old_high_fail 4
16
+ new_1h_high_warn 1
17
+ new_1d_high_warn 0
18
+ new_1w_high_warn 3
19
+ old_high_warn 4
20
+ new_1h_high_error 1
21
+ new_1d_high_error 0
22
+ new_1w_high_error 4
23
+ old_high_error 0
24
+ new_1h_medium_pass 4
25
+ new_1d_medium_pass 3
26
+ new_1w_medium_pass 0
27
+ old_medium_pass 2
28
+ new_1h_medium_fail 4
29
+ new_1d_medium_fail 3
30
+ new_1w_medium_fail 3
31
+ old_medium_fail 3
32
+ new_1h_medium_warn 3
33
+ new_1d_medium_warn 1
34
+ new_1w_medium_warn 4
35
+ old_medium_warn 3
36
+ new_1h_medium_error 0
37
+ new_1d_medium_error 2
38
+ new_1w_medium_error 3
39
+ old_medium_error 4
40
+ new_1h_low_pass 4
41
+ new_1d_low_pass 2
42
+ new_1w_low_pass 3
43
+ old_low_pass 4
44
+ new_1h_low_fail 3
45
+ new_1d_low_fail 4
46
+ new_1w_low_fail 4
47
+ old_low_fail 1
48
+ new_1h_low_warn 0
49
+ new_1d_low_warn 3
50
+ new_1w_low_warn 1
51
+ old_low_warn 0
52
+ new_1h_low_error 4
53
+ new_1d_low_error 1
54
+ new_1w_low_error 3
55
+ old_low_error 0
56
+ suppressed_high_pass 2
57
+ suppressed_high_fail 2
58
+ suppressed_high_warn 2
59
+ suppressed_high_error 3
60
+ suppressed_medium_pass 4
61
+ suppressed_medium_fail 2
62
+ suppressed_medium_warn 4
63
+ suppressed_medium_error 4
64
+ suppressed_low_pass 0
65
+ suppressed_low_fail 4
66
+ suppressed_low_warn 0
67
+ suppressed_low_error 4
68
+ new_1h_high_info 1
69
+ new_1d_high_info 4
70
+ new_1w_high_info 0
71
+ old_high_info 0
72
+ new_1h_medium_info 0
73
+ new_1d_medium_info 2
74
+ new_1w_medium_info 1
75
+ old_medium_info 2
76
+ new_1h_low_info 0
77
+ new_1d_low_info 2
78
+ new_1w_low_info 1
79
+ old_low_info 1
80
+ suppressed_high_info 0
81
+ suppressed_medium_info 2
82
+ suppressed_low_info 1
83
+ relationships do
84
+ { region: {
85
+ data:
86
+ {
87
+ id: "3",
88
+ type: "regions"
89
+ },
90
+ links: {
91
+ related: "http://test.host/api/v2/regions/3.json"
92
+ }
93
+ }
94
+ }
95
+ end
96
+ end
97
+ end
@@ -0,0 +1,97 @@
1
+ FactoryGirl.define do
2
+ factory :stat_service, class: 'ESP::StatService' do
3
+ skip_create
4
+
5
+ sequence(:id) { |n| n }
6
+ type "stat_services"
7
+
8
+ new_1h_high_pass 3
9
+ new_1d_high_pass 0
10
+ new_1w_high_pass 4
11
+ old_high_pass 1
12
+ new_1h_high_fail 3
13
+ new_1d_high_fail 3
14
+ new_1w_high_fail 2
15
+ old_high_fail 4
16
+ new_1h_high_warn 1
17
+ new_1d_high_warn 0
18
+ new_1w_high_warn 3
19
+ old_high_warn 4
20
+ new_1h_high_error 1
21
+ new_1d_high_error 0
22
+ new_1w_high_error 4
23
+ old_high_error 0
24
+ new_1h_medium_pass 4
25
+ new_1d_medium_pass 3
26
+ new_1w_medium_pass 0
27
+ old_medium_pass 2
28
+ new_1h_medium_fail 4
29
+ new_1d_medium_fail 3
30
+ new_1w_medium_fail 3
31
+ old_medium_fail 3
32
+ new_1h_medium_warn 3
33
+ new_1d_medium_warn 1
34
+ new_1w_medium_warn 4
35
+ old_medium_warn 3
36
+ new_1h_medium_error 0
37
+ new_1d_medium_error 2
38
+ new_1w_medium_error 3
39
+ old_medium_error 4
40
+ new_1h_low_pass 4
41
+ new_1d_low_pass 2
42
+ new_1w_low_pass 3
43
+ old_low_pass 4
44
+ new_1h_low_fail 3
45
+ new_1d_low_fail 4
46
+ new_1w_low_fail 4
47
+ old_low_fail 1
48
+ new_1h_low_warn 0
49
+ new_1d_low_warn 3
50
+ new_1w_low_warn 1
51
+ old_low_warn 0
52
+ new_1h_low_error 4
53
+ new_1d_low_error 1
54
+ new_1w_low_error 3
55
+ old_low_error 0
56
+ suppressed_high_pass 2
57
+ suppressed_high_fail 2
58
+ suppressed_high_warn 2
59
+ suppressed_high_error 3
60
+ suppressed_medium_pass 4
61
+ suppressed_medium_fail 2
62
+ suppressed_medium_warn 4
63
+ suppressed_medium_error 4
64
+ suppressed_low_pass 0
65
+ suppressed_low_fail 4
66
+ suppressed_low_warn 0
67
+ suppressed_low_error 4
68
+ new_1h_high_info 1
69
+ new_1d_high_info 4
70
+ new_1w_high_info 0
71
+ old_high_info 0
72
+ new_1h_medium_info 0
73
+ new_1d_medium_info 2
74
+ new_1w_medium_info 1
75
+ old_medium_info 2
76
+ new_1h_low_info 0
77
+ new_1d_low_info 2
78
+ new_1w_low_info 1
79
+ old_low_info 1
80
+ suppressed_high_info 0
81
+ suppressed_medium_info 2
82
+ suppressed_low_info 1
83
+ relationships do
84
+ { service: {
85
+ data:
86
+ {
87
+ id: "1",
88
+ type: "services"
89
+ },
90
+ links: {
91
+ related: "http://test.host/api/v2/services/1.json"
92
+ }
93
+ }
94
+ }
95
+ end
96
+ end
97
+ end
@@ -0,0 +1,97 @@
1
+ FactoryGirl.define do
2
+ factory :stat_signature, class: 'ESP::StatSignature' do
3
+ skip_create
4
+
5
+ sequence(:id) { |n| n }
6
+ type "stat_signatures"
7
+
8
+ new_1h_high_pass 3
9
+ new_1d_high_pass 0
10
+ new_1w_high_pass 4
11
+ old_high_pass 1
12
+ new_1h_high_fail 3
13
+ new_1d_high_fail 3
14
+ new_1w_high_fail 2
15
+ old_high_fail 4
16
+ new_1h_high_warn 1
17
+ new_1d_high_warn 0
18
+ new_1w_high_warn 3
19
+ old_high_warn 4
20
+ new_1h_high_error 1
21
+ new_1d_high_error 0
22
+ new_1w_high_error 4
23
+ old_high_error 0
24
+ new_1h_medium_pass 4
25
+ new_1d_medium_pass 3
26
+ new_1w_medium_pass 0
27
+ old_medium_pass 2
28
+ new_1h_medium_fail 4
29
+ new_1d_medium_fail 3
30
+ new_1w_medium_fail 3
31
+ old_medium_fail 3
32
+ new_1h_medium_warn 3
33
+ new_1d_medium_warn 1
34
+ new_1w_medium_warn 4
35
+ old_medium_warn 3
36
+ new_1h_medium_error 0
37
+ new_1d_medium_error 2
38
+ new_1w_medium_error 3
39
+ old_medium_error 4
40
+ new_1h_low_pass 4
41
+ new_1d_low_pass 2
42
+ new_1w_low_pass 3
43
+ old_low_pass 4
44
+ new_1h_low_fail 3
45
+ new_1d_low_fail 4
46
+ new_1w_low_fail 4
47
+ old_low_fail 1
48
+ new_1h_low_warn 0
49
+ new_1d_low_warn 3
50
+ new_1w_low_warn 1
51
+ old_low_warn 0
52
+ new_1h_low_error 4
53
+ new_1d_low_error 1
54
+ new_1w_low_error 3
55
+ old_low_error 0
56
+ suppressed_high_pass 2
57
+ suppressed_high_fail 2
58
+ suppressed_high_warn 2
59
+ suppressed_high_error 3
60
+ suppressed_medium_pass 4
61
+ suppressed_medium_fail 2
62
+ suppressed_medium_warn 4
63
+ suppressed_medium_error 4
64
+ suppressed_low_pass 0
65
+ suppressed_low_fail 4
66
+ suppressed_low_warn 0
67
+ suppressed_low_error 4
68
+ new_1h_high_info 1
69
+ new_1d_high_info 4
70
+ new_1w_high_info 0
71
+ old_high_info 0
72
+ new_1h_medium_info 0
73
+ new_1d_medium_info 2
74
+ new_1w_medium_info 1
75
+ old_medium_info 2
76
+ new_1h_low_info 0
77
+ new_1d_low_info 2
78
+ new_1w_low_info 1
79
+ old_low_info 1
80
+ suppressed_high_info 0
81
+ suppressed_medium_info 2
82
+ suppressed_low_info 1
83
+ relationships do
84
+ { signature: {
85
+ data:
86
+ {
87
+ id: "1",
88
+ type: "signatures"
89
+ },
90
+ links: {
91
+ related: "http://test.host/api/v2/signatures/1.json"
92
+ }
93
+ }
94
+ }
95
+ end
96
+ end
97
+ end
@@ -0,0 +1,129 @@
1
+ FactoryGirl.define do
2
+ factory :stat, class: 'ESP::Stat' do
3
+ skip_create
4
+
5
+ sequence(:id) { |n| n }
6
+ type "stats"
7
+ total 47
8
+ total_suppressed 38
9
+ new_1h_high_pass 3
10
+ new_1d_high_pass 4
11
+ new_1w_high_pass 2
12
+ old_high_pass 2
13
+ new_1h_high_fail 3
14
+ new_1d_high_fail 0
15
+ new_1w_high_fail 0
16
+ old_high_fail 1
17
+ new_1h_high_warn 3
18
+ new_1d_high_warn 0
19
+ new_1w_high_warn 1
20
+ old_high_warn 0
21
+ new_1h_high_error 4
22
+ new_1d_high_error 4
23
+ new_1w_high_error 4
24
+ old_high_error 2
25
+ new_1h_medium_pass 4
26
+ new_1d_medium_pass 0
27
+ new_1w_medium_pass 1
28
+ old_medium_pass 2
29
+ new_1h_medium_fail 2
30
+ new_1d_medium_fail 0
31
+ new_1w_medium_fail 3
32
+ old_medium_fail 2
33
+ new_1h_medium_warn 0
34
+ new_1d_medium_warn 2
35
+ new_1w_medium_warn 1
36
+ old_medium_warn 1
37
+ new_1h_medium_error 2
38
+ new_1d_medium_error 2
39
+ new_1w_medium_error 3
40
+ old_medium_error 1
41
+ new_1h_low_pass 4
42
+ new_1d_low_pass 0
43
+ new_1w_low_pass 0
44
+ old_low_pass 4
45
+ new_1h_low_fail 0
46
+ new_1d_low_fail 4
47
+ new_1w_low_fail 2
48
+ old_low_fail 2
49
+ new_1h_low_warn 2
50
+ new_1d_low_warn 2
51
+ new_1w_low_warn 2
52
+ old_low_warn 0
53
+ new_1h_low_error 1
54
+ new_1d_low_error 1
55
+ new_1w_low_error 0
56
+ old_low_error 1
57
+ suppressed_high_pass 3
58
+ suppressed_high_fail 1
59
+ suppressed_high_warn 4
60
+ suppressed_high_error 3
61
+ suppressed_medium_pass 2
62
+ suppressed_medium_fail 0
63
+ suppressed_medium_warn 3
64
+ suppressed_medium_error 4
65
+ suppressed_low_pass 3
66
+ suppressed_low_fail 3
67
+ suppressed_low_warn 2
68
+ suppressed_low_error 3
69
+ new_1h_high_info 0
70
+ new_1d_high_info 4
71
+ new_1w_high_info 2
72
+ old_high_info 1
73
+ new_1h_medium_info 1
74
+ new_1d_medium_info 2
75
+ new_1w_medium_info 1
76
+ old_medium_info 3
77
+ new_1h_low_info 1
78
+ new_1d_low_info 2
79
+ new_1w_low_info 3
80
+ old_low_info 0
81
+ suppressed_high_info 4
82
+ suppressed_medium_info 1
83
+ suppressed_low_info 2
84
+ relationships do
85
+ { report: {
86
+ data: {
87
+ id: "3",
88
+ type: "reports"
89
+ },
90
+ links: {
91
+ related: "http://test.host/api/v2/reports/3.json"
92
+ }
93
+ },
94
+ regions: {
95
+ data: [
96
+ {
97
+ id: "3",
98
+ type: "stat_regions"
99
+ }
100
+ ]
101
+ },
102
+ services: {
103
+ data: [
104
+ {
105
+ id: "3",
106
+ type: "stat_services"
107
+ }
108
+ ]
109
+ },
110
+ signatures: {
111
+ data: [
112
+ {
113
+ id: "3",
114
+ type: "stat_signatures"
115
+ }
116
+ ]
117
+ },
118
+ custom_signatures: {
119
+ data: [
120
+ {
121
+ id: "3",
122
+ type: "stat_custom_signatures"
123
+ }
124
+ ]
125
+ }
126
+ }
127
+ end
128
+ end
129
+ end
@@ -0,0 +1,34 @@
1
+ FactoryGirl.define do
2
+ factory :sub_organization, class: 'ESP::SubOrganization' do
3
+ skip_create
4
+
5
+ sequence(:id) { |n| n }
6
+ type "sub_organizations"
7
+ name "Default Sub Organization"
8
+ created_at { Time.current }
9
+ updated_at { Time.current }
10
+ relationships do
11
+ { organization: {
12
+ data: {
13
+ type: "organizations",
14
+ id: "45"
15
+ },
16
+ links: {
17
+ related: "http://localhost:3000/api/v2/organizations/45.json"
18
+ }
19
+ },
20
+ teams: {
21
+ data: [
22
+ {
23
+ type: "teams",
24
+ id: "33"
25
+ }
26
+ ],
27
+ links: {
28
+ related: "http://localhost:3000/api/v2/teams.json?q%5Bsub_organization_id_eq%5D=34"
29
+ }
30
+ }
31
+ }
32
+ end
33
+ end
34
+ end