Class: Gemfire::CacheServerInstance

Inherits:
Shared::Instance show all
Defined in:
lib/vas/gemfire/cache_server_instances.rb

Overview

A cache server 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) ⇒ CacheServerInstance

Returns a new instance of CacheServerInstance.



44
45
46
47
48
49
50
51
# File 'lib/vas/gemfire/cache_server_instances.rb', line 44

def initialize(location, client)
  super(location, client, Group, Installation, CacheServerLiveConfigurations, CacheServerPendingConfigurations,
        CacheServerNodeInstance, 'cache-server-node-instance')

  @live_application_code_location = Util::LinkUtils.get_link_href(details, 'live-application-code')
  @pending_application_code_location = Util::LinkUtils.get_link_href(details, 'pending-application-code')

end

Instance Method Details

#live_application_codeLiveApplicationCodes

Returns the instance’s live application code.

Returns:



64
65
66
# File 'lib/vas/gemfire/cache_server_instances.rb', line 64

def live_application_code
  @live_application_code ||= LiveApplicationCodes.new(@live_application_code_location, client)
end

#pending_application_codePendingApplicationCodes

Returns the instance’s pending application code.

Returns:



69
70
71
# File 'lib/vas/gemfire/cache_server_instances.rb', line 69

def pending_application_code
  @pending_application_code ||= PendingApplicationCodes.new(@pending_application_code_location, 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



58
59
60
61
# File 'lib/vas/gemfire/cache_server_instances.rb', line 58

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