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 ⇒ Applications
readonly
The instance’s applications.
-
#layout ⇒ String
readonly
The instance’s layout.
-
#runtime_version ⇒ String
readonly
The version of runtime used by the instance.
-
#services ⇒ Hash
readonly
The instance’s services.
Attributes inherited from Shared::Instance
#group, #live_configurations, #name, #pending_configurations
Attributes inherited from Shared::Resource
Instance Method Summary collapse
-
#initialize(location, client) ⇒ Instance
constructor
A new instance of Instance.
-
#update(installation, runtime_version = nil) ⇒ void
Updates the installation and, optionally, the runtime_version used by the instance.
Methods inherited from Shared::Instance
#installation, #node_instances, #to_s
Methods inherited from Shared::StateResource
Constructor Details
#initialize(location, client) ⇒ Instance
Returns a new instance of Instance.
84 85 86 87 88 89 90 91 92 |
# File 'lib/vas/tc_server/instances.rb', line 84 def initialize(location, client) 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 ⇒ Applications (readonly)
Returns the instance’s applications.
81 82 83 |
# File 'lib/vas/tc_server/instances.rb', line 81 def applications @applications end |
#layout ⇒ String (readonly)
Returns the instance’s layout.
72 73 74 |
# File 'lib/vas/tc_server/instances.rb', line 72 def layout @layout end |
#runtime_version ⇒ String (readonly)
Returns the version of runtime used by the instance.
75 76 77 |
# File 'lib/vas/tc_server/instances.rb', line 75 def runtime_version @runtime_version end |
#services ⇒ Hash (readonly)
Returns the instance’s services.
78 79 80 |
# File 'lib/vas/tc_server/instances.rb', line 78 def services @services end |
Instance Method Details
#update(installation, runtime_version = nil) ⇒ void
This method returns an undefined value.
Updates the installation and, optionally, the runtime_version used by the instance
100 101 102 103 104 105 106 |
# File 'lib/vas/tc_server/instances.rb', line 100 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 |