virtengine_api 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +21 -0
- data/.travis.yml +11 -0
- data/Gemfile +5 -0
- data/LICENSE +21 -0
- data/README.md +27 -0
- data/Rakefile +10 -0
- data/lib/megam/api.rb +329 -0
- data/lib/megam/api/accounts.rb +96 -0
- data/lib/megam/api/addons.rb +27 -0
- data/lib/megam/api/assemblies.rb +49 -0
- data/lib/megam/api/assembly.rb +56 -0
- data/lib/megam/api/backups.rb +57 -0
- data/lib/megam/api/balances.rb +45 -0
- data/lib/megam/api/billedhistories.rb +35 -0
- data/lib/megam/api/billingtransactions.rb +25 -0
- data/lib/megam/api/components.rb +24 -0
- data/lib/megam/api/credits.rb +34 -0
- data/lib/megam/api/disks.rb +44 -0
- data/lib/megam/api/domains.rb +25 -0
- data/lib/megam/api/errors.rb +29 -0
- data/lib/megam/api/eventsall.rb +36 -0
- data/lib/megam/api/eventsbilling.rb +35 -0
- data/lib/megam/api/eventscontainer.rb +35 -0
- data/lib/megam/api/eventsmarketplace.rb +35 -0
- data/lib/megam/api/eventsstorage.rb +24 -0
- data/lib/megam/api/eventsvm.rb +35 -0
- data/lib/megam/api/flavors.rb +56 -0
- data/lib/megam/api/license.rb +26 -0
- data/lib/megam/api/marketplaces.rb +68 -0
- data/lib/megam/api/organizations.rb +50 -0
- data/lib/megam/api/promos.rb +18 -0
- data/lib/megam/api/quotas.rb +47 -0
- data/lib/megam/api/rawimages.rb +36 -0
- data/lib/megam/api/reports.rb +24 -0
- data/lib/megam/api/requests.rb +36 -0
- data/lib/megam/api/sensors.rb +35 -0
- data/lib/megam/api/snapshots.rb +46 -0
- data/lib/megam/api/sshkeys.rb +35 -0
- data/lib/megam/api/subscriptions.rb +26 -0
- data/lib/megam/api/version.rb +6 -0
- data/lib/megam/core/account.rb +245 -0
- data/lib/megam/core/account_collection.rb +122 -0
- data/lib/megam/core/addons.rb +169 -0
- data/lib/megam/core/addons_collection.rb +121 -0
- data/lib/megam/core/assemblies.rb +191 -0
- data/lib/megam/core/assemblies_collection.rb +122 -0
- data/lib/megam/core/assembly.rb +226 -0
- data/lib/megam/core/assembly_collection.rb +122 -0
- data/lib/megam/core/backups.rb +259 -0
- data/lib/megam/core/backups_collection.rb +122 -0
- data/lib/megam/core/balances.rb +187 -0
- data/lib/megam/core/balances_collection.rb +121 -0
- data/lib/megam/core/billedhistories.rb +190 -0
- data/lib/megam/core/billedhistories_collection.rb +121 -0
- data/lib/megam/core/billingtransactions.rb +214 -0
- data/lib/megam/core/billingtransactions_collection.rb +122 -0
- data/lib/megam/core/components.rb +326 -0
- data/lib/megam/core/components_collection.rb +123 -0
- data/lib/megam/core/credits.rb +146 -0
- data/lib/megam/core/credits_collection.rb +121 -0
- data/lib/megam/core/disks.rb +199 -0
- data/lib/megam/core/disks_collection.rb +122 -0
- data/lib/megam/core/domain_collection.rb +122 -0
- data/lib/megam/core/domains.rb +118 -0
- data/lib/megam/core/error.rb +70 -0
- data/lib/megam/core/eventsall.rb +186 -0
- data/lib/megam/core/eventsall_collection.rb +122 -0
- data/lib/megam/core/eventsbilling.rb +174 -0
- data/lib/megam/core/eventsbilling_collection.rb +122 -0
- data/lib/megam/core/eventscontainer.rb +187 -0
- data/lib/megam/core/eventscontainer_collection.rb +122 -0
- data/lib/megam/core/eventsmarketplace.rb +187 -0
- data/lib/megam/core/eventsmarketplace_collection.rb +122 -0
- data/lib/megam/core/eventsstorage.rb +156 -0
- data/lib/megam/core/eventsstorage_collection.rb +122 -0
- data/lib/megam/core/eventsvm.rb +187 -0
- data/lib/megam/core/eventsvm_collection.rb +122 -0
- data/lib/megam/core/flavors.rb +294 -0
- data/lib/megam/core/flavors_collection.rb +121 -0
- data/lib/megam/core/json_compat.rb +289 -0
- data/lib/megam/core/konipai.rb +42 -0
- data/lib/megam/core/license.rb +101 -0
- data/lib/megam/core/license_collection.rb +122 -0
- data/lib/megam/core/log.rb +19 -0
- data/lib/megam/core/marketplace.rb +308 -0
- data/lib/megam/core/marketplace_collection.rb +123 -0
- data/lib/megam/core/monologger.rb +89 -0
- data/lib/megam/core/organizations.rb +142 -0
- data/lib/megam/core/organizations_collection.rb +121 -0
- data/lib/megam/core/promos.rb +145 -0
- data/lib/megam/core/quotas.rb +215 -0
- data/lib/megam/core/quotas_collection.rb +121 -0
- data/lib/megam/core/rawimages.rb +194 -0
- data/lib/megam/core/rawimages_collection.rb +121 -0
- data/lib/megam/core/reports.rb +176 -0
- data/lib/megam/core/reports_collection.rb +121 -0
- data/lib/megam/core/request.rb +197 -0
- data/lib/megam/core/request_collection.rb +121 -0
- data/lib/megam/core/rest_adapter.rb +44 -0
- data/lib/megam/core/sensors.rb +141 -0
- data/lib/megam/core/sensors_collection.rb +121 -0
- data/lib/megam/core/snapshots.rb +268 -0
- data/lib/megam/core/snapshots_collection.rb +122 -0
- data/lib/megam/core/sshkey.rb +173 -0
- data/lib/megam/core/sshkey_collection.rb +122 -0
- data/lib/megam/core/stuff.rb +22 -0
- data/lib/megam/core/subscriptions.rb +167 -0
- data/lib/megam/core/subscriptions_collection.rb +121 -0
- data/lib/megam/core/text.rb +87 -0
- data/lib/megam/core/text_formatter.rb +64 -0
- data/lib/megam/mixins/assemblies.rb +16 -0
- data/lib/megam/mixins/assembly.rb +59 -0
- data/lib/megam/mixins/common_deployable.rb +78 -0
- data/lib/megam/mixins/components.rb +182 -0
- data/lib/megam/mixins/megam_attributes.rb +30 -0
- data/lib/megam/mixins/outputs.rb +23 -0
- data/lib/megam/mixins/policies.rb +27 -0
- data/lib/megam_api.rb +1 -0
- data/megam_api.gemspec +26 -0
- data/test/mixins/test_assemblies.rb +113 -0
- data/test/mixins/test_assembly.rb +74 -0
- data/test/mixins/test_component.rb +19 -0
- data/test/test_accounts.rb +127 -0
- data/test/test_addons.rb +26 -0
- data/test/test_assemblies.rb +88 -0
- data/test/test_assembly.rb +37 -0
- data/test/test_backups.rb +29 -0
- data/test/test_balances.rb +38 -0
- data/test/test_billedhistories.rb +30 -0
- data/test/test_billingtranscations.rb +35 -0
- data/test/test_components.rb +42 -0
- data/test/test_credits.rb +28 -0
- data/test/test_disks.rb +25 -0
- data/test/test_domains.rb +29 -0
- data/test/test_eventsbilling.rb +30 -0
- data/test/test_eventscontainer.rb +26 -0
- data/test/test_eventsstorage.rb +12 -0
- data/test/test_eventsvm.rb +26 -0
- data/test/test_helper.rb +77 -0
- data/test/test_marketplaces.rb +38 -0
- data/test/test_organizations.rb +45 -0
- data/test/test_promos.rb +11 -0
- data/test/test_quotas.rb +33 -0
- data/test/test_reports.rb +32 -0
- data/test/test_requests.rb +95 -0
- data/test/test_sensors.rb +50 -0
- data/test/test_snapshots.rb +30 -0
- data/test/test_sshkeys.rb +50 -0
- data/test/test_subscriptions.rb +22 -0
- metadata +325 -0
@@ -0,0 +1,36 @@
|
|
1
|
+
module Megam
|
2
|
+
class API
|
3
|
+
# GET /nodes
|
4
|
+
def list_eventsall(limit)
|
5
|
+
@options = {:path => "/eventsvm/#{limit}",:body => ""}.merge(@options)
|
6
|
+
|
7
|
+
request(
|
8
|
+
:expects => 200,
|
9
|
+
:method => :get,
|
10
|
+
:body => @options[:body]
|
11
|
+
)
|
12
|
+
end
|
13
|
+
|
14
|
+
|
15
|
+
def get_eventsall(limit, new_events)
|
16
|
+
@options = {:path => "/eventsall/show/#{limit}",
|
17
|
+
:body => Megam::JSONCompat.to_json(new_events)}.merge(@options)
|
18
|
+
request(
|
19
|
+
:expects => 200,
|
20
|
+
:method => :post,
|
21
|
+
:body => @options[:body]
|
22
|
+
)
|
23
|
+
end
|
24
|
+
|
25
|
+
|
26
|
+
def index_eventsall
|
27
|
+
@options = {:path => "/eventsall",:body => ""}.merge(@options)
|
28
|
+
|
29
|
+
request(
|
30
|
+
:expects => 200,
|
31
|
+
:method => :get,
|
32
|
+
:body => @options[:body]
|
33
|
+
)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
module Megam
|
2
|
+
class API
|
3
|
+
# GET /nodes
|
4
|
+
def list_eventsbilling(limit)
|
5
|
+
@options = {:path => "/eventsbilling/#{limit}",:body => ""}.merge(@options)
|
6
|
+
|
7
|
+
request(
|
8
|
+
:expects => 200,
|
9
|
+
:method => :get,
|
10
|
+
:body => @options[:body]
|
11
|
+
)
|
12
|
+
end
|
13
|
+
|
14
|
+
|
15
|
+
def get_eventsbilling(limit, new_events)
|
16
|
+
@options = {:path => "/eventsbilling/show/#{limit}",
|
17
|
+
:body => Megam::JSONCompat.to_json(new_events)}.merge(@options)
|
18
|
+
request(
|
19
|
+
:expects => 200,
|
20
|
+
:method => :post,
|
21
|
+
:body => @options[:body]
|
22
|
+
)
|
23
|
+
end
|
24
|
+
|
25
|
+
def index_eventsbilling
|
26
|
+
@options = {:path => "/eventsbilling",:body => ""}.merge(@options)
|
27
|
+
|
28
|
+
request(
|
29
|
+
:expects => 200,
|
30
|
+
:method => :get,
|
31
|
+
:body => @options[:body]
|
32
|
+
)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
module Megam
|
2
|
+
class API
|
3
|
+
# GET /nodes
|
4
|
+
def list_eventscontainer(limit)
|
5
|
+
@options = {:path => "/eventscontainer/#{limit}",:body => ""}.merge(@options)
|
6
|
+
|
7
|
+
request(
|
8
|
+
:expects => 200,
|
9
|
+
:method => :get,
|
10
|
+
:body => @options[:body]
|
11
|
+
)
|
12
|
+
end
|
13
|
+
|
14
|
+
|
15
|
+
def get_eventscontainer(limit, new_events)
|
16
|
+
@options = {:path => "/eventscontainer/show/#{limit}",
|
17
|
+
:body => Megam::JSONCompat.to_json(new_events)}.merge(@options)
|
18
|
+
request(
|
19
|
+
:expects => 200,
|
20
|
+
:method => :post,
|
21
|
+
:body => @options[:body]
|
22
|
+
)
|
23
|
+
end
|
24
|
+
|
25
|
+
def index_eventscontainer
|
26
|
+
@options = {:path => "/eventscontainer",:body => ""}.merge(@options)
|
27
|
+
|
28
|
+
request(
|
29
|
+
:expects => 200,
|
30
|
+
:method => :get,
|
31
|
+
:body => @options[:body]
|
32
|
+
)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
module Megam
|
2
|
+
class API
|
3
|
+
# GET /nodes
|
4
|
+
def list_eventsMarketplace(limit)
|
5
|
+
@options = {:path => "/eventsmarketplace/#{limit}",:body => ""}.merge(@options)
|
6
|
+
|
7
|
+
request(
|
8
|
+
:expects => 200,
|
9
|
+
:method => :get,
|
10
|
+
:body => @options[:body]
|
11
|
+
)
|
12
|
+
end
|
13
|
+
|
14
|
+
|
15
|
+
def get_eventsMarketplace(limit, new_events)
|
16
|
+
@options = {:path => "/eventsmarketplace/show/#{limit}",
|
17
|
+
:body => Megam::JSONCompat.to_json(new_events)}.merge(@options)
|
18
|
+
request(
|
19
|
+
:expects => 200,
|
20
|
+
:method => :post,
|
21
|
+
:body => @options[:body]
|
22
|
+
)
|
23
|
+
end
|
24
|
+
|
25
|
+
def index_eventsMarketplace
|
26
|
+
@options = {:path => "/eventsmarketplace",:body => ""}.merge(@options)
|
27
|
+
|
28
|
+
request(
|
29
|
+
:expects => 200,
|
30
|
+
:method => :get,
|
31
|
+
:body => @options[:body]
|
32
|
+
)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Megam
|
2
|
+
class API
|
3
|
+
# GET /nodes
|
4
|
+
def list_eventsstorage(limit)
|
5
|
+
@options = {:path => "/eventsstorage/#{limit}",:body => ""}.merge(@options)
|
6
|
+
|
7
|
+
request(
|
8
|
+
:expects => 200,
|
9
|
+
:method => :get,
|
10
|
+
:body => @options[:body]
|
11
|
+
)
|
12
|
+
end
|
13
|
+
|
14
|
+
def index_eventsstorage
|
15
|
+
@options = {:path => "/eventsstorage",:body => ""}.merge(@options)
|
16
|
+
|
17
|
+
request(
|
18
|
+
:expects => 200,
|
19
|
+
:method => :get,
|
20
|
+
:body => @options[:body]
|
21
|
+
)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
module Megam
|
2
|
+
class API
|
3
|
+
# GET /nodes
|
4
|
+
def list_eventsvm(limit)
|
5
|
+
@options = {:path => "/eventsvm/#{limit}",:body => ""}.merge(@options)
|
6
|
+
|
7
|
+
request(
|
8
|
+
:expects => 200,
|
9
|
+
:method => :get,
|
10
|
+
:body => @options[:body]
|
11
|
+
)
|
12
|
+
end
|
13
|
+
|
14
|
+
|
15
|
+
def get_eventsvm(limit, new_events)
|
16
|
+
@options = {:path => "/eventsvm/show/#{limit}",
|
17
|
+
:body => Megam::JSONCompat.to_json(new_events)}.merge(@options)
|
18
|
+
request(
|
19
|
+
:expects => 200,
|
20
|
+
:method => :post,
|
21
|
+
:body => @options[:body]
|
22
|
+
)
|
23
|
+
end
|
24
|
+
|
25
|
+
def index_eventsvm
|
26
|
+
@options = {:path => "/eventsvm",:body => ""}.merge(@options)
|
27
|
+
|
28
|
+
request(
|
29
|
+
:expects => 200,
|
30
|
+
:method => :get,
|
31
|
+
:body => @options[:body]
|
32
|
+
)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
module Megam
|
2
|
+
class API
|
3
|
+
|
4
|
+
def get_flavors()
|
5
|
+
@options = {:path => "/flavors",:body => ""}.merge(@options)
|
6
|
+
request(
|
7
|
+
:expects => 200,
|
8
|
+
:method => :get,
|
9
|
+
:body => @options[:body]
|
10
|
+
)
|
11
|
+
end
|
12
|
+
|
13
|
+
def get_one_flavor(id)
|
14
|
+
@options = { path: "/flavors/#{id}", body: '' }.merge(@options)
|
15
|
+
|
16
|
+
request(
|
17
|
+
expects: 200,
|
18
|
+
method: :get,
|
19
|
+
body: @options[:body]
|
20
|
+
)
|
21
|
+
end
|
22
|
+
|
23
|
+
def post_flavors(new_flavors)
|
24
|
+
@options = {:path => "/flavors/content",
|
25
|
+
:body => Megam::JSONCompat.to_json(new_flavors)}.merge(@options)
|
26
|
+
request(
|
27
|
+
:expects => 201,
|
28
|
+
:method => :post,
|
29
|
+
:body => @options[:body]
|
30
|
+
)
|
31
|
+
end
|
32
|
+
|
33
|
+
def update_flavors(update_flavors)
|
34
|
+
@options = {:path => '/flavors/update',
|
35
|
+
:body => Megam::JSONCompat.to_json(update_flavors)}.merge(@options)
|
36
|
+
|
37
|
+
request(
|
38
|
+
:expects => 201,
|
39
|
+
:method => :post,
|
40
|
+
:body => @options[:body]
|
41
|
+
)
|
42
|
+
end
|
43
|
+
|
44
|
+
def delete_flavors(delete_flavors)
|
45
|
+
@options = {path: "/flavors/#{delete_flavors["name"]}",
|
46
|
+
:body => ''}.merge(@options)
|
47
|
+
|
48
|
+
request(
|
49
|
+
:expects => 201,
|
50
|
+
:method => :delete,
|
51
|
+
:body => @options[:body]
|
52
|
+
)
|
53
|
+
end
|
54
|
+
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module Megam
|
2
|
+
class API
|
3
|
+
|
4
|
+
def get_license(license_id)
|
5
|
+
@options = {:path => "/admin/licenses/#{license_id}",:body => ""}.merge(@options)
|
6
|
+
|
7
|
+
request(
|
8
|
+
:expects => 200,
|
9
|
+
:method => :get,
|
10
|
+
:body => @options[:body]
|
11
|
+
)
|
12
|
+
end
|
13
|
+
|
14
|
+
def post_license(new_license)
|
15
|
+
@options = {:path => '/admin/licenses/content',
|
16
|
+
:body => Megam::JSONCompat.to_json(new_license)}.merge(@options)
|
17
|
+
|
18
|
+
request(
|
19
|
+
:expects => 201,
|
20
|
+
:method => :post,
|
21
|
+
:body => @options[:body]
|
22
|
+
)
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
module Megam
|
2
|
+
class API
|
3
|
+
|
4
|
+
def get_marketplaceapps
|
5
|
+
@options = {:path => '/marketplaces',:body => ""}.merge(@options)
|
6
|
+
|
7
|
+
request(
|
8
|
+
:expects => 200,
|
9
|
+
:method => :get,
|
10
|
+
:body => @options[:body]
|
11
|
+
)
|
12
|
+
end
|
13
|
+
|
14
|
+
def get_marketplaceapp(id)
|
15
|
+
@options = {:path => "/marketplaces/#{id}",:body => ""}.merge(@options)
|
16
|
+
|
17
|
+
request(
|
18
|
+
:expects => 200,
|
19
|
+
:method => :get,
|
20
|
+
:body => @options[:body]
|
21
|
+
)
|
22
|
+
end
|
23
|
+
|
24
|
+
def get_marketplaceprovider(provider)
|
25
|
+
@options = {:path => "/marketplaces/p/#{provider}" ,:body => ""}.merge(@options)
|
26
|
+
|
27
|
+
request(
|
28
|
+
:expects => 200,
|
29
|
+
:method => :get,
|
30
|
+
:body => @options[:body]
|
31
|
+
)
|
32
|
+
end
|
33
|
+
|
34
|
+
def get_marketplaceflavor(flavor)
|
35
|
+
@options = {:path => "/marketplaces/f/#{flavor}",:body => ""}.merge(@options)
|
36
|
+
request(
|
37
|
+
:expects => 200,
|
38
|
+
:method => :get,
|
39
|
+
:body => @options[:body]
|
40
|
+
)
|
41
|
+
end
|
42
|
+
|
43
|
+
def post_marketplaceapp(catitem)
|
44
|
+
@options = {:path => '/marketplaces/content',
|
45
|
+
:body => Megam::JSONCompat.to_json(catitem)}.merge(@options)
|
46
|
+
|
47
|
+
request(
|
48
|
+
:expects => 201,
|
49
|
+
:method => :post,
|
50
|
+
:body => @options[:body]
|
51
|
+
)
|
52
|
+
end
|
53
|
+
|
54
|
+
#Yet to be tested
|
55
|
+
# DELETE /marketplacess/:node_id
|
56
|
+
def delete_marketplaceapp(catitem_id)
|
57
|
+
@options = {:path => '/marketplaces/#{catitem_id}',
|
58
|
+
:body => ""}.merge(@options)
|
59
|
+
|
60
|
+
request(
|
61
|
+
:expects => 200,
|
62
|
+
:method => :delete,
|
63
|
+
:body => @options[:body]
|
64
|
+
)
|
65
|
+
end
|
66
|
+
|
67
|
+
end
|
68
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
module Megam
|
2
|
+
class API
|
3
|
+
def get_organizations
|
4
|
+
@options = {:path => '/organizations',:body => ''}.merge(@options)
|
5
|
+
|
6
|
+
request(
|
7
|
+
:expects => 200,
|
8
|
+
:method => :get,
|
9
|
+
:body => @options[:body]
|
10
|
+
|
11
|
+
)
|
12
|
+
end
|
13
|
+
|
14
|
+
def get_organization(id)
|
15
|
+
|
16
|
+
@options = {:path => "/organizations/#{id}",
|
17
|
+
:body => ''}.merge(@options)
|
18
|
+
|
19
|
+
request(
|
20
|
+
:expects => 200,
|
21
|
+
:method => :get,
|
22
|
+
:body => @options[:body]
|
23
|
+
)
|
24
|
+
end
|
25
|
+
|
26
|
+
def post_organization(new_organization)
|
27
|
+
|
28
|
+
@options = {:path => '/organizations/content',
|
29
|
+
:body => Megam::JSONCompat.to_json(new_organization)}.merge(@options)
|
30
|
+
|
31
|
+
request(
|
32
|
+
:expects => 201,
|
33
|
+
:method => :post,
|
34
|
+
:body => @options[:body]
|
35
|
+
)
|
36
|
+
end
|
37
|
+
|
38
|
+
def update_organization(new_organization)
|
39
|
+
|
40
|
+
@options = {:path => '/organizations/update',
|
41
|
+
:body => Megam::JSONCompat.to_json(new_organization)}.merge(@options)
|
42
|
+
|
43
|
+
request(
|
44
|
+
:expects => 201,
|
45
|
+
:method => :post,
|
46
|
+
:body => @options[:body]
|
47
|
+
)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
module Megam
|
2
|
+
class API
|
3
|
+
|
4
|
+
def get_one_quota(name)
|
5
|
+
@options = { path: "/quotas/#{name}", body: '' }.merge(@options)
|
6
|
+
|
7
|
+
request(
|
8
|
+
expects: 200,
|
9
|
+
method: :get,
|
10
|
+
body: @options[:body]
|
11
|
+
)
|
12
|
+
end
|
13
|
+
|
14
|
+
def update_quotas(new_asm)
|
15
|
+
@options = { path: '/quotas/update',
|
16
|
+
body: Megam::JSONCompat.to_json(new_asm) }.merge(@options)
|
17
|
+
|
18
|
+
request(
|
19
|
+
expects: [200, 201],
|
20
|
+
method: :post,
|
21
|
+
body: @options[:body]
|
22
|
+
)
|
23
|
+
end
|
24
|
+
|
25
|
+
def list_quotas
|
26
|
+
@options = {:path => "/quotas",:body => ""}.merge(@options)
|
27
|
+
|
28
|
+
request(
|
29
|
+
:expects => 200,
|
30
|
+
:method => :get,
|
31
|
+
:body => @options[:body]
|
32
|
+
)
|
33
|
+
end
|
34
|
+
|
35
|
+
def post_quotas(new_sps)
|
36
|
+
@options = {:path => '/quotas/content',
|
37
|
+
:body => Megam::JSONCompat.to_json(new_sps)}.merge(@options)
|
38
|
+
|
39
|
+
request(
|
40
|
+
:expects => 201,
|
41
|
+
:method => :post,
|
42
|
+
:body => @options[:body]
|
43
|
+
)
|
44
|
+
end
|
45
|
+
|
46
|
+
end
|
47
|
+
end
|