fog/fog

Fog::Vcloud::Compute::Real
F

Very high overall complexity: 713

require 'fog/vcloud/core'

module Fog
  module Vcloud
    class Collection < Fog::Collection
Found in Fog::Vcloud::Compute::Real - About 6 days to fix

When classes take on too many responsibilities, they grow. A large number of instance variables or methods can make a class hard to understand. Large classes tend to have lower cohesion and higher churn.

Often large classes have methods that do not operate on all of the class state. Identifying the groups of data that are used together can point to seams to split out additional collaborator classes or value objects.

Another trick is to look for repeated prefixes or suffixes in method and variable names, or repeated parameter names, and use them to guide extractions.

Refactorings

Further Reading

Very complex method in #generate_configure_vm_request

          end
          msg = ":href missing, call with a :href pointing to #{if opts[:message]
                  opts[:message]
                elsif opts[:parent]
                  "the #{opts[:parent]} whos #{self.class.to_s.split('::').last.downcase} you want to enumerate"
Found in Fog::Vcloud::Compute::Real - About 1 day to fix

Long or complex methods can make code harder to understand. In most circumstances, methods are best as a small chunk of code (the "how") with a clear, understandable name (the "what"). Long methods can also lead to duplication, as it's harder to reuse logic that is tightly coupled to surrounding code.

Refactorings

Read More

Very complex method in #generate_configure_vm_disks_request

    class Model < Fog::Model
      attr_accessor :loaded
      alias_method :loaded?, :loaded

      def reload
Found in Fog::Vcloud::Compute::Real - About 1 day to fix

Long or complex methods can make code harder to understand. In most circumstances, methods are best as a small chunk of code (the "how") with a clear, understandable name (the "what"). Long methods can also lead to duplication, as it's harder to reuse logic that is tightly coupled to surrounding code.

Refactorings

Read More

Very complex method in #generate_configure_vapp_request

          end
          msg = ":href missing, call with a :href pointing to #{if opts[:message]
                  opts[:message]
                elsif opts[:parent]
                  "the #{opts[:parent]} whos #{self.class.to_s.split('::').last.downcase} you want to enumerate"
Found in Fog::Vcloud::Compute::Real - About 1 day to fix

Long or complex methods can make code harder to understand. In most circumstances, methods are best as a small chunk of code (the "how") with a clear, understandable name (the "what"). Long methods can also lead to duplication, as it's harder to reuse logic that is tightly coupled to surrounding code.

Refactorings

Read More

Complex method in #do_request

        def do_request(params)
          # Convert the uri to a URI if it's a string.
          if params[:uri].is_a?(String)
            params[:uri] = URI.parse(params[:uri])
          end
Found in Fog::Vcloud::Compute::Real - About 5 hrs to fix

Long or complex methods can make code harder to understand. In most circumstances, methods are best as a small chunk of code (the "how") with a clear, understandable name (the "what"). Long methods can also lead to duplication, as it's harder to reuse logic that is tightly coupled to surrounding code.

Refactorings

Read More

