Sha256: 71d85afc6fc4319e57902f62b925e63d91d65ef7e8101f68f2e6acb03d4f2b59

Contents?: true

Size: 768 Bytes

Versions: 1

Compression:

Stored size: 768 Bytes

Contents

require 'uri'

module TreasureData
module Command

  def server_status(op)
    op.cmd_parse

    puts Client.server_status
  end

  def server_endpoint(op)
    endpoint = op.cmd_parse

    Command.validate_api_endpoint(endpoint)

    if Config.cl_endpoint and endpoint != Config.endpoint
      raise ParameterConfigurationError,
            "You specified the API server endpoint in the command options as well (-e / --endpoint option) but it does not match the value provided to the 'server:endpoint' command. Please remove the option or ensure the endpoints URLs match each other."
    end

    conf = nil
    begin
      conf = Config.read
    rescue ConfigError
      conf = Config.new
    end
    conf["account.endpoint"] = endpoint
    conf.save
  end

end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
td-0.11.2 lib/td/command/server.rb