SequoiaDB
 All Classes Functions
Public Member Functions | Static Public Attributes | List of all members
pysequoiadb.client.client Class Reference
Inheritance diagram for pysequoiadb.client.client:

Public Member Functions

def __init__
 
def __del__
 
def __repr__
 
def __getitem__
 
def __getattr__
 
def connect_to_hosts
 
def connect
 
def disconnect
 
def create_user
 
def remove_user
 
def get_snapshot
 
def reset_snapshot
 
def get_list
 
def get_collection
 
def get_collection_space
 
def create_collection_space
 
def drop_collection_space
 
def rename_collection_space
 
def list_collection_spaces
 
def list_collections
 
def list_replica_groups
 
def get_replica_group_by_name
 
def get_replica_group_by_id
 
def get_cata_replica_group
 
def get_coord_replica_group
 
def create_replica_group
 
def create_cata_replica_group
 
def create_coord_replica_group
 
def create_replica_cata_group
 
def remove_replica_group
 
def remove_cata_replica_group
 
def remove_coord_replica_group
 
def start_replica_group
 
def stop_replica_group
 
def exec_update
 
def exec_sql
 
def transaction_begin
 
def transaction_commit
 
def transaction_rollback
 
def flush_configure
 
def update_config
 
def delete_config
 
def create_procedure
 
def remove_procedure
 
def list_procedures
 
def eval_procedure
 
def backup
 
def backup_offline
 
def list_backup
 
def remove_backup
 
def list_tasks
 
def wait_task
 
def cancel_task
 
def set_session_attri
 
def get_session_attri
 
def interrupt_operation
 
def interrupt
 
def close_all_cursors
 
def is_valid
 
def list_domains
 
def is_domain_existing
 
def create_domain
 
def drop_domain
 
def get_domain
 
def sync
 
def analyze
 
def invalidate_cache
 
def force_session
 
def reload_config
 
def set_pdlevel
 
def force_stepup
 
def create_sequence
 
def drop_sequence
 
def get_sequence
 
def rename_sequence
 

Static Public Attributes

string HOST "localhost"
 
string SERVICE "11810"
 
string USER ""
 
string PSW ""
 

Detailed Description

SequoiaDB Client Driver

The client support interfaces to connect to SequoiaDB.
In order to connect to SequoiaDB, you need use the class first.
And you should make sure the instance of it released when you don't use it
any more.

All operation need deal with the error code returned first, if it has.
Every error code is not SDB_OK(or 0), it means something error has appeared,
and user should deal with it according the meaning of error code printed.

@version: execute to get version
          >>> import pysequoiadb
          >>> print pysequoiadb.get_version()

@notice : The dict of built-in Python is hashed and non-ordered. so the
          element in dict may not the order we make it. we make a dict and
          print it like this:
          ...
          >>> a = {"avg_age":24, "major":"computer science"}
          >>> a
          >>> {'major': 'computer science', 'avg_age': 24}
          ...
          the elements order it is not we make it!!
          therefore, we use bson.SON to make the order-sensitive dict if the
          order is important such as operations in "$sort", "$group",
          "split_by_condition", "aggregate","create_collection"...
          In every scene which the order is important, please make it using
          bson.SON and list. It is a subclass of built-in dict
          and order-sensitive

Constructor & Destructor Documentation

def pysequoiadb.client.client.__init__ (   self,
  host = None,
  service = None,
  user = None,
  psw = None,
  ssl = False,
  host_list = None,
  policy = None,
  token = None,
  cipher_file = None 
)
initialize when product an object.

   it will try to connect to SequoiaDB.

