megam_api 0.40 → 0.41

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dd60098533007fe3a9b643d55cb878670e207d40
4
- data.tar.gz: f0b88a82971c3bcb17c810fc327ba5133d0c26da
3
+ metadata.gz: d9c8bc9c1bbd2f46a7e18a2a4b4c7854dc8d6e64
4
+ data.tar.gz: fc575b87198bf131d2efa43ffc55b115c9dcc586
5
5
  SHA512:
6
- metadata.gz: c6ae07ffae5b01bc48efcb11ed50c737f9c0e2a5317fc3463eb162334c3424f85ff5351e363d8e0739cbd9dcfe8aebb570dc95a75b6c66d6255008d67d09238f
7
- data.tar.gz: c31823b892d6ba4d46fd63ab7b1db6383a7cf65eb8ec9c09caa1c505da19675e6d2c491a8968909738d8006dfde628c0ed1fd03b586bad784dd9b82c5743295e
6
+ metadata.gz: 5376f2ed4aee2d46a16defe9bf2286b0f4fc372240167ffd52f7d9814febffd7e506639f1080a89ba3cee0882fb22b728549b04ed4a275a572d0cf788439825d
7
+ data.tar.gz: fa25f71b924b0b306328fde1b04310734a8f0091ec64a0b23cee1f10576670407e7cfc01a4227872edd861eb8c15dea9af8572cf16aff6380bf3fd51fa3e0a21
@@ -1,5 +1,6 @@
1
1
  module Megam
2
2
  class API
3
- VERSION = "0.40"
3
+
4
+ VERSION = "0.41"
4
5
  end
5
6
  end
@@ -225,8 +225,9 @@ module Megam
225
225
  end
226
226
 
227
227
 
228
- def self.update(o,tmp_email=nil, tmp_api_key=nil)
229
- acct = from_hash(o, tmp_email, tmp_api_key)
228
+ def self.update(o)
229
+ puts "called uda"
230
+ acct = from_hash(o)
230
231
  acct.update
231
232
  end
232
233
 
@@ -167,8 +167,8 @@ module Megam
167
167
  asm.megam_rest.get_one_assemblies(one_assemblies_id)
168
168
  end
169
169
 
170
- def self.list(tmp_email=nil, tmp_api_key=nil, inflated=false)
171
- asm = self.new(tmp_email, tmp_api_key)
170
+ def self.list(params)
171
+ asm = self.new(params["email"], params["api_key"])
172
172
  asm.megam_rest.get_assemblies
173
173
  end
174
174
 
@@ -19,6 +19,7 @@ module Megam
19
19
  def initialize(email=nil, api_key=nil)
20
20
  @id = nil
21
21
  @name = nil
22
+ @tosca_type = nil
22
23
  @components = []
23
24
  @policies=[]
24
25
  @inputs = []
@@ -48,6 +49,14 @@ module Megam
48
49
  @name
49
50
  end
50
51
  end
52
+
53
+ def tosca_type(arg=nil)
54
+ if arg != nil
55
+ @tosca_type = arg
56
+ else
57
+ @tosca_type
58
+ end
59
+ end
51
60
 
52
61
  def components(arg=[])
53
62
  if arg != []
@@ -115,6 +124,7 @@ module Megam
115
124
  index_hash["json_claz"] = self.class.name
116
125
  index_hash["id"] = id
117
126
  index_hash["name"] = name
127
+ index_hash["tosca_type"] = tosca_type
118
128
  index_hash["components"] = components
119
129
  index_hash["policies"] = policies
120
130
  index_hash["inputs"] = inputs
