builder/extra/cluster-home/samples/bin/CLI_API.rb
def configure
        super()
    
        require_installed_directory?(false)
        @cctrl = TungstenDataserviceManager.new(nil)
        apis = @cctrl.to_hash
        # 
        # loops through the API calls and creates an option for each one
        #
        apis.each { |name,api| 
            add_option(name.to_sym, {
                :on => "--#{name}",
                :help => api['help'],
                :default => false
                })
        }
        #
        # Add an option to define to which datasource we want to apply the call
        #
        add_option(:target, {
            :on => "--target String",
            :help => "defines the datasource to which we apply the api call ",
            :default => nil
        })

        #
        # Add an option to show the outline of the returning object
        #
        add_option(:structure, {
            :on => "--structure",
            :help => "Prints an outline of the object structure for each call",
            :default => false
        })
        
        #
        # Add an option to define the data service
        #
        add_option(:service, {
            :on => "--service String",
            :help => "defines the service name for the API call",
            :default => nil
        })

        #
        # Add an option to define the manager API server
        #
        add_option(:api_server, {
            :on => "--api-server String",
            :help => "defines the server to ask for the API",
            :default => 'localhost:8090'
        })

        #
        # We can instead list all calls
        #
        add_option(:list, {
            :on => "--list",
            :help => "Shows the api list",
            :default => false
        })
    end
#
# Initializes the cctrl object
# and creates a command line option for every API call available
#
Initializes the cctrl object
and creates a command line option for every API call available
Initializes the cctrl object and creates a command line option for every API call available
def configure
        super()
        require_installed_directory?(false)
        @cctrl = TungstenDataserviceManager.new(nil)
        apis = @cctrl.to_hash
        loops through the API calls and creates an option for each one
        apis.each { |name,api| 
            add_option(name.to_sym, {
                :on => "--{name}",
                :help => api['help'],
                :default => false
                })
        }
        Add an option to define to which datasource we want to apply the call
        add_option(:target, {
            :on => "--target String",
            :help => "defines the datasource to which we apply the api call ",
            :default => nil
        })
        Add an option to show the outline of the returning object
        add_option(:structure, {
            :on => "--structure",
            :help => "Prints an outline of the object structure for each call",
            :default => false
        })
        Add an option to define the data service
        add_option(:service, {
            :on => "--service String",
            :help => "defines the service name for the API call",
            :default => nil
        })
        Add an option to define the manager API server
        add_option(:api_server, {
            :on => "--api-server String",
            :help => "defines the server to ask for the API",
            :default => 'localhost:8090'
        })
        We can instead list all calls
        add_option(:list, {
            :on => "--list",
            :help => "Shows the api list",
            :default => false
        })
    end
def configure super ( ) require_installed_directory? ( false ) @cctrl = TungstenDataserviceManager . new ( nil ) apis = @cctrl . to_hash apis . each { | name , api | add_option ( name . to_sym , { :on => "--#{name}" , :help => api [ 'help' ] , :default => false } ) } add_option ( :target , { :on => "--target String" , :help => "defines the datasource to which we apply the api call " , :default => nil } ) add_option ( :structure , { :on => "--structure" , :help => "Prints an outline of the object structure for each call" , :default => false } ) add_option ( :service , { :on => "--service String" , :help => "defines the service name for the API call" , :default => nil } ) add_option ( :api_server , { :on => "--api-server String" , :help => "defines the server to ask for the API" , :default => 'localhost:8090' } ) add_option ( :list , { :on => "--list" , :help => "Shows the api list" , :default => false } ) end
Initializes the cctrl object
and creates a command line option for every API call available
Initializes the cctrl object and creates a command line option for every API call available
#  # loops through the API calls and creates an option for each one # # # Add an option to define to which datasource we want to apply the call # # # Add an option to show the outline of the returning object # # # Add an option to define the data service # # # Add an option to define the manager API server # # # We can instead list all calls #