Class: Ey::Core::Client::Slot
- Inherits:
-
Model
- Object
- Cistern::Model
- Model
- Ey::Core::Client::Slot
show all
- Extended by:
- Associations
- Defined in:
- lib/vendor/core/ey-core/models/slot.rb
Instance Method Summary
collapse
assoc_accessor, assoc_coverage, assoc_reader, assoc_writer, associations, collection_reader
Methods inherited from Model
#destroy, range_parser, #save, #update!, #url
Instance Method Details
#disable ⇒ Object
34
35
36
37
38
39
40
41
42
43
44
|
# File 'lib/vendor/core/ey-core/models/slot.rb', line 34
def disable
return false if new_record?
params = {
"id" => id,
"slot" => {
"disabled" => true
}
}
merge_attributes(self.connection.update_slot(params).body["slot"])
end
|
#retire ⇒ Object
22
23
24
25
26
27
28
29
30
31
32
|
# File 'lib/vendor/core/ey-core/models/slot.rb', line 22
def retire
return false if new_record?
params = {
"id" => id,
"slot" => {
"retired" => true
}
}
merge_attributes(self.connection.update_slot(params).body["slot"])
end
|
#save! ⇒ Object
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
# File 'lib/vendor/core/ey-core/models/slot.rb', line 46
def save!
raise NotImplementedError, "Cannot create or update a single slot"
=begin
params = {
"cluster" => self.cluster_id,
"url" => self.collection.url,
"slot" => {
"image" => self.image,
"flavor" => self.flavor,
},
}
if new_record?
self.connections.slots.load(self.connection.create_slot(params).body["slot"])
else raise NotImplementedError # update
end
=end
end
|