Chapter 09/circuit-oneops-1-master/components/cookbooks/azure/libraries/subnet.rb
# this builds an array of subnets to be used for creating a vnet.
this builds an array of subnets to be used for creating a vnet.
this builds an array of subnets to be used for creating a vnet .
def build_subnet_object
      sub_nets = Array.new
      for i in 0..@sub_address.length-1
        OOLog.info('sub_address[' + i.to_s + ']: ' + @sub_address[i].strip)
        subnet_properties =
          Azure::ARM::Network::Models::SubnetPropertiesFormat.new
        subnet_properties.address_prefix = @sub_address[i].strip
        subnet = Azure::ARM::Network::Models::Subnet.new
        subnet.name = 'subnet_' + i.to_s + '_' + @name
        subnet.properties = subnet_properties
        sub_nets.push(subnet)
        OOLog.info('Subnet name is: ' + subnet.name)
      end
      sub_nets
    end
def build_subnet_object sub_nets = Array . new for i in 0 .. @sub_address . length - 1 OOLog . info ( 'sub_address[' + i . to_s + ']: ' + @sub_address [ i ] . strip ) subnet_properties = Azure :: ARM :: Network :: Models :: SubnetPropertiesFormat . new subnet_properties . address_prefix = @sub_address [ i ] . strip subnet = Azure :: ARM :: Network :: Models :: Subnet . new subnet . name = 'subnet_' + i . to_s + '_' + @name subnet . properties = subnet_properties sub_nets . push ( subnet ) OOLog . info ( 'Subnet name is: ' + subnet . name ) end sub_nets end
this builds an array of subnets to be used for creating a vnet.
this builds an array of subnets to be used for creating a vnet .