parameters: (self, domain_name, options=None)
return_statement: return dm
docstring: 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
docstring_summary: Create domain.
docstring_tokens: Create domain .
function: def 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
          """
          if options is None:
              options = {}
          if not isinstance(domain_name, str_type):
              raise SDBTypeError("domain name must be an instance of str_type")
          if not isinstance(options, dict):
              raise SDBTypeError("options must be an instance of dict")
          bson_options = bson.BSON.encode(options)
  
          dm = domain(domain_name)
          try:
              rc = sdb.sdb_create_domain(self._client, domain_name, bson_options, dm._domain)
              raise_if_error(rc, "Failed to create domain: %s" % domain_name)
          except SDBBaseError:
              del dm
              raise
          return dm
function_tokens: def create_domain ( self , domain_name , options = None ) : if options is None : options = { } if not isinstance ( domain_name , str_type ) : raise SDBTypeError ( "domain name must be an instance of str_type" ) if not isinstance ( options , dict ) : raise SDBTypeError ( "options must be an instance of dict" ) bson_options = bson . BSON . encode ( options ) dm = domain ( domain_name ) try : rc = sdb . sdb_create_domain ( self . _client , domain_name , bson_options , dm . _domain ) raise_if_error ( rc , "Failed to create domain: %s" % domain_name ) except SDBBaseError : del dm raise return dm