Class: Miasma::Models::Compute::Server

Inherits:
Types::Model show all
Defined in:
lib/miasma/models/compute/server.rb

Overview

Abstract server

Defined Under Namespace

Classes: Address, Network

Constant Summary

VALID_COMPUTE_STATES =

Returns valid compute instance states

Returns:

  • (Array<Symbol>)

    valid compute instance states

[:running, :stopped, :pending, :terminated]

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

This class inherits a constructor from Miasma::Types::Model

Instance Attribute Details

- (Miasma::Types::Api) api (readonly) Originally defined in class Types::Model

Returns underlying service API

Returns:

Instance Method Details

- (String) address

Returns public IP address

Returns:

  • (String)

    public IP address



44
45
46
47
48
49
# File 'lib/miasma/models/compute/server.rb', line 44

def address
  obj = addresses_public.detect do |addr|
    addr.version == 4
  end
  obj.address if obj
end

- (Array<Smash>) addresses

Returns:



39
40
41
# File 'lib/miasma/models/compute/server.rb', line 39

def addresses
  addresses_public + addresses_private
end