Parameters:
   Name           Type      Info:
   host           str       The hostname or IP address of SequoiaDB server. If None, "localhost" will be used.
   service        str/int   The service name or port number of SequoiaDB server. If None, "11810" will be used.
   user           str       The user name to access to SequoiaDB server. If None, "" will be used.
   psw            str       The user password to access to SequoiaDB server. If None, "" will be used.
   ssl            bool      Decide whether to use ssl or not, default is False.
   host_list      list      The list contains hosts. If both 'host' and 'host_list' exist, the 'host' is
                    preferred, if the size of the 'host_list' is 0, "localhost" will be used.
                    eg.
                    [ {'host':'sdbservre1', 'service':11810},
                      {'host':'sdbservre2', 'service':11810},
                      {'host':'sdbservre3', 'service':11810} ]
   policy         str       The policy of select hosts. it must be string of 'random' or 'local_first' or
                    'one_by_one', default is 'random'. 'local_first' will choose local host firstly,
                    then use 'random' if no local host.
   token          str       The Password encryption token, it needs to used with 'cipher_file'.
   cipher_file    str       The cipher file location, if both 'psw' and 'cipher_file' exist, the 'psw' is
                    preferred.

Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.client.client.__del__ (   self)
release resource when del called.

Exceptions:
   pysequoiadb.error.SDBBaseError

Member Function Documentation

def pysequoiadb.client.client.__getattr__ (   self,
  name 
)
support client.cs to access to collection space.

   eg.
   cc = client()
   cs = cc.test # access to collection space named 'test'

   and we should pass '__members__' and '__methods__',
   becasue dir(cc) will invoke __getattr__("__members__") and
   __getattr__("__methods__").

   if success, a collection object will be returned, or None.
Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.client.client.__getitem__ (   self,
  name 
)
support [] to access to collection space.

   eg.
   cc = client()
   cs = cc['test'] # access to collection space named 'test'.

Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.client.client.analyze (   self,
  options = None 
)
Analyze collection or index to collect statistics information

Parameters:
   Name         Type     Info:
   options      dict     The control options:
                 CollectionSpace:
                    (String) Specify the collection space to be analyzed.
                 Collection:
                    (String) Specify the collection to be analyzed.
                 Index:
                    (String) Specify the index to be analyzed.
                 Mode:
                    (Int32) Specify the analyze mode (default is 1):
                    Mode 1 will analyze with data samples.
                    Mode 2 will analyze with full data.
                    Mode 3 will generate default statistics.
                    Mode 4 will reload statistics into memory cache.
                    Mode 5 will clear statistics from memory cache.
                 Others:
                    Only take effect in coordinate nodes)
                    GroupID:INT32,
                    GroupName:String,
                    NodeID:INT32,
                    HostName:String,
                    svcname:String,
                    ...
Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.client.client.backup (   self,
  options = None 
)
Backup the whole database or specified replica group.

Parameters:
   Name      Type  Info:
   options   dict  Contains a series of backup configuration
                 information. Backup the whole cluster if None.
                 The "options" contains 6 options as below.
                 All the elements in options are optional.
                 eg:
                 { "GroupName":["rgName1", "rgName2"],
                   "Path":"/opt/sequoiadb/backup",
                   "Name":"backupName", "Description":description,
                   "EnsureInc":True, "OverWrite":True }
                 See Info as below.
Exceptions:
   pysequoiadb.error.SDBBaseError
Info:
   GroupName   :  The replica groups which to be backuped, if not assign, default all replica groups.
   Path        :  The backup path, if not assign, use the backup path assigned in configuration file.
   Name        :  The name for the backup.
   Description :  The description for the backup.
   EnsureInc   :  Whether execute increment synchronization,
                default to be False.
   OverWrite   :  Whether overwrite the old backup file,
                default to be False.
def pysequoiadb.client.client.backup_offline (   self,
  options = None 
)
Backup the whole database or specified replica group.
Knowing the specific params to function backup
def pysequoiadb.client.client.cancel_task (   self,
  task_id,
  is_async 
)
Cancel the specified task.

Parameters:
   Name         Type     Info:
   task_id      long     The task id to be canceled.
   is_async     bool     The operation "cancel task" is async or not,
                       "True" for async, "False" for sync.
Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.client.client.close_all_cursors (   self)
Send a "Interrupt" message to engine, as a result, all the cursors and lobs created by
 current connection will be closed.

Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.client.client.connect (   self,
  host,
  service,
  kwargs 
)
connect to specified database

