megam_api 1.5.rc5 → 1.5.rc7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +2 -2
  3. data/LICENSE +21 -202
  4. data/README.md +3 -20
  5. data/lib/megam/api.rb +154 -169
  6. data/lib/megam/api/accounts.rb +0 -15
  7. data/lib/megam/api/assemblies.rb +0 -15
  8. data/lib/megam/api/assembly.rb +0 -15
  9. data/lib/megam/api/balances.rb +0 -15
  10. data/lib/megam/api/billedhistories.rb +0 -15
  11. data/lib/megam/api/billingtransactions.rb +0 -15
  12. data/lib/megam/api/components.rb +0 -15
  13. data/lib/megam/api/domains.rb +0 -15
  14. data/lib/megam/api/errors.rb +0 -15
  15. data/lib/megam/api/eventsbilling.rb +0 -15
  16. data/lib/megam/api/eventscontainer.rb +0 -15
  17. data/lib/megam/api/eventsstorage.rb +0 -15
  18. data/lib/megam/api/eventsvm.rb +0 -15
  19. data/lib/megam/api/marketplaces.rb +0 -15
  20. data/lib/megam/api/organizations.rb +0 -15
  21. data/lib/megam/api/promos.rb +0 -15
  22. data/lib/megam/api/requests.rb +0 -15
  23. data/lib/megam/api/sensors.rb +0 -15
  24. data/lib/megam/api/snapshots.rb +0 -15
  25. data/lib/megam/api/sshkeys.rb +0 -15
  26. data/lib/megam/api/version.rb +1 -16
  27. data/lib/megam/core/account.rb +241 -60
  28. data/lib/megam/core/assemblies.rb +0 -16
  29. data/lib/megam/core/assemblies_collection.rb +101 -116
  30. data/lib/megam/core/assembly.rb +201 -218
  31. data/lib/megam/core/assembly_collection.rb +101 -116
  32. data/lib/megam/core/balances.rb +182 -197
  33. data/lib/megam/core/balances_collection.rb +101 -116
  34. data/lib/megam/core/billedhistories.rb +186 -201
  35. data/lib/megam/core/billedhistories_collection.rb +101 -116
  36. data/lib/megam/core/billingtransactions.rb +0 -15
  37. data/lib/megam/core/billingtransactions_collection.rb +0 -15
  38. data/lib/megam/core/components.rb +300 -316
  39. data/lib/megam/core/components_collection.rb +0 -15
  40. data/lib/megam/core/domain_collection.rb +1 -16
  41. data/lib/megam/core/domains.rb +115 -131
  42. data/lib/megam/core/error.rb +55 -70
  43. data/lib/megam/core/eventsbilling.rb +0 -16
  44. data/lib/megam/core/eventsbilling_collection.rb +101 -116
  45. data/lib/megam/core/eventscontainer.rb +0 -16
  46. data/lib/megam/core/eventscontainer_collection.rb +101 -116
  47. data/lib/megam/core/eventsstorage.rb +0 -16
  48. data/lib/megam/core/eventsstorage_collection.rb +0 -15
  49. data/lib/megam/core/eventsvm.rb +0 -16
  50. data/lib/megam/core/eventsvm_collection.rb +101 -116
  51. data/lib/megam/core/json_compat.rb +0 -12
  52. data/lib/megam/core/konipai.rb +0 -15
  53. data/lib/megam/core/log.rb +0 -15
  54. data/lib/megam/core/marketplace.rb +224 -241
  55. data/lib/megam/core/marketplace_collection.rb +0 -15
  56. data/lib/megam/core/organizations.rb +0 -16
  57. data/lib/megam/core/organizations_collection.rb +0 -15
  58. data/lib/megam/core/promos.rb +0 -15
  59. data/lib/megam/core/request.rb +0 -15
  60. data/lib/megam/core/request_collection.rb +0 -15
  61. data/lib/megam/core/rest_adapter.rb +0 -15
  62. data/lib/megam/core/sensors.rb +138 -154
  63. data/lib/megam/core/sensors_collection.rb +0 -15
  64. data/lib/megam/core/snapshots.rb +0 -16
  65. data/lib/megam/core/snapshots_collection.rb +0 -15
  66. data/lib/megam/core/sshkey.rb +169 -184
  67. data/lib/megam/core/sshkey_collection.rb +0 -15
  68. data/lib/megam/core/stuff.rb +17 -32
  69. data/lib/megam/core/text.rb +82 -97
  70. data/lib/megam/mixins/assemblies.rb +10 -25
  71. data/lib/megam/mixins/assembly.rb +33 -49
  72. data/lib/megam/mixins/common_deployable.rb +64 -79
  73. data/lib/megam/mixins/components.rb +160 -175
  74. data/lib/megam/mixins/megam_attributes.rb +22 -37
  75. data/lib/megam/mixins/outputs.rb +14 -29
  76. data/lib/megam/mixins/policies.rb +21 -36
  77. data/lib/megam_api.rb +0 -15
  78. data/test/mixins/test_assemblies.rb +1 -2
  79. data/test/test_accounts.rb +84 -29
  80. data/test/test_billingtranscations.rb +17 -21
  81. data/test/test_eventscontainer.rb +19 -23
  82. data/test/test_eventsstorage.rb +8 -10
  83. data/test/test_eventsvm.rb +19 -23
  84. data/test/test_helper.rb +30 -30
  85. data/test/test_snapshots.rb +16 -22
  86. metadata +2 -2