Complex method in #basic_request

          def basic_request(*args)
            self.class_eval <<-EOS, __FILE__,__LINE__
              def #{args[0]}(uri)
                request(
                  {
Found in Fog::Vcloud::Compute::Real - About 2 hrs to fix

Long or complex methods can make code harder to understand. In most circumstances, methods are best as a small chunk of code (the "how") with a clear, understandable name (the "what"). Long methods can also lead to duplication, as it's harder to reuse logic that is tightly coupled to surrounding code.

Refactorings

Read More

Complex method in #configure_metadata

    class Collection < Fog::Collection
      def load(objects)
        objects = [ objects ] if objects.is_a?(Hash)
        super
      end
Found in Fog::Vcloud::Compute::Real - About 2 hrs to fix

Long or complex methods can make code harder to understand. In most circumstances, methods are best as a small chunk of code (the "how") with a clear, understandable name (the "what"). Long methods can also lead to duplication, as it's harder to reuse logic that is tightly coupled to surrounding code.

Refactorings

Read More

Similar code found in 1 other location

require 'fog/vcloud/core'

module Fog
  module Vcloud
    class Collection < Fog::Collection
Found in Fog::Vcloud::Compute::Real and 1 other location - About 4 hrs to fix
lib/fog/vcloud/requests/compute/configure_vapp.rb on lines 4..10

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Refactorings

Further Reading

Similar code found in 1 other location

require 'fog/vcloud/core'

module Fog
  module Vcloud
    class Collection < Fog::Collection
Found in Fog::Vcloud::Compute::Real and 1 other location - About 4 hrs to fix
lib/fog/vcloud/requests/compute/configure_vm.rb on lines 4..10

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Refactorings

Further Reading

Similar code found in 1 other location

require 'fog/vcloud/core'

module Fog
  module Vcloud
    class Collection < Fog::Collection
Found in Fog::Vcloud::Compute::Real and 1 other location - About 4 hrs to fix
lib/fog/vcloud_director/generators/compute/edge_gateway_service_configuration.rb on lines 33..38

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Refactorings

Further Reading

Similar code found in 1 other location

require 'fog/vcloud/core'

module Fog
  module Vcloud
    class Collection < Fog::Collection
Found in Fog::Vcloud::Compute::Real and 1 other location - About 3 hrs to fix
lib/fog/vcloud/requests/compute/configure_vapp.rb on lines 96..106

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Refactorings

Further Reading

Similar code found in 1 other location

require 'fog/vcloud/core'

module Fog
  module Vcloud
    class Collection < Fog::Collection
Found in Fog::Vcloud::Compute::Real and 1 other location - About 3 hrs to fix
lib/fog/vcloud/requests/compute/configure_vm.rb on lines 91..101

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Refactorings

Further Reading

Similar code found in 1 other location

require 'fog/vcloud/core'

module Fog
  module Vcloud
    class Collection < Fog::Collection
Found in Fog::Vcloud::Compute::Real and 1 other location - About 3 hrs to fix
lib/fog/vcloud/requests/compute/configure_vm_cpus.rb on lines 10..10

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Refactorings

Further Reading

Similar code found in 1 other location

require 'fog/vcloud/core'

module Fog
  module Vcloud
    class Collection < Fog::Collection
Found in Fog::Vcloud::Compute::Real and 1 other location - About 3 hrs to fix
lib/fog/vcloud/requests/compute/configure_vm_memory.rb on lines 10..10

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Refactorings

Further Reading

Similar code found in 1 other location

require 'fog/vcloud/core'

module Fog
  module Vcloud
    class Collection < Fog::Collection
Found in Fog::Vcloud::Compute::Real and 1 other location - About 3 hrs to fix
lib/fog/vcloud/requests/compute/configure_network.rb on lines 12..22

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Refactorings

Further Reading

Similar code found in 1 other location

require 'fog/vcloud/core'

module Fog
  module Vcloud
    class Collection < Fog::Collection
Found in Fog::Vcloud::Compute::Real and 1 other location - About 3 hrs to fix
lib/fog/vcloud/requests/compute/configure_network_ip.rb on lines 18..28

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Refactorings

Further Reading

Similar code found in 2 other locations

require 'fog/vcloud/core'

module Fog
  module Vcloud
    class Collection < Fog::Collection
Found in Fog::Vcloud::Compute::Real and 2 other locations - About 2 hrs to fix
lib/fog/vcloud/requests/compute/configure_vm_customization_script.rb on lines 18..25
lib/fog/vcloud/requests/compute/configure_vm_password.rb on lines 24..31

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Refactorings

Further Reading

Similar code found in 2 other locations

require 'fog/vcloud/core'

module Fog
  module Vcloud
    class Collection < Fog::Collection
Found in Fog::Vcloud::Compute::Real and 2 other locations - About 2 hrs to fix
lib/fog/vcloud/requests/compute/configure_vm_network.rb on lines 21..28
lib/fog/vcloud/requests/compute/configure_vm_password.rb on lines 24..31

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Refactorings

Further Reading

Similar code found in 2 other locations

require 'fog/vcloud/core'

module Fog
  module Vcloud
    class Collection < Fog::Collection
Found in Fog::Vcloud::Compute::Real and 2 other locations - About 2 hrs to fix
lib/fog/vcloud/requests/compute/configure_vm_customization_script.rb on lines 18..25
lib/fog/vcloud/requests/compute/configure_vm_network.rb on lines 21..28

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Refactorings

Further Reading

Similar code found in 1 other location

require 'fog/vcloud/core'

module Fog
  module Vcloud
    class Collection < Fog::Collection
Found in Fog::Vcloud::Compute::Real and 1 other location - About 2 hrs to fix
lib/fog/vcloud/requests/compute/configure_vm_disks.rb on lines 52..55

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Refactorings

Further Reading

Similar code found in 1 other location

require 'fog/vcloud/core'

module Fog
  module Vcloud
    class Collection < Fog::Collection
Found in Fog::Vcloud::Compute::Real and 1 other location - About 2 hrs to fix
lib/fog/vcloud/requests/compute/configure_vapp.rb on lines 37..40

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Refactorings

Further Reading

Similar code found in 1 other location

require 'fog/vcloud/core'

module Fog
  module Vcloud
    class Collection < Fog::Collection
Found in Fog::Vcloud::Compute::Real and 1 other location - About 2 hrs to fix
lib/fog/vcloud/requests/compute/configure_org_network.rb on lines 26..46

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Refactorings

Further Reading

Similar code found in 1 other location

require 'fog/vcloud/core'

module Fog
  module Vcloud
    class Collection < Fog::Collection
Found in Fog::Vcloud::Compute::Real and 1 other location - About 2 hrs to fix
lib/fog/vcloud/requests/compute/configure_org_network.rb on lines 49..69

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Refactorings

Further Reading

There are no issues that match your filters.

require 'fog/vcloud/core'

module Fog
  module Vcloud
    class Collection < Fog::Collection
      def load(objects)
        objects = [ objects ] if objects.is_a?(Hash)
        super
      end

      def check_href!(opts = {})
        self.href = service.default_vdc_href unless href
        unless href
          if opts.is_a?(String)
            t = Hash.new
            t[:parent] = opts
            opts = t
          end
          msg = ":href missing, call with a :href pointing to #{if opts[:message]
                  opts[:message]
                elsif opts[:parent]
                  "the #{opts[:parent]} whos #{self.class.to_s.split('::').last.downcase} you want to enumerate"
                else
                  "the resource"
                end}"
          raise Fog::Errors::Error.new(msg)
        end
      end
    end
  end
end

module Fog
  module Vcloud
    class Model < Fog::Model
      attr_accessor :loaded
      alias_method :loaded?, :loaded

      def reload
        instance = super
        @loaded = true
        instance
      end

      def load_unless_loaded!
        unless @loaded
          reload
        end
      end

      def link_up
        load_unless_loaded!
        self.links.find{|l| l[:rel] == 'up' }
      end

      def self.has_up(item)
        class_eval <<-EOS, __FILE__,__LINE__
          def #{item}
            load_unless_loaded!
            service.get_#{item}(link_up[:href])
          end
        EOS
      end
    end
  end
end

module Fog
  module Vcloud
    class Compute < Fog::Service
      BASE_PATH   = '/api'
      DEFAULT_VERSION = '1.5'
      SUPPORTED_VERSIONS = [ '1.5', '1.0' ]
      PORT   = 443
      SCHEME = 'https'

      attr_writer :default_organization_uri

      requires   :vcloud_username, :vcloud_password, :vcloud_host
      recognizes :vcloud_port, :vcloud_scheme, :vcloud_path, :vcloud_default_vdc, :vcloud_version, :vcloud_base_path
      recognizes :provider # remove post deprecation

      model_path 'fog/vcloud/models/compute'
      model :catalog
      collection :catalogs
      model :catalog_item
      model :catalog_items
      model :ip
      collection :ips
      model :network
      collection :networks
      model :server
      collection :servers
      model :task
      collection :tasks
      model :vapp
      collection :vapps
      model :vdc
      collection :vdcs
      model :organization
      collection :organizations
      model :tag
      collection :tags

      request_path 'fog/vcloud/requests/compute'
      request :clone_vapp
      request :configure_network
      request :configure_network_ip
      request :configure_vapp
      request :configure_vm_memory
      request :configure_vm_cpus
      request :configure_org_network
      request :configure_vm_name_description
      request :configure_vm_disks
      request :configure_vm_password
      request :configure_vm_network
      request :delete_vapp
      request :get_catalog_item
      request :get_customization_options
      request :get_network_ip
      request :get_network_ips
      request :get_network_extensions
      request :get_task_list
      request :get_vapp_template
      request :get_vm_disks
      request :get_vm_memory
      request :instantiate_vapp_template
      request :login
      request :power_off
      request :power_on
      request :power_reset
      request :power_shutdown
      request :undeploy
      request :get_metadata
      request :delete_metadata
      request :configure_metadata
      request :configure_vm_customization_script

      class Mock
        def initialize(options={})
          Fog::Mock.not_implemented
        end
      end

      class Real
        class << self
          def basic_request(*args)
            self.class_eval <<-EOS, __FILE__,__LINE__
              def #{args[0]}(uri)
                request(
                  {
                    :expects => #{args[1] || 200},
                    :method  => '#{args[2] || 'GET'}',
                    :headers => #{args[3] ? args[3].inspect : '{}'},
                    :body => '#{args[4] ? args[4] : ''}',
                    :parse => true,
                    :uri     => uri
                  }
                )
              end
            EOS
          end

          def unauthenticated_basic_request(*args)
            self.class_eval <<-EOS, __FILE__,__LINE__
              def #{args[0]}(uri)
                unauthenticated_request({
                  :expects => #{args[1] || 200},
                  :method  => '#{args[2] || 'GET'}',
                  :headers => #{args[3] ? args[3].inspect : '{}'},
                  :parse => true,
                  :uri     => uri })
              end
            EOS
          end
        end

        attr_reader :version

        def initialize(options = {})
          require 'builder'

          @connections = {}
          @connection_options = options[:connection_options] || {}
          @persistent = options[:persistent]

          @username  = options[:vcloud_username]
          @password  = options[:vcloud_password]
          @host      = options[:vcloud_host]
          @base_path = options[:vcloud_base_path]   || Fog::Vcloud::Compute::BASE_PATH
          @version   = options[:vcloud_version]     || Fog::Vcloud::Compute::DEFAULT_VERSION
          @path      = options[:vcloud_path]        || "#{@base_path}/v#{@version}"
          @port      = options[:vcloud_port]        || Fog::Vcloud::Compute::PORT
          @scheme    = options[:vcloud_scheme]      || Fog::Vcloud::Compute::SCHEME
          @vdc_href  = options[:vcloud_default_vdc]
        end

        def reload
          @connections.each_value { |k,v| v.reset if v }
        end

        def default_organization_uri
          @default_organization_uri ||= organizations.first.href
          @default_organization_uri
        end

        def default_vdc_href
          if @vdc_href.nil?
            unless @login_results
              do_login
            end
            org = organizations.first
            vdc = get_organization(org.href).links.find { |item| item[:type] == 'application/vnd.vmware.vcloud.vdc+xml'}
            @vdc_href = vdc[:href]
          end
          @vdc_href
        end

        # login handles the auth, but we just need the Set-Cookie
        # header from that call.
        def do_login
          @login_results = login
          @cookie = @login_results.headers['Set-Cookie'] || @login_results.headers['set-cookie']
        end

        def ensure_unparsed(uri)
          if uri.is_a?(String)
            uri
          else
            uri.to_s
          end
        end

        def xmlns
          if version == '1.0'
            { "xmlns" => "http://www.vmware.com/vcloud/v1",
              "xmlns:ovf" => "http://schemas.dmtf.org/ovf/envelope/1",
              "xmlns:xsi" => "http://www.w3.org/2001/XMLSchema-instance",
              "xmlns:xsd" => "http://www.w3.org/2001/XMLSchema" }
          else
            { 'xmlns' => "http://www.vmware.com/vcloud/v1.5",
              "xmlns:ovf" => "http://schemas.dmtf.org/ovf/envelope/1",
              "xmlns:xsi" => "http://www.w3.org/2001/XMLSchema-instance",
              "xmlns:xsd" => "http://www.w3.org/2001/XMLSchema" }
          end
        end

        # If the cookie isn't set, do a get_organizations call to set it
        # and try the request.
        # If we get an Unauthorized error, we assume the token expired, re-auth and try again
        def request(params)
          unless @cookie
            do_login
          end
          begin
            do_request(params)
          rescue Excon::Errors::Unauthorized
            do_login
            do_request(params)
          end
        end

        def basic_request_params(uri,*args)
          {
            :expects => args[0] || 200,
            :method  => args[1] || 'GET',
            :headers => args[2] ? args[2].inspect : {},
            :body => args[3] ? args[3] : '',
            :parse => true,
            :uri     => uri
          }
        end

        def base_path_url
          "#{@scheme}://#{@host}:#{@port}#{@base_path}"
        end

        private
        def ensure_parsed(uri)
          if uri.is_a?(String)
            URI.parse(uri)
          else
            uri
          end
        end

        # Don't need to  set the cookie for these or retry them if the cookie timed out
        def unauthenticated_request(params)
          do_request(params)
        end

        def base_url
          "#{@scheme}://#{@host}:#{@port}#{@path}"
        end

        # Use this to set the Authorization header for login
        def authorization_header
          "Basic #{Base64.encode64("#{@username}:#{@password}").delete("\r\n")}"
        end

        # Actually do the request
        def do_request(params)
          # Convert the uri to a URI if it's a string.
          if params[:uri].is_a?(String)
            params[:uri] = URI.parse(params[:uri])
          end
          host_url = "#{params[:uri].scheme}://#{params[:uri].host}#{params[:uri].port ? ":#{params[:uri].port}" : ''}"

          # Hash connections on the host_url ... There's nothing to say we won't get URI's that go to
          # different hosts.
          @connections[host_url] ||= Fog::XML::Connection.new(host_url, @persistent, @connection_options)

          # Set headers to an empty hash if none are set.
          headers = params[:headers] || {}
          headers['Accept'] = 'application/*+xml;version=1.5' if version == '1.5'

          # Add our auth cookie to the headers
          if @cookie
            headers.merge!('Cookie' => @cookie)
          end

          # Make the request
          response = @connections[host_url].request({
            :body     => params[:body] || '',
            :expects  => params[:expects] || 200,
            :headers  => headers,
            :method   => params[:method] || 'GET',
            :path     => params[:uri].path
          })

          # Parse the response body into a hash
          unless response.body.empty?
            if params[:parse]
              document = Fog::ToHashDocument.new
              parser = Nokogiri::XML::SAX::PushParser.new(document)
              parser << response.body
              parser.finish
              response.body = document.body
            end
          end

          response
        end
      end
      def self.item_requests(*types)
        types.each{|t| item_request(t) }
      end
      def self.item_request(type)
        Fog::Vcloud::Compute::Real.class_eval <<-EOS, __FILE__,__LINE__
          def get_#{type}(uri)
            Fog::Vcloud::Compute::#{type.to_s.capitalize}.new(
              self.request(basic_request_params(uri)).body.merge(
                :service => self,
                :collection => Fog::Vcloud::Compute::#{type.to_s.capitalize}s.new(
                  :service => self
                )
              )
            )
          end
        EOS
      end

      item_requests :organization, :vdc, :network, :vapp, :server, :catalog, :task
    end
  end
end

Size

Lines of code
311