megam_api 1.11.1 → 1.50.1

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
  SHA1:
3
- metadata.gz: 7aa472adc539b1a6d3537fb9b8a4ea3732e26753
4
- data.tar.gz: 5faa64a818de996faa61017f69b60c745c1f9884
3
+ metadata.gz: 4c1203e2c0e4a221a28d814f4fa87c28b5ffc204
4
+ data.tar.gz: f00e89bddb834be3afebd353643ad3bd2f57137f
5
5
  SHA512:
6
- metadata.gz: c464c9305916044a52e67e8e2f442bec72bfba0793333c39cd62cf639001edfa22e2adb179a2c8c4794d5fffa83dacd7863b09e774bd45a90e7d35f66d42c4d1
7
- data.tar.gz: 389861d893429f24713053d5908c6b617d47c99cdd297883110aa0fd7281b955b6a573cc6915bb8be2ea08dac0be6edcabf299192381b93e4bd89195fcf7e6c7
6
+ metadata.gz: ac97397a7c26ff5d892bd7163fdbc1675422825ad919d8be765fed875fba7ed05e7b527963ee66a6231fc7b156d1546f39f98ec076fff3045fd23884b9c2540e
7
+ data.tar.gz: 8d30f457632a424a36b9bbbc8c730868c9afb19faab6e3a0824c6f92466058b2c30a752276c341d66c882fb91febcaf92330066233f6c43353833da812e1cd4a
@@ -41,5 +41,16 @@ module Megam
41
41
  )
42
42
  end
43
43
 
44
+ def delete_assembly(delete_assembly)
45
+ @options = {path: "/admin/assembly/#{delete_assembly}",
46
+ :body => ''}.merge(@options)
47
+
48
+ request(
49
+ :expects => 200,
50
+ :method => :delete,
51
+ :body => @options[:body]
52
+ )
53
+ end
54
+
44
55
  end
45
56
  end
@@ -1,5 +1,5 @@
1
1
  module Megam
2
2
  class API
3
- VERSION = "1.11.1"
3
+ VERSION = "1.50.1"
4
4
  end
5
5
  end
@@ -209,6 +209,11 @@ module Megam
209
209
  asm.megam_rest.list_assembly
210
210
  end
211
211
 
212
+ def self.remove(params)
213
+ asm = self.new(params)
214
+ asm.megam_rest.delete_assembly(params['id'])
215
+ end
216
+
212
217
  # Create the node via the REST API
213
218
  def update
214
219
  megam_rest.update_assembly(to_hash)
@@ -7,6 +7,8 @@ module Megam
7
7
  @cost = nil
8
8
  @allowed = nil
9
9
  @allocated_to = nil
10
+ @quota_type = nil
11
+ @status = nil
10
12
  @inputs = []
11
13
  @created_at = nil
12
14
  @updated_at = nil
@@ -65,6 +67,22 @@ module Megam
65
67
  end
66
68
  end
67
69
 
70
+ def quota_type(arg = nil)
71
+ if !arg.nil?
72
+ @quota_type = arg
73
+ else
74
+ @quota_type
75
+ end
76
+ end
77
+
78
+ def status(arg = nil)
79
+ if !arg.nil?
80
+ @status = arg
81
+ else
82
+ @status
83
+ end
84
+ end
85
+
68
86
  def created_at(arg = nil)
69
87
  if !arg.nil?
70
88
  @created_at = arg
@@ -94,6 +112,8 @@ module Megam
94
112
  index_hash['name'] = name
95
113
  index_hash['allowed'] = allowed
96
114
  index_hash['allocated_to'] = allocated_to
115
+ index_hash['quota_type'] = quota_type
116
+ index_hash['status'] = status
97
117
  index_hash['inputs'] = inputs
98
118
  index_hash['created_at'] = created_at
99
119
  index_hash['updated_at'] = updated_at
@@ -114,6 +134,8 @@ module Megam
114
134
  'allowed' => allowed,
115
135
  'allocated_to' => allocated_to,
116
136
  'inputs' => inputs,
137
+ 'quota_type' => quota_type,
138
+ 'status' => status,
117
139
  'created_at' => created_at,
118
140
  'updated_at' => updated_at
119
141
  }
@@ -129,6 +151,8 @@ module Megam
129
151
  quo.allowed(o['allowed']) if o.key?('allowed')
130
152
  quo.allocated_to(o['allocated_to']) if o.key?('allocated_to') # this will be an array? can hash store array?
131
153
  quo.inputs(o['inputs']) if o.key?('inputs')
154
+ quo.quota_type(o['quota_type']) if o.key?('quota_type')
155
+ quo.status(o['status']) if o.key?('status')
132
156
  quo.created_at(o['created_at']) if o.key?('created_at')
133
157
  quo.updated_at(o['updated_at']) if o.key?('updated_at')
134
158
  quo
@@ -147,6 +171,8 @@ module Megam
147
171
  @allowed = o['allowed'] if o.key?('allowed')
148
172
  @allocated_to = o['allocated_to'] if o.key?('allocated_to')
149
173
  @inputs = o['inputs'] if o.key?('inputs')
174
+ @quota_type = o['quota_type'] if o.key?('quota_type')
175
+ @status = o['status'] if o.key?('status')
150
176
  @created_at = o['created_at'] if o.key?('created_at')
151
177
  @updated_at = o['updated_at'] if o.key?('updated_at')
152
178
  self
@@ -0,0 +1,33 @@
1
+ require File.expand_path("#{File.dirname(__FILE__)}/test_helper")
2
+
3
+ class TestApps < MiniTest::Unit::TestCase
4
+
5
+ def test_post_quotas
6
+ tmp_hash = {
7
+ "name"=>"cloud-s01",
8
+ "account_id"=>"test@megam.io",
9
+ "allowed"=>[
10
+ {
11
+ "key" => "ram",
12
+ "value" => "4GB"
13
+ },
14
+ {
15
+ "key" => "cpu",
16
+ "value" => "2cores"
17
+ },
18
+ {
19
+ "key" => "disk",
20
+ "value" => "10GB"
21
+ },
22
+ ],
23
+ "allocated_to" => "",
24
+ "quota_type"=> "vm",
25
+ "status" => "active",
26
+ "inputs" => [],
27
+
28
+ }
29
+
30
+ response = megams.post_quotas(tmp_hash)
31
+ assert_equal(201, response.status)
32
+ end
33
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: megam_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.11.1
4
+ version: 1.50.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rajthilak, Kishorekumar Neelamegam, Ranjitha R, Vinodhini V, Rathish VBR, Rajesh
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-02-03 00:00:00.000000000 Z
12
+ date: 2017-02-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: excon
@@ -262,6 +262,7 @@ files:
262
262
  - test/test_marketplaces.rb
263
263
  - test/test_organizations.rb
264
264
  - test/test_promos.rb
265
+ - test/test_quotas.rb
265
266
  - test/test_reports.rb
266
267
  - test/test_requests.rb
267
268
  - test/test_sensors.rb