Parameters:
   Name           Type     Info:
   host           str      The host name or IP address of database server.
   service        int/str  The service name of database server.
   **kwargs                Useful options are below:
   -  user        str      The user name to access to database.
   -  password    str      The user password to access to database,

Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.client.client.connect_to_hosts (   self,
  hosts,
  kwargs 
)
try to connect a host in specified hosts

Parameters:
   Name           Type     Info:
   hosts          list     The list contains hosts.
                   eg.
                   [ {'host':'sdbservre1', 'service':11810},
                     {'host':'sdbservre2', 'service':11810},
                     {'host':'sdbservre3', 'service':11810} ]
   **kwargs       Useful options are below:
   -  user        str      The user name to access to database.
   -  password    str      The user password to access to database.
   -  policy      str      The policy of select hosts. it must be string of 'random' or 'local_first' or
                   'one_by_one', default is 'random'. 'local_first' will choose local host firstly,
                   then use 'random' if no local host.

Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.client.client.create_cata_replica_group (   self,
  host,
  service,
  path,
  configure = None 
)
Create catalog replica group.

Parameters:
   Name         Type     Info:
   host         str      The hostname for the catalog replica group.
   service      str      The service name for the catalog replica group.
   path         str      The path for the catalog replica group.
   configure    dict     The optional configurations for the catalog replica group.
Return values:
   The created catalog replicagroup object.
Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.client.client.create_collection_space (   self,
  cs_name,
  options = 0 
)
Create collection space with specified pagesize.

Parameters:
   Name          Type     Info:
   cs_name       str      The name of collection space to be created.
   options       int/dict The options to create collection space.
                  When type is int, means setting PageSize.
    -PageSize    int      The page size of collection space. See Info
                       as below.
    -Domain      str      The domain of collection space to belongs
    -LobPageSize int      The page size when stored lob, see Info as below
Return values:
   collection space object created.
Exceptions:
   pysequoiadb.error.SDBBaseError
Info:
   valid page size value:
             0  :  64k default page size
          4096  :  4k
          8192  :  8k
         16384  :  16k
         32768  :  32k
         65536  :  64k
   valid LOB page size value:
             0  :  256k default Lob page size
          4096  :  4k
          8192  :  8k
         16384  :  16k
         32768  :  32k
         65536  :  64k
        131072  :  128k
        262144  :  256k
        524288  :  512k
def pysequoiadb.client.client.create_coord_replica_group (   self)
Create coordinator replica group.

Return values:
   The created coordinator replicagroup object.
Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.client.client.create_domain (   self,
  domain_name,
  options = None 
)
Create domain.

Parameters:
   Name        Type     Info
   domain_name  str     The domain name.
   options      dict    The options for the domain. The options are as below:
                Groups: the list of the replica groups' names which the domain is going to contain.
                        eg: { "Groups": [ "group1", "group2", "group3" ] }
                        If this argument is not included, the domain will contain all replica groups in the cluster.
                AutoSplit: If this option is set to be true, while creating collection(ShardingType is "hash") in this domain,
                           the data of this collection will be split(hash split) into all the groups in this domain automatically.
                           However, it won't automatically split data into those groups which were add into this domain later.
                           eg: { "Groups": [ "group1", "group2", "group3" ], "AutoSplit": True }
Return values:
   The created domain object.
Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.client.client.create_procedure (   self,
  code 
)
Create a store procedures

Parameters:
   Name         Type     Info:
   code         str      The JS code of store procedures.
Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.client.client.create_replica_cata_group (   self,
  host,
  service,
  path,
  configure = None 
)
Use create_cata_replica_group instead.
def pysequoiadb.client.client.create_replica_group (   self,
  group_name 
)
Create the specified replica group.

Parameters:
   Name        Type     Info:
   group_name  str      The name of replica group to be created.
