3scale-api 0.1.6 → 0.1.7
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/lib/3scale/api/client.rb +17 -0
- data/lib/3scale/api/http_client.rb +14 -1
- data/lib/3scale/api/version.rb +1 -1
- metadata +9 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df4b5b877c13c4884de2339922563deff07ce9ee994ea601d9288634f4cb17a1
|
4
|
+
data.tar.gz: e4a38f29ed58dbf4106caddf51bbe58e19e180a98b16c4fa34ee09ff39a330d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b8c0f57918d45bfd612d96a3bf18719f0bd5b1ae1db95ec1ea8b32a72cd36cfa897510368a0e2d63fa66e6386a2604c8f67ca9572dcc342fd632a19ce6302397
|
7
|
+
data.tar.gz: f92047a44226e2ad72a603b77727dd1e4f9b86323d0ef7191ceb29deb735ee1cac1a46bd60414b9c8fc0a62218cfb4da6fbfd1f8d988e1fbd15d3fc8b2c2a5ff
|
data/lib/3scale/api/client.rb
CHANGED
@@ -24,6 +24,13 @@ module ThreeScale
|
|
24
24
|
extract(collection: 'services', entity: 'service', from: response)
|
25
25
|
end
|
26
26
|
|
27
|
+
# @api public
|
28
|
+
# @param [Fixnum] id Service ID
|
29
|
+
def delete_service(id)
|
30
|
+
http_client.delete("/admin/api/services/#{id}")
|
31
|
+
true
|
32
|
+
end
|
33
|
+
|
27
34
|
# @api public
|
28
35
|
# @return [Array<Hash>]
|
29
36
|
# @param [Fixnum] service_id Service ID
|
@@ -242,6 +249,16 @@ module ThreeScale
|
|
242
249
|
extract(entity: 'application_plan', from: response)
|
243
250
|
end
|
244
251
|
|
252
|
+
|
253
|
+
# @api public
|
254
|
+
# @return [Bool]
|
255
|
+
# @param [Fixnum] service_id Service ID
|
256
|
+
# @param [Fixnum] application_plan_id Application Plan ID
|
257
|
+
def delete_application_plan(service_id,application_plan_id)
|
258
|
+
http_client.delete("/admin/api/services/#{service_id}/application_plans/#{application_plan_id}")
|
259
|
+
true
|
260
|
+
end
|
261
|
+
|
245
262
|
# @api public
|
246
263
|
# @return [Array<Hash>]
|
247
264
|
# @param [Fixnum] application_plan_id Application Plan ID
|
@@ -57,16 +57,29 @@ module ThreeScale
|
|
57
57
|
case response
|
58
58
|
when Net::HTTPUnprocessableEntity, Net::HTTPSuccess then parser.decode(response.body)
|
59
59
|
when Net::HTTPForbidden then forbidden!(response)
|
60
|
-
|
60
|
+
when Net::HTTPNotFound then notfound!(response)
|
61
|
+
else unexpected!(response.inspect)
|
61
62
|
end
|
62
63
|
end
|
63
64
|
|
64
65
|
class ForbiddenError < StandardError; end
|
65
66
|
|
67
|
+
class UnexpectedResponseError < StandardError; end
|
68
|
+
|
69
|
+
class NotFoundError < StandardError; end
|
70
|
+
|
66
71
|
def forbidden!(response)
|
67
72
|
raise ForbiddenError, response
|
68
73
|
end
|
69
74
|
|
75
|
+
def notfound!(response)
|
76
|
+
raise NotFoundError, response
|
77
|
+
end
|
78
|
+
|
79
|
+
def unexpected!(response)
|
80
|
+
raise UnexpectedResponseError, response
|
81
|
+
end
|
82
|
+
|
70
83
|
def serialize(body)
|
71
84
|
case body
|
72
85
|
when nil then nil
|
data/lib/3scale/api/version.rb
CHANGED
metadata
CHANGED
@@ -1,29 +1,30 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: 3scale-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michal Cichra
|
8
|
+
- Eguzki Astiz Lezaun
|
8
9
|
autorequire:
|
9
10
|
bindir: exe
|
10
11
|
cert_chain: []
|
11
|
-
date: 2018-
|
12
|
+
date: 2018-12-05 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: bundler
|
15
16
|
requirement: !ruby/object:Gem::Requirement
|
16
17
|
requirements:
|
17
|
-
- - "
|
18
|
+
- - ">="
|
18
19
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
20
|
+
version: '0'
|
20
21
|
type: :development
|
21
22
|
prerelease: false
|
22
23
|
version_requirements: !ruby/object:Gem::Requirement
|
23
24
|
requirements:
|
24
|
-
- - "
|
25
|
+
- - ">="
|
25
26
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
27
|
+
version: '0'
|
27
28
|
- !ruby/object:Gem::Dependency
|
28
29
|
name: rake
|
29
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -69,6 +70,7 @@ dependencies:
|
|
69
70
|
description: 'API Client to access your 3scale APIs: Account Management API'
|
70
71
|
email:
|
71
72
|
- michal@3scale.net
|
73
|
+
- eastizle@redhat.com
|
72
74
|
executables: []
|
73
75
|
extensions: []
|
74
76
|
extra_rdoc_files: []
|
@@ -79,7 +81,7 @@ files:
|
|
79
81
|
- lib/3scale/api/http_client.rb
|
80
82
|
- lib/3scale/api/version.rb
|
81
83
|
- lib/three_scale/api.rb
|
82
|
-
homepage: https://github.com/3scale/3scale-api-ruby
|
84
|
+
homepage: https://github.com/3scale/3scale-api-ruby
|
83
85
|
licenses:
|
84
86
|
- MIT
|
85
87
|
metadata: {}
|