NCCConfidence 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/NCCConfidence.gemspec +1 -1
- data/README.md +90 -2
- data/lib/nccconfidence/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3d07d7266db01ee983d3cd4ef830035b9dfef784
|
4
|
+
data.tar.gz: d021188d2b45610f2b54e80a73c56db17ff262bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f698dbd2a0e329813f84242286f5affa17072b05bc9d93d275080733137cfb492abb6f983bb1036f67c0310d6155551ba34ac642fba771fd53a14594243122f2
|
7
|
+
data.tar.gz: 8cbc88353d7d7d2d126fe296a7be9d8a7b01878fd125a6034c9954daaf4a15ca2879fb8903745da514b65ddeb3ba6bc54ea24ab38becbf64a5e78199e436a5e6
|
data/NCCConfidence.gemspec
CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.require_paths = ["lib"]
|
21
21
|
|
22
22
|
spec.add_runtime_dependency "addressable" , "2.3.8"
|
23
|
-
spec.add_runtime_dependency "curb" , "0.
|
23
|
+
spec.add_runtime_dependency "curb" , "0.8.8"
|
24
24
|
spec.add_runtime_dependency "json" , "1.8.3"
|
25
25
|
|
26
26
|
spec.add_development_dependency "bundler", "~> 1.9"
|
data/README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# NCCConfidence
|
2
2
|
|
3
|
-
This is a gem to allow you
|
3
|
+
This is a gem to allow you to make requests to NCC Confidence's API.
|
4
4
|
|
5
|
-
It provides mechanims to allow easier creation of API
|
5
|
+
It provides mechanims to allow easier creation of API queries.
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
@@ -31,8 +31,96 @@ First set your current API key that you wish to use.
|
|
31
31
|
And then make a query.
|
32
32
|
|
33
33
|
```ruby
|
34
|
+
result = NCCConfidence.query do |test_filter,data_filter|
|
35
|
+
[test_filter.make do
|
36
|
+
account_id "BN5A64933"
|
37
|
+
id "MA2PG72611"
|
38
|
+
start_date "2015-08-12"
|
39
|
+
start_time "12:00:00"
|
40
|
+
end_date "2015-08-07"
|
41
|
+
end_time "07:05:05"
|
42
|
+
status_code 1
|
43
|
+
end,
|
44
|
+
data_filter.make do
|
45
|
+
object "Account" do
|
46
|
+
item "AccountId"
|
47
|
+
object "Pages" do
|
48
|
+
item "Page"
|
49
|
+
end
|
50
|
+
object "ServiceStatus" do
|
51
|
+
item "HighestStatusCode"
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end]
|
55
|
+
|
56
|
+
end
|
57
|
+
puts result
|
58
|
+
|
59
|
+
```
|
60
|
+
|
61
|
+
You can even store the filter blocks as `Procs` and pass them to the query block like this:
|
62
|
+
|
63
|
+
```ruby
|
64
|
+
|
65
|
+
t_filter = Proc.new do
|
66
|
+
account_id "BN5A64933"
|
67
|
+
id "MA2PG72611"
|
68
|
+
start_date "2015-08-12"
|
69
|
+
start_time "12:00:00"
|
70
|
+
end_date "2015-08-07"
|
71
|
+
end_time "07:05:05"
|
72
|
+
status_code 1
|
73
|
+
end
|
74
|
+
|
75
|
+
d_filter = Proc.new do
|
76
|
+
object "Account" do
|
77
|
+
item "AccountId"
|
78
|
+
object "Pages" do
|
79
|
+
item "Page"
|
80
|
+
end
|
81
|
+
object "ServiceStatus" do
|
82
|
+
item "HighestStatusCode"
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
result = NCCConfidence.query do |test_filter,data_filter|
|
88
|
+
[test_filter.make(&t_filter),data_filter.make(&d_filter)]
|
89
|
+
end
|
90
|
+
puts result
|
34
91
|
```
|
35
92
|
|
93
|
+
That way you can make them re-usable or make the query easily changable by just switching which Procs you provide.
|
94
|
+
|
95
|
+
Please note you have to put both test_filter & data_filter into an array otherwise the client will only get one of the filters instead of an array of two two filters.
|
96
|
+
|
97
|
+
Here's a list of possible test filters:
|
98
|
+
+ account_id
|
99
|
+
+ id
|
100
|
+
+ start_date
|
101
|
+
+ start_time
|
102
|
+
+ end_date
|
103
|
+
+ end_time
|
104
|
+
+ start_timestamp
|
105
|
+
+ end_time_stamp
|
106
|
+
+ script_type
|
107
|
+
+ show_steps
|
108
|
+
+ limit_errors_open
|
109
|
+
+ offset_errors_open
|
110
|
+
+ limit_errors_closed
|
111
|
+
+ offset_errors_closed
|
112
|
+
+ limit_test_results
|
113
|
+
+ offset_test_results
|
114
|
+
+ up_time_min
|
115
|
+
+ up_time_max
|
116
|
+
+ kpi_min
|
117
|
+
+ kpi_max
|
118
|
+
+ status_code
|
119
|
+
+ result_code
|
120
|
+
+ exclude_re_test
|
121
|
+
+ format
|
122
|
+
|
123
|
+
|
36
124
|
## Development
|
37
125
|
|
38
126
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment.
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: NCCConfidence
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thermatix
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 0.8.8
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - '='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 0.8.8
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: json
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|