class RedfishTools::Cli::Serve

Public Class Methods

new(path, options) click to toggle source
# File lib/redfish_tools/cli/serve.rb, line 9
def initialize(path, options)
  @path = path
  @options = options
end

Public Instance Methods

run() click to toggle source
# File lib/redfish_tools/cli/serve.rb, line 14
def run
  datastore = RedfishTools::DataStore.new(@path)
  server = RedfishTools::Server.new(datastore,
                                    @options[:user],
                                    @options[:pass],
                                    Port: @options[:port],
                                    BindAddress: @options[:bind],
                                    SSLEnable: @options[:ssl],
                                    SSLCertName: [%w[CN localhost]])
  trap("INT") { server.shutdown }
  server.start
end