Class: Mystro::Cloud::Aws::Compute
- Inherits:
-
Connect
show all
- Defined in:
- lib/mystro/cloud/connect/aws/compute.rb
Instance Attribute Summary
Attributes inherited from Fog::Connect
#options
Attributes inherited from Connect
#config, #options
Instance Method Summary
collapse
#collection, #destroy, #find, #initialize, #service
Methods inherited from Connect
#decode, #destroy, #encode, #find, #initialize
Instance Method Details
#all(filters = {}) ⇒ Object
7
8
9
|
# File 'lib/mystro/cloud/connect/aws/compute.rb', line 7
def all(filters={})
decode(service.send(collection).all(filters))
end
|
#create(model) ⇒ Object
15
16
17
18
19
20
21
|
# File 'lib/mystro/cloud/connect/aws/compute.rb', line 15
def create(model)
e = encode(model)
r = service.send(collection).create(e)
model.id = r.id
tag(model)
model
end
|
#running ⇒ Object
11
12
13
|
# File 'lib/mystro/cloud/connect/aws/compute.rb', line 11
def running
all({"instance-state-name" => "running"})
end
|
#tag(model) ⇒ Object
23
24
25
26
27
28
29
30
|
# File 'lib/mystro/cloud/connect/aws/compute.rb', line 23
def tag(model)
unless model.id
Mystro::Log.warn "tag called with no id"
return
end
t = model.tags
service.create_tags(model.id, t)
end
|
#untag ⇒ Object
32
33
34
|
# File 'lib/mystro/cloud/connect/aws/compute.rb', line 32
def untag
raise "write me"
end
|