Class: Sqlfire::AgentInstance
- Inherits:
-
Shared::Instance
- Object
- Shared::Resource
- Shared::StateResource
- Shared::Instance
- Sqlfire::AgentInstance
- Defined in:
- lib/vas/sqlfire/agent_instances.rb
Overview
An agent instance
Instance Attribute Summary collapse
-
#jvm_options ⇒ String[]
readonly
The JVM options that are passed to the agent’s JVM when it is started.
Attributes inherited from Shared::Instance
Attributes included from Shared::Deletable
Attributes inherited from Shared::Resource
Instance Method Summary collapse
-
#initialize(location, client) ⇒ AgentInstance
constructor
A new instance of AgentInstance.
-
#reload ⇒ void
Reloads the agent instance’s details from the server.
-
#to_s ⇒ String
A string representation of the instance.
-
#update(options = {}) ⇒ void
Updates the instance using the supplied
options
.
Methods inherited from Shared::Instance
#group, #installation, #live_configurations, #node_instances, #pending_configurations, #start, #stop
Methods included from Shared::Deletable
Methods inherited from Shared::StateResource
Constructor Details
#initialize(location, client) ⇒ AgentInstance
Returns a new instance of AgentInstance.
55 56 57 |
# File 'lib/vas/sqlfire/agent_instances.rb', line 55 def initialize(location, client) super(location, client, Group, Installation, AgentLiveConfigurations, AgentPendingConfigurations, AgentNodeInstance, 'agent-node-instance') end |
Instance Attribute Details
#jvm_options ⇒ String[] (readonly)
Returns The JVM options that are passed to the agent’s JVM when it is started.
52 53 54 |
# File 'lib/vas/sqlfire/agent_instances.rb', line 52 def @jvm_options end |
Instance Method Details
#reload ⇒ void
This method returns an undefined value.
Reloads the agent instance’s details from the server
61 62 63 64 |
# File 'lib/vas/sqlfire/agent_instances.rb', line 61 def reload super @jvm_options = details['jvm-options'] end |
#to_s ⇒ String
Returns a string representation of the instance.
92 93 94 |
# File 'lib/vas/sqlfire/agent_instances.rb', line 92 def to_s "#<#{self.class} name='#{name}' jvm_options='#@jvm_options'>" end |
#update(options = {}) ⇒ void
This method returns an undefined value.
Updates the instance using the supplied options
76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/vas/sqlfire/agent_instances.rb', line 76 def update( = {}) payload = {} if .has_key? 'jvm-options' payload['jvm-options'] = ['jvm-options'] end if .has_key? :installation payload[:installation] = [:installation].location end client.post(location, payload) reload end |