class Fog::Compute::Aliyun::Vpcs
Public Instance Methods
all(filters_arg = {})
click to toggle source
Returns an array of all VPCs that have been created Aliyun.vpcs.all ==== Returns Returns an array of all VPCs
>> Aliyun.vpcs.all
<Fog::Aliyun::VPC::VPCs [ <Fog::Aliyun::VPC::VPC id="vpc-12345678", TODO > ] >
# File lib/fog/aliyun/models/compute/vpcs.rb, line 49 def all(filters_arg = {}) unless filters_arg.is_a?(Hash) Fog::Logger.warning("all with #{filters_arg.class} param is deprecated, use all('vpcId' => []) instead [light_black](#{caller.first})[/]") filters_arg = {'vpcId' => [*filters_arg]} end data = Fog::JSON.decode(service.list_vpcs(filters_arg).body)['Vpcs']['Vpc'] load(data) end
get(vpcId)
click to toggle source
Used to retrieve a VPC vpc_id is required to get the associated VPC information. You can run the following command to get the details: Aliyun.vpcs.get("vpc-12345678") ==== Returns
>> Aliyun.vpcs.get(“vpc-12345678”)
<Fog::Aliyun::Compute::VPC id="vpc-12345678", TODO >
# File lib/fog/aliyun/models/compute/vpcs.rb, line 73 def get(vpcId) if vpcId $vpc=self.class.new(:service => service).all('vpcId' => vpcId)[0] end end