Class: TcServer::Application

Inherits:
Shared::Resource show all
Includes:
Shared::Deletable
Defined in:
lib/vas/tc_server/applications.rb

Overview

An application

Instance Attribute Summary collapse

Attributes included from Shared::Deletable

#collection

Attributes inherited from Shared::Resource

#location, #security

Instance Method Summary collapse

Methods included from Shared::Deletable

#delete

Constructor Details

#initialize(location, client) ⇒ Application

Returns a new instance of Application.



62
63
64
65
66
67
68
69
70
71
72
# File 'lib/vas/tc_server/applications.rb', line 62

def initialize(location, client)
  super(location, client)

  @revisions_location = Util::LinkUtils.get_link_href(details, 'group-revisions')
  @instance_location = Util::LinkUtils.get_link_href(details, 'group-instance')

  @context_path = details['context-path']
  @name = details['name']
  @service = details['service']
  @host = details['host']
end

Instance Attribute Details

#context_pathString (readonly)

Returns the application’s context path.

Returns:

  • (String)

    the application’s context path



50
51
52
# File 'lib/vas/tc_server/applications.rb', line 50

def context_path
  @context_path
end

#hostString (readonly)

Returns the host the application will deploy its revisions to.

Returns:

  • (String)

    the host the application will deploy its revisions to



59
60
61
# File 'lib/vas/tc_server/applications.rb', line 59

def host
  @host
end

#nameString (readonly)

Returns the application’s name.

Returns:

  • (String)

    the application’s name



53
54
55
# File 'lib/vas/tc_server/applications.rb', line 53

def name
  @name
end

#serviceString (readonly)

Returns the service the application will deploy its revisions to.

Returns:

  • (String)

    the service the application will deploy its revisions to



56
57
58
# File 'lib/vas/tc_server/applications.rb', line 56

def service
  @service
end

Instance Method Details

#instanceInstance

Returns the instance that contains the application.

Returns:

  • (Instance)

    the instance that contains the application



87
88
89
# File 'lib/vas/tc_server/applications.rb', line 87

def instance
  @instance ||= Instance.new(@instance_location, client)
end

#node_applicationsNodeApplication[]

Returns the application’s individual node applications.

Returns:



82
83
84
# File 'lib/vas/tc_server/applications.rb', line 82

def node_applications
  @node_applications ||= create_resources_from_links('node-application', NodeApplication)
end

#reloadvoid

This method returns an undefined value.

Reloads the application’s details from the server



76
77
78
79
# File 'lib/vas/tc_server/applications.rb', line 76

def reload
  super
  @node_applications = nil
end

#revisionsRevisions

Returns the application’s revisions.

Returns:

  • (Revisions)

    the application’s revisions



92
93
94
# File 'lib/vas/tc_server/applications.rb', line 92

def revisions
  @revisions ||= Revisions.new(@revisions_location, client)
end

#to_sString

Returns a string representation of the application.

Returns:

  • (String)

    a string representation of the application



97
98
99
# File 'lib/vas/tc_server/applications.rb', line 97

def to_s
  "#<#{self.class} name='#@name' context_path='#@context_path' service='#@service' host='#@host'>"
end