pisoni 1.25.0 → 1.26.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e9b028a5986ee4a1afc4e1a07c3029e30861b4563b936084fc0c8f9c684b78f3
4
- data.tar.gz: '00391525ce6ea29046aed52421a9df0882bf878d0e9e8a25e336efb4674626e3'
3
+ metadata.gz: 1675046183f0f1221921e9e2637d5107875f6528a1f829467cbf6d634752f263
4
+ data.tar.gz: 593203983ca15e7249917cb66ceb3bdb9884585faa1fe1bc91e1ae4a88f341fc
5
5
  SHA512:
6
- metadata.gz: a2bd6747faf1121c04e66149bf60cbf0b246e5dffc893fb599988034b2609cf8fee2e4fafd54bdcfdbb7a246c0aae32958f93bb5e3d009f8da4645f10b7b3edb
7
- data.tar.gz: fced6e7795fffaf5489d63bb41cf911a1ad661aeb6e96bb99d8a897af6c9e04a903e7b64b687685c6f533329f9c9e32f82bd3a17c125eef7a71d285951d5ac4b
6
+ metadata.gz: bbd28ac55fa5feadf7cba3759e123f72f2df9c4b47fb63053d0f535fbf437cdea9a7dfcb8c75496ad4401ff84a72df1462f17d748f973000e3d6af294ecb6e4a
7
+ data.tar.gz: f4135e0196aa5e3d7ade69fd44f101bf5bb024ba36691125a93adb3dab75145df0f9a5664e47d3bb95b98b836f7362d145f2d416a9dfe244ba831d225b1db56d
data/CHANGELOG.md CHANGED
@@ -2,6 +2,16 @@
2
2
 
3
3
  Notable changes to Pisoni will be tracked in this document.
4
4
 
5
+ ## 1.26.0 - 2019-03-05
6
+
7
+ ### Added
8
+
9
+ - The stats of a service can now be deleted. [#19](https://github.com/3scale/pisoni/pull/19)
10
+
11
+ ### Changed
12
+
13
+ - Ruby 2.2 is no longer supported. The minimum version is 2.3.0. [#18](https://github.com/3scale/pisoni/pull/18)
14
+
5
15
  ## 1.25.0 - 2019-02-20
6
16
 
7
17
  ### Added
@@ -46,6 +46,10 @@ module ThreeScale
46
46
  save! id: service_id, default_service: true
47
47
  end
48
48
 
49
+ def delete_stats(service_id, delete_job)
50
+ api_delete(delete_job, uri: "#{service_uri(service_id)}/stats", prefix: '')
51
+ end
52
+
49
53
  private
50
54
 
51
55
  def service_uri(id)
@@ -1,5 +1,5 @@
1
1
  module ThreeScale
2
2
  module Core
3
- VERSION = '1.25.0'
3
+ VERSION = '1.26.0'
4
4
  end
5
5
  end
data/pisoni.gemspec CHANGED
@@ -39,5 +39,5 @@ Gem::Specification.new do |s|
39
39
 
40
40
  s.rdoc_options = ["--charset=UTF-8"]
41
41
 
42
- s.required_ruby_version = '>= 2.2.4'
42
+ s.required_ruby_version = '>= 2.3.0'
43
43
  end
data/spec/service_spec.rb CHANGED
@@ -220,6 +220,42 @@ module ThreeScale
220
220
  s.active?.must_equal false
221
221
  end
222
222
  end
223
+
224
+ describe '.delete_stats' do
225
+ let(:service_id) { default_service_id }
226
+ let(:applications) { %w[1 2 3] }
227
+ let(:metrics) { %w[10 20 30] }
228
+ let(:users) { %w[100 200 300] }
229
+ let(:from) { Time.new(2002, 10, 31).to_i }
230
+ let(:to) { Time.new(2003, 10, 31).to_i }
231
+ let(:delete_job) do
232
+ {
233
+ deletejobdef: {
234
+ applications: applications,
235
+ metrics: metrics,
236
+ users: users,
237
+ from: from,
238
+ to: to
239
+ }
240
+ }
241
+ end
242
+
243
+ describe 'with valid job' do
244
+ it 'does not raise error' do
245
+ Service.delete_stats(default_service_id, delete_job).must_equal true
246
+ end
247
+ end
248
+
249
+ describe 'with invalid job' do
250
+ # to < from
251
+ let(:to) { Time.new(2001, 10, 31).to_i }
252
+ it 'raises error' do
253
+ lambda {
254
+ Service.delete_stats(default_service_id, delete_job)
255
+ }.must_raise APIClient::APIError
256
+ end
257
+ end
258
+ end
223
259
  end
224
260
  end
225
261
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pisoni
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.25.0
4
+ version: 1.26.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alejandro Martinez Ruiz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-02-20 00:00:00.000000000 Z
11
+ date: 2019-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -151,14 +151,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
151
151
  requirements:
152
152
  - - ">="
153
153
  - !ruby/object:Gem::Version
154
- version: 2.2.4
154
+ version: 2.3.0
155
155
  required_rubygems_version: !ruby/object:Gem::Requirement
156
156
  requirements:
157
157
  - - ">="
158
158
  - !ruby/object:Gem::Version
159
159
  version: '0'
160
160
  requirements: []
161
- rubygems_version: 3.0.1
161
+ rubygems_version: 3.0.2
162
162
  signing_key:
163
163
  specification_version: 4
164
164
  summary: Client for the Apisonator internal API for model data