Sha256: 069e4dd4c013b3ad4a62e1eba5e981d50e8e5a58ec939457b26a36f801a78647

Contents?: true

Size: 1.79 KB

Versions: 22

Compression:

Stored size: 1.79 KB

Contents

# frozen_string_literal: true

require 'fog/core/collection'
require 'fog/aliyun/models/compute/vswitch'

module Fog
  module Compute
    class Aliyun
      class Vswitches < Fog::Collection
        attribute :vpc

        model Fog::Compute::Aliyun::Vswitch

        # Creates a new VPC
        #
        # Aliyun.vpcs.new
        #
        # ==== Returns
        #
        # Returns the details of the new VPC
        #
        # >> Aliyun.vpcs.new
        # <Fog::Aliyun::VPC::VPC
        # id=nil,
        # state=nil,
        # cidr_block=nil,
        # dhcp_options_id=nil
        # tags=nil
        # tenancy=nil
        # >

        # 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
        # >
        # ]
        # >
        #

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

        # 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
        # >
        #

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

Version data entries

22 entries across 20 versions & 2 rubygems

Version Path
fog-aliyun-0.4.0 lib/fog/aliyun/models/compute/vswitches.rb
fog-aliyun-0.3.19 lib/fog/aliyun/models/compute/vswitches.rb
fog-aliyun-0.3.18 lib/fog/aliyun/models/compute/vswitches.rb
fog-aliyun-0.3.17 lib/fog/aliyun/models/compute/vswitches.rb
fog-aliyun-0.3.16 lib/fog/aliyun/models/compute/vswitches.rb
fog-aliyun-0.3.15 lib/fog/aliyun/models/compute/vswitches.rb
fog-aliyun-0.3.13 lib/fog/aliyun/models/compute/vswitches.rb
fog-aliyun-0.3.12 lib/fog/aliyun/models/compute/vswitches.rb
fog-aliyun-0.3.11 lib/fog/aliyun/models/compute/vswitches.rb
fog-aliyun-0.3.10 lib/fog/aliyun/models/compute/vswitches.rb
fog-aliyun-0.3.9 lib/fog/aliyun/models/compute/vswitches.rb
fog-aliyun-0.3.8 lib/fog/aliyun/models/compute/vswitches.rb
fog-aliyun-0.3.7 lib/fog/aliyun/models/compute/vswitches.rb
fog-aliyun-0.3.6 lib/fog/aliyun/models/compute/vswitches.rb
fog-aliyun-0.3.5 lib/fog/aliyun/models/compute/vswitches.rb
fog-aliyun-0.3.4 lib/fog/aliyun/models/compute/vswitches.rb
fog-aliyun-0.3.3 lib/fog/aliyun/models/compute/vswitches.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-aliyun-0.3.2/lib/fog/aliyun/models/compute/vswitches.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-aliyun-0.3.2/lib/fog/aliyun/models/compute/vswitches.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-aliyun-0.3.2/lib/fog/aliyun/models/compute/vswitches.rb