Return values:
   The created replicagroup object.
Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.client.client.create_sequence (   self,
  sequence_name,
  options = None 
)
Create the sequence with specified options.

Parameters:
    Name             Type    Info
    sequence_name    str     The name of sequence.
    options          dict    The options for create sequence:
    - StartValue     int     The start value of sequence
    - MinValue       int     The minimum value of sequence
    - MaxValue       int     The maxmun value of sequence
    - Increment      int     The increment value of sequence
    - CacheSize      int     The cache size of sequence
    - AcquireSize    int     The acquire size of sequence
    - Cycled         bool    The cycled flag of sequence
Return values:
   A sequence object
Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.client.client.create_user (   self,
  name,
  psw 
)
Add an user in current database.

Parameters:
   Name         Type     Info:
   name         str      The name of user to be created.
   psw          str      The password of user to be created.
Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.client.client.delete_config (   self,
  configs,
  options 
)
Force the node to delete configs online.
Parameters:
   Name      Type  Info:
   configs   dict  The specific configuration parameters to delete
   options   dict  The configure information, pass {"Global":true} or
                 {"Global":false} In cluster environment, passing
                 {"Global":true} will flush data's and catalog's
                 configuration file, while passing {"Global":false} will
                 flush coord's configuration file. In stand-alone
                 environment, both them have the same behaviour.
Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.client.client.disconnect (   self)
disconnect to current server.

Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.client.client.drop_collection_space (   self,
  cs_name,
  options = None 
)
Remove the specified collection space.

Parameters:
   Name             Type     Info:
   cs_name          str      The name of collection space to be dropped
   options          dict     The options for dropping collection, default to be None
    - EnsureEmpty   bool     Ensure the collection space is empty or not, default to be false.
                      * True : Delete fails when the collection space is not empty
                      * False: Directly delete the collection space
Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.client.client.drop_domain (   self,
  domain_name 
)
Drop the specified domain.

Parameters:
    Name        Type     Info
    domain_name  str     The domain name.
Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.client.client.drop_sequence (   self,
  sequence_name 
)
Drop the specified sequence.

Parameters:
    Name             Type     Info
    sequence_name    str      The name of sequence.
Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.client.client.eval_procedure (   self,
  name 
)
Eval a func.

Parameters:
   Name         Type     Info:
   name         str      The name of store procedure.
Return values:
   cursor object of current eval.
Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.client.client.exec_sql (   self,
  sql 
)
Executing SQL command for query.

Parameters:
   Name         Type     Info:
   sql          str      The SQL command.
Return values:
   a cursor object of matching documents.
Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.client.client.exec_update (   self,
  sql 
)
Executing SQL command for updating, inserting and deleting.

Parameters:
   Name         Type     Info:
   sql          str      The SQL command.
Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.client.client.flush_configure (   self,
  options 
)
Flush the options to configure file.
Parameters:
   Name      Type  Info:
   options   dict  The configure information, pass {"Global":true} or
                 {"Global":false} In cluster environment, passing
                 {"Global":true} will flush data's and catalog's
                 configuration file, while passing {"Global":false} will
                 flush coord's configuration file. In stand-alone
                 environment, both them have the same behaviour.
Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.client.client.force_session (   self,
  session_id,
  options = None 
)
Terminate current operation of the specified session.

Parameters:
    Name         Type     Info
    session_id   int/long The id of session whose current operation is to be terminated.
    options      dict     Command location parameters.
Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.client.client.force_stepup (   self,
  options = None 
)
Force a slave node to be master.

Parameters:
    Name         Type     Info
    options      dict     The control parameters:
                  Seconds: (Type: int) Duration to be master. Default is 120.
Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.client.client.get_cata_replica_group (   self)
Get catalog replica group

Return values:
   The catalog replicagroup object.
Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.client.client.get_collection (   self,
  cl_full_name 
)
Get the specified collection.

Parameters:
   Name         Type     Info:
   cl_full_name str      The full name of collection
Return values:
   a collection object of query.
Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.client.client.get_collection_space (   self,
  cs_name 
)
Get the specified collection space.

