Package couchdbkit :: Module client :: Class Server
[hide private]
[frames] | no frames]

Class Server

source code

object --+
         |
        Server

Server object that allows you to access and manage a couchdb node. A Server object can be used like any `dict` object.

Nested Classes [hide private]
  resource_class
Instance Methods [hide private]
 
__init__(self, uri='http://127.0.0.1:5984', uuid_batch_count=1000, resource_class=None, resource_instance=None, **client_opts)
constructor for Server object
source code
 
info(self)
info of server
source code
 
all_dbs(self)
get list of databases in CouchDb host
source code
 
get_db(self, dbname, **params)
Try to return a Database object for dbname.
source code
 
create_db(self, dbname, **params)
Try to return a Database object for dbname.
source code
 
get_or_create_db(self, dbname, **params)
Try to return a Database object for dbname.
source code
 
delete_db(self, dbname)
Delete database
source code
 
replicate(self, source, target, **params)
simple handler for replication
source code
 
active_tasks(self)
return active tasks
source code
 
uuids(self, count=1) source code
 
next_uuid(self, count=None)
return an available uuid from couchdbkit
source code
 
__getitem__(self, dbname) source code
 
__delitem__(self, dbname) source code
 
__contains__(self, dbname) source code
 
__iter__(self) source code
 
__len__(self) source code
 
__nonzero__(self) source code
 
_db_uri(self, dbname) source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, uri='http://127.0.0.1:5984', uuid_batch_count=1000, resource_class=None, resource_instance=None, **client_opts)
(Constructor)

source code 

constructor for Server object

Parameters:
  • uri - uri of CouchDb host
  • uuid_batch_count - max of uuids to get in one time
  • resource_instance - `restkit.resource.CouchdbDBResource` instance. It alows you to set a resource class with custom parameters.
Overrides: object.__init__

info(self)

source code 

info of server

Returns:
dict

create_db(self, dbname, **params)

source code 

Try to return a Database object for dbname. If database doest't exist, it will be created.

get_or_create_db(self, dbname, **params)

source code 

Try to return a Database object for dbname. If database doest't exist, it will be created.

replicate(self, source, target, **params)

source code 

simple handler for replication

Parameters:
  • source - str, URI or dbname of the source
  • target - str, URI or dbname of the target
  • params - replication options

    More info about replication here : http://wiki.apache.org/couchdb/Replication