Class: AWS::EC2::AvailabilityZone

Inherits:
Resource show all
Defined in:
lib/aws/ec2/availability_zone.rb

Overview

Represents an EC2 availability zone. You can use this class to get information about the state of an availability zone that is available to your account.

Instance Attribute Summary collapse

Attributes included from Core::Model

#config

Instance Method Summary collapse

Methods inherited from Core::Resource

attribute_providers, attribute_providers_for, attributes, #attributes_from_response, define_attribute_type, #eql?, #inspect, new_from

Methods included from Core::Cacheable

included, #retrieve_attribute

Methods included from Core::Model

#client, #config_prefix, #inspect

Constructor Details

#initialize(name, options = {}) ⇒ AvailabilityZone



33
34
35
36
37
38
39
40
# File 'lib/aws/ec2/availability_zone.rb', line 33

def initialize name, options = {}
  @name = name
  if options[:region]
    options[:region_name] = options[:region].name
    
  end
  super
end

Instance Attribute Details

#messagesArray<String> (readonly)

Returns a list of messages about the Availability Zone.



30
31
32
# File 'lib/aws/ec2/availability_zone.rb', line 30

def messages
  @messages
end

#nameString (readonly) Also known as: to_s, to_str



44
45
46
# File 'lib/aws/ec2/availability_zone.rb', line 44

def name
  @name
end

#region_nameString? (readonly)

Returns the region name of the availability zone.



30
31
32
# File 'lib/aws/ec2/availability_zone.rb', line 30

def region_name
  @region_name
end

#stateSymbol (readonly)

Returns the state of the availability zone, e.g. :available.



30
31
32
# File 'lib/aws/ec2/availability_zone.rb', line 30

def state
  @state
end

Instance Method Details

#regionRegion



65
66
67
# File 'lib/aws/ec2/availability_zone.rb', line 65

def region
  Region.new(self.region_name, :config => config)
end