Class: TcServer::Instance
- Inherits:
-
Shared::Instance
- Object
- Shared::Resource
- Shared::StateResource
- Shared::Instance
- TcServer::Instance
- Defined in:
- lib/vas/tc_server/instances.rb
Overview
A tc Server instance
Instance Attribute Summary collapse
-
#applications ⇒ Object
readonly
The instance’s Applications.
-
#layout ⇒ Object
readonly
The instance’s layout.
-
#runtime_version ⇒ Object
readonly
The version of runtime used by the instance.
-
#services ⇒ Object
readonly
The instance’s services.
Attributes inherited from Shared::Instance
#group, #live_configurations, #name, #node_instances, #pending_configurations
Attributes inherited from Shared::Resource
Instance Method Summary collapse
-
#initialize(location, client) ⇒ Instance
constructor
:nodoc:.
-
#update(installation, runtime_version = nil) ⇒ Object
Updates the instance to use the given
installation
and, optionally, to use the givenruntime_version
.
Methods inherited from Shared::Instance
Methods inherited from Shared::StateResource
Constructor Details
#initialize(location, client) ⇒ Instance
:nodoc:
81 82 83 84 85 86 87 88 89 |
# File 'lib/vas/tc_server/instances.rb', line 81 def initialize(location, client) #:nodoc: super(location, client, Group, Installation, LiveConfigurations, PendingConfigurations, NodeInstance, 'node-instance') @layout = details["layout"] @runtime_version = details["runtime-version"] @services = details["services"] @applications = Applications.new(Util::LinkUtils.get_link_href(details, "group-applications"), client) end |
Instance Attribute Details
#applications ⇒ Object (readonly)
The instance’s Applications
79 80 81 |
# File 'lib/vas/tc_server/instances.rb', line 79 def applications @applications end |
#layout ⇒ Object (readonly)
The instance’s layout
70 71 72 |
# File 'lib/vas/tc_server/instances.rb', line 70 def layout @layout end |
#runtime_version ⇒ Object (readonly)
The version of runtime used by the instance
73 74 75 |
# File 'lib/vas/tc_server/instances.rb', line 73 def runtime_version @runtime_version end |
#services ⇒ Object (readonly)
The instance’s services
76 77 78 |
# File 'lib/vas/tc_server/instances.rb', line 76 def services @services end |
Instance Method Details
#update(installation, runtime_version = nil) ⇒ Object
Updates the instance to use the given installation
and, optionally, to use the given runtime_version
92 93 94 95 96 97 98 |
# File 'lib/vas/tc_server/instances.rb', line 92 def update(installation, runtime_version = nil) payload = { :installation => installation.location } if (!runtime_version.nil?) payload['runtime-version'] = runtime_version end client.post(location, payload); end |