3scale-api 0.1.8 → 0.1.9

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b1445e270241502bdce63974ebc160fc1c91ddc6a6f9b82a4704b15d079fbc3e
4
- data.tar.gz: 9e59856615750458376342fd25a1279de1afb530c897a0902b41dd48ab1def12
3
+ metadata.gz: 67f1761515409caf851bf106a36040346d0b0d313cad3e8bace3b02d5a0ae6d0
4
+ data.tar.gz: 9f149409d6a9358c3b91112e890da79d70771cc6e109d7d2b8146a69672ee474
5
5
  SHA512:
6
- metadata.gz: fb21bf527eaa118ef88b0ad182e8d48e1f45e97425a9a721bb18fd9c8aa4355d8baf9eace6aa1040d3e5c9213fe14028bdd0c00486c51605815de88cfa324366
7
- data.tar.gz: f3dbbfcceaf1a2b52e59b8d411b9093f9c5954cdfa4883694164baac59f762d615d7b611e674465d750158c63919741639ff433301a2c9a006529824f73c3216
6
+ metadata.gz: effe200f56049db818f217e1cf37345ec9162da1fe3c9a58a1a19eafed3cd43f0bd0942bcddf830eb96be6b7fcaea05dbc7a867d512de5842c0ed8e92c782fa0
7
+ data.tar.gz: d36bbf4325aa45971cfa196fc673b8ef764d23795cd28fe6d6930012b29f4a3c434223b152aa0150ba0280081040f6cb98e0c574cbcfaa22e91cfa95530aa9f6
data/README.md CHANGED
@@ -55,15 +55,10 @@ For running the integration tests you will need to have a real 3scale account, y
55
55
  ```
56
56
  ENDPOINT=https://your-domain-admin.3scale.net
57
57
  PROVIDER_KEY=abc123
58
- SERVICE_ID=12345
59
- METRIC_ID=12345 # should be a numeric value, not the system name
60
- APPLICATION_PLAN_ID=12345
61
58
  VERIFY_SSL=true (by default true)
62
59
  ```
63
60
 
64
61
  **Note:** for the tests to pass the following requirements need to be met:
65
- - authorization mode of the service should be *API key*
66
- - there should be at least 1 method for the 'hits' metric
67
62
  - the field `billing_address` should be added to the Account model in **Settings > Fields Definitions**
68
63
 
69
64
  To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
@@ -51,7 +51,7 @@ module ThreeScale
51
51
  # @return [Hash]
52
52
  # @param [Fixnum] id Application ID
53
53
  # @param [String] user_key Application User Key
54
- # @param [String] application_id Application App ID
54
+ # @param [String] application_id Application app_id
55
55
  def find_application(id: nil, user_key: nil, application_id: nil)
56
56
  params = { application_id: id, user_key: user_key, app_id: application_id }.reject { |_, value| value.nil? }
57
57
  response = http_client.get('/admin/api/applications/find', params: params)
@@ -82,6 +82,15 @@ module ThreeScale
82
82
  extract(entity: 'application_plan', from: response)
83
83
  end
84
84
 
85
+ # @api public
86
+ # @return [Hash] a Plan
87
+ # @param [Fixnum] account_id Account ID
88
+ # @param [Fixnum] application_id Application ID
89
+ def delete_application_plan_customization(account_id, application_id)
90
+ response = http_client.put("/admin/api/accounts/#{account_id}/applications/#{application_id}/decustomize_plan")
91
+ extract(entity: 'application_plan', from: response)
92
+ end
93
+
85
94
  # @api public
86
95
  # @return [Hash] an Account
87
96
  # @param [String] name Account Name
@@ -369,6 +378,47 @@ module ThreeScale
369
378
  true
370
379
  end
371
380
 
381
+ # @api public
382
+ # @return [Array<Hash>]
383
+ def list_accounts
384
+ response = http_client.get('/admin/api/accounts')
385
+ extract(collection: 'accounts', entity: 'account', from: response)
386
+ end
387
+
388
+ # @api public
389
+ # @param [Fixnum] account_id Account ID
390
+ # @return [Bool]
391
+ def delete_account(id)
392
+ http_client.delete("/admin/api/accounts/#{id}")
393
+ true
394
+ end
395
+
396
+ # @api public
397
+ # @param [Fixnum] account_id Account ID
398
+ # @param [Fixnum] application_id Application ID
399
+ # @return [Bool]
400
+ def delete_application(account_id, id)
401
+ http_client.delete("/admin/api/accounts/#{account_id}/applications/#{id}")
402
+ true
403
+ end
404
+
405
+ # @api public
406
+ # @param [Fixnum] id Service ID
407
+ # @return [Array<Hash>]
408
+ def show_oidc(service_id)
409
+ response = http_client.get("/admin/api/services/#{service_id}/proxy/oidc_configuration")
410
+ extract(entity: 'oidc_configuration', from: response)
411
+ end
412
+
413
+ # @api public
414
+ # @param [Fixnum] id Service ID
415
+ # @return [Hash]
416
+ def update_oidc(service_id, attributes)
417
+ response = http_client.patch("/admin/api/services/#{service_id}/proxy/oidc_configuration",
418
+ body: { oidc_configuration: attributes })
419
+ extract(entity: 'oidc_configuration', from: response)
420
+ end
421
+
372
422
  protected
373
423
 
374
424
  def extract(collection: nil, entity:, from:)
@@ -1,5 +1,5 @@
1
1
  module ThreeScale
2
2
  module API
3
- VERSION = '0.1.8'.freeze
3
+ VERSION = '0.1.9'.freeze
4
4
  end
5
5
  end
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.1.8
4
+ version: 0.1.9
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-03-06 00:00:00.000000000 Z
12
+ date: 2019-03-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler