3scale-api 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/3scale/api/client.rb +33 -5
- data/lib/3scale/api/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 534c8d32f7f151a610d59cf1b006072ecef44df853ea9bc3598768182aef2409
|
4
|
+
data.tar.gz: c756d62437992a2557953dac7aa6e8eac1d81a2c9bdd95bd844edf8bd6ffba07
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6df107eed792c7b7d2d58a6aaa8badef812195a708b024c3ec8e852afe995c020f9dd4198e6ffd25b89728d3fe76de41fb206b90f551ea00feb0c2d372476019
|
7
|
+
data.tar.gz: c06697d2021cfe41454f49e3eb8c2c90d7e811169fa30ab298fa6a025fd8faa8c3d04556983b843e55c43e8039fdf4852bd8dfdaf33dc0f6113fe23dcea66826
|
data/lib/3scale/api/client.rb
CHANGED
@@ -138,7 +138,7 @@ module ThreeScale
|
|
138
138
|
# @api public
|
139
139
|
# @return [Hash]
|
140
140
|
# @param [Fixnum] service_id Service ID
|
141
|
-
# @param [String] environment. Must be 'sandbox' or 'production'
|
141
|
+
# @param [String] environment. Must be 'sandbox' or 'production'
|
142
142
|
def proxy_config_list(service_id, environment='sandbox')
|
143
143
|
response = http_client.get("/admin/api/services/#{service_id}/proxy/configs/#{environment}")
|
144
144
|
extract(entity: 'proxy', from: response)
|
@@ -147,7 +147,7 @@ module ThreeScale
|
|
147
147
|
# @api public
|
148
148
|
# @return [Hash]
|
149
149
|
# @param [Fixnum] service_id Service ID
|
150
|
-
# @param [String] environment. Must be 'sandbox' or 'production'
|
150
|
+
# @param [String] environment. Must be 'sandbox' or 'production'
|
151
151
|
def proxy_config_latest(service_id, environment='sandbox')
|
152
152
|
response = http_client.get("/admin/api/services/#{service_id}/proxy/configs/#{environment}/latest")
|
153
153
|
extract(entity: 'proxy', from: response)
|
@@ -256,6 +256,15 @@ module ThreeScale
|
|
256
256
|
extract(entity: 'method', from: response)
|
257
257
|
end
|
258
258
|
|
259
|
+
# @api public
|
260
|
+
# @param [Fixnum] application_plan_id Application Plan ID
|
261
|
+
# @param [Fixnum] metric_id Metric ID
|
262
|
+
# @return [Hash]
|
263
|
+
def list_metric_limits(application_plan_id, metric_id)
|
264
|
+
response = http_client.get("/admin/api/application_plans/#{application_plan_id}/metrics/#{metric_id}/limits")
|
265
|
+
extract(collection: 'limits', entity: 'limit', from: response)
|
266
|
+
end
|
267
|
+
|
259
268
|
# @api public
|
260
269
|
# @return [Array<Hash>]
|
261
270
|
# @param [Fixnum] service_id Service ID
|
@@ -305,6 +314,15 @@ module ThreeScale
|
|
305
314
|
true
|
306
315
|
end
|
307
316
|
|
317
|
+
# @api public
|
318
|
+
# @param [Fixnum] service_id Service ID
|
319
|
+
# @param [Fixnum] application_plan_id Application Plan ID
|
320
|
+
# @return [Hash]
|
321
|
+
def application_plan_as_default(service_id, application_plan_id)
|
322
|
+
response = http_client.put("/admin/api/services/#{service_id}/application_plans/#{application_plan_id}/default")
|
323
|
+
extract(entity: 'application_plan', from: response)
|
324
|
+
end
|
325
|
+
|
308
326
|
# @api public
|
309
327
|
# @return [Array<Hash>]
|
310
328
|
# @param [Fixnum] application_plan_id Application Plan ID
|
@@ -317,16 +335,26 @@ module ThreeScale
|
|
317
335
|
# @api public
|
318
336
|
# @return [Hash]
|
319
337
|
# @param [Fixnum] application_plan_id Application Plan ID
|
320
|
-
# @param [Hash] attributes Metric Attributes
|
321
338
|
# @param [Fixnum] metric_id Metric ID
|
322
|
-
# @
|
323
|
-
# @option attributes [String] :value Usage Limit value
|
339
|
+
# @param [Hash] attributes Limit Attributes
|
324
340
|
def create_application_plan_limit(application_plan_id, metric_id, attributes)
|
325
341
|
response = http_client.post("/admin/api/application_plans/#{application_plan_id}/metrics/#{metric_id}/limits",
|
326
342
|
body: { usage_limit: attributes })
|
327
343
|
extract(entity: 'limit', from: response)
|
328
344
|
end
|
329
345
|
|
346
|
+
# @api public
|
347
|
+
# @return [Hash]
|
348
|
+
# @param [Fixnum] application_plan_id Application Plan ID
|
349
|
+
# @param [Fixnum] metric_id Metric ID
|
350
|
+
# @param [Fixnum] limit_id Usage Limit ID
|
351
|
+
# @param [Hash] attributes Limit Attributes
|
352
|
+
def update_application_plan_limit(application_plan_id, metric_id, limit_id, attributes)
|
353
|
+
response = http_client.put("/admin/api/application_plans/#{application_plan_id}/metrics/#{metric_id}/limits/#{limit_id}",
|
354
|
+
body: { usage_limit: attributes })
|
355
|
+
extract(entity: 'limit', from: response)
|
356
|
+
end
|
357
|
+
|
330
358
|
# @param [Fixnum] application_plan_id Application Plan ID
|
331
359
|
# @param [Fixnum] metric_id Metric ID
|
332
360
|
# @param [Fixnum] limit_id Usage Limit ID
|
data/lib/3scale/api/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: 3scale-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michal Cichra
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2019-
|
12
|
+
date: 2019-05-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|