GithubHelp home page GithubHelp logo

td-1's Introduction

Treasure Data command line tool

<img src=“https://travis-ci.org/treasure-data/td.svg?branch=master” alt=“Build Status” /> <img src=“https://ci.appveyor.com/api/projects/status/github/treasure-data/td?branch=master&svg=true” alt=“appveyor” /> <img src=“https://coveralls.io/repos/treasure-data/td/badge.svg?branch=master&service=github” alt=“Coverage Status” />

This CUI utility wraps the Ruby Client Library td-client-ruby to interact with the REST API in managing databases and jobs on the Treasure Data Cloud.

For more info about Treasure Data, see <www.treasuredata.com/>.

For full documentation see <docs.treasuredata.com/>.

Getting Started

Install td command as a gem.

> gem install td

See help message for details.

> td

You need to authorize the account, before executing any other commands.

> td account

Sample Workflow

> td account -f                       # authorize an account
user: [email protected]
password: **********
> td database:create mydb             # create a database
> td table:create mydb www_access     # create a table

Packaging

Mac OS X

Disable RVM or rbenv and use ruby.pkg’s ruby (/usr/local/td/ruby/bin/ruby). And then run following commands:

$ /usr/local/td/ruby/bin/gem install bundler rubyzip
$ /usr/local/td/ruby/bin/bundle install
$ /usr/local/td/ruby/bin/rake pkg:build

It uses github.com/treasure-data/ruby-osx-packager

Windows

Install following binary packages:

* MinGW with MSYS Basic System and using mingw-get-inst
* Git for Windows, with Windows Command Prompt support
* Ruby ruby-1.9.3p327 using RubyInstaller for Windows, with PATH update
* Inno Setup 5

Then run following commands on MinGW Shell:

$ mingw-get install msys-vim
$ mingw-get install msys-wget
$ gem install bundler rubyzip
$ bundle install  # don't use "--path" option
$ rake exe:build  # don't use "bundle exec"

Bulk Import

Some of the td commands prefixed with td import leverages the Java Bulk Import CLI td-import-java to process and Bulk load data in the Treasure Data Cloud.

The Bulk Import CLI is downloaded automatically at the first call to any of the command that require it; the use will need internet connectivity in order to fetch the Bulk Import CLI JAR file from the Central Maven repository and take advantage of these advanced features. If you need to setup a proxy, please consult this documentation page.

The log levels and properties of the Bulk Import CLI can be configured in a logging.properties file. A default configuration is provided in a file within the gem or Toolbelt folder root, in the java/ folder. If you wish to customize it, please make a copy of this file and store it in the:

~/.td/java             folder on Mac OSX or Linux
%USERPROFILE%\.td\java folder on Windows

Testing Hooks

The CLI implements several hooks to enable/disable/trigger special behaviors. These hooks are expressed as environment variables and can therefore be provided in several ways:

How to Use

  • Unix / Linux / MacOSX

    • environment variable export in the shell the command is executed. The setting remains active until the shell is closed. E.g.:

      $ export TD_TOOLBELT_DEBUG=1
    • in the shell configuration file, to be active in any new shell that is opened. E.g.: add

      export TD_TOOLBELT_DEBUG=1
      

      to ~/.bashrc or equivalent shell configuration file. To make the setting active in the current shell, source the configuration file, e.g.:

      $ source ~/.bashrc
    • on the command line at runtime (active only for the duration of the command). E.g.:

      $ TD_TOOLBELT_DEBUG=1 td ....
    • as alias on in the current shell. The setting remains active until the shell is closed. E.g.:

      $ alias td='TD_TOOLBELT_DEBUG=1 td'
    • as alias in configuration file, to be active in any new shell that is opened. E.g.:

      alias td='TD_TOOLBELT_DEBUG=1 td'`

      to ~/.bashrc or equivalent shell configuration file. To make the setting active in the current shell, source the configuration file, e.g.:

      $ source ~/.bashrc
  • Windows

    • in the command prompt the command is executed. The setting remains active until the command prompt window is closed. E.g.:

      cmd> set TD_TOOLBELT_DEBUG=1
    • as a global environment variable in the system settings. It will be active for all new command prompt windows.

These are the available hooks:

  • Enable debugging mode:

    $ TD_TOOLBELT_DEBUG=1
  • JAR auto update (enabled by default is not specified). This setting does not affect import:jar_update:

    • Enable:

      $ TD_TOOLBELT_JAR_UPDATE=1
    • Disable:

      $ TD_TOOLBELT_JAR_UPDATE=0
  • Specify an alternative endpoint to use updating the toolbelt (default: toolbelt.treasuredata.com):

    $ TD_TOOLBELT_UPDATE_ROOT="http://toolbelt.treasuredata.com"
  • Specify an alternative endpoint to use updating the JAR file (default: repo1.maven.org):

    $ TD_TOOLBELT_JARUPDATE_ROOT="https://repo1.maven.org"

Copyright

Copyright

Copyright © 2015 Treasure Data Inc.

License

Apache License, Version 2.0

td-1's People

Contributors

akito19 avatar danielnorberg avatar eddsteel avatar frsyuki avatar guilleiguaran avatar hieudion avatar jwyuan avatar k0kubun avatar kamikaseda avatar kazukoohmura avatar kenhys avatar kietdo360 avatar komamitsu avatar kzk avatar makimoto avatar mcaramello avatar muga avatar nahi avatar naritta avatar nurse avatar repeatedly avatar tagomoris avatar takkanm avatar toru-takahashi avatar trung-huynh avatar tung-vu avatar uu59 avatar y-ken avatar yakitorii avatar yui-knk avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.