Class: Fog::Compute::Aliyun::Vswitches

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

Instance Method Summary collapse

Instance Method Details

#all(options = {}) ⇒ Object

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 filters={} [ <Fog::Aliyun::VPC::VPC id=“vpc-12345678”, TODO > ] >



52
53
54
55
56
# File 'lib/fog/aliyun/models/compute/vswitches.rb', line 52

def all(options = {})
  requires :vpc
  data = Fog::JSON.decode(service.list_vswitchs(vpc.id, options).body)['VSwitches']['VSwitch']
  load(data)
end

#get(vswitchId) ⇒ 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 >



73
74
75
76
# File 'lib/fog/aliyun/models/compute/vswitches.rb', line 73

def get(vswitchId)
  requires :vpc
  self.class.new(service: service, vpc: vpc).all(vSwitchId: vswitchId)[0] if vswitchId
end