@@ -1,19 +1,3 @@
1
- # Copyright:: Copyright (c) 2013-2016 Megam Systems
2
- # License:: Apache License, Version 2.0
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
- #
16
-
17
1
  module Megam
18
2
  class Assemblies < Megam::RestAdapter
19
3
  def initialize(o)
@@ -1,137 +1,122 @@
1
- # Copyright:: Copyright (c) 2013-2016 Megam Systems
2
- # License:: Apache License, Version 2.0
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
- #
16
1
  module Megam
17
- class AssembliesCollection
18
- include Enumerable
19
-
20
- attr_reader :iterator
21
- def initialize
22
- @assemblies = Array.new
23
- @assemblies_by_name = Hash.new
24
- @insert_after_idx = nil
25
- end
2
+ class AssembliesCollection
3
+ include Enumerable
4
+
5
+ attr_reader :iterator
6
+ def initialize
7
+ @assemblies = Array.new
8
+ @assemblies_by_name = Hash.new
9
+ @insert_after_idx = nil
10
+ end
26
11
 
27
- def all_assemblies
28
- @assemblies
29
- end
12
+ def all_assemblies
13
+ @assemblies
14
+ end
30
15
 
31
- def [](index)
32
- @assemblies[index]
33
- end
16
+ def [](index)
17
+ @assemblies[index]
18
+ end
34
19
 
35
- def []=(index, arg)
36
- is_megam_assemblies(arg)
37
- @assemblies[index] = arg
38
- @assemblies_by_name[arg.assembies_name] = index
39
- end
20
+ def []=(index, arg)
21
+ is_megam_assemblies(arg)
22
+ @assemblies[index] = arg
23
+ @assemblies_by_name[arg.assembies_name] = index
24
+ end
40
25
 
41
- def <<(*args)
42
- args.flatten.each do |a|
43
- is_megam_assemblies(a)
44
- @assemblies << a
45
- @assemblies_by_name[a.name] = @assemblies.length - 1
46
- end
47
- self
48
- end
26
+ def <<(*args)
27
+ args.flatten.each do |a|
28
+ is_megam_assemblies(a)
29
+ @assemblies << a
30
+ @assemblies_by_name[a.name] = @assemblies.length - 1
31
+ end
32
+ self
33
+ end
49
34
 