Parameters:
   Name         Type     Info:
   cs_name      str      The name of collection space.
Return values:
   a collection space object of query.
Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.client.client.get_coord_replica_group (   self)
Get coordinator replica group

Return values:
   The coordinator replicagroup object.
Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.client.client.get_domain (   self,
  domain_name 
)
Get the specified domain.

Parameters:
    Name        Type     Info
    domain_name  str     The domain name.
Return values:
   The specified domain object.
Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.client.client.get_list (   self,
  list_type,
  kwargs 
)
Get information of the specified type.

Parameters:
   Name              Type     Info:
   list_type         int      Type of list option, see Info as below.
   **kwargs                   Useful options are below
   - condition       dict     The matching rule, match all the documents
                              if None.
   - selector        dict     The selective rule, return the whole
                              documents if None.
   - order_by        dict     The ordered rule, never sort if None.
   - hint            dict     The options provided for specific list type. Reserved.
   - num_to_skip     long     Skip the first numToSkip documents,
                              default is 0L.
   - num_to_return   long     Only return numToReturn documents,
                              default is -1L for returning
                              all results.
Return values:
   a cursor object of query
Exceptions:
   pysequoiadb.error.SDBBaseError
Info:
   list type:
     SDB_LIST_CONTEXTS              : Get all contexts list
     SDB_LIST_CONTEXTS_CURRENT      : Get contexts list for the current session
     SDB_LIST_SESSIONS              : Get all sessions list
     SDB_LIST_SESSIONS_CURRENT      : Get the current session
     SDB_LIST_COLLECTIONS           : Get all collections list
     SDB_LIST_COLLECTIONSPACES      : Get all collection spaces' list
     SDB_LIST_STORAGEUNITS          : Get storage units list
     SDB_LIST_GROUPS                : Get replicaGroup list ( only applicable in sharding env )
     SDB_LIST_STOREPROCEDURES       : Get store procedure list
     SDB_LIST_DOMAINS               : Get domains list
     SDB_LIST_TASKS                 : Get tasks list
     SDB_LIST_TRANSACTIONS          : Get transactions list
     SDB_LIST_TRANSACTIONS_CURRENT  : Get current session's transaction list
     SDB_LIST_SVCTASKS              : Get all the schedule task informations
     SDB_LIST_SEQUENCES             : Get all the sequence informations
     SDB_LIST_USERS                 : Get all the user informations
     SDB_LIST_BACKUPS               : Get backups list
def pysequoiadb.client.client.get_replica_group_by_id (   self,
  group_id 
)
Get the specified replica group of specified group id.

Parameters:
   Name       Type     Info:
   group_id   int      The id of replica group.
Return values:
   the replicagroup object of query.
Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.client.client.get_replica_group_by_name (   self,
  group_name 
)
Get the specified replica group of specified group name.

Parameters:
   Name         Type     Info:
   group_name   str      The name of replica group.
Return values:
   the replicagroup object of query.
Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.client.client.get_sequence (   self,
  sequence_name 
)
Get the named sequence.

Parameters:
    Name             Type     Info
    sequence_name    str      The name of sequence.
Return values:
   A sequence object
Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.client.client.get_session_attri (   self,
  useCache = True 
)
Get the attributes of the current session.

Parameters:
   Name         Type     Info:
   useCache     bool     Whether to use cache in local, default to be TRUE.

Return values:
   a dict object of attributes
Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.client.client.get_snapshot (   self,
  snap_type,
  kwargs 
)
Get the snapshots of specified type.

Parameters:
   Name              Type     Info:
   snap_type         int      The type of snapshot, see Info as below
   **kwargs                   Useful options are below
   - condition       dict     The matching rule, match all the documents if not provided.
   - selector        dict     The selective rule, return the whole document if not provided.
   - order_by        dict     The ordered rule, result set is unordered if not provided.
   - hint            dict     The options provided for specific snapshot type. Format:{ '$Options': { <options> } }
   - num_to_skip     int     Skip the first numToSkip documents, default is 0.
   - num_to_return   int     Only return numToReturn documents, default is -1 for returning all results.
