Class: Fog::Compute::Aliyun::Vrouters

Inherits:
Fog::Collection
  • Object
show all
Defined in:
lib/fog/aliyun/models/compute/vrouters.rb

Instance Method Summary collapse

Instance Method Details

#all(filters_arg = {}) ⇒ Object

Returns an array of all VPCs that have been created

Aliyun.vrouters.all

Returns

Returns an array of all VPCs

>> Aliyun.vrouters.all <Fog::Aliyun::Compute::VRouters [ <Fog::Aliyun::Compute::VRouter id=“vpc-12345678”, TODO > ] >



31
32
33
34
35
36
37
38
# File 'lib/fog/aliyun/models/compute/vrouters.rb', line 31

def all(filters_arg = {})
  unless filters_arg.is_a?(Hash)
    Fog::Logger.warning("all with #{filters_arg.class} param is deprecated, use all('vRouterId' => "") instead [light_black](#{caller.first})[/]")
    filters_arg = { 'vRouterId' => filters_arg }
  end
  data = Fog::JSON.decode(service.list_vrouters(filters_arg).body)['VRouters']['VRouter']
  load(data)
end

#get(vRouterId) ⇒ Object

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 >



55
56
57
# File 'lib/fog/aliyun/models/compute/vrouters.rb', line 55

def get(vRouterId)
  self.class.new(service: service).all('vRouterId' => vRouterId)[0] if vRouterId
end