50
- # 'push' is an alias method to <<
51
- alias_method :push, :<<
52
-
53
- def insert(assemblies)
54
- is_megam_assemblies(assemblies)
55
- if @insert_after_idx
56
- # in the middle of executing a run, so any nodes inserted now should
57
- # be placed after the most recent addition done by the currently executing
58
- # node
59
- @assemblies.insert(@insert_after_idx + 1, assemblies)
60
- # update name -> location mappings and register new node
61
- @assemblies_by_name.each_key do |key|
62
- @assemblies_by_name[key] += 1 if @assemblies_by_name[key] > @insert_after_idx
35
+ # 'push' is an alias method to <<
36
+ alias_method :push, :<<
37
+
38
+ def insert(assemblies)
39
+ is_megam_assemblies(assemblies)
40
+ if @insert_after_idx
41
+ # in the middle of executing a run, so any nodes inserted now should
42
+ # be placed after the most recent addition done by the currently executing
43
+ # node
44
+ @assemblies.insert(@insert_after_idx + 1, assemblies)
45
+ # update name -> location mappings and register new node
46
+ @assemblies_by_name.each_key do |key|
47
+ @assemblies_by_name[key] += 1 if @assemblies_by_name[key] > @insert_after_idx
48
+ end
49
+ @assemblies_by_name[assemblies.name] = @insert_after_idx + 1
50
+ @insert_after_idx += 1
51
+ else
52
+ @assemblies << assemblies
53
+ @assemblies_by_name[assemblies.name] = @assemblies.length - 1
54
+ end
63
55
  end
64
- @assemblies_by_name[assemblies.name] = @insert_after_idx + 1
65
- @insert_after_idx += 1
66
- else
67
- @assemblies << assemblies
68
- @assemblies_by_name[assemblies.name] = @assemblies.length - 1
69
- end
70
- end
71
56
 
72
- def each
73
- @assemblies.each do |assemblies|
74
- yield assemblies
75
- end
76
- end
57
+ def each
58
+ @assemblies.each do |assemblies|
59
+ yield assemblies
60
+ end
61
+ end
77
62
 
78
- def each_index
79
- @assemblies.each_index do |i|
80
- yield i
81
- end
82
- end
63
+ def each_index
64
+ @assemblies.each_index do |i|
65
+ yield i
66
+ end
67
+ end
83
68
 
84
- def empty?
85
- @assemblies.empty?
86
- end
69
+ def empty?
70
+ @assemblies.empty?
71
+ end
87
72
 
88
- def lookup(assemblies)
89
- lookup_by = nil
90
- if assemblies.kind_of?(Megam::Assemblies)
91
- lookup_by = assemblies.name
92
- elsif assemblies.kind_of?(String)
93
- lookup_by = assemblies
94
- else
95
- raise ArgumentError, "Must pass a Megam::Assemblies or String to lookup"
96
- end
97
- res = @assemblies_by_name[lookup_by]
98
- unless res
99
- raise ArgumentError, "Cannot find a node matching #{lookup_by} (did you define it first?)"
100
- end
101
- @assemblies[res]
102
- end
73
+ def lookup(assemblies)
74
+ lookup_by = nil
75
+ if assemblies.kind_of?(Megam::Assemblies)
76
+ lookup_by = assemblies.name
77
+ elsif assemblies.kind_of?(String)
78
+ lookup_by = assemblies
79
+ else
80
+ raise ArgumentError, "Must pass a Megam::Assemblies or String to lookup"
81
+ end
82
+ res = @assemblies_by_name[lookup_by]
83
+ unless res
84
+ raise ArgumentError, "Cannot find a node matching #{lookup_by} (did you define it first?)"
85
+ end
86
+ @assemblies[res]
87
+ end
103
88
 
104
- def to_s
105
- @assemblies.join(", ")
106
- end
89
+ def to_s
90
+ @assemblies.join(", ")
91
+ end
107
92
 
108
- def for_json
109
- to_a.map { |item| item.to_s }
110
- end
93
+ def for_json
94
+ to_a.map { |item| item.to_s }
95
+ end
111
96
 
112
- def to_json(*a)
113
- Megam::JSONCompat.to_json(for_json, *a)
114
- end
97
+ def to_json(*a)
98
+ Megam::JSONCompat.to_json(for_json, *a)
99
+ end
115
100
 
116
- def self.json_create(o)
117
- collection = self.new()
118
- o["results"].each do |assemblies_list|
119
- assemblies_array = assemblies_list.kind_of?(Array) ? assemblies_list : [ assemblies_list ]
120
- assemblies_array.each do |assemblies|
121
- collection.insert(assemblies)
101
+ def self.json_create(o)
102
+ collection = self.new()
103
+ o["results"].each do |assemblies_list|
104
+ assemblies_array = assemblies_list.kind_of?(Array) ? assemblies_list : [ assemblies_list ]
105
+ assemblies_array.each do |assemblies|
106
+ collection.insert(assemblies)
122
107
 