Return values:
   a cursor object of query
Exceptions:
   pysequoiadb.error.SDBBaseError
Info:
  snapshot type:
    SDB_SNAP_CONTEXTS              : Get all contexts' snapshot
    SDB_SNAP_CONTEXTS_CURRENT      : Get the current context's snapshot
    SDB_SNAP_SESSIONS              : Get all sessions' snapshot
    SDB_SNAP_SESSIONS_CURRENT      : Get the current session's snapshot
    SDB_SNAP_COLLECTIONS           : Get the collections' snapshot
    SDB_SNAP_COLLECTIONSPACES      : Get the collection spaces' snapshot
    SDB_SNAP_DATABASE              : Get database's snapshot
    SDB_SNAP_SYSTEM                : Get system's snapshot
    SDB_SNAP_CATALOG               : Get catalog's snapshot
    SDB_SNAP_TRANSACTIONS          : Get transactions' snapshot
    SDB_SNAP_TRANSACTIONS_CURRENT  : Get current session's transaction snapshot
    SDB_SNAP_ACCESSPLANS           : Get cached access plan snapshot
    SDB_SNAP_HEALTH                : Get node health detection snapshot
    SDB_SNAP_CONFIGS               : Get node configuration's snapshot
    SDB_SNAP_SVCTASKS              : Get the snapshot of service tasks
    SDB_SNAP_SEQUENCES             : Get the snapshot of sequences
    SDB_SNAP_QUERIES               : Get the snapshot of queries
    SDB_SNAP_LATCHWAITS            : Get the snapshot of latch waits
    SDB_SNAP_LOCKWAITS             : Get the snapshot of lock waits
    SDB_SNAP_INDEXSTATS            : Get the snapshot of index statistics
    SDB_SNAP_TRANSWAITS            : Get the snapshot of transaction waits
    SDB_SNAP_TRANSDEADLOCK         : Get the snapshot of transaction deadlock
def pysequoiadb.client.client.interrupt (   self)
Send a "Interrupt" message to engine, as a result, all the cursors and lobs created by
current connection will be closed.

Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.client.client.interrupt_operation (   self)
Send "INTERRUPT_SELF" message to engine to stop the current operation. When the current operation had finish,
nothing happened, Otherwise, the current operation will be stop, and return error.

Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.client.client.invalidate_cache (   self,
  options = None 
)
Clean up cache in nodes(Data/Coordinator nodes).

Parameters:
    Name         Type     Info:
    options      dict     The control options:(Only take effect in coordinate nodes).
                    About the parameter 'options', please reference to the official
                    website(www.sequoiadb.com) and then search "命令位置参数"
                    for more details. Some of its optional parameters are as bellow:
                  
                    Global(Bool): execute this command in global or not. While 'options' is null, it's equals to {Global: true}.
                    GroupID(INT32 or INT32 Array): specified one or several groups by their group IDs. e.g. {GroupID:[1001, 1002]}.
                    GroupName(String or String Array): specified one or several groups by their group names. e.g. {GroupID:"group1"}.
                    ...

Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.client.client.is_domain_existing (   self,
  domain_name 
)
Check the existence of specified domain.

Parameters:
    Name        Type     Info
    domain_name  str     The domain name.
Return values:
   True if domain exists and False if not exists
Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.client.client.is_valid (   self)
Judge whether the connection is valid.

Return values:
   bool
Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.client.client.list_backup (   self,
  options,
  kwargs 
)
List the backups.

Parameters:
   Name        Type     Info:
   options     dict     Contains configuration information for backups,
                list all the backups if the default backup path is None.
                       The "options" contains 3 options as below.
                       All the elements in options are optional.
                       eg:
                       { "GroupName":["rgame1", "rgName2"],
                         "Path":"/opt/sequoiadb/backup",
                         "Name":"backupName" }
                       See Info as below.
   **kwargs             Useful option arw below
   - condition dict     The matching rule, return all the documents
                      if None.
   - selector  dict     The selective rule, return the whole document
                      if None.
   - order_by  dict     The ordered rule, never sort if None.
