megam_api 0.36 → 0.38
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -3
- data/lib/megam/api.rb +22 -3
- data/lib/megam/api/accounts.rb +15 -1
- data/lib/megam/api/availableunits.rb +35 -0
- data/lib/megam/api/balances.rb +46 -0
- data/lib/megam/api/billinghistories.rb +35 -0
- data/lib/megam/api/billings.rb +35 -0
- data/lib/megam/api/components.rb +2 -2
- data/lib/megam/api/credithistories.rb +35 -0
- data/lib/megam/api/discounts.rb +35 -0
- data/lib/megam/api/profile.rb +42 -0
- data/lib/megam/api/subscriptions.rb +35 -0
- data/lib/megam/api/version.rb +1 -1
- data/lib/megam/core/account.rb +85 -8
- data/lib/megam/core/assembly.rb +5 -9
- data/lib/megam/core/availableunits.rb +181 -0
- data/lib/megam/core/availableunits_collection.rb +144 -0
- data/lib/megam/core/balances.rb +201 -0
- data/lib/megam/core/balances_collection.rb +144 -0
- data/lib/megam/core/billinghistories.rb +206 -0
- data/lib/megam/core/billinghistories_collection.rb +144 -0
- data/lib/megam/core/billings.rb +242 -0
- data/lib/megam/core/billings_collection.rb +144 -0
- data/lib/megam/core/credithistories.rb +191 -0
- data/lib/megam/core/credithistories_collection.rb +144 -0
- data/lib/megam/core/discounts.rb +191 -0
- data/lib/megam/core/discounts_collection.rb +144 -0
- data/lib/megam/core/json_compat.rb +57 -15
- data/lib/megam/core/subscriptions.rb +191 -0
- data/lib/megam/core/subscriptions_collection.rb +144 -0
- data/megam_api.gemspec +2 -2
- data/test/test_accounts.rb +19 -0
- data/test/test_availableunits.rb +29 -0
- data/test/test_balances.rb +39 -0
- data/test/test_billinghistories.rb +31 -0
- data/test/test_billings.rb +34 -0
- data/test/test_credithistories.rb +30 -0
- data/test/test_discounts.rb +30 -0
- data/test/test_helper.rb +2 -2
- data/test/test_subscriptions.rb +30 -0
- metadata +61 -7
@@ -0,0 +1,29 @@
|
|
1
|
+
require File.expand_path("#{File.dirname(__FILE__)}/test_helper")
|
2
|
+
|
3
|
+
class TestApps < MiniTest::Unit::TestCase
|
4
|
+
#=begin
|
5
|
+
def test_post_availableunits1
|
6
|
+
tmp_hash = { :name => "name",
|
7
|
+
:duration => "duration",
|
8
|
+
:charges_per_duration => "charges_per_duration"
|
9
|
+
}
|
10
|
+
|
11
|
+
response = megams.post_availableunits(tmp_hash)
|
12
|
+
assert_equal(201, response.status)
|
13
|
+
end
|
14
|
+
#=end
|
15
|
+
|
16
|
+
=begin
|
17
|
+
def test_get_availableunits
|
18
|
+
response = megams.get_availableunits
|
19
|
+
assert_equal(200, response.status)
|
20
|
+
end
|
21
|
+
=end
|
22
|
+
=begin
|
23
|
+
def test_get_availableunits
|
24
|
+
response = megams.get_availableunit("iaas_default")
|
25
|
+
assert_equal(200, response.status)
|
26
|
+
end
|
27
|
+
=end
|
28
|
+
end
|
29
|
+
|
@@ -0,0 +1,39 @@
|
|
1
|
+
require File.expand_path("#{File.dirname(__FILE__)}/test_helper")
|
2
|
+
|
3
|
+
class TestApps < MiniTest::Unit::TestCase
|
4
|
+
=begin
|
5
|
+
def test_post_balances
|
6
|
+
tmp_hash = { :accounts_id => "ACT93476985797",
|
7
|
+
:credit => "50"
|
8
|
+
}
|
9
|
+
|
10
|
+
response = megams.post_balances(tmp_hash)
|
11
|
+
assert_equal(201, response.status)
|
12
|
+
end
|
13
|
+
=end
|
14
|
+
|
15
|
+
def test_update_balances
|
16
|
+
tmp_hash = {:id=>"BAL1200828423543586816",
|
17
|
+
:accounts_id=>"ACT1195015634723930112",
|
18
|
+
:credit=>"23",
|
19
|
+
:created_at=>"2015-04-17 12:33:40 +0000",
|
20
|
+
:updated_at=>"2015-04-17 12:33:40 +0000"
|
21
|
+
}
|
22
|
+
response = megams.update_balance(tmp_hash)
|
23
|
+
assert_equal(201, response.status)
|
24
|
+
end
|
25
|
+
|
26
|
+
=begin
|
27
|
+
def test_get_balances
|
28
|
+
response = megams.get_balances
|
29
|
+
assert_equal(200, response.status)
|
30
|
+
end
|
31
|
+
=end
|
32
|
+
=begin
|
33
|
+
def test_get_balances
|
34
|
+
response = megams.get_balance("iaas_default")
|
35
|
+
assert_equal(200, response.status)
|
36
|
+
end
|
37
|
+
=end
|
38
|
+
end
|
39
|
+
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require File.expand_path("#{File.dirname(__FILE__)}/test_helper")
|
2
|
+
|
3
|
+
class TestApps < MiniTest::Unit::TestCase
|
4
|
+
#=begin
|
5
|
+
def test_post_billinghistories
|
6
|
+
tmp_hash = { :accounts_id => "ACT93476985797",
|
7
|
+
:assembly_id => "ASM89687",
|
8
|
+
:bill_type => "paypal",
|
9
|
+
:billing_amount => "45",
|
10
|
+
:currency_type => "USD"
|
11
|
+
}
|
12
|
+
|
13
|
+
response = megams.post_billinghistories(tmp_hash)
|
14
|
+
assert_equal(201, response.status)
|
15
|
+
end
|
16
|
+
#=end
|
17
|
+
|
18
|
+
=begin
|
19
|
+
def test_get_billinghistories
|
20
|
+
response = megams.get_billinghistories
|
21
|
+
assert_equal(200, response.status)
|
22
|
+
end
|
23
|
+
=end
|
24
|
+
=begin
|
25
|
+
def test_get_billinghistories
|
26
|
+
response = megams.get_billinghistory("iaas_default")
|
27
|
+
assert_equal(200, response.status)
|
28
|
+
end
|
29
|
+
=end
|
30
|
+
end
|
31
|
+
|
@@ -0,0 +1,34 @@
|
|
1
|
+
require File.expand_path("#{File.dirname(__FILE__)}/test_helper")
|
2
|
+
|
3
|
+
class TestApps < MiniTest::Unit::TestCase
|
4
|
+
#=begin
|
5
|
+
def test_post_billings
|
6
|
+
tmp_hash = { :accounts_id => "ACT93476985797",
|
7
|
+
:line1 => "paypal",
|
8
|
+
:line2 => "#kjbh76",
|
9
|
+
:country_code => "",
|
10
|
+
:postal_code => "",
|
11
|
+
:state => "",
|
12
|
+
:phone => "",
|
13
|
+
:bill_type => ""
|
14
|
+
}
|
15
|
+
|
16
|
+
response = megams.post_billings(tmp_hash)
|
17
|
+
assert_equal(201, response.status)
|
18
|
+
end
|
19
|
+
#=end
|
20
|
+
|
21
|
+
=begin
|
22
|
+
def test_get_billings
|
23
|
+
response = megams.get_billings
|
24
|
+
assert_equal(200, response.status)
|
25
|
+
end
|
26
|
+
=end
|
27
|
+
=begin
|
28
|
+
def test_get_billings
|
29
|
+
response = megams.get_billing("iaas_default")
|
30
|
+
assert_equal(200, response.status)
|
31
|
+
end
|
32
|
+
=end
|
33
|
+
end
|
34
|
+
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require File.expand_path("#{File.dirname(__FILE__)}/test_helper")
|
2
|
+
|
3
|
+
class TestApps < MiniTest::Unit::TestCase
|
4
|
+
#=begin
|
5
|
+
def test_post_credithistories
|
6
|
+
tmp_hash = { :accounts_id => "ACT93476985797",
|
7
|
+
:bill_type => "paypal",
|
8
|
+
:credit_amount => "50",
|
9
|
+
:currency_type => ""
|
10
|
+
}
|
11
|
+
|
12
|
+
response = megams.post_credithistories(tmp_hash)
|
13
|
+
assert_equal(201, response.status)
|
14
|
+
end
|
15
|
+
#=end
|
16
|
+
|
17
|
+
=begin
|
18
|
+
def test_get_credithistories
|
19
|
+
response = megams.get_credithistories
|
20
|
+
assert_equal(200, response.status)
|
21
|
+
end
|
22
|
+
=end
|
23
|
+
=begin
|
24
|
+
def test_get_credithistories
|
25
|
+
response = megams.get_credithistories("iaas_default")
|
26
|
+
assert_equal(200, response.status)
|
27
|
+
end
|
28
|
+
=end
|
29
|
+
end
|
30
|
+
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require File.expand_path("#{File.dirname(__FILE__)}/test_helper")
|
2
|
+
|
3
|
+
class TestApps < MiniTest::Unit::TestCase
|
4
|
+
#=begin
|
5
|
+
def test_post_discount
|
6
|
+
tmp_hash = { :accounts_id => "ACT93476985797",
|
7
|
+
:bill_type => "paypal",
|
8
|
+
:code => "#kjbh76",
|
9
|
+
:status => ""
|
10
|
+
}
|
11
|
+
|
12
|
+
response = megams.post_discounts(tmp_hash)
|
13
|
+
assert_equal(201, response.status)
|
14
|
+
end
|
15
|
+
#=end
|
16
|
+
|
17
|
+
=begin
|
18
|
+
def test_get_discounts
|
19
|
+
response = megams.get_discounts
|
20
|
+
assert_equal(200, response.status)
|
21
|
+
end
|
22
|
+
=end
|
23
|
+
=begin
|
24
|
+
def test_get_discounts
|
25
|
+
response = megams.get_discounts("iaas_default")
|
26
|
+
assert_equal(200, response.status)
|
27
|
+
end
|
28
|
+
=end
|
29
|
+
end
|
30
|
+
|
data/test/test_helper.rb
CHANGED
@@ -0,0 +1,30 @@
|
|
1
|
+
require File.expand_path("#{File.dirname(__FILE__)}/test_helper")
|
2
|
+
|
3
|
+
class TestApps < MiniTest::Unit::TestCase
|
4
|
+
#=begin
|
5
|
+
def test_post_subscriptions
|
6
|
+
tmp_hash = { :accounts_id => "ACT93476985797",
|
7
|
+
:assembly_id => "ASMkh9879847",
|
8
|
+
:start_date => "45",
|
9
|
+
:end_date => ""
|
10
|
+
}
|
11
|
+
|
12
|
+
response = megams.post_subscriptions(tmp_hash)
|
13
|
+
assert_equal(201, response.status)
|
14
|
+
end
|
15
|
+
#=end
|
16
|
+
|
17
|
+
=begin
|
18
|
+
def test_get_subscriptions
|
19
|
+
response = megams.get_subscriptions
|
20
|
+
assert_equal(200, response.status)
|
21
|
+
end
|
22
|
+
=end
|
23
|
+
=begin
|
24
|
+
def test_get_subscriptions
|
25
|
+
response = megams.get_subscriptions("iaas_default")
|
26
|
+
assert_equal(200, response.status)
|
27
|
+
end
|
28
|
+
=end
|
29
|
+
end
|
30
|
+
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: megam_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.38'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rajthilak, Kishorekumar Neelamegam, Thomas Alrin, Yeshwanth Kumar, Subash Sethurajan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: excon
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 0.45.3
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 0.45.3
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: highline
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -86,14 +86,14 @@ dependencies:
|
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '5.
|
89
|
+
version: '5.6'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '5.
|
96
|
+
version: '5.6'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: rake
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -134,9 +134,15 @@ files:
|
|
134
134
|
- lib/megam/api/app_requests.rb
|
135
135
|
- lib/megam/api/assemblies.rb
|
136
136
|
- lib/megam/api/assembly.rb
|
137
|
+
- lib/megam/api/availableunits.rb
|
138
|
+
- lib/megam/api/balances.rb
|
139
|
+
- lib/megam/api/billinghistories.rb
|
140
|
+
- lib/megam/api/billings.rb
|
137
141
|
- lib/megam/api/cloud_tool_settings.rb
|
138
142
|
- lib/megam/api/components.rb
|
143
|
+
- lib/megam/api/credithistories.rb
|
139
144
|
- lib/megam/api/csars.rb
|
145
|
+
- lib/megam/api/discounts.rb
|
140
146
|
- lib/megam/api/domains.rb
|
141
147
|
- lib/megam/api/errors.rb
|
142
148
|
- lib/megam/api/event.rb
|
@@ -145,8 +151,10 @@ files:
|
|
145
151
|
- lib/megam/api/marketplaces.rb
|
146
152
|
- lib/megam/api/organizations.rb
|
147
153
|
- lib/megam/api/predef_clouds.rb
|
154
|
+
- lib/megam/api/profile.rb
|
148
155
|
- lib/megam/api/requests.rb
|
149
156
|
- lib/megam/api/sshkeys.rb
|
157
|
+
- lib/megam/api/subscriptions.rb
|
150
158
|
- lib/megam/api/version.rb
|
151
159
|
- lib/megam/core/account.rb
|
152
160
|
- lib/megam/core/app_request.rb
|
@@ -156,13 +164,25 @@ files:
|
|
156
164
|
- lib/megam/core/assembly.rb
|
157
165
|
- lib/megam/core/assembly_collection.rb
|
158
166
|
- lib/megam/core/auth.rb
|
167
|
+
- lib/megam/core/availableunits.rb
|
168
|
+
- lib/megam/core/availableunits_collection.rb
|
169
|
+
- lib/megam/core/balances.rb
|
170
|
+
- lib/megam/core/balances_collection.rb
|
171
|
+
- lib/megam/core/billinghistories.rb
|
172
|
+
- lib/megam/core/billinghistories_collection.rb
|
173
|
+
- lib/megam/core/billings.rb
|
174
|
+
- lib/megam/core/billings_collection.rb
|
159
175
|
- lib/megam/core/cloudtoolsetting.rb
|
160
176
|
- lib/megam/core/cloudtoolsetting_collection.rb
|
161
177
|
- lib/megam/core/components.rb
|
162
178
|
- lib/megam/core/components_collection.rb
|
163
179
|
- lib/megam/core/config.rb
|
180
|
+
- lib/megam/core/credithistories.rb
|
181
|
+
- lib/megam/core/credithistories_collection.rb
|
164
182
|
- lib/megam/core/csar.rb
|
165
183
|
- lib/megam/core/csar_collection.rb
|
184
|
+
- lib/megam/core/discounts.rb
|
185
|
+
- lib/megam/core/discounts_collection.rb
|
166
186
|
- lib/megam/core/domains.rb
|
167
187
|
- lib/megam/core/error.rb
|
168
188
|
- lib/megam/core/event.rb
|
@@ -184,6 +204,8 @@ files:
|
|
184
204
|
- lib/megam/core/sshkey.rb
|
185
205
|
- lib/megam/core/sshkey_collection.rb
|
186
206
|
- lib/megam/core/stuff.rb
|
207
|
+
- lib/megam/core/subscriptions.rb
|
208
|
+
- lib/megam/core/subscriptions_collection.rb
|
187
209
|
- lib/megam/core/text.rb
|
188
210
|
- lib/megam/core/text_formatter.rb
|
189
211
|
- lib/megam_api.rb
|
@@ -192,9 +214,15 @@ files:
|
|
192
214
|
- test/test_app_requests.rb
|
193
215
|
- test/test_assemblies.rb
|
194
216
|
- test/test_assembly.rb
|
217
|
+
- test/test_availableunits.rb
|
218
|
+
- test/test_balances.rb
|
219
|
+
- test/test_billinghistories.rb
|
220
|
+
- test/test_billings.rb
|
195
221
|
- test/test_cloudtoolsettings.rb
|
196
222
|
- test/test_components.rb
|
223
|
+
- test/test_credithistories.rb
|
197
224
|
- test/test_csars.rb
|
225
|
+
- test/test_discounts.rb
|
198
226
|
- test/test_domains.rb
|
199
227
|
- test/test_event.rb
|
200
228
|
- test/test_helper.rb
|
@@ -206,6 +234,7 @@ files:
|
|
206
234
|
- test/test_predefclouds.rb
|
207
235
|
- test/test_requests.rb
|
208
236
|
- test/test_sshkeys.rb
|
237
|
+
- test/test_subscriptions.rb
|
209
238
|
homepage: http://github.com/megamsys/megam_api
|
210
239
|
licenses:
|
211
240
|
- Apache V2
|
@@ -230,4 +259,29 @@ rubygems_version: 2.4.6
|
|
230
259
|
signing_key:
|
231
260
|
specification_version: 4
|
232
261
|
summary: Ruby Client for the Megam
|
233
|
-
test_files:
|
262
|
+
test_files:
|
263
|
+
- test/test_accounts.rb
|
264
|
+
- test/test_app_requests.rb
|
265
|
+
- test/test_assemblies.rb
|
266
|
+
- test/test_assembly.rb
|
267
|
+
- test/test_availableunits.rb
|
268
|
+
- test/test_balances.rb
|
269
|
+
- test/test_billinghistories.rb
|
270
|
+
- test/test_billings.rb
|
271
|
+
- test/test_cloudtoolsettings.rb
|
272
|
+
- test/test_components.rb
|
273
|
+
- test/test_credithistories.rb
|
274
|
+
- test/test_csars.rb
|
275
|
+
- test/test_discounts.rb
|
276
|
+
- test/test_domains.rb
|
277
|
+
- test/test_event.rb
|
278
|
+
- test/test_helper.rb
|
279
|
+
- test/test_login.rb
|
280
|
+
- test/test_logs.rb
|
281
|
+
- test/test_marketplaceaddons.rb
|
282
|
+
- test/test_marketplaces.rb
|
283
|
+
- test/test_organizations.rb
|
284
|
+
- test/test_predefclouds.rb
|
285
|
+
- test/test_requests.rb
|
286
|
+
- test/test_sshkeys.rb
|
287
|
+
- test/test_subscriptions.rb
|