Class: Miasma::Models::Compute::Server
- Inherits:
-
Types::Model
- Object
- Types::Data
- Types::Model
- Miasma::Models::Compute::Server
- Defined in:
- lib/miasma/models/compute/server.rb
Overview
Abstract server
Defined Under Namespace
Constant Summary collapse
- VALID_COMPUTE_STATES =
Returns valid compute instance states.
[:running, :stopped, :pending, :terminated]
Instance Attribute Summary
Attributes inherited from Types::Model
Instance Method Summary collapse
-
#address ⇒ String
Public IP address.
- #addresses ⇒ Array<Smash>
Methods inherited from Types::Model
#destroy, from_json, #id?, #initialize, #persisted?, #reload, #save
Methods included from Utils::ApiMethoding
Methods inherited from Types::Data
from_json, #from_json, #initialize, #to_json
Constructor Details
This class inherits a constructor from Miasma::Types::Model
Instance Method Details
#address ⇒ String
Returns public IP address.
46 47 48 49 50 51 |
# File 'lib/miasma/models/compute/server.rb', line 46 def address obj = addresses_public.detect do |addr| addr.version == 4 end obj.address if obj end |
#addresses ⇒ Array<Smash>
41 42 43 |
# File 'lib/miasma/models/compute/server.rb', line 41 def addresses addresses_public + addresses_private end |