Method: ZAWS::Services::EC2::Subnet#id_by_ip
- Defined in:
- lib/zaws/services/ec2/subnet.rb
#id_by_ip(region, verbose = nil, vpcid, ip) ⇒ Object
def available(subnet, verbose)
#based on the structure of the return from create-subnet and describe-subnet determine if subnet is available
subnet_hash=JSON.parse(subnet)
return (subnet_hash["Subnet"]["State"] == "available") if subnet_hash["Subnet"]
return (subnet_hash["Subnets"][0]["State"] == "available") if subnet_hash["Subnets"] and subnet_hash["Subnets"].count == 1
return false
end
88 89 90 91 |
# File 'lib/zaws/services/ec2/subnet.rb', line 88 def id_by_ip(region, verbose=nil, vpcid, ip) view(region, 'json', verbose, vpcid) return @aws.awscli.command_ec2.describeSubnets.id_by_ip(ip) end |