Return values:
   a cursor object of backup list
Exceptions:
   pysequoiadb.error.SDBBaseError
Info:
   GroupName   :  Assign the backups of specified replica groups to be list.
   Path        :  Assign the backups in specified path to be list,
                if not assign, use the backup path assigned in the
                configuration file.
   Name        :  Assign the backups with specified name to be list.
def pysequoiadb.client.client.list_collection_spaces (   self)
List all collection space of current database, include temporary
   collection space.

Return values:
   a cursor object of collection spaces.
Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.client.client.list_collections (   self)
List all collections in current database.

Return values:
   a cursor object of collection.
Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.client.client.list_domains (   self,
  kwargs 
)
Get information of domains.

Parameters:
   Name        Type     Info:
   **kwargs             Useful options are below
   - condition dict     The matching rule, match all the documents
                      if None.
   - selector  dict     The selective rule, return the whole
                      documents if None.
   - order_by  dict     The ordered rule, never sort if None.
Return values:
   a cursor object of domains
Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.client.client.list_procedures (   self,
  condition 
)
List store procedures.

Parameters:
   Name         Type     Info:
   condition    dict     The condition of list.
Return values:
   an cursor object of result
Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.client.client.list_replica_groups (   self)
List all replica groups of current database.

Return values:
   a cursor object of replication groups.
Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.client.client.list_tasks (   self,
  kwargs 
)
List the tasks.

Parameters:
   Name           Type     Info:
   **kwargs                Useful options are below
   - condition    dict     The matching rule, return all the documents
                         if None.
   - selector     dict     The selective rule, return the whole
                         document if None.
   - order_by     dict     The ordered rule, never sort if None.
                         bson.SON may need if it is order-sensitive.
                         eg.
                         bson.SON([("name",-1), ("age":1)]) it will
                         be ordered descending by 'name' first, and
                         be ordered ascending by 'age'
   - hint         dict     The hint, automatically match the optimal
                         hint if None.
Return values:
   a cursor object of task list
Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.client.client.reload_config (   self,
  options = None 
)
Reload configurations.

Parameters:
    Name         Type     Info
    options      dict     Command location parameters.
Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.client.client.remove_backup (   self,
  options 
)
Remove the backups

Parameters:
   Name      Type  Info:
   options   dict  Contains configuration information for remove
                 backups, remove all the backups in the default
                 backup path if null. The "options" contains 3
                 options as below. All the elements in options are
                 optional.
                 eg:
                 { "GroupName":["rgName1", "rgName2"],
                   "Path":"/opt/sequoiadb/backup",
                   "Name":"backupName" }
                 See Info as below.
Return values:
   an cursor object of result
Exceptions:
   pysequoiadb.error.SDBBaseError
Info:
   GroupName   : Assign the backups of specified replica groups to be
               remove.
   Path        : Assign the backups in specified path to be remove, if not
               assign, use the backup path assigned in the configuration
               file.
   Name        : Assign the backups with specified name to be remove.
def pysequoiadb.client.client.remove_cata_replica_group (   self)
Remove the catalog replica group.

Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.client.client.remove_coord_replica_group (   self)
Remove the coordinator replica group.

Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.client.client.remove_procedure (   self,
  name 
)
Remove a store procedures.

Parameters:
   Name         Type     Info:
   name         str      The name of store procedure.
Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.client.client.remove_replica_group (   self,
  group_name 
)
Remove the specified replica group.

Parameters:
   Name         Type     Info:
   group_name   str      The name of replica group to be removed
Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.client.client.remove_user (   self,
  name,
  psw 
)
Remove the specified user from current database.

Parameters:
   Name     Type     Info:
   name     str      The name of user to be removed.
   psw      str      The password of user to be removed.
Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.client.client.rename_collection_space (   self,
  old_name,
  new_name,
  options = None 
)
Rename the specified collection space.

