Class: RabbitMq::Plugin
- Inherits:
-
Shared::Resource
- Object
- Shared::Resource
- RabbitMq::Plugin
- Defined in:
- lib/vas/rabbitmq/plugins.rb
Overview
A plugin in a Rabbit instance
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
The plugin’s name.
-
#version ⇒ Object
readonly
The plugin’s version.
Attributes inherited from Shared::Resource
Instance Method Summary collapse
-
#disable ⇒ Object
Disables the plugin.
-
#enable ⇒ Object
Enables the plugin.
-
#initialize(location, client) ⇒ Plugin
constructor
:nodoc:.
-
#instance ⇒ Object
The instance that contains the plugin.
-
#plugin_image ⇒ Object
The plugin image, if any, that was used to create the plugin.
-
#state ⇒ Object
The state of the plugin.
-
#to_s ⇒ Object
:nodoc:.
Constructor Details
#initialize(location, client) ⇒ Plugin
:nodoc:
43 44 45 46 47 48 49 50 51 |
# File 'lib/vas/rabbitmq/plugins.rb', line 43 def initialize(location, client) #:nodoc: super(location, client) @name = details['name'] @version = details['version'] @plugin_image_location = Util::LinkUtils.get_link_href(details, 'plugin-image') @instance_location = Util::LinkUtils.get_link_href(details, 'group-instance') @state_location = Util::LinkUtils.get_link_href(details, 'state') end |
Instance Attribute Details
#name ⇒ Object (readonly)
The plugin’s name
41 42 43 |
# File 'lib/vas/rabbitmq/plugins.rb', line 41 def name @name end |
#version ⇒ Object (readonly)
The plugin’s version
38 39 40 |
# File 'lib/vas/rabbitmq/plugins.rb', line 38 def version @version end |
Instance Method Details
#disable ⇒ Object
Disables the plugin
76 77 78 |
# File 'lib/vas/rabbitmq/plugins.rb', line 76 def disable client.post(@state_location, { :status => 'DISABLED' }) end |
#enable ⇒ Object
Enables the plugin
71 72 73 |
# File 'lib/vas/rabbitmq/plugins.rb', line 71 def enable client.post(@state_location, { :status => 'ENABLED' }) end |
#instance ⇒ Object
The instance that contains the plugin
61 62 63 |
# File 'lib/vas/rabbitmq/plugins.rb', line 61 def instance Instance.new(@instance_location, client) end |
#plugin_image ⇒ Object
The plugin image, if any, that was used to create the plugin
54 55 56 57 58 |
# File 'lib/vas/rabbitmq/plugins.rb', line 54 def plugin_image if (!@plugin_image_location.nil?) PluginImage.new(@plugin_image_location, client) end end |
#state ⇒ Object
The state of the plugin
66 67 68 |
# File 'lib/vas/rabbitmq/plugins.rb', line 66 def state client.get(@state_location)['status'] end |
#to_s ⇒ Object
:nodoc:
80 81 82 |
# File 'lib/vas/rabbitmq/plugins.rb', line 80 def to_s #:nodoc: "#<#{self.class} name='#@name' version='#@version'>" end |