Class: Phase::Adapters::AWS::Subnet
- Inherits:
-
Phase::Adapters::Abstract::Base
- Object
- Phase::Adapters::Abstract::Base
- Phase::Adapters::AWS::Subnet
- Defined in:
- lib/phase/adapters/aws/subnet.rb
Instance Attribute Summary
Attributes inherited from Phase::Adapters::Abstract::Base
Class Method Summary collapse
-
.all ⇒ Array<AWS::Subnet>
All known subnets.
-
.find(subnet_id) ⇒ AWS::Subnet?
The requested subnet.
-
.where(options = {}) ⇒ Array<AWS::Subnet>
All subnets matching the optional filters.
Instance Method Summary collapse
-
#servers(options = {}) ⇒ Array<AWS::Server>
The AWS instances within this VPC.
Methods inherited from Phase::Adapters::Abstract::Base
Constructor Details
This class inherits a constructor from Phase::Adapters::Abstract::Base
Class Method Details
.all ⇒ Array<AWS::Subnet>
Returns All known subnets.
16 17 18 |
# File 'lib/phase/adapters/aws/subnet.rb', line 16 def all where end |
.find(subnet_id) ⇒ AWS::Subnet?
Returns The requested subnet.
22 23 24 |
# File 'lib/phase/adapters/aws/subnet.rb', line 22 def find(subnet_id) new(api.subnets.get(subnet_id)) end |
.where(options = {}) ⇒ Array<AWS::Subnet>
Returns All subnets matching the optional filters.
30 31 32 33 34 35 36 37 |
# File 'lib/phase/adapters/aws/subnet.rb', line 30 def where( = {}) filters = {} filters["vpc-id"] = [:vpc_id] if [:vpc_id] filters["tag:Name"] = [:name] if [:name] api.subnets.all(filters).map {|subnet| new(subnet) } end |
Instance Method Details
#servers(options = {}) ⇒ Array<AWS::Server>
Returns The AWS instances within this VPC.
9 10 11 12 |
# File 'lib/phase/adapters/aws/subnet.rb', line 9 def servers( = {}) [:subnet_id] = resource.subnet_id Server.where() end |