Class: RabbitMq::Instance

Inherits:
Shared::Instance show all
Defined in:
lib/vas/rabbitmq/instances.rb

Overview

A RabbitMQ instance

Instance Attribute Summary

Attributes inherited from Shared::Instance

#name

Attributes included from Shared::Deletable

#collection

Attributes inherited from Shared::Resource

#location, #security

Instance Method Summary collapse

Methods inherited from Shared::Instance

#group, #installation, #live_configurations, #node_instances, #pending_configurations, #reload, #start, #stop, #to_s

Methods included from Shared::Deletable

#delete

Methods inherited from Shared::StateResource

#start, #state, #stop

Constructor Details

#initialize(location, client) ⇒ Instance

Returns a new instance of Instance.



44
45
46
47
# File 'lib/vas/rabbitmq/instances.rb', line 44

def initialize(location, client)
  super(location, client, Group, Installation, LiveConfigurations, PendingConfigurations, NodeInstance, 'node-instance')
  @plugins = Plugins.new(Util::LinkUtils.get_link_href(details, "plugins"), client)
end

Instance Method Details

#pluginsPlugins

Returns the instance’s plugins.

Returns:

  • (Plugins)

    the instance’s plugins



60
61
62
# File 'lib/vas/rabbitmq/instances.rb', line 60

def plugins
  @plugins ||= Plugins.new(Util::LinkUtils.get_link_href(details, 'plugins'), client)
end

#update(installation) ⇒ void

This method returns an undefined value.

Updates the instance to use a different installation

Parameters:

  • installation (Installation)

    the installation that the instance should use



54
55
56
57
# File 'lib/vas/rabbitmq/instances.rb', line 54

def update(installation)
  client.post(location, { :installation => installation.location })
  reload
end