Parameters:
   Name         Type     Info:
   old_name     str      The original name of collection space.
   new_name     str      The new name of collection space.
   options      dict     Options for renaming.
Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.client.client.rename_sequence (   self,
  old_name,
  new_name 
)
Rename sequence.

Parameters:
    Name        Type     Info
    old_name    str      The old name of sequence.
    new_name    str      The new name of sequence.
Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.client.client.reset_snapshot (   self,
  options = None 
)
Reset the snapshot.

Parameters:
   Name         Type     Info:
   options      dict     The control options:
                 Type:
                    (Int32) Specify the snapshot type to be reset (default is "all"):
                    "sessions"
                    "sessions current"
                    "database"
                    "health"
                    "all"
                 SessionID:
                    (String) Specify the session ID to be reset.
                 Others options:
                    Some of other options are as below:(please visit the official website to search "Location Elements" for more detail.)
                    GroupID:INT32,
                    GroupName:String,
                    NodeID:INT32,
                    HostName:String,
                    svcname:String,
                    ...
Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.client.client.set_pdlevel (   self,
  level,
  options = None 
)
Set PD log level of node.

Parameters:
    Name         Type     Info
    level        int      PD log level, the value can be 0~5.
                  0: SEVERE
                  1: ERROR
                  2: EVENT
                  3: WARNING
                  4: INFO
                  5: DEBUG
    options      dict     Command location parameters.
Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.client.client.set_session_attri (   self,
  options 
)
Set the attributes of the session.

Parameters:
   Name         Type     Info:
   options      dict     The options for setting session attributes. Can not be None.
                         While it's a empty options, the local session attributes cache
                         will be cleanup. Please visit this url:
                         "http://doc.sequoiadb.com/cn/SequoiaDB-cat_id-1432190808-edition_id-304"
                         to get more details.
Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.client.client.start_replica_group (   self,
  group_name 
)
Start the specified replica group.

Parameters:
   Name         Type     Info:
   group_name   str      The name of replica group to be started
Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.client.client.stop_replica_group (   self,
  group_name 
)
Stop the specified replica group.

Parameters:
   Name         Type     Info:
   group_name   str      The name of replica group to be stopped
Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.client.client.sync (   self,
  options = None 
)
Sync database which are specified.

Parameters:
   Name         Type     Info:
   options      dict     The control options:
                 Deep:
                     (INT32) Flush with deep mode or not. 1 in default.
                     0 for non-deep mode,1 for deep mode,-1 means use the configuration with server
                 Block:
                     (Bool) Flush with block mode or not. false in default.
                 CollectionSpace:
                     (String) Specify the collectionspace to sync.
                     If not set, will sync all the collectionspaces and logs,
                     otherwise, will only sync the collectionspace specified.
                 Others:(Only take effect in coordinate nodes)
                     GroupID:INT32,
                     GroupName:String,
                     NodeID:INT32,
                     HostName:String,
                     svcname:String
                     ...
Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.client.client.transaction_begin (   self)
Transaction begin.

Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.client.client.transaction_commit (   self)
Transaction commit.

Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.client.client.transaction_rollback (   self)
Transaction rollback

Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.client.client.update_config (   self,
  configs,
  options 
)
Force the node to update configs online.
Parameters:
   Name      Type  Info:
   configs   dict  The specific configuration parameters to update
   options   dict  The configure information, pass {"Global":true} or
                 {"Global":false} In cluster environment, passing
                 {"Global":true} will flush data's and catalog's
                 configuration file, while passing {"Global":false} will
                 flush coord's configuration file. In stand-alone
                 environment, both them have the same behaviour.
Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.client.client.wait_task (   self,
  task_ids,
  num 
)
Wait the tasks to finish.

Parameters:
   Name         Type     Info:
   task_ids     list     The list of task id.
   num          int      The number of task id.
Exceptions:
   pysequoiadb.error.SDBBaseError

The documentation for this class was generated from the following file: