Class: Miasma::Models::Compute

Inherits:
Types::Api show all
Defined in:
lib/miasma/models/compute.rb,
lib/miasma/models/compute/server.rb,
lib/miasma/models/compute/servers.rb

Overview

Abstract compute API

Defined Under Namespace

Classes: Server, Servers

Instance Method Summary (collapse)

Constructor Details

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

Instance Method Details

- (Array<Models::Compute::Server>) server_all

Return all servers

Returns:

Raises:

  • (NotImplementedError)


55
56
57
# File 'lib/miasma/models/compute.rb', line 55

def server_all
  raise NotImplementedError
end

- (TrueClass, FalseClass) server_change_state(server, action)

Change server to desired state

Parameters:

Returns:

  • (TrueClass, FalseClass)

Raises:

  • (NotImplementedError)


64
65
66
# File 'lib/miasma/models/compute.rb', line 64

def server_change_state(server, action)
  raise NotImplementedError
end

- (TrueClass, FalseClass) server_destroy(server)

Delete server instance

Parameters:

Returns:

  • (TrueClass, FalseClass)

Raises:

  • (NotImplementedError)


48
49
50
# File 'lib/miasma/models/compute.rb', line 48

def server_destroy(server)
  raise NotImplementedError
end

- (Array<Server>) server_filter(filter = {})

Filtered compute instances

Parameters:

  • filter (Hash) (defaults to: {})

    search filter

Options Hash (filter):

  • :state (Symbol)

    state of server Server::VALID_COMPUTE_STATES

Returns:



25
26
# File 'lib/miasma/models/compute.rb', line 25

def server_filter(filter={})
end

- (Models::Compute::Server) server_reload(server)

Reload the server data from the API

Parameters:

Returns:

Raises:

  • (NotImplementedError)


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

def server_reload(server)
  raise NotImplementedError
end

- (Models::Compute::Server) server_save(server)

Create new server instance

Parameters:

Returns:

Raises:

  • (NotImplementedError)


32
33
34
# File 'lib/miasma/models/compute.rb', line 32

def server_save(server)
  raise NotImplementedError
end

- (Types::Collection<Models::Compute::Server>) servers

All compute instances

Returns:



14
15
16
17
18
# File 'lib/miasma/models/compute.rb', line 14

def servers
  memoize(:servers) do
    Servers.new(self)
  end
end