108
+ end
109
+ end
110
+ collection
123
111
  end
124
- end
125
- collection
126
- end
127
112
 
128
- private
113
+ private
129
114
 
130
- def is_megam_assemblies(arg)
131
- unless arg.kind_of?(Megam::Assemblies)
132
- raise ArgumentError, "Members must be Megam::Assemblies's"
133
- end
134
- true
115
+ def is_megam_assemblies(arg)
116
+ unless arg.kind_of?(Megam::Assemblies)
117
+ raise ArgumentError, "Members must be Megam::Assemblies's"
118
+ end
119
+ true
120
+ end
135
121
  end
136
- end
137
122
  end
@@ -1,221 +1,204 @@
1
- # Copyright:: Copyright (c) 2013-2016 Megam Systems
2
- # License:: Apache License, Version 2.0
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
- #
16
-
17
1
  module Megam
18
- class Assembly < Megam::RestAdapter
19
- def initialize(o)
20
- @id = nil
21
- @asms_id = nil
22
- @name = nil
23
- @components = []
24
- @tosca_type = nil
25
- @policies = []
26
- @inputs = []
27
- @outputs = []
28
- @status = nil
29
- @created_at = nil
30
-
31
- super(o)
32
- end
33
-
34
- def assembly
35
- self
36
- end
37
-
38
- def id(arg = nil)
39
- if !arg.nil?
40
- @id = arg
41
- else
42
- @id
43
- end
44
- end
45
-
46
- def asms_id(arg=nil)
47
- if arg != nil
48
- @asms_id = arg
49
- else
50
- @asms_id
51
- end
52
- end
53
-
54
- def name(arg = nil)
55
- if !arg.nil?
56
- @name = arg
57
- else
58
- @name
59
- end
60
- end
61
-
62
- def tosca_type(arg = nil)
63
- if !arg.nil?
64
- @tosca_type = arg
65
- else
66
- @tosca_type
67
- end
68
- end
69
-
70
- def components(arg = [])
71
- if arg != []
72
- @components = arg
73
- else
74
- @components
75
- end
76
- end
77
-
78
- def policies(arg = [])
79
- if arg != []
80
- @policies = arg
81
- else
82
- @policies
83
- end
84
- end
85
-
86
- def inputs(arg = [])
87
- if arg != []
88
- @inputs = arg
89
- else
90
- @inputs
91
- end
92
- end
93
-
94
- def outputs(arg = [])
95
- if arg != []
96
- @outputs = arg
97
- else
98
- @outputs
99
- end
100
- end
101
-
102
- def status(arg = nil)
103
- if !arg.nil?
104
- @status = arg
105
- else
106
- @status
107
- end
108
- end
109
-
110
- def created_at(arg = nil)
111
- if !arg.nil?
112
- @created_at = arg
113
- else
114
- @created_at
115
- end
116
- end
117
-
118
- def error?
119
- crocked = true if some_msg.key?(:msg_type) && some_msg[:msg_type] == 'error'
120
- end
121
-
122
- # Transform the ruby obj -> to a Hash
123
- def to_hash
124
- index_hash = {}
125
- index_hash['json_claz'] = self.class.name
126
- index_hash['id'] = id
127
- index_hash["asms_id"] = asms_id
128
- index_hash['name'] = name
129
- index_hash['components'] = components
130
- index_hash['tosca_type'] = tosca_type
131
- index_hash['policies'] = policies
132
- index_hash['inputs'] = inputs
133
- index_hash['outputs'] = outputs
134
- index_hash['status'] = status
135
- index_hash['created_at'] = created_at
136
- index_hash
137
- end
138
-
139
- # Serialize this object as a hash: called from JsonCompat.
140
- # Verify if this called from JsonCompat during testing.
141
- def to_json(*a)
142
- for_json.to_json(*a)
143
- end
144
-
145
- def for_json
146
- result = {
147
- 'id' => id,
148
- 'name' => name,
149
- 'components' => components,
150
- 'tosca_type' => tosca_type,
151
- 'policies' => policies,
152
- 'inputs' => inputs,
153
- 'outputs' => outputs,
154
- 'status' => status,
155
- 'created_at' => created_at
156
- }
157
-
158
- result
159
- end
160
-
161
- def self.json_create(o)
162
- asm = new({})
163
- asm.id(o['id']) if o.key?('id')
164
- asm.asms_id(o["asms_id"]) if o.has_key?("asms_id")
165
- asm.name(o['name']) if o.key?('name')
166
- asm.components(o['components']) if o.key?('components')
167
- asm.tosca_type(o['tosca_type']) if o.key?('tosca_type')
168
- asm.policies(o['policies']) if o.key?('policies') # this will be an array? can hash store array?
169
- asm.inputs(o['inputs']) if o.key?('inputs')
170
- asm.outputs(o['outputs']) if o.key?('outputs')
171
- asm.status(o['status']) if o.key?('status')
172
- asm.created_at(o['created_at']) if o.key?('created_at')
173
- asm
174
- end
175
-
176
- def self.from_hash(o)
177
- asm = new(o)
178
- asm.from_hash(o)
179
- asm
180
- end
181
-
182
- def from_hash(o)
183
- @id = o['id'] if o.key?('id')
184
- @asms_id = o["asms_id"] if o.has_key?("asms_id")
185
- @name = o['name'] if o.key?('name')
186
- @components = o['components'] if o.key?('components')
187
- @tosca_type = o['tosca_type'] if o.key?('tosca_type')
188
- @policies = o['policies'] if o.key?('policies')
189
- @inputs = o['inputs'] if o.key?('inputs')
190
- @outputs = o['outputs'] if o.key?('outputs')
191
- @status = o['status'] if o.key?('status')
192
- @created_at = o['created_at'] if o.key?('created_at')
193
- self
2
+ class Assembly < Megam::RestAdapter
3
+ def initialize(o)
4
+ @id = nil
5
+ @asms_id = nil
6
+ @name = nil
7
+ @components = []
8
+ @tosca_type = nil
9
+ @policies = []
10
+ @inputs = []
11
+ @outputs = []
12
+ @status = nil
13
+ @created_at = nil
14
+
15
+ super(o)
16
+ end
17
+
18
+ def assembly
19
+ self
20
+ end
21
+
22
+ def id(arg = nil)
23
+ if !arg.nil?
24
+ @id = arg
25
+ else
26
+ @id
27
+ end
28
+ end
29
+
30
+ def asms_id(arg=nil)
31
+ if arg != nil
32
+ @asms_id = arg
33
+ else
34
+ @asms_id
35
+ end
36
+ end
37
+
38
+ def name(arg = nil)
39
+ if !arg.nil?
40
+ @name = arg
41
+ else
42
+ @name
43
+ end
44
+ end
45
+
46
+ def tosca_type(arg = nil)
47
+ if !arg.nil?
48
+ @tosca_type = arg
49
+ else
50
+ @tosca_type
51
+ end
52
+ end
53
+
54
+ def components(arg = [])
55
+ if arg != []
56
+ @components = arg
57
+ else
58
+ @components
59
+ end
60
+ end
61
+
62
+ def policies(arg = [])
63
+ if arg != []
64
+ @policies = arg
65
+ else
66
+ @policies
67
+ end
68
+ end
69
+
70
+ def inputs(arg = [])
71
+ if arg != []
72
+ @inputs = arg
73
+ else
74
+ @inputs
75
+ end
76
+ end
77
+
78
+ def outputs(arg = [])
79
+ if arg != []
80
+ @outputs = arg
81
+ else
82
+ @outputs
83
+ end
84
+ end
85
+
86
+ def status(arg = nil)
87
+ if !arg.nil?
88
+ @status = arg
89
+ else
90
+ @status
91
+ end
92
+ end
93
+
94
+ def created_at(arg = nil)
95
+ if !arg.nil?
96
+ @created_at = arg
97
+ else
98
+ @created_at
99
+ end
100
+ end
101
+
102
+ def error?
103
+ crocked = true if some_msg.key?(:msg_type) && some_msg[:msg_type] == 'error'
104
+ end
105
+
106
+ # Transform the ruby obj -> to a Hash
107
+ def to_hash
108
+ index_hash = {}
109
+ index_hash['json_claz'] = self.class.name
110
+ index_hash['id'] = id
111
+ index_hash["asms_id"] = asms_id
112
+ index_hash['name'] = name
113
+ index_hash['components'] = components
114
+ index_hash['tosca_type'] = tosca_type
115
+ index_hash['policies'] = policies
116
+ index_hash['inputs'] = inputs
117
+ index_hash['outputs'] = outputs
118
+ index_hash['status'] = status
119
+ index_hash['created_at'] = created_at
120
+ index_hash
121
+ end
122
+
123
+ # Serialize this object as a hash: called from JsonCompat.
124
+ # Verify if this called from JsonCompat during testing.
125
+ def to_json(*a)
126
+ for_json.to_json(*a)
127
+ end
128
+
129
+ def for_json
130
+ result = {
131
+ 'id' => id,
132
+ 'name' => name,
133
+ 'components' => components,
134
+ 'tosca_type' => tosca_type,
135
+ 'policies' => policies,
136
+ 'inputs' => inputs,
137
+ 'outputs' => outputs,
138
+ 'status' => status,
139
+ 'created_at' => created_at
140
+ }
141
+
142
+ result
143
+ end
144
+
145
+ def self.json_create(o)
146
+ asm = new({})
147
+ asm.id(o['id']) if o.key?('id')
148
+ asm.asms_id(o["asms_id"]) if o.has_key?("asms_id")
149
+ asm.name(o['name']) if o.key?('name')
150
+ asm.components(o['components']) if o.key?('components')
151
+ asm.tosca_type(o['tosca_type']) if o.key?('tosca_type')
152
+ asm.policies(o['policies']) if o.key?('policies') # this will be an array? can hash store array?
153
+ asm.inputs(o['inputs']) if o.key?('inputs')
154
+ asm.outputs(o['outputs']) if o.key?('outputs')
155
+ asm.status(o['status']) if o.key?('status')
156
+ asm.created_at(o['created_at']) if o.key?('created_at')
157
+ asm
158
+ end
159
+
160
+ def self.from_hash(o)
161
+ asm = new(o)
162
+ asm.from_hash(o)
163
+ asm
164
+ end
165
+
166
+ def from_hash(o)
167
+ @id = o['id'] if o.key?('id')
168
+ @asms_id = o["asms_id"] if o.has_key?("asms_id")
169
+ @name = o['name'] if o.key?('name')
170
+ @components = o['components'] if o.key?('components')
171
+ @tosca_type = o['tosca_type'] if o.key?('tosca_type')
172
+ @policies = o['policies'] if o.key?('policies')
173
+ @inputs = o['inputs'] if o.key?('inputs')
174
+ @outputs = o['outputs'] if o.key?('outputs')
175
+ @status = o['status'] if o.key?('status')
176
+ @created_at = o['created_at'] if o.key?('created_at')
177
+ self
178
+ end
179
+
180
+ def self.show(params)
181
+ asm = new(params)
182
+ asm.megam_rest.get_one_assembly(params['id'])
183
+ end
184
+
185
+ def self.update(params)
186
+ asm = from_hash(params)
187
+ asm.update
188
+ end
189
+
190
+ def self.upgrade(params)
191
+ asm = from_hash(params)
192
+ asm.megam_rest.upgrade_assembly(params['id'])
193
+ end
194
+
195
+ # Create the node via the REST API
196
+ def update
197
+ megam_rest.update_assembly(to_hash)
198
+ end
199
+
200
+ def to_s
201
+ Megam::Stuff.styled_hash(to_hash)
202
+ end
194
203
  end
195
-
196
- def self.show(params)
197
- asm = new(params)
198
- asm.megam_rest.get_one_assembly(params['id'])
199
- end
200
-
201
- def self.update(params)
202
- asm = from_hash(params)
203
- asm.update
204
- end
205
-
206
- def self.upgrade(params)
207
- asm = from_hash(params)
208
- asm.megam_rest.upgrade_assembly(params['id'])
209
- end
210
-
211
- # Create the node via the REST API
212
- def update
213
- megam_rest.update_assembly(to_hash)
214
- end
215
-
216
- def to_s
217
- Megam::Stuff.styled_hash(to_hash)
218
- end
219
- end
220
204
  end
221
-