Class: Cartography::Cluster::Site

Inherits:
Object
  • Object
show all
Defined in:
lib/cartography/cluster.rb

Defined Under Namespace

Classes: Endpoints, LoadBalancer, ServerGroup

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ Site

Returns a new instance of Site.



51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/cartography/cluster.rb', line 51

def initialize(params = {})
  @site = params["Site"]
  @site_groups = params["SiteGroups"]
  @region = params["Region"]
  @server_groups = params["ServerGroups"].map { |p| ServerGroup.new(p) }

  @load_balancers = params["LoadBalancers"].each_with_object({}) do |(kind, lbs), hash|
    hash[kind] = lbs.map { |lb| LoadBalancer.new(lb) }
  end

  @zone_assignment = params["ZoneAssignment"]
  @availability_zone = params["AvailabilityZone"]
  @endpoints = Endpoints.new(params["Endpoints"])
end

Instance Attribute Details

#availability_zoneObject (readonly)

Returns the value of attribute availability_zone.



38
39
40
# File 'lib/cartography/cluster.rb', line 38

def availability_zone
  @availability_zone
end

#cluster_idObject (readonly)

Returns the value of attribute cluster_id.



38
39
40
# File 'lib/cartography/cluster.rb', line 38

def cluster_id
  @cluster_id
end

#endpointsObject (readonly)

Returns the value of attribute endpoints.



38
39
40
# File 'lib/cartography/cluster.rb', line 38

def endpoints
  @endpoints
end

#environmentObject (readonly)

Returns the value of attribute environment.



38
39
40
# File 'lib/cartography/cluster.rb', line 38

def environment
  @environment
end

#load_balancersObject (readonly)

Returns the value of attribute load_balancers.



38
39
40
# File 'lib/cartography/cluster.rb', line 38

def load_balancers
  @load_balancers
end

#namespaceObject (readonly)

Returns the value of attribute namespace.



38
39
40
# File 'lib/cartography/cluster.rb', line 38

def namespace
  @namespace
end

#regionObject (readonly)

Returns the value of attribute region.



38
39
40
# File 'lib/cartography/cluster.rb', line 38

def region
  @region
end

#server_groupsObject (readonly)

Returns the value of attribute server_groups.



38
39
40
# File 'lib/cartography/cluster.rb', line 38

def server_groups
  @server_groups
end

#siteObject (readonly)

Returns the value of attribute site.



38
39
40
# File 'lib/cartography/cluster.rb', line 38

def site
  @site
end

#site_groupsObject (readonly)

Returns the value of attribute site_groups.



38
39
40
# File 'lib/cartography/cluster.rb', line 38

def site_groups
  @site_groups
end

#typeObject (readonly)

Returns the value of attribute type.



38
39
40
# File 'lib/cartography/cluster.rb', line 38

def type
  @type
end

#zone_assignmentObject (readonly)

Returns the value of attribute zone_assignment.



38
39
40
# File 'lib/cartography/cluster.rb', line 38

def zone_assignment
  @zone_assignment
end