def create_bucket(name, options = {})
      defaults = {
        :type => "couchbase",
        :ram_quota => 100,
        :replica_number => 1,
        :auth_type => "sasl",
        :sasl_password => "",
        :proxy_port => nil,
        :flush_enabled => false,
        :replica_index => true,
        :parallel_db_and_view_compaction => false
      }
      options = defaults.merge(options)
      params = {"name" => name}
      params["bucketType"] = options[:type]
      params["ramQuotaMB"] = options[:ram_quota]
      params["replicaNumber"] = options[:replica_number]
      params["authType"] = options[:auth_type]
      params["saslPassword"] = options[:sasl_password]
      params["proxyPort"] = options[:proxy_port]
      params["flushEnabled"] = options[:flush_enabled] ? 1 : 0
      params["replicaIndex"] = options[:replica_index] ? 1 : 0
      params["parallelDBAndViewCompaction"] = !!options[:parallel_db_and_view_compaction]
      payload = Utils.encode_params(params.reject! { |_k, v| v.nil? })
      response = @connection.send(:__http_query, :management, :post,
                                  "/pools/default/buckets", payload,
                                  "application/x-www-form-urlencoded", nil, nil, nil)
      Result.new(response.merge(:operation => :create_bucket))
    end
def create_bucket(name, options = {})
      defaults = {
        :type => "couchbase",
        :ram_quota => 100,
        :replica_number => 1,
        :auth_type => "sasl",
        :sasl_password => "",
        :proxy_port => nil,
        :flush_enabled => false,
        :replica_index => true,
        :parallel_db_and_view_compaction => false
      }
      options = defaults.merge(options)
      params = {"name" => name}
      params["bucketType"] = options[:type]
      params["ramQuotaMB"] = options[:ram_quota]
      params["replicaNumber"] = options[:replica_number]
      params["authType"] = options[:auth_type]
      params["saslPassword"] = options[:sasl_password]
      params["proxyPort"] = options[:proxy_port]
      params["flushEnabled"] = options[:flush_enabled] ? 1 : 0
      params["replicaIndex"] = options[:replica_index] ? 1 : 0
      params["parallelDBAndViewCompaction"] = !!options[:parallel_db_and_view_compaction]
      payload = Utils.encode_params(params.reject! { |_k, v| v.nil? })
      response = @connection.send(:__http_query, :management, :post,
                                  "/pools/default/buckets", payload,
                                  "application/x-www-form-urlencoded", nil, nil, nil)
      Result.new(response.merge(:operation => :create_bucket))
    end
Establish connection to the cluster for administration

 @param [String] connstr ("couchbasae://localhost") connection string
 @param [Hash] options The connection parameter
 @option options [String] :username The username
 @option options [String] :password The password
 Create data bucket

 @param [String] name The name of the bucket
 @param [Hash] options The bucket parameters
 @option options [String] :bucket_type ("couchbase") The type of the
   bucket. Possible values are "memcached" and "couchbase".
 @option options [Fixnum] :ram_quota (100) The RAM quota in megabytes.
 @option options [Fixnum] :replica_number (1) The number of replicas of
   each document. Minimum 0, maximum 3.
 @option options [String] :auth_type ("sasl") The authentication type.
   Possible values are "sasl" and "none". Note you should specify free
   port for "none"
 @option options [Fixnum] :proxy_port The port for moxi
 @option options [true, false] :replica_index (true) Disable or
   enable indexes for bucket replicas
 @option options [true, false] :flush_enabled (false) Enables the
   'flush all' functionality on the specified bucket.
 @option options [true, false] :parallel_db_and_view_compaction (false)
   Indicates whether database and view files on disk can be
   compacted simultaneously