Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

CBD-594: Add cbdocloader func spec

Change-Id: I086222c5e6eede296a29435a2f4bd490ac3f7061
Reviewed-on: http://review.couchbase.org/20996
Reviewed-by: Steve Yen <steve.yen@gmail.com>
Tested-by: Bin Cui <bin.cui@gmail.com>
  • Loading branch information...
commit 693225bbf5939f91bb58757e067ff58643d4ca3b 1 parent 0a08bf1
Bin Cui bcui6611 authored Peter Wansch committed

Showing 2 changed files with 61 additions and 10 deletions. Show diff stats Hide diff stats

  1. +0 10 README
  2. +61 0 README.md
10 README
... ... @@ -1,10 +0,0 @@
1   -
2   -1. Install couchbase python client library
3   - git clone git://github.com/couchbase/couchbase-python-client.git
4   - python setup.py install
5   -
6   -2. Run cbdocloader
7   - cbdocloader.py -u Administrator -p 123456 -b mybucket testapp.zip
8   -or cbdocloader.py -u Administrator -p 123456 -b mybucket testapp.zip
9   -or cbdocloader -p 8091 -b newsim -u newsim -p newsim gamesim-sample.zip
10   -
61 README.md
Source Rendered
... ... @@ -0,0 +1,61 @@
  1 +Docloader
  2 +=============
  3 +
  4 +We use this tool to upload a bunch of json documents into Couchbase Server.
  5 +
  6 +Build
  7 +-------
  8 +
  9 +After you clone the project from `git@github.com:couchbase/couchbase-examples.git`, run the following command:
  10 +
  11 + config/autorun.sh
  12 +
  13 +To build the package, run
  14 +
  15 + make bdist
  16 +
  17 +Run command
  18 +------------
  19 +
  20 + cbdocloader OPTIONS DOCUMENTS
  21 +
  22 +DOCUMENTS:
  23 +
  24 +The documents parameter can be either a directory name which contains all the json documents or a .zip file which archives the document directory.
  25 +
  26 +Generally speaking, the document directory should have the following layout:
  27 +
  28 + /design_docs which contains all the design docs for views.
  29 + /docs which contains all the raw json data files. It can have other sub directories too.
  30 +
  31 +All json files should be well formatted. And no spaces allowed in file names. Design docs will be uploaded after all other data files.
  32 +
  33 +OPTIONS:
  34 +
  35 + `-n HOST[:PORT]`, --node=HOST[:PORT] Default port is 8091
  36 +
  37 + `-u USERNAME`, --user=USERNAME REST username of the cluster. It can be specified in environment variable REST_USERNAME.
  38 +
  39 + `-p PASSWORD`, --password=PASSWORD REST password of the cluster. It can be specified in environment variable REST_PASSWORD.
  40 +
  41 + `-b BUCKETNAME`, --bucket=BUCKETNAME Specific bucket name. Default is default bucket. Bucket will be created if it doesn't exist.
  42 +
  43 + `-s QUOTA`, RAM quota for the bucket. Unit is MB. Default is 100MB.
  44 +
  45 + `-h` --help Show this help message and exit
  46 +
  47 +Example
  48 +-------
  49 +
  50 + # Upload documents archived in zip file ../samples/gamesim.zip. All data will be inserted in bucket mybucket
  51 + #
  52 + ./cbdocloader -n localhost:8091 -u Administrator -p password -b mybucket ../samples/gamesim.zip
  53 +
  54 +Errors
  55 +------
  56 +
  57 +These are kinds of error cases to consider ...
  58 +
  59 +* JSON files are not well formatted
  60 +* Wrong REST username and password
  61 +* Bucket cannot be created due to too large ram quota specified.

0 comments on commit 693225b

Please sign in to comment.
Something went wrong with that request. Please try again.