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.
- checksums.yaml +4 -4
- data/.gitignore +0 -2
- data/.rubocop.yml +53 -6
- data/.ruby-version +1 -1
- data/.travis.yml +8 -2
- data/Gemfile.lock +171 -0
- data/Guardfile +47 -0
- data/README.md +230 -5
- data/Rakefile +14 -1
- data/assets/logo.png +0 -0
- data/bin/esp_console +71 -0
- data/esp_sdk.gemspec +27 -18
- data/lib/esp/exceptions.rb +3 -0
- data/lib/esp/extensions/active_resource/formats/json_api_format.rb +105 -0
- data/lib/esp/extensions/active_resource/paginated_collection.rb +198 -0
- data/lib/esp/extensions/active_resource/validations.rb +45 -0
- data/lib/esp/resources/alert.rb +135 -0
- data/lib/esp/resources/cloud_trail_event.rb +45 -0
- data/lib/esp/resources/concerns/stat_totals.rb +79 -0
- data/lib/esp/resources/contact_request.rb +42 -0
- data/lib/esp/resources/custom_signature.rb +224 -0
- data/lib/esp/resources/dashboard.rb +31 -0
- data/lib/esp/resources/external_account.rb +89 -0
- data/lib/esp/resources/organization.rb +61 -0
- data/lib/esp/resources/region.rb +46 -0
- data/lib/esp/resources/report.rb +100 -0
- data/lib/esp/resources/resource.rb +66 -0
- data/lib/esp/resources/service.rb +31 -0
- data/lib/esp/resources/signature.rb +106 -0
- data/lib/esp/resources/stat.rb +124 -0
- data/lib/esp/resources/stat_custom_signature.rb +121 -0
- data/lib/esp/resources/stat_region.rb +121 -0
- data/lib/esp/resources/stat_service.rb +121 -0
- data/lib/esp/resources/stat_signature.rb +121 -0
- data/lib/esp/resources/sub_organization.rb +69 -0
- data/lib/esp/resources/suppression/region.rb +99 -0
- data/lib/esp/resources/suppression/signature.rb +107 -0
- data/lib/esp/resources/suppression/unique_identifier.rb +60 -0
- data/lib/esp/resources/suppression.rb +86 -0
- data/lib/esp/resources/tag.rb +45 -0
- data/lib/esp/resources/team.rb +79 -0
- data/lib/esp/resources/user.rb +46 -0
- data/lib/esp/version.rb +3 -0
- data/lib/esp.rb +95 -0
- data/lib/esp_sdk.rb +9 -45
- data/lib/tasks/rubocop.rake +2 -0
- data/lib/tasks/testing.rake +3 -0
- data/rdoc/ActiveResource/Formats.html +176 -0
- data/rdoc/ActiveResource/PaginatedCollection.html +910 -0
- data/rdoc/ActiveResource.html +180 -0
- data/rdoc/ESP/Alert.html +771 -0
- data/rdoc/ESP/CloudTrailEvent.html +375 -0
- data/rdoc/ESP/ContactRequest.html +366 -0
- data/rdoc/ESP/CustomSignature.html +746 -0
- data/rdoc/ESP/Dashboard.html +355 -0
- data/rdoc/ESP/ExternalAccount.html +565 -0
- data/rdoc/ESP/Organization.html +590 -0
- data/rdoc/ESP/Region.html +399 -0
- data/rdoc/ESP/Report.html +622 -0
- data/rdoc/ESP/Service.html +380 -0
- data/rdoc/ESP/Signature.html +555 -0
- data/rdoc/ESP/Stat.html +1778 -0
- data/rdoc/ESP/StatCustomSignature.html +1599 -0
- data/rdoc/ESP/StatRegion.html +1598 -0
- data/rdoc/ESP/StatService.html +1598 -0
- data/rdoc/ESP/StatSignature.html +1598 -0
- data/rdoc/ESP/SubOrganization.html +540 -0
- data/rdoc/ESP/Suppression/Region.html +454 -0
- data/rdoc/ESP/Suppression/Signature.html +470 -0
- data/rdoc/ESP/Suppression/UniqueIdentifier.html +417 -0
- data/rdoc/ESP/Suppression.html +649 -0
- data/rdoc/ESP/Tag.html +371 -0
- data/rdoc/ESP/Team.html +584 -0
- data/rdoc/ESP/User.html +483 -0
- data/rdoc/ESP.html +546 -0
- data/rdoc/README_md.html +501 -0
- data/rdoc/created.rid +30 -0
- data/rdoc/images/add.png +0 -0
- data/rdoc/images/arrow_up.png +0 -0
- data/rdoc/images/brick.png +0 -0
- data/rdoc/images/brick_link.png +0 -0
- data/rdoc/images/bug.png +0 -0
- data/rdoc/images/bullet_black.png +0 -0
- data/rdoc/images/bullet_toggle_minus.png +0 -0
- data/rdoc/images/bullet_toggle_plus.png +0 -0
- data/rdoc/images/date.png +0 -0
- data/rdoc/images/delete.png +0 -0
- data/rdoc/images/find.png +0 -0
- data/rdoc/images/loadingAnimation.gif +0 -0
- data/rdoc/images/macFFBgHack.png +0 -0
- data/rdoc/images/package.png +0 -0
- data/rdoc/images/page_green.png +0 -0
- data/rdoc/images/page_white_text.png +0 -0
- data/rdoc/images/page_white_width.png +0 -0
- data/rdoc/images/plugin.png +0 -0
- data/rdoc/images/ruby.png +0 -0
- data/rdoc/images/tag_blue.png +0 -0
- data/rdoc/images/tag_green.png +0 -0
- data/rdoc/images/transparent.png +0 -0
- data/rdoc/images/wrench.png +0 -0
- data/rdoc/images/wrench_orange.png +0 -0
- data/rdoc/images/zoom.png +0 -0
- data/rdoc/index.html +134 -0
- data/rdoc/js/darkfish.js +155 -0
- data/rdoc/js/jquery.js +4 -0
- data/rdoc/js/navigation.js +142 -0
- data/rdoc/js/search.js +94 -0
- data/rdoc/js/search_index.js +1 -0
- data/rdoc/js/searcher.js +228 -0
- data/rdoc/rdoc.css +595 -0
- data/rdoc/table_of_contents.html +927 -0
- data/test/esp/extensions/active_resource/formats/json_api_format_test.rb +109 -0
- data/test/esp/extensions/active_resource/paginated_collection_test.rb +435 -0
- data/test/esp/extensions/active_resource/validations_test.rb +59 -0
- data/test/esp/resources/alert_test.rb +263 -0
- data/test/esp/resources/cloud_trail_event_test.rb +98 -0
- data/test/esp/resources/contact_request_test.rb +73 -0
- data/test/esp/resources/custom_signature_test.rb +241 -0
- data/test/esp/resources/dashboard_test.rb +71 -0
- data/test/esp/resources/external_account_test.rb +125 -0
- data/test/esp/resources/organization_test.rb +175 -0
- data/test/esp/resources/region_test.rb +84 -0
- data/test/esp/resources/report_test.rb +180 -0
- data/test/esp/resources/resource_test.rb +183 -0
- data/test/esp/resources/service_test.rb +64 -0
- data/test/esp/resources/signature_test.rb +177 -0
- data/test/esp/resources/stat_custom_signature_test.rb +115 -0
- data/test/esp/resources/stat_region_test.rb +114 -0
- data/test/esp/resources/stat_service_test.rb +114 -0
- data/test/esp/resources/stat_signature_test.rb +115 -0
- data/test/esp/resources/stat_test.rb +159 -0
- data/test/esp/resources/sub_organization_test.rb +127 -0
- data/test/esp/resources/suppression/region_test.rb +115 -0
- data/test/esp/resources/suppression/signature_test.rb +117 -0
- data/test/esp/resources/suppression/unique_identifier_test.rb +79 -0
- data/test/esp/resources/suppression_test.rb +226 -0
- data/test/esp/resources/tag_test.rb +98 -0
- data/test/esp/resources/team_test.rb +140 -0
- data/test/esp/resources/user_test.rb +113 -0
- data/test/esp_test.rb +139 -0
- data/test/factories/alerts.rb +234 -0
- data/test/factories/cloud_trail_events.rb +16 -0
- data/test/factories/contact_requests.rb +14 -0
- data/test/factories/custom_signatures.rb +30 -0
- data/test/factories/dashboards.rb +91 -0
- data/test/factories/errors.rb +24 -0
- data/test/factories/external_accounts.rb +44 -0
- data/test/factories/organizations.rb +48 -0
- data/test/factories/regions.rb +9 -0
- data/test/factories/reports.rb +56 -0
- data/test/factories/services.rb +12 -0
- data/test/factories/signatures.rb +28 -0
- data/test/factories/stat_custom_signatures.rb +97 -0
- data/test/factories/stat_regions.rb +97 -0
- data/test/factories/stat_services.rb +97 -0
- data/test/factories/stat_signautures.rb +97 -0
- data/test/factories/stats.rb +129 -0
- data/test/factories/sub_organizations.rb +34 -0
- data/test/factories/suppression/regions.rb +90 -0
- data/test/factories/suppression/signatures.rb +117 -0
- data/test/factories/suppression/unique_identifiers.rb +111 -0
- data/test/factories/suppressions.rb +71 -0
- data/test/factories/tags.rb +12 -0
- data/test/factories/teams.rb +32 -0
- data/test/factories/users.rb +54 -0
- data/test/json_strategy.rb +25 -0
- data/test/test_helper.rb +44 -5
- metadata +387 -119
- data/bin/esp_repl +0 -60
- data/lib/esp_sdk/api.rb +0 -33
- data/lib/esp_sdk/client.rb +0 -62
- data/lib/esp_sdk/configure.rb +0 -40
- data/lib/esp_sdk/end_points/base.rb +0 -102
- data/lib/esp_sdk/end_points/contact_requests.rb +0 -6
- data/lib/esp_sdk/end_points/custom_signatures.rb +0 -41
- data/lib/esp_sdk/end_points/dashboard.rb +0 -35
- data/lib/esp_sdk/end_points/external_accounts.rb +0 -9
- data/lib/esp_sdk/end_points/organizations.rb +0 -6
- data/lib/esp_sdk/end_points/reports.rb +0 -6
- data/lib/esp_sdk/end_points/services.rb +0 -6
- data/lib/esp_sdk/end_points/signatures.rb +0 -39
- data/lib/esp_sdk/end_points/sub_organizations.rb +0 -6
- data/lib/esp_sdk/end_points/teams.rb +0 -6
- data/lib/esp_sdk/end_points/users.rb +0 -6
- data/lib/esp_sdk/exceptions.rb +0 -8
- data/lib/esp_sdk/extensions/rest_client/request.rb +0 -9
- data/lib/esp_sdk/repl.rb +0 -61
- data/lib/esp_sdk/version.rb +0 -3
- data/test/esp_sdk/api_test.rb +0 -36
- data/test/esp_sdk/client_test.rb +0 -129
- data/test/esp_sdk/configure_test.rb +0 -65
- data/test/esp_sdk/end_points/.keep +0 -0
- data/test/esp_sdk/end_points/base_test.rb +0 -230
- data/test/esp_sdk/end_points/custom_signatures_test.rb +0 -90
- data/test/esp_sdk/end_points/dashboard_test.rb +0 -55
- data/test/esp_sdk/end_points/external_accounts_test.rb +0 -20
- data/test/esp_sdk/end_points/signatures_test.rb +0 -83
- data/test/esp_sdk/exceptions_test.rb +0 -41
- 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,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,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
|