3scale-api 0.1.3 → 0.1.4
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 +50 -0
- data/lib/3scale/api/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 94f03fe320fe39054fded73ddd6fe765a1dc6057
|
4
|
+
data.tar.gz: b4f7f3e2b07138c733aff57cdd419406c5d5b72b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c6089e0ffb2bfdc0942506531d7cadf10287217fa2a6f344c0e7e79c914994df3db93a9d6d35cbc35235833c8e247ae5d2592f6f0ba6c404f1dcef1ffdd01aa
|
7
|
+
data.tar.gz: 111169a40674449ac58bfaa837bd29ea6ef8fd58663e98c7a9a9061b4ae7ba1f4c0c3ba3c00ed40056f44d2ab392373e5e8e1b9bd00f4d5ca06bec2b9fc60b01
|
data/lib/3scale/api/client.rb
CHANGED
@@ -34,6 +34,56 @@ module ThreeScale
|
|
34
34
|
extract(collection: 'applications', entity: 'application', from: response)
|
35
35
|
end
|
36
36
|
|
37
|
+
# @api public
|
38
|
+
# @return [Hash]
|
39
|
+
# @param [Fixnum] id Application ID
|
40
|
+
def show_application(id)
|
41
|
+
find_application(id: id)
|
42
|
+
end
|
43
|
+
|
44
|
+
# @api public
|
45
|
+
# @return [Hash]
|
46
|
+
# @param [Fixnum] id Application ID
|
47
|
+
# @param [String] user_key Application User Key
|
48
|
+
# @param [String] application_id Application App ID
|
49
|
+
def find_application(id: nil, user_key: nil, application_id: nil)
|
50
|
+
params = { application_id: id, user_key: user_key, app_id: application_id }.reject { |_,value| value.nil? }
|
51
|
+
response = http_client.get('/admin/api/applications/find', params: params)
|
52
|
+
extract(entity: 'application', from: response)
|
53
|
+
end
|
54
|
+
|
55
|
+
# @api public
|
56
|
+
# @return [Hash] an Application
|
57
|
+
# @param [Fixnum] plan_id Application Plan ID
|
58
|
+
# @param [Hash] attributes Application Attributes
|
59
|
+
# @option attributes [String] :name Application Name
|
60
|
+
# @option attributes [String] :description Application Description
|
61
|
+
# @option attributes [String] :user_key Application User Key
|
62
|
+
# @option attributes [String] :application_id Application App ID
|
63
|
+
# @option attributes [String] :application_key Application App Key(s)
|
64
|
+
def create_application(account_id, attributes = {}, plan_id: , **rest)
|
65
|
+
body = { plan_id: plan_id }.merge(attributes).merge(rest)
|
66
|
+
response = http_client.post("/admin/api/accounts/#{account_id}/applications", body: body)
|
67
|
+
extract(entity: 'application', from: response)
|
68
|
+
end
|
69
|
+
|
70
|
+
# @api public
|
71
|
+
# @return [Hash] an Account
|
72
|
+
# @param [String] name Account Name
|
73
|
+
# @param [String] username User Username
|
74
|
+
# @param [Hash] attributes User and Account Attributes
|
75
|
+
# @option attributes [String] :email User Email
|
76
|
+
# @option attributes [String] :password User Password
|
77
|
+
# @option attributes [String] :account_plan_id Account Plan ID
|
78
|
+
# @option attributes [String] :service_plan_id Service Plan ID
|
79
|
+
# @option attributes [String] :application_plan_id Application Plan ID
|
80
|
+
def signup(attributes = {}, name: , username: , **rest)
|
81
|
+
body = { org_name: name,
|
82
|
+
username: username }.merge(attributes).merge(rest)
|
83
|
+
response = http_client.post('/admin/api/signup', body: body)
|
84
|
+
extract(entity: 'account', from: response)
|
85
|
+
end
|
86
|
+
|
37
87
|
# @api public
|
38
88
|
# @return [Hash]
|
39
89
|
# @param [Hash] attributes Service Attributes
|
data/lib/3scale/api/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michal Cichra
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-05-
|
11
|
+
date: 2016-05-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|