def consume_fts_index( opts, sink_spec: str, sink_map, source_bucket, source_map, source_design: Union[str, bytes]) -> couchbaseConstants.PUMP_ERROR: if not source_design: return 0 try: index_defs = json.loads(source_design) if not index_defs: return 0 except ValueError as e: return f'error: could not parse fts index definitions; exception: {e!s}' try: username = opts.username password = opts.password if opts.username_dest is not None and opts.password_dest is not None: username = opts.username_dest password = opts.password_dest rest = ClusterManager(sink_spec, username, password, opts.ssl, opts.no_ssl_verify, opts.cacert, False) _, errors = rest.restore_fts_index_metadata(index_defs) return errors except ServiceNotAvailableException as e: return "No fts service in cluster, skipping restore of aliases"
def consume_fts_alias(opts, sink_spec: str, sink_map, source_bucket, source_map, source_design: Union[str, bytes]) -> couchbaseConstants.PUMP_ERROR: if not source_design: return 0 try: index_defs = json.loads(source_design) if not index_defs: return 0 except ValueError as e: return f'error: could not parse fts index definitions; exception: {e!s}' try: username = opts.username password = opts.password if opts.username_dest is not None and opts.password_dest is not None: username = opts.username_dest password = opts.password_dest rest = ClusterManager(sink_spec, username, password, opts.ssl, opts.no_ssl_verify, opts.cacert, False) _, errors = rest.restore_fts_index_metadata(index_defs) return errors except ServiceNotAvailableException as e: return "No fts service in cluster, skipping restore of indexes"
source_design): if not source_design: return 0 try: index_defs = json.loads(source_design) if not index_defs: return 0 except ValueError, e: return "error: could not parse fts index definitions; exception: %s" % ( e) try: rest = ClusterManager(sink_spec, opts.username, opts.password, opts.ssl, False, None, False) _, errors = rest.restore_fts_index_metadata(index_defs) return errors except ServiceNotAvailableException, e: return "No fts service in cluster, skipping restore of indexes" @staticmethod def consume_index(opts, sink_spec, sink_map, source_bucket, source_map, source_design): if not source_design: return 0 try: sd = json.loads(source_design) if not sd: return 0 except ValueError, e:
@staticmethod def consume_fts_index(opts, sink_spec, sink_map, source_bucket, source_map, source_design): if not source_design: return 0 try: index_defs = json.loads(source_design) if not index_defs: return 0 except ValueError, e: return "error: could not parse fts index definitions; exception: %s" % (e) try: rest = ClusterManager(sink_spec, opts.username, opts.password, opts.ssl, False, None, False) _, errors = rest.restore_fts_index_metadata(index_defs) return errors except ServiceNotAvailableException, e: return "No fts service in cluster, skipping restore of indexes" @staticmethod def consume_index(opts, sink_spec, sink_map, source_bucket, source_map, source_design): if not source_design: return 0 try: sd = json.loads(source_design) if not sd: return 0 except ValueError, e: return "error: could not parse source design; exception: %s" % (e)