@@ -5860,49 +5860,6 @@ def head_scheduler_job(self,
58605860 return response
58615861
58625862
5863- def post_replicate(self,
5864- replication_document: 'ReplicationDocument',
5865- **kwargs
5866- ) -> DetailedResponse:
5867- """
5868- Create or modify a replication operation.
5869-
5870- Requests, configures, or stops a replicate operation.
5871-
5872- :param ReplicationDocument replication_document: HTTP request body for
5873- replication operations.
5874- :param dict headers: A `dict` containing the request headers
5875- :return: A `DetailedResponse` containing the result, headers and HTTP status code.
5876- :rtype: DetailedResponse with `dict` result representing a `ReplicationResult` object
5877- """
5878-
5879- if replication_document is None:
5880- raise ValueError('replication_document must be provided')
5881- if isinstance(replication_document, ReplicationDocument):
5882- replication_document = convert_model(replication_document)
5883- headers = {}
5884- sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
5885- service_version='V1',
5886- operation_id='post_replicate')
5887- headers.update(sdk_headers)
5888-
5889- data = json.dumps(replication_document)
5890- headers['content-type'] = 'application/json'
5891-
5892- if 'headers' in kwargs:
5893- headers.update(kwargs.get('headers'))
5894- headers['Accept'] = 'application/json'
5895-
5896- url = '/_replicate'
5897- request = self.prepare_request(method='POST',
5898- url=url,
5899- headers=headers,
5900- data=data)
5901-
5902- response = self.send(request)
5903- return response
5904-
5905-
59065863 def delete_replication_document(self,
59075864 doc_id: str,
59085865 *,
@@ -6066,7 +6023,7 @@ def put_replication_document(self,
60666023 **kwargs
60676024 ) -> DetailedResponse:
60686025 """
6069- Start or update a replication.
6026+ Create or modify a replication using a replication document .
60706027
60716028 Creates or modifies a document in the `_replicator` database to start a new
60726029 replication or to edit an existing replication.
@@ -14366,262 +14323,6 @@ def __ne__(self, other: 'ReplicationDocument') -> bool:
1436614323 """Return `true` when self and other are not equal, false otherwise."""
1436714324 return not self == other
1436814325
14369- class ReplicationHistory():
14370- """
14371- Schema for replication history information.
14372-
14373- :attr int doc_write_failures: Number of document write failures.
14374- :attr int docs_read: Number of documents read.
14375- :attr int docs_written: Number of documents written to target.
14376- :attr str end_last_seq: Last sequence number in changes stream.
14377- :attr str end_time: Date/Time replication operation completed in RFC 2822
14378- format.
14379- :attr int missing_checked: Number of missing documents checked.
14380- :attr int missing_found: Number of missing documents found.
14381- :attr str recorded_seq: Last recorded sequence number.
14382- :attr str session_id: Session ID for this replication operation.
14383- :attr str start_last_seq: First sequence number in changes stream.
14384- :attr str start_time: Date/Time replication operation started in RFC 2822
14385- format.
14386- """
14387-
14388- def __init__(self,
14389- doc_write_failures: int,
14390- docs_read: int,
14391- docs_written: int,
14392- end_last_seq: str,
14393- end_time: str,
14394- missing_checked: int,
14395- missing_found: int,
14396- recorded_seq: str,
14397- session_id: str,
14398- start_last_seq: str,
14399- start_time: str) -> None:
14400- """
14401- Initialize a ReplicationHistory object.
14402-
14403- :param int doc_write_failures: Number of document write failures.
14404- :param int docs_read: Number of documents read.
14405- :param int docs_written: Number of documents written to target.
14406- :param str end_last_seq: Last sequence number in changes stream.
14407- :param str end_time: Date/Time replication operation completed in RFC 2822
14408- format.
14409- :param int missing_checked: Number of missing documents checked.
14410- :param int missing_found: Number of missing documents found.
14411- :param str recorded_seq: Last recorded sequence number.
14412- :param str session_id: Session ID for this replication operation.
14413- :param str start_last_seq: First sequence number in changes stream.
14414- :param str start_time: Date/Time replication operation started in RFC 2822
14415- format.
14416- """
14417- self.doc_write_failures = doc_write_failures
14418- self.docs_read = docs_read
14419- self.docs_written = docs_written
14420- self.end_last_seq = end_last_seq
14421- self.end_time = end_time
14422- self.missing_checked = missing_checked
14423- self.missing_found = missing_found
14424- self.recorded_seq = recorded_seq
14425- self.session_id = session_id
14426- self.start_last_seq = start_last_seq
14427- self.start_time = start_time
14428-
14429- @classmethod
14430- def from_dict(cls, _dict: Dict) -> 'ReplicationHistory':
14431- """Initialize a ReplicationHistory object from a json dictionary."""
14432- args = {}
14433- if 'doc_write_failures' in _dict:
14434- args['doc_write_failures'] = _dict.get('doc_write_failures')
14435- else:
14436- raise ValueError('Required property \'doc_write_failures\' not present in ReplicationHistory JSON')
14437- if 'docs_read' in _dict:
14438- args['docs_read'] = _dict.get('docs_read')
14439- else:
14440- raise ValueError('Required property \'docs_read\' not present in ReplicationHistory JSON')
14441- if 'docs_written' in _dict:
14442- args['docs_written'] = _dict.get('docs_written')
14443- else:
14444- raise ValueError('Required property \'docs_written\' not present in ReplicationHistory JSON')
14445- if 'end_last_seq' in _dict:
14446- args['end_last_seq'] = _dict.get('end_last_seq')
14447- else:
14448- raise ValueError('Required property \'end_last_seq\' not present in ReplicationHistory JSON')
14449- if 'end_time' in _dict:
14450- args['end_time'] = _dict.get('end_time')
14451- else:
14452- raise ValueError('Required property \'end_time\' not present in ReplicationHistory JSON')
14453- if 'missing_checked' in _dict:
14454- args['missing_checked'] = _dict.get('missing_checked')
14455- else:
14456- raise ValueError('Required property \'missing_checked\' not present in ReplicationHistory JSON')
14457- if 'missing_found' in _dict:
14458- args['missing_found'] = _dict.get('missing_found')
14459- else:
14460- raise ValueError('Required property \'missing_found\' not present in ReplicationHistory JSON')
14461- if 'recorded_seq' in _dict:
14462- args['recorded_seq'] = _dict.get('recorded_seq')
14463- else:
14464- raise ValueError('Required property \'recorded_seq\' not present in ReplicationHistory JSON')
14465- if 'session_id' in _dict:
14466- args['session_id'] = _dict.get('session_id')
14467- else:
14468- raise ValueError('Required property \'session_id\' not present in ReplicationHistory JSON')
14469- if 'start_last_seq' in _dict:
14470- args['start_last_seq'] = _dict.get('start_last_seq')
14471- else:
14472- raise ValueError('Required property \'start_last_seq\' not present in ReplicationHistory JSON')
14473- if 'start_time' in _dict:
14474- args['start_time'] = _dict.get('start_time')
14475- else:
14476- raise ValueError('Required property \'start_time\' not present in ReplicationHistory JSON')
14477- return cls(**args)
14478-
14479- @classmethod
14480- def _from_dict(cls, _dict):
14481- """Initialize a ReplicationHistory object from a json dictionary."""
14482- return cls.from_dict(_dict)
14483-
14484- def to_dict(self) -> Dict:
14485- """Return a json dictionary representing this model."""
14486- _dict = {}
14487- if hasattr(self, 'doc_write_failures') and self.doc_write_failures is not None:
14488- _dict['doc_write_failures'] = self.doc_write_failures
14489- if hasattr(self, 'docs_read') and self.docs_read is not None:
14490- _dict['docs_read'] = self.docs_read
14491- if hasattr(self, 'docs_written') and self.docs_written is not None:
14492- _dict['docs_written'] = self.docs_written
14493- if hasattr(self, 'end_last_seq') and self.end_last_seq is not None:
14494- _dict['end_last_seq'] = self.end_last_seq
14495- if hasattr(self, 'end_time') and self.end_time is not None:
14496- _dict['end_time'] = self.end_time
14497- if hasattr(self, 'missing_checked') and self.missing_checked is not None:
14498- _dict['missing_checked'] = self.missing_checked
14499- if hasattr(self, 'missing_found') and self.missing_found is not None:
14500- _dict['missing_found'] = self.missing_found
14501- if hasattr(self, 'recorded_seq') and self.recorded_seq is not None:
14502- _dict['recorded_seq'] = self.recorded_seq
14503- if hasattr(self, 'session_id') and self.session_id is not None:
14504- _dict['session_id'] = self.session_id
14505- if hasattr(self, 'start_last_seq') and self.start_last_seq is not None:
14506- _dict['start_last_seq'] = self.start_last_seq
14507- if hasattr(self, 'start_time') and self.start_time is not None:
14508- _dict['start_time'] = self.start_time
14509- return _dict
14510-
14511- def _to_dict(self):
14512- """Return a json dictionary representing this model."""
14513- return self.to_dict()
14514-
14515- def __str__(self) -> str:
14516- """Return a `str` version of this ReplicationHistory object."""
14517- return json.dumps(self.to_dict(), indent=2)
14518-
14519- def __eq__(self, other: 'ReplicationHistory') -> bool:
14520- """Return `true` when self and other are equal, false otherwise."""
14521- if not isinstance(other, self.__class__):
14522- return False
14523- return self.__dict__ == other.__dict__
14524-
14525- def __ne__(self, other: 'ReplicationHistory') -> bool:
14526- """Return `true` when self and other are not equal, false otherwise."""
14527- return not self == other
14528-
14529- class ReplicationResult():
14530- """
14531- Schema for a replication result.
14532-
14533- :attr List[ReplicationHistory] history: Replication history.
14534- :attr bool ok: Replication status.
14535- :attr int replication_id_version: Replication protocol version.
14536- :attr str session_id: Unique session ID.
14537- :attr str source_last_seq: Last sequence number read from source database.
14538- """
14539-
14540- def __init__(self,
14541- history: List['ReplicationHistory'],
14542- ok: bool,
14543- replication_id_version: int,
14544- session_id: str,
14545- source_last_seq: str) -> None:
14546- """
14547- Initialize a ReplicationResult object.
14548-
14549- :param List[ReplicationHistory] history: Replication history.
14550- :param bool ok: Replication status.
14551- :param int replication_id_version: Replication protocol version.
14552- :param str session_id: Unique session ID.
14553- :param str source_last_seq: Last sequence number read from source database.
14554- """
14555- self.history = history
14556- self.ok = ok
14557- self.replication_id_version = replication_id_version
14558- self.session_id = session_id
14559- self.source_last_seq = source_last_seq
14560-
14561- @classmethod
14562- def from_dict(cls, _dict: Dict) -> 'ReplicationResult':
14563- """Initialize a ReplicationResult object from a json dictionary."""
14564- args = {}
14565- if 'history' in _dict:
14566- args['history'] = [ReplicationHistory.from_dict(x) for x in _dict.get('history')]
14567- else:
14568- raise ValueError('Required property \'history\' not present in ReplicationResult JSON')
14569- if 'ok' in _dict:
14570- args['ok'] = _dict.get('ok')
14571- else:
14572- raise ValueError('Required property \'ok\' not present in ReplicationResult JSON')
14573- if 'replication_id_version' in _dict:
14574- args['replication_id_version'] = _dict.get('replication_id_version')
14575- else:
14576- raise ValueError('Required property \'replication_id_version\' not present in ReplicationResult JSON')
14577- if 'session_id' in _dict:
14578- args['session_id'] = _dict.get('session_id')
14579- else:
14580- raise ValueError('Required property \'session_id\' not present in ReplicationResult JSON')
14581- if 'source_last_seq' in _dict:
14582- args['source_last_seq'] = _dict.get('source_last_seq')
14583- else:
14584- raise ValueError('Required property \'source_last_seq\' not present in ReplicationResult JSON')
14585- return cls(**args)
14586-
14587- @classmethod
14588- def _from_dict(cls, _dict):
14589- """Initialize a ReplicationResult object from a json dictionary."""
14590- return cls.from_dict(_dict)
14591-
14592- def to_dict(self) -> Dict:
14593- """Return a json dictionary representing this model."""
14594- _dict = {}
14595- if hasattr(self, 'history') and self.history is not None:
14596- _dict['history'] = [x.to_dict() for x in self.history]
14597- if hasattr(self, 'ok') and self.ok is not None:
14598- _dict['ok'] = self.ok
14599- if hasattr(self, 'replication_id_version') and self.replication_id_version is not None:
14600- _dict['replication_id_version'] = self.replication_id_version
14601- if hasattr(self, 'session_id') and self.session_id is not None:
14602- _dict['session_id'] = self.session_id
14603- if hasattr(self, 'source_last_seq') and self.source_last_seq is not None:
14604- _dict['source_last_seq'] = self.source_last_seq
14605- return _dict
14606-
14607- def _to_dict(self):
14608- """Return a json dictionary representing this model."""
14609- return self.to_dict()
14610-
14611- def __str__(self) -> str:
14612- """Return a `str` version of this ReplicationResult object."""
14613- return json.dumps(self.to_dict(), indent=2)
14614-
14615- def __eq__(self, other: 'ReplicationResult') -> bool:
14616- """Return `true` when self and other are equal, false otherwise."""
14617- if not isinstance(other, self.__class__):
14618- return False
14619- return self.__dict__ == other.__dict__
14620-
14621- def __ne__(self, other: 'ReplicationResult') -> bool:
14622- """Return `true` when self and other are not equal, false otherwise."""
14623- return not self == other
14624-
1462514326class Revisions():
1462614327 """
1462714328 Schema for list of revision information.
0 commit comments