@@ -135,6 +145,7 @@ module Megam
135
145
  result = {
136
146
  "id" => id,
137
147
  "name" => name,
148
+ "tosca_type" => tosca_type,
138
149
  "components" => components,
139
150
  "policies" => policies,
140
151
  "inputs" => inputs,
@@ -151,6 +162,7 @@ module Megam
151
162
  asm = new
152
163
  asm.id(o["id"]) if o.has_key?("id")
153
164
  asm.name(o["name"]) if o.has_key?("name")
165
+ asm.tosca_type(o["tosca_type"]) if o.has_key?("tosca_type")
154
166
  asm.components(o["components"]) if o.has_key?("components")
155
167
  asm.policies(o["policies"]) if o.has_key?("policies") #this will be an array? can hash store array?
156
168
  asm.inputs(o["inputs"]) if o.has_key?("inputs")
@@ -170,6 +182,7 @@ module Megam
170
182
  def from_hash(o)
171
183
  @id = o["id"] if o.has_key?("id")
172
184
  @name = o["name"] if o.has_key?("name")
185
+ @tosca_type = o["tosca_type"] if o.has_key?("tosca_type")
173
186
  @components = o["components"] if o.has_key?("components")
174
187
  @policies = o["policies"] if o.has_key?("policies")
175
188
  @inputs = o["inputs"] if o.has_key?("inputs")
@@ -166,16 +166,16 @@ module Megam
166
166
  # Load all balances -
167
167
  # returns a BalanceCollection
168
168
  # don't return self. check if the Megam::BalanceCollection is returned.
169
- def self.list(tmp_email=nil, tmp_api_key=nil)
170
- balance = self.new(tmp_email,tmp_api_key)
169
+ def self.list(params)
170
+ balance = self.new(params["email"], params["api_key"])
171
171
  balance.megam_rest.get_balances
172
172
  end
173
173
 
174
174
  # Show a particular balance by name,
175
175
  # Megam::Balance
176
- def self.show(p_name,tmp_email=nil, tmp_api_key=nil)
177
- pre = self.new(tmp_email,tmp_api_key)
178
- pre.megam_rest.get_balance(p_name)
176
+ def self.show(params)
177
+ pre = self.new(params["email"], params["api_key"])
178
+ pre.megam_rest.get_balance(params["email"])
179
179
  end
180
180
 
181
181
  def self.delete(p_name,tmp_email=nil, tmp_api_key=nil)
@@ -31,7 +31,6 @@ module Megam
31
31
  self
32
32
  end
33
33
 
34
-
35
34
  def id(arg=nil)
36
35
  if arg != nil
37
36
  @id = arg
@@ -136,7 +135,7 @@ module Megam
136
135
  #
137
136
  def self.json_create(o)
138
137
  bal = new
139
- bal.id(o["id"]) if o.has_key?("id")
138
+ bal.id(o["id"]) if o.has_key?("id")
140
139
  bal.accounts_id(o["accounts_id"]) if o.has_key?("accounts_id")
141
140
  bal.assembly_id(o["assembly_id"]) if o.has_key?("assembly_id")
142
141
  bal.bill_type(o["bill_type"]) if o.has_key?("bill_type")
@@ -181,21 +180,21 @@ module Megam
181
180
  # Load all billing histories -
182
181
  # returns a BillingHistoriesCollection
183
182
  # don't return self. check if the Megam::BillingHistoriesCollection is returned.
184
- def self.list(tmp_email=nil, tmp_api_key=nil)
185
- billhistory = self.new(tmp_email,tmp_api_key)
183
+ def self.list(params)
184
+ billhistory = self.new(params["email"], params["api_key"])
186
185
  billhistory.megam_rest.get_billinghistories
187
186
  end
188
187
 
189
188
  # Show a particular billing history by name,
190
189
  # Megam::BillingHistory
191
190
  def self.show(p_name,tmp_email=nil, tmp_api_key=nil)
192
- pre = self.new(tmp_email,tmp_api_key)
193
- pre.megam_rest.get_billinghistory(p_name)
191
+ pre = self.new(tmp_email,tmp_api_key)
192
+ pre.megam_rest.get_billinghistory(p_name)
194
193
  end
195
194
 
196
195
  def self.delete(p_name,tmp_email=nil, tmp_api_key=nil)
197
- pre = self.new(tmp_email,tmp_api_key)
198
- pre.megam_rest.delete_billinghistory(p_name)
196
+ pre = self.new(tmp_email,tmp_api_key)
197
+ pre.megam_rest.delete_billinghistory(p_name)
199
198
  end
200
199
 
201
200
  def to_s
@@ -21,7 +21,6 @@ class TestAccounts < MiniTest::Unit::TestCase
21
21
  "email" => "coolvader@enterprise.com",
22
22
  "phone" => "19090909090",
23
23
  "api_key" => "IamAtlas{74}NobdyCanSedfefdeME#07",
24
- "password" => "test",
25
24
  "authority" => "admin",
26
25
  "password_reset_key" => "",
27
26
  "created_at" => "2014-10-29 13:24:06 +0000"
@@ -11,6 +11,7 @@ class TestApps < MiniTest::Unit::TestCase
11
11
  "id" => "ASM1139235178976247808",
12
12
  "json_claz" => "Megam::Assembly",
13
13
  "name" => "calcines",
14
+ "tosca_type" => "",
14
15
  "components" => ["COM1139235178934304768",""],
15
16
  "policies" => [{
16
17
  "name" => "bind policy",
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: '0.40'
4
+ version: '0.41'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rajthilak, Kishorekumar Neelamegam, Thomas Alrin, Yeshwanth Kumar, Subash Sethurajan