ibmcloudant package¶
Submodules¶
ibmcloudant.cloudant_v1 module¶
NoSQL database based on Apache CouchDB
See: https://cloud.ibm.com/docs/services/Cloudant/
- class ibmcloudant.cloudant_v1.ActiveTask(database: str, node: str, pid: str, started_on: int, type: str, updated_on: int, *, changes_done: Optional[int] = None, progress: Optional[int] = None, status: Optional[str] = None, task: Optional[str] = None, total_changes: Optional[int] = None)¶
Bases:
object
Schema for information about a running task.
- Attr int changes_done
(optional) Processed changes.
- Attr str database
Source database.
- Attr str node
Cluster node where the task is running.
- Attr str pid
Process ID.
- Attr int progress
(optional) Current percentage progress.
- Attr int started_on
Schema for a Unix epoch timestamp.
- Attr str status
(optional) Task status message.
- Attr str task
(optional) Task name.
- Attr int total_changes
(optional) Total changes to process.
- Attr str type
Operation type.
- Attr int updated_on
Schema for a Unix epoch timestamp.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.ActiveTask ¶
Initialize a ActiveTask object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.ActivityTrackerEvents(types: List[str])¶
Bases:
object
Schema for Activity Tracker events.
- Attr List[str] types
An array of event types that are being sent to IBM Cloud Activity Tracker for the IBM Cloudant instance. “management” is a required element of this array.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.ActivityTrackerEvents ¶
Initialize a ActivityTrackerEvents object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.AllDocsQueriesResult(results: List[ibmcloudant.cloudant_v1.AllDocsResult])¶
Bases:
object
Schema for the result of an all documents queries operation.
- Attr List[AllDocsResult] results
An array of result objects - one for each query. Each result object contains the same fields as the response to a regular /_all_docs request.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.AllDocsQueriesResult ¶
Initialize a AllDocsQueriesResult object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.AllDocsQuery(*, att_encoding_info: Optional[bool] = None, attachments: Optional[bool] = None, conflicts: Optional[bool] = None, descending: Optional[bool] = None, include_docs: Optional[bool] = None, inclusive_end: Optional[bool] = None, limit: Optional[int] = None, skip: Optional[int] = None, update_seq: Optional[bool] = None, endkey: Optional[str] = None, key: Optional[str] = None, keys: Optional[List[str]] = None, startkey: Optional[str] = None)¶
Bases:
object
Schema for an all documents query operation.
- Attr bool att_encoding_info
(optional) Parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
- Attr bool attachments
(optional) Parameter to specify whether to include attachments bodies in a response.
- Attr bool conflicts
(optional) Parameter to specify whether to include a list of conflicted revisions in the _conflicts property of the returned document. Ignored if include_docs isn’t true.
- Attr bool descending
(optional) Parameter to specify whether to return the documents in descending by key order.
- Attr bool include_docs
(optional) Parameter to specify whether to include the full content of the documents in the response.
- Attr bool inclusive_end
(optional) Parameter to specify whether the specified end key should be included in the result.
- Attr int limit
(optional) Parameter to specify the number of returned documents to limit the result to.
- Attr int skip
(optional) Parameter to specify the number of records before starting to return the results.
- Attr bool update_seq
(optional) Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
- Attr str endkey
(optional) Schema for a document ID.
- Attr str key
(optional) Schema for a document ID.
- Attr List[str] keys
(optional) Schema for a list of document IDs.
- Attr str startkey
(optional) Schema for a document ID.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.AllDocsQuery ¶
Initialize a AllDocsQuery object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.AllDocsResult(total_rows: int, rows: List[ibmcloudant.cloudant_v1.DocsResultRow], *, update_seq: Optional[str] = None)¶
Bases:
object
Schema for the result of an all documents operation.
- Attr int total_rows
Number of total rows.
- Attr List[DocsResultRow] rows
List of doc results.
- Attr str update_seq
(optional) Current update sequence for the database.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.AllDocsResult ¶
Initialize a AllDocsResult object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.Analyzer(*, name: Optional[str] = None, stopwords: Optional[List[str]] = None)¶
Bases:
object
Schema for a full text search analyzer.
- Attr str name
(optional) Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage: * For search indexes the default is standard * For query text indexes the default is keyword * For a query text index default_field the default is standard.
- Attr List[str] stopwords
(optional) Custom stopwords to use with the named analyzer.
- class NameEnum(value)¶
Bases:
str
,enum.Enum
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage: * For search indexes the default is standard * For query text indexes the default is keyword * For a query text index default_field the default is standard.
- ARABIC = 'arabic'¶
- ARMENIAN = 'armenian'¶
- BASQUE = 'basque'¶
- BRAZILIAN = 'brazilian'¶
- BULGARIAN = 'bulgarian'¶
- CATALAN = 'catalan'¶
- CHINESE = 'chinese'¶
- CJK = 'cjk'¶
- CLASSIC = 'classic'¶
- CZECH = 'czech'¶
- DANISH = 'danish'¶
- DUTCH = 'dutch'¶
- EMAIL = 'email'¶
- ENGLISH = 'english'¶
- FINNISH = 'finnish'¶
- FRENCH = 'french'¶
- GALICIAN = 'galician'¶
- GERMAN = 'german'¶
- GREEK = 'greek'¶
- HINDI = 'hindi'¶
- HUNGARIAN = 'hungarian'¶
- INDONESIAN = 'indonesian'¶
- IRISH = 'irish'¶
- ITALIAN = 'italian'¶
- JAPANESE = 'japanese'¶
- KEYWORD = 'keyword'¶
- LATVIAN = 'latvian'¶
- NORWEGIAN = 'norwegian'¶
- PERFIELD = 'perfield'¶
- PERSIAN = 'persian'¶
- POLISH = 'polish'¶
- PORTUGUESE = 'portuguese'¶
- ROMANIAN = 'romanian'¶
- RUSSIAN = 'russian'¶
- SIMPLE = 'simple'¶
- SPANISH = 'spanish'¶
- STANDARD = 'standard'¶
- SWEDISH = 'swedish'¶
- THAI = 'thai'¶
- TURKISH = 'turkish'¶
- WHITESPACE = 'whitespace'¶
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.Analyzer ¶
Initialize a Analyzer object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.AnalyzerConfiguration(*, name: Optional[str] = None, stopwords: Optional[List[str]] = None, fields: Optional[dict] = None)¶
Bases:
object
Schema for a search analyzer configuration.
- Attr str name
(optional) Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage: * For search indexes the default is standard * For query text indexes the default is keyword * For a query text index default_field the default is standard.
- Attr List[str] stopwords
(optional) Custom stopwords to use with the named analyzer.
- Attr dict fields
(optional) Schema for mapping a field name to a per field analyzer.
- class NameEnum(value)¶
Bases:
str
,enum.Enum
Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage: * For search indexes the default is standard * For query text indexes the default is keyword * For a query text index default_field the default is standard.
- ARABIC = 'arabic'¶
- ARMENIAN = 'armenian'¶
- BASQUE = 'basque'¶
- BRAZILIAN = 'brazilian'¶
- BULGARIAN = 'bulgarian'¶
- CATALAN = 'catalan'¶
- CHINESE = 'chinese'¶
- CJK = 'cjk'¶
- CLASSIC = 'classic'¶
- CZECH = 'czech'¶
- DANISH = 'danish'¶
- DUTCH = 'dutch'¶
- EMAIL = 'email'¶
- ENGLISH = 'english'¶
- FINNISH = 'finnish'¶
- FRENCH = 'french'¶
- GALICIAN = 'galician'¶
- GERMAN = 'german'¶
- GREEK = 'greek'¶
- HINDI = 'hindi'¶
- HUNGARIAN = 'hungarian'¶
- INDONESIAN = 'indonesian'¶
- IRISH = 'irish'¶
- ITALIAN = 'italian'¶
- JAPANESE = 'japanese'¶
- KEYWORD = 'keyword'¶
- LATVIAN = 'latvian'¶
- NORWEGIAN = 'norwegian'¶
- PERFIELD = 'perfield'¶
- PERSIAN = 'persian'¶
- POLISH = 'polish'¶
- PORTUGUESE = 'portuguese'¶
- ROMANIAN = 'romanian'¶
- RUSSIAN = 'russian'¶
- SIMPLE = 'simple'¶
- SPANISH = 'spanish'¶
- STANDARD = 'standard'¶
- SWEDISH = 'swedish'¶
- THAI = 'thai'¶
- TURKISH = 'turkish'¶
- WHITESPACE = 'whitespace'¶
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.AnalyzerConfiguration ¶
Initialize a AnalyzerConfiguration object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.ApiKeysResult(ok: bool, key: str, password: str)¶
Bases:
object
Schema for api keys.
- Attr bool ok
ok.
- Attr str key
The generated api key.
- Attr str password
The password associated with the api key.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.ApiKeysResult ¶
Initialize a ApiKeysResult object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.Attachment(*, content_type: Optional[str] = None, data: Optional[bytes] = None, digest: Optional[str] = None, encoded_length: Optional[int] = None, encoding: Optional[str] = None, follows: Optional[bool] = None, length: Optional[int] = None, revpos: Optional[int] = None, stub: Optional[bool] = None)¶
Bases:
object
Schema for an attachment.
- Attr str content_type
(optional) Attachment MIME type.
- Attr bytes data
(optional) Base64-encoded content. Available if attachment content is requested by using the query parameters attachments=true or atts_since. Note that when used with a view or changes feed include_docs must also be true.
- Attr str digest
(optional) Content hash digest. It starts with prefix which announce hash type (e.g. md5-) and continues with Base64-encoded hash digest.
- Attr int encoded_length
(optional) Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter att_encoding_info is true. Note that when used with a view or changes feed include_docs must also be true.
- Attr str encoding
(optional) Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter att_encoding_info is true. Note that when used with a view or changes feed include_docs must also be true.
- Attr bool follows
(optional) True if the attachment follows in a multipart request or response.
- Attr int length
(optional) Real attachment size in bytes. Not available if inline attachment content requested.
- Attr int revpos
(optional) Revision number when attachment was added.
- Attr bool stub
(optional) Has true value if object contains stub info and no content. Otherwise omitted in response.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.Attachment ¶
Initialize a Attachment object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.BulkDocs(docs: List[ibmcloudant.cloudant_v1.Document], *, new_edits: Optional[bool] = None)¶
Bases:
object
Schema for submitting documents for bulk modifications.
- Attr List[Document] docs
Array of documents.
- Attr bool new_edits
(optional) If false, prevents the database from assigning them new revision IDs. Default is true.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.BulkDocs ¶
Initialize a BulkDocs object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.BulkGetQueryDocument(id: str, *, atts_since: Optional[List[str]] = None, rev: Optional[str] = None)¶
Bases:
object
Schema for a document item in a bulk get query.
- Attr List[str] atts_since
(optional) Includes attachments only since specified revisions.
- Attr str id
Schema for a document ID.
- Attr str rev
(optional) Schema for a document revision identifier.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.BulkGetQueryDocument ¶
Initialize a BulkGetQueryDocument object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.BulkGetResult(results: List[ibmcloudant.cloudant_v1.BulkGetResultItem])¶
Bases:
object
Schema for the results object of a bulk get operation.
- Attr List[BulkGetResultItem] results
Results.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.BulkGetResult ¶
Initialize a BulkGetResult object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.BulkGetResultDocument(*, error: Optional[ibmcloudant.cloudant_v1.DocumentResult] = None, ok: Optional[ibmcloudant.cloudant_v1.Document] = None)¶
Bases:
object
Schema for BulkGetResult object containing a successfully retrieved document or error information.
- Attr DocumentResult error
(optional) Schema for the result of a document modification.
- Attr Document ok
(optional) Schema for a document.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.BulkGetResultDocument ¶
Initialize a BulkGetResultDocument object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.BulkGetResultItem(docs: List[ibmcloudant.cloudant_v1.BulkGetResultDocument], id: str)¶
Bases:
object
Schema for the document revisions information from a bulk get operation.
- Attr List[BulkGetResultDocument] docs
Array of document revisions or error information.
- Attr str id
Schema for a document ID.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.BulkGetResultItem ¶
Initialize a BulkGetResultItem object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.CapacityThroughputInformation(current: ibmcloudant.cloudant_v1.CapacityThroughputInformationCurrent, *, target: Optional[ibmcloudant.cloudant_v1.CapacityThroughputInformationTarget] = None)¶
Bases:
object
Schema for information about the currently provisioned and target throughput capacity.
- Attr CapacityThroughputInformationCurrent current
Detailed information about provisioned throughput capacity.
- Attr CapacityThroughputInformationTarget target
(optional) Detailed information about target throughput capacity.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.CapacityThroughputInformation ¶
Initialize a CapacityThroughputInformation object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.CapacityThroughputInformationCurrent(throughput: ibmcloudant.cloudant_v1.ThroughputInformation)¶
Bases:
object
Detailed information about provisioned throughput capacity.
- Attr ThroughputInformation throughput
Schema for detailed information about throughput capacity with breakdown by specific throughput requests classes.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.CapacityThroughputInformationCurrent ¶
Initialize a CapacityThroughputInformationCurrent object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.CapacityThroughputInformationTarget(throughput: ibmcloudant.cloudant_v1.ThroughputInformation)¶
Bases:
object
Detailed information about target throughput capacity.
- Attr ThroughputInformation throughput
Schema for detailed information about throughput capacity with breakdown by specific throughput requests classes.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.CapacityThroughputInformationTarget ¶
Initialize a CapacityThroughputInformationTarget object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.Change(rev: str)¶
Bases:
object
Schema for a document leaf with single field rev.
- Attr str rev
Schema for a document revision identifier.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.Change ¶
Initialize a Change object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.ChangesResult(last_seq: str, pending: int, results: List[ibmcloudant.cloudant_v1.ChangesResultItem])¶
Bases:
object
Schema for normal changes feed result.
- Attr str last_seq
last_seq.
- Attr int pending
pending.
- Attr List[ChangesResultItem] results
results.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.ChangesResult ¶
Initialize a ChangesResult object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.ChangesResultItem(changes: List[ibmcloudant.cloudant_v1.Change], id: str, seq: str, *, deleted: Optional[bool] = None, doc: Optional[ibmcloudant.cloudant_v1.Document] = None)¶
Bases:
object
Schema for an item in the changes results array.
- Attr List[Change] changes
List of document’s leaves with single field rev.
- Attr bool deleted
(optional) if true then the document is deleted.
- Attr Document doc
(optional) Schema for a document.
- Attr str id
Schema for a document ID.
- Attr str seq
Update sequence.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.ChangesResultItem ¶
Initialize a ChangesResultItem object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.CloudantV1(authenticator: Optional[ibm_cloud_sdk_core.authenticators.authenticator.Authenticator] = None)¶
Bases:
ibm_cloud_sdk_core.base_service.BaseService
The Cloudant V1 service.
- delete_attachment(db: str, doc_id: str, attachment_name: str, *, if_match: Optional[str] = None, rev: Optional[str] = None, batch: Optional[str] = None, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Delete an attachment.
Deletes the attachment with the filename, {attachment_name}, from the specified doc. You must supply the rev query parameter or If-Match header with the current revision to delete the attachment.
- Parameters
db (str) – Path parameter to specify the database name.
doc_id (str) – Path parameter to specify the document ID.
attachment_name (str) – Path parameter to specify the attachment name.
if_match (str) – (optional) Header parameter to specify the document revision. Alternative to rev query parameter.
rev (str) – (optional) Query parameter to specify a document revision.
batch (str) – (optional) Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a DocumentResult object
- delete_database(db: str, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Delete a database.
Deletes the specified database and all documents and attachments contained within it. To avoid deleting a database, the server responds with a 400 HTTP status code when the request URL includes a ?rev= parameter. This response suggests that a user wanted to delete a document but forgot to add the document ID to the URL.
- Parameters
db (str) – Path parameter to specify the database name.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a Ok object
- delete_design_document(db: str, ddoc: str, *, if_match: Optional[str] = None, batch: Optional[str] = None, rev: Optional[str] = None, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Delete a design document.
Marks the specified design document as deleted by adding a _deleted field with the value true. Documents with this field are not returned with requests but stay in the database. You must supply the current (latest) revision, either by using the rev parameter or by using the If-Match header to specify the revision.
- Parameters
db (str) – Path parameter to specify the database name.
ddoc (str) – Path parameter to specify the design document name. The design document name is the design document ID excluding the _design/ prefix.
if_match (str) – (optional) Header parameter to specify the document revision. Alternative to rev query parameter.
batch (str) – (optional) Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
rev (str) – (optional) Query parameter to specify a document revision.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a DocumentResult object
- delete_document(db: str, doc_id: str, *, if_match: Optional[str] = None, batch: Optional[str] = None, rev: Optional[str] = None, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Delete a document.
Marks the specified document as deleted by adding a _deleted field with the value true. Documents with this field are not returned within requests anymore but stay in the database. You must supply the current (latest) revision, either by using the rev parameter or by using the If-Match header to specify the revision.
- Parameters
db (str) – Path parameter to specify the database name.
doc_id (str) – Path parameter to specify the document ID.
if_match (str) – (optional) Header parameter to specify the document revision. Alternative to rev query parameter.
batch (str) – (optional) Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
rev (str) – (optional) Query parameter to specify a document revision.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a DocumentResult object
- delete_index(db: str, ddoc: str, type: str, index: str, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Delete an index.
- Parameters
db (str) – Path parameter to specify the database name.
ddoc (str) – Path parameter to specify the design document name. The design document name is the design document ID excluding the _design/ prefix.
type (str) – Path parameter to specify the index type.
index (str) – Path parameter to specify the index name.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a Ok object
- delete_local_document(db: str, doc_id: str, *, batch: Optional[str] = None, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Delete a local document.
Deletes the specified local document. The semantics are identical to deleting a standard document in the specified database, except that the document is not replicated.
- Parameters
db (str) – Path parameter to specify the database name.
doc_id (str) – Path parameter to specify the document ID.
batch (str) – (optional) Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a DocumentResult object
- delete_replication_document(doc_id: str, *, if_match: Optional[str] = None, batch: Optional[str] = None, rev: Optional[str] = None, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Cancel a replication.
Cancels a replication by deleting the document that describes it from the _replicator database.
- Parameters
doc_id (str) – Path parameter to specify the document ID.
if_match (str) – (optional) Header parameter to specify the document revision. Alternative to rev query parameter.
batch (str) – (optional) Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
rev (str) – (optional) Query parameter to specify a document revision.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a DocumentResult object
- get_active_tasks(**kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Retrieve list of running tasks.
Lists running tasks, including the task type, name, status, and process ID. The result includes a JSON array of the currently running tasks, with each task described as a single object. Depending on the operation type, the set of response object fields might be different.
- Parameters
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with List[ActiveTask] result
- get_activity_tracker_events(**kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Retrieve Activity Tracker events information.
Check event types that are being sent to IBM Cloud Activity Tracker for the IBM Cloudant instance.
- Parameters
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a ActivityTrackerEvents object
- get_all_dbs(*, descending: Optional[bool] = None, endkey: Optional[str] = None, limit: Optional[int] = None, skip: Optional[int] = None, startkey: Optional[str] = None, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Query a list of all database names in the instance.
- Parameters
descending (bool) – (optional) Query parameter to specify whether to return the documents in descending by key order.
endkey (str) – (optional) Query parameter to specify to stop returning records when the specified key is reached. String representation of any JSON type that matches the key type emitted by the view function.
limit (int) – (optional) Query parameter to specify the number of returned documents to limit the result to.
skip (int) – (optional) Query parameter to specify the number of records before starting to return the results.
startkey (str) – (optional) Query parameter to specify to start returning records from the specified key. String representation of any JSON type that matches the key type emitted by the view function.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with List[str] result
- get_attachment(db: str, doc_id: str, attachment_name: str, *, if_match: Optional[str] = None, if_none_match: Optional[str] = None, range: Optional[str] = None, rev: Optional[str] = None, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Retrieve an attachment.
Returns the file attachment that is associated with the document. The raw data of the associated attachment is returned, just as if you were accessing a static file. The returned Content-Type header is the same as the content type set when the document attachment was submitted to the database.
- Parameters
db (str) – Path parameter to specify the database name.
doc_id (str) – Path parameter to specify the document ID.
attachment_name (str) – Path parameter to specify the attachment name.
if_match (str) – (optional) Header parameter to specify the document revision. Alternative to rev query parameter.
if_none_match (str) – (optional) Header parameter to specify a double quoted document revision token for cache control.
range (str) – (optional) Header parameter to specify the byte range for a request. This allows the implementation of resumable downloads and skippable streams. This is available for all attachments inside CouchDB.
rev (str) – (optional) Query parameter to specify a document revision.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with BinaryIO result
- get_capacity_throughput_information(**kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Retrieve provisioned throughput capacity information.
View the amount of provisioned throughput capacity that is allocated to an IBM Cloudant instance and what is the target provisioned throughput capacity.
- Parameters
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a CapacityThroughputInformation object
- get_cors_information(**kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Retrieve CORS configuration information.
Lists all Cross-origin resource sharing (CORS) configuration. CORS defines a way in which the browser and the server interact to determine whether or not to allow the request.
- Parameters
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a CorsInformation object
- get_current_throughput_information(**kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Retrieve the current provisioned throughput capacity consumption.
View the current consumption of provisioned throughput capacity for an IBM Cloudant instance. The current consumption shows the quantities of reads, writes, and global queries conducted against the instance for a given second.
- Parameters
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a CurrentThroughputInformation object
- get_database_information(db: str, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Retrieve information about a database.
- Parameters
db (str) – Path parameter to specify the database name.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a DatabaseInformation object
- get_db_updates(*, feed: Optional[str] = None, heartbeat: Optional[int] = None, timeout: Optional[int] = None, since: Optional[str] = None, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Retrieve change events for all databases.
Lists changes to databases, like a global changes feed. Types of changes include updating the database and creating or deleting a database. Like the changes feed, the feed is not guaranteed to return changes in the correct order and might repeat changes. Polling modes for this method work like polling modes for the changes feed. Note: This endpoint requires _admin or _db_updates role and is only available on dedicated clusters..
- Parameters
feed (str) – (optional) Query parameter to specify the changes feed type.
heartbeat (int) – (optional) Query parameter to specify the period in milliseconds after which an empty line is sent in the results. Only applicable for longpoll, continuous, and eventsource feeds. Overrides any timeout to keep the feed alive indefinitely. May also be true to use default value of 60000.
timeout (int) – (optional) Query parameter to specify the maximum period in milliseconds to wait for a change before the response is sent, even if there are no results. Only applicable for longpoll or continuous feeds. Default value is specified by httpd/changes_timeout configuration option. Note that 60000 value is also the default maximum timeout to prevent undetected dead connections.
since (str) – (optional) Query parameter to specify to start the results from the change immediately after the given update sequence. Can be a valid update sequence or now value. Default is 0 i.e. all changes.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a DbUpdates object
- get_design_document(db: str, ddoc: str, *, if_none_match: Optional[str] = None, attachments: Optional[bool] = None, att_encoding_info: Optional[bool] = None, conflicts: Optional[bool] = None, deleted_conflicts: Optional[bool] = None, latest: Optional[bool] = None, local_seq: Optional[bool] = None, meta: Optional[bool] = None, rev: Optional[str] = None, revs: Optional[bool] = None, revs_info: Optional[bool] = None, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Retrieve a design document.
Returns design document with the specified doc_id from the specified database. Unless you request a specific revision, the current revision of the design document is always returned.
- Parameters
db (str) – Path parameter to specify the database name.
ddoc (str) – Path parameter to specify the design document name. The design document name is the design document ID excluding the _design/ prefix.
if_none_match (str) – (optional) Header parameter to specify a double quoted document revision token for cache control.
attachments (bool) – (optional) Query parameter to specify whether to include attachments bodies in a response.
att_encoding_info (bool) – (optional) Query parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
conflicts (bool) – (optional) Query parameter to specify whether to include a list of conflicted revisions in the _conflicts property of the returned document. Ignored if include_docs isn’t true.
deleted_conflicts (bool) – (optional) Query parameter to specify whether to include a list of deleted conflicted revisions in the _deleted_conflicts property of the returned document.
latest (bool) – (optional) Query parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested.
local_seq (bool) – (optional) Query parameter to specify whether to include the last update sequence for the document.
meta (bool) – (optional) Query parameter to specify whether to include document meta information. Acts the same as specifying all of the conflicts, deleted_conflicts and open_revs query parameters.
rev (str) – (optional) Query parameter to specify a document revision.
revs (bool) – (optional) Query parameter to specify whether to include a list of all known document revisions.
revs_info (bool) – (optional) Query parameter to specify whether to includes detailed information for all known document revisions.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a DesignDocument object
- get_design_document_information(db: str, ddoc: str, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Retrieve information about a design document.
Retrieves information about the specified design document, including the index, index size, and current status of the design document and associated index information.
- Parameters
db (str) – Path parameter to specify the database name.
ddoc (str) – Path parameter to specify the design document name. The design document name is the design document ID excluding the _design/ prefix.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a DesignDocumentInformation object
- get_document(db: str, doc_id: str, *, if_none_match: Optional[str] = None, attachments: Optional[bool] = None, att_encoding_info: Optional[bool] = None, conflicts: Optional[bool] = None, deleted_conflicts: Optional[bool] = None, latest: Optional[bool] = None, local_seq: Optional[bool] = None, meta: Optional[bool] = None, rev: Optional[str] = None, revs: Optional[bool] = None, revs_info: Optional[bool] = None, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Retrieve a document.
Returns document with the specified doc_id from the specified database. Unless you request a specific revision, the latest revision of the document is always returned.
- Parameters
db (str) – Path parameter to specify the database name.
doc_id (str) – Path parameter to specify the document ID.
if_none_match (str) – (optional) Header parameter to specify a double quoted document revision token for cache control.
attachments (bool) – (optional) Query parameter to specify whether to include attachments bodies in a response.
att_encoding_info (bool) – (optional) Query parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
conflicts (bool) – (optional) Query parameter to specify whether to include a list of conflicted revisions in the _conflicts property of the returned document. Ignored if include_docs isn’t true.
deleted_conflicts (bool) – (optional) Query parameter to specify whether to include a list of deleted conflicted revisions in the _deleted_conflicts property of the returned document.
latest (bool) – (optional) Query parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested.
local_seq (bool) – (optional) Query parameter to specify whether to include the last update sequence for the document.
meta (bool) – (optional) Query parameter to specify whether to include document meta information. Acts the same as specifying all of the conflicts, deleted_conflicts and open_revs query parameters.
rev (str) – (optional) Query parameter to specify a document revision.
revs (bool) – (optional) Query parameter to specify whether to include a list of all known document revisions.
revs_info (bool) – (optional) Query parameter to specify whether to includes detailed information for all known document revisions.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a Document object
- get_document_as_mixed(db: str, doc_id: str, *, if_none_match: Optional[str] = None, attachments: Optional[bool] = None, att_encoding_info: Optional[bool] = None, conflicts: Optional[bool] = None, deleted_conflicts: Optional[bool] = None, latest: Optional[bool] = None, local_seq: Optional[bool] = None, meta: Optional[bool] = None, rev: Optional[str] = None, revs: Optional[bool] = None, revs_info: Optional[bool] = None, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Retrieve a document as mixed.
Returns document with the specified doc_id from the specified database. Unless you request a specific revision, the latest revision of the document is always returned.
- Parameters
db (str) – Path parameter to specify the database name.
doc_id (str) – Path parameter to specify the document ID.
if_none_match (str) – (optional) Header parameter to specify a double quoted document revision token for cache control.
attachments (bool) – (optional) Query parameter to specify whether to include attachments bodies in a response.
att_encoding_info (bool) – (optional) Query parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
conflicts (bool) – (optional) Query parameter to specify whether to include a list of conflicted revisions in the _conflicts property of the returned document. Ignored if include_docs isn’t true.
deleted_conflicts (bool) – (optional) Query parameter to specify whether to include a list of deleted conflicted revisions in the _deleted_conflicts property of the returned document.
latest (bool) – (optional) Query parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested.
local_seq (bool) – (optional) Query parameter to specify whether to include the last update sequence for the document.
meta (bool) – (optional) Query parameter to specify whether to include document meta information. Acts the same as specifying all of the conflicts, deleted_conflicts and open_revs query parameters.
rev (str) – (optional) Query parameter to specify a document revision.
revs (bool) – (optional) Query parameter to specify whether to include a list of all known document revisions.
revs_info (bool) – (optional) Query parameter to specify whether to includes detailed information for all known document revisions.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with BinaryIO result
Retrieve a document as related.
Returns document with the specified doc_id from the specified database. Unless you request a specific revision, the latest revision of the document is always returned.
- Parameters
db (str) – Path parameter to specify the database name.
doc_id (str) – Path parameter to specify the document ID.
if_none_match (str) – (optional) Header parameter to specify a double quoted document revision token for cache control.
attachments (bool) – (optional) Query parameter to specify whether to include attachments bodies in a response.
att_encoding_info (bool) – (optional) Query parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
conflicts (bool) – (optional) Query parameter to specify whether to include a list of conflicted revisions in the _conflicts property of the returned document. Ignored if include_docs isn’t true.
deleted_conflicts (bool) – (optional) Query parameter to specify whether to include a list of deleted conflicted revisions in the _deleted_conflicts property of the returned document.
latest (bool) – (optional) Query parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested.
local_seq (bool) – (optional) Query parameter to specify whether to include the last update sequence for the document.
meta (bool) – (optional) Query parameter to specify whether to include document meta information. Acts the same as specifying all of the conflicts, deleted_conflicts and open_revs query parameters.
rev (str) – (optional) Query parameter to specify a document revision.
revs (bool) – (optional) Query parameter to specify whether to include a list of all known document revisions.
revs_info (bool) – (optional) Query parameter to specify whether to includes detailed information for all known document revisions.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with BinaryIO result
- get_document_as_stream(db: str, doc_id: str, *, if_none_match: Optional[str] = None, attachments: Optional[bool] = None, att_encoding_info: Optional[bool] = None, conflicts: Optional[bool] = None, deleted_conflicts: Optional[bool] = None, latest: Optional[bool] = None, local_seq: Optional[bool] = None, meta: Optional[bool] = None, rev: Optional[str] = None, revs: Optional[bool] = None, revs_info: Optional[bool] = None, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Retrieve a document as stream.
Returns document with the specified doc_id from the specified database. Unless you request a specific revision, the latest revision of the document is always returned.
- Parameters
db (str) – Path parameter to specify the database name.
doc_id (str) – Path parameter to specify the document ID.
if_none_match (str) – (optional) Header parameter to specify a double quoted document revision token for cache control.
attachments (bool) – (optional) Query parameter to specify whether to include attachments bodies in a response.
att_encoding_info (bool) – (optional) Query parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
conflicts (bool) – (optional) Query parameter to specify whether to include a list of conflicted revisions in the _conflicts property of the returned document. Ignored if include_docs isn’t true.
deleted_conflicts (bool) – (optional) Query parameter to specify whether to include a list of deleted conflicted revisions in the _deleted_conflicts property of the returned document.
latest (bool) – (optional) Query parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested.
local_seq (bool) – (optional) Query parameter to specify whether to include the last update sequence for the document.
meta (bool) – (optional) Query parameter to specify whether to include document meta information. Acts the same as specifying all of the conflicts, deleted_conflicts and open_revs query parameters.
rev (str) – (optional) Query parameter to specify a document revision.
revs (bool) – (optional) Query parameter to specify whether to include a list of all known document revisions.
revs_info (bool) – (optional) Query parameter to specify whether to includes detailed information for all known document revisions.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with BinaryIO result
- get_document_shards_info(db: str, doc_id: str, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Retrieve shard information for a specific document.
Retrieves information about a specific shard where a particular document is stored, along with information about the nodes where that shard has a replica.
- Parameters
db (str) – Path parameter to specify the database name.
doc_id (str) – Path parameter to specify the document ID.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a DocumentShardInfo object
- get_geo(db: str, ddoc: str, index: str, *, bbox: Optional[str] = None, bookmark: Optional[str] = None, format: Optional[str] = None, g: Optional[str] = None, include_docs: Optional[bool] = None, lat: Optional[float] = None, limit: Optional[int] = None, lon: Optional[float] = None, nearest: Optional[bool] = None, radius: Optional[float] = None, rangex: Optional[float] = None, rangey: Optional[float] = None, relation: Optional[str] = None, skip: Optional[int] = None, stale: Optional[str] = None, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Query a geospatial index.
Executes a query against the requested geospatial index from the specified design document.
- Parameters
db (str) – Path parameter to specify the database name.
ddoc (str) – Path parameter to specify the design document name. The design document name is the design document ID excluding the _design/ prefix.
index (str) – Path parameter to specify the index name.
bbox (str) – (optional) Query parameter to specify a geospatial query bounding box with two latitude,longitude coordinates for the lower-left and upper-right corners. An example is -11.05987446,12.28339928,-101.05987446,62.28339928.
bookmark (str) – (optional) Query parameter to specify a bookmark that was received from a previous request. This parameter enables paging through the results. If there are no more results after the bookmark, you get a response containing no further results and the same bookmark, confirming the end of the result list.
format (str) – (optional) Query parameter that causes the geospatial query output to be returned in the specified format.
g (str) – (optional) Query parameter to specify a Well Known Text (WKT) representation of a geospatial query geometry. The valid values for the WKT parameter include Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and GeometryCollection.
include_docs (bool) – (optional) Query parameter to specify whether to include the full content of the documents in the response.
lat (float) – (optional) Query parameter to specify a latitude coordinate for use with radius or ellipse geospatial queries.
limit (int) – (optional) Query parameter to specify the number of returned documents to limit the result to.
lon (float) – (optional) Query parameter to specify a longitude coordinate for use with radius or ellipse geospatial queries.
nearest (bool) – (optional) Query parameter to specify whether to perform a nearest neighbour (NN) search. If provided, the nearest=true search returns all results by sorting their distances to the center of the query geometry. NN search can be used alone or with any of the supported DE-9IM (Dimensionally Extended nine-Intersection Model) specification geometric relations documented.
radius (float) – (optional) Query parameter to specify the radius, in meters, to search from a lat,lon coordinate point in a circular geospatial query.
rangex (float) – (optional) Query parameter to specify the first radius, in meters, to search from a lat,lon coordinate point in an ellipse geospatial query.
rangey (float) – (optional) Query parameter to specify the second radius, in meters, to search from a lat,lon coordinate point in an ellipse geospatial query.
relation (str) – (optional) Query parameter to specify the DE-9IM (Dimensionally Extended nine-Intersection Model)geospatial relationship between the query geometry and the result documents.
skip (int) – (optional) Query parameter to specify the number of records before starting to return the results.
stale (str) – (optional) Query parameter to specify to not wait for the index to finish building before returning results.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a GeoResult object
- get_geo_as_stream(db: str, ddoc: str, index: str, *, bbox: Optional[str] = None, bookmark: Optional[str] = None, format: Optional[str] = None, g: Optional[str] = None, include_docs: Optional[bool] = None, lat: Optional[float] = None, limit: Optional[int] = None, lon: Optional[float] = None, nearest: Optional[bool] = None, radius: Optional[float] = None, rangex: Optional[float] = None, rangey: Optional[float] = None, relation: Optional[str] = None, skip: Optional[int] = None, stale: Optional[str] = None, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Query a geospatial index as stream.
Executes a query against the requested geospatial index from the specified design document.
- Parameters
db (str) – Path parameter to specify the database name.
ddoc (str) – Path parameter to specify the design document name. The design document name is the design document ID excluding the _design/ prefix.
index (str) – Path parameter to specify the index name.
bbox (str) – (optional) Query parameter to specify a geospatial query bounding box with two latitude,longitude coordinates for the lower-left and upper-right corners. An example is -11.05987446,12.28339928,-101.05987446,62.28339928.
bookmark (str) – (optional) Query parameter to specify a bookmark that was received from a previous request. This parameter enables paging through the results. If there are no more results after the bookmark, you get a response containing no further results and the same bookmark, confirming the end of the result list.
format (str) – (optional) Query parameter that causes the geospatial query output to be returned in the specified format.
g (str) – (optional) Query parameter to specify a Well Known Text (WKT) representation of a geospatial query geometry. The valid values for the WKT parameter include Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and GeometryCollection.
include_docs (bool) – (optional) Query parameter to specify whether to include the full content of the documents in the response.
lat (float) – (optional) Query parameter to specify a latitude coordinate for use with radius or ellipse geospatial queries.
limit (int) – (optional) Query parameter to specify the number of returned documents to limit the result to.
lon (float) – (optional) Query parameter to specify a longitude coordinate for use with radius or ellipse geospatial queries.
nearest (bool) – (optional) Query parameter to specify whether to perform a nearest neighbour (NN) search. If provided, the nearest=true search returns all results by sorting their distances to the center of the query geometry. NN search can be used alone or with any of the supported DE-9IM (Dimensionally Extended nine-Intersection Model) specification geometric relations documented.
radius (float) – (optional) Query parameter to specify the radius, in meters, to search from a lat,lon coordinate point in a circular geospatial query.
rangex (float) – (optional) Query parameter to specify the first radius, in meters, to search from a lat,lon coordinate point in an ellipse geospatial query.
rangey (float) – (optional) Query parameter to specify the second radius, in meters, to search from a lat,lon coordinate point in an ellipse geospatial query.
relation (str) – (optional) Query parameter to specify the DE-9IM (Dimensionally Extended nine-Intersection Model)geospatial relationship between the query geometry and the result documents.
skip (int) – (optional) Query parameter to specify the number of records before starting to return the results.
stale (str) – (optional) Query parameter to specify to not wait for the index to finish building before returning results.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with BinaryIO result
- get_geo_index_information(db: str, ddoc: str, index: str, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Retrieve information about a geospatial index.
- Parameters
db (str) – Path parameter to specify the database name.
ddoc (str) – Path parameter to specify the design document name. The design document name is the design document ID excluding the _design/ prefix.
index (str) – Path parameter to specify the index name.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a GeoIndexInformation object
- get_indexes_information(db: str, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Retrieve information about all indexes.
When you make a GET request to /db/_index, you get a list of all indexes used by Cloudant Query in the database, including the primary index. In addition to the information available through this API, indexes are also stored in the indexes property of design documents.
- Parameters
db (str) – Path parameter to specify the database name.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a IndexesInformation object
- get_local_document(db: str, doc_id: str, *, accept: Optional[str] = None, if_none_match: Optional[str] = None, attachments: Optional[bool] = None, att_encoding_info: Optional[bool] = None, local_seq: Optional[bool] = None, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Retrieve a local document.
Retrieves the specified local document. The semantics are identical to accessing a standard document in the specified database, except that the document is not replicated.
- Parameters
db (str) – Path parameter to specify the database name.
doc_id (str) – Path parameter to specify the document ID.
accept (str) – (optional) The type of the response: application/json, multipart/mixed, multipart/related, or application/octet-stream.
if_none_match (str) – (optional) Header parameter to specify a double quoted document revision token for cache control.
attachments (bool) – (optional) Query parameter to specify whether to include attachments bodies in a response.
att_encoding_info (bool) – (optional) Query parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
local_seq (bool) – (optional) Query parameter to specify whether to include the last update sequence for the document.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a Document object
- get_membership_information(**kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Retrieve cluster membership information.
Displays the nodes that are part of the cluster as cluster_nodes. The field, all_nodes, displays all nodes this node knows about, including the ones that are part of the cluster. This endpoint is useful when you set up a cluster.
- Parameters
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a MembershipInformation object
- get_partition_information(db: str, partition_key: str, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Retrieve information about a database partition.
Given a partition key, return the database name, sizes, partition, doc count, and doc delete count.
- Parameters
db (str) – Path parameter to specify the database name.
partition_key (str) – Path parameter to specify the database partition key.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a PartitionInformation object
- get_replication_document(doc_id: str, *, if_none_match: Optional[str] = None, attachments: Optional[bool] = None, att_encoding_info: Optional[bool] = None, conflicts: Optional[bool] = None, deleted_conflicts: Optional[bool] = None, latest: Optional[bool] = None, local_seq: Optional[bool] = None, meta: Optional[bool] = None, rev: Optional[str] = None, revs: Optional[bool] = None, revs_info: Optional[bool] = None, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Retrieve a replication document.
Retrieves a replication document from the _replicator database to view the configuration of the replication. The status of the replication is no longer recorded in the document but can be checked via the replication scheduler.
- Parameters
doc_id (str) – Path parameter to specify the document ID.
if_none_match (str) – (optional) Header parameter to specify a double quoted document revision token for cache control.
attachments (bool) – (optional) Query parameter to specify whether to include attachments bodies in a response.
att_encoding_info (bool) – (optional) Query parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
conflicts (bool) – (optional) Query parameter to specify whether to include a list of conflicted revisions in the _conflicts property of the returned document. Ignored if include_docs isn’t true.
deleted_conflicts (bool) – (optional) Query parameter to specify whether to include a list of deleted conflicted revisions in the _deleted_conflicts property of the returned document.
latest (bool) – (optional) Query parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested.
local_seq (bool) – (optional) Query parameter to specify whether to include the last update sequence for the document.
meta (bool) – (optional) Query parameter to specify whether to include document meta information. Acts the same as specifying all of the conflicts, deleted_conflicts and open_revs query parameters.
rev (str) – (optional) Query parameter to specify a document revision.
revs (bool) – (optional) Query parameter to specify whether to include a list of all known document revisions.
revs_info (bool) – (optional) Query parameter to specify whether to includes detailed information for all known document revisions.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a ReplicationDocument object
- get_scheduler_docs(*, limit: Optional[int] = None, skip: Optional[int] = None, states: Optional[List[str]] = None, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Retrieve replication scheduler documents.
Lists replication documents, including information about all documents, even the ones in a completed or failed state. For each document, the endpoint returns the document ID, database, replication ID, source and target, and other information.
- Parameters
limit (int) – (optional) Query parameter to specify the number of returned documents to limit the result to.
skip (int) – (optional) Query parameter to specify the number of records before starting to return the results.
states (List[str]) – (optional) Query parameter to include only replication documents in the specified states. String must be a comma-delimited string.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a SchedulerDocsResult object
- get_scheduler_document(doc_id: str, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Retrieve a replication scheduler document.
Retrieves information about a replication document from the replicator database. The endpoint returns the document ID, database, replication ID, source and target, and other information.
- Parameters
doc_id (str) – Path parameter to specify the document ID.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a SchedulerDocument object
- get_scheduler_job(job_id: str, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Retrieve a replication scheduler job.
Retrieves the state of a single replication task based on its replication ID.
- Parameters
job_id (str) – Path parameter to specify the replication job id.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a SchedulerJob object
- get_scheduler_jobs(*, limit: Optional[int] = None, skip: Optional[int] = None, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Retrieve replication scheduler jobs.
Retrieves information about replications that were created via /_replicate endpoint, as well as those created from replication documents. It doesn’t include replications that completed or failed to start because replication documents were malformed. Each job description includes source and target information, replication ID, history of recent events, and other information.
- Parameters
limit (int) – (optional) Query parameter to specify the number of returned documents to limit the result to.
skip (int) – (optional) Query parameter to specify the number of records before starting to return the results.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a SchedulerJobsResult object
- get_search_info(db: str, ddoc: str, index: str, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Retrieve information about a search index.
Retrieve search index metadata information, such as the size of the index on disk.
- Parameters
db (str) – Path parameter to specify the database name.
ddoc (str) – Path parameter to specify the design document name. The design document name is the design document ID excluding the _design/ prefix.
index (str) – Path parameter to specify the index name.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a SearchInfoResult object
- get_security(db: str, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Retrieve database permissions information.
See who has permission to read, write, and manage the database. The credentials you use to log in to the dashboard automatically include _admin permissions to all databases you create. Everyone and everything else, including users you share databases with and API keys you create, must be given a permission level explicitly.
- Parameters
db (str) – Path parameter to specify the database name.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a Security object
- get_server_information(**kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Retrieve server instance information.
When you access the root of an instance, IBM Cloudant returns meta-information about the instance. The response includes a JSON structure that contains information about the server, including a welcome message and the server’s version.
- Parameters
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a ServerInformation object
- get_session_information(**kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Retrieve current session cookie information.
Retrieves information about the authenticated user’s session.
- Parameters
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a SessionInformation object
- get_shards_information(db: str, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Retrieve shard information.
List each shard range and the corresponding replicas for a specified database.
- Parameters
db (str) – Path parameter to specify the database name.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a ShardsInformation object
- get_up_information(**kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Retrieve information about whether the server is up.
Confirms that the server is up, running, and ready to respond to requests. If maintenance_mode is true or nolb, the endpoint returns a 404 response.
- Parameters
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a UpInformation object
- get_uuids(*, count: Optional[int] = None, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Retrieve one or more UUIDs.
Requests one or more Universally Unique Identifiers (UUIDs) from the instance. The response is a JSON object that provides a list of UUIDs.
- Parameters
count (int) – (optional) Query parameter to specify the number of UUIDs to return.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a UuidsResult object
- head_attachment(db: str, doc_id: str, attachment_name: str, *, if_match: Optional[str] = None, if_none_match: Optional[str] = None, rev: Optional[str] = None, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Retrieve the HTTP headers for an attachment.
Returns the HTTP headers that contain a minimal amount of information about the specified attachment. This method supports the same query arguments as the GET /{db}/{doc_id}/{attachment_name} method, but only the header information (including attachment size, encoding, and the MD5 hash as an ETag), is returned.
- Parameters
db (str) – Path parameter to specify the database name.
doc_id (str) – Path parameter to specify the document ID.
attachment_name (str) – Path parameter to specify the attachment name.
if_match (str) – (optional) Header parameter to specify the document revision. Alternative to rev query parameter.
if_none_match (str) – (optional) Header parameter to specify a double quoted document revision token for cache control.
rev (str) – (optional) Query parameter to specify a document revision.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse
- head_database(db: str, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Retrieve the HTTP headers for a database.
Returns the HTTP headers that contain a minimal amount of information about the specified database. Since the response body is empty, using the HEAD method is a lightweight way to check if the database exists or not.
- Parameters
db (str) – Path parameter to specify the database name.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse
- head_design_document(db: str, ddoc: str, *, if_none_match: Optional[str] = None, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Retrieve the HTTP headers for a design document.
This method supports the same query arguments as the GET /{db}/_design/{ddoc} method, but the results include only the header information (including design document size, and the revision as an ETag). The ETag header shows the current revision for the requested design document, and if you requested the design document in full, the Content-Length specifies the length of the data. If you add any of the query arguments, then the resulting HTTP headers correspond to what is returned for the equivalent GET request.
- Parameters
db (str) – Path parameter to specify the database name.
ddoc (str) – Path parameter to specify the design document name. The design document name is the design document ID excluding the _design/ prefix.
if_none_match (str) – (optional) Header parameter to specify a double quoted document revision token for cache control.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse
- head_document(db: str, doc_id: str, *, if_none_match: Optional[str] = None, latest: Optional[bool] = None, rev: Optional[str] = None, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Retrieve the HTTP headers for the document.
This method supports the same query arguments as the GET /{db}/{docid} method, but only the header information (including document size and the revision as an ETag) is returned. The ETag header shows the current revision for the requested document, and the Content-Length specifies the length of the data if the document was requested in full. Add any of the query arguments, then the resulting HTTP headers that correspond to it are returned.
- Parameters
db (str) – Path parameter to specify the database name.
doc_id (str) – Path parameter to specify the document ID.
if_none_match (str) – (optional) Header parameter to specify a double quoted document revision token for cache control.
latest (bool) – (optional) Query parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested.
rev (str) – (optional) Query parameter to specify a document revision.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse
- head_local_document(db: str, doc_id: str, *, if_none_match: Optional[str] = None, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Retrieve HTTP headers for a local document.
Retrieves the HTTP headers containing minimal amount of information about the specified local document. Since the response body is empty, using the HEAD method is a lightweight way to check if the local document exists or not.
- Parameters
db (str) – Path parameter to specify the database name.
doc_id (str) – Path parameter to specify the document ID.
if_none_match (str) – (optional) Header parameter to specify a double quoted document revision token for cache control.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse
- head_replication_document(doc_id: str, *, if_none_match: Optional[str] = None, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Retrieve the HTTP headers for a replication document.
Retrieves the HTTP headers containing minimal amount of information about the specified replication document from the _replicator database. The method supports the same query arguments as the GET /_replicator/{doc_id} method, but only headers like content length and the revision (ETag header) are returned.
- Parameters
doc_id (str) – Path parameter to specify the document ID.
if_none_match (str) – (optional) Header parameter to specify a double quoted document revision token for cache control.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse
- head_scheduler_document(doc_id: str, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Retrieve HTTP headers for a replication scheduler document.
Retrieves the HTTP headers containing minimal amount of information about the specified replication scheduler document. Since the response body is empty, using the HEAD method is a lightweight way to check if the replication scheduler document exists or not.
- Parameters
doc_id (str) – Path parameter to specify the document ID.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse
- head_scheduler_job(job_id: str, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Retrieve the HTTP headers for a replication scheduler job.
Returns the HTTP headers that contain a minimal amount of information about the specified replication task. Only the header information is returned.
- Parameters
job_id (str) – Path parameter to specify the replication job id.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse
- head_up_information(**kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Retrieve HTTP headers about whether the server is up.
Retrieves the HTTP headers about whether the server is up.
- Parameters
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse
- classmethod new_instance(service_name: str = 'cloudant') ibmcloudant.cloudant_v1.CloudantV1 ¶
- Return a new client for the Cloudant service using the specified parameters
and external configuration.
- post_activity_tracker_events(types: List[str], **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Modify Activity Tracker events configuration.
Configure event types that are being sent to IBM Cloud Activity Tracker for the IBM Cloudant instance.
- Parameters
types (List[str]) – An array of event types that are being sent to IBM Cloud Activity Tracker for the IBM Cloudant instance. “management” is a required element of this array.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a Ok object
- post_all_docs(db: str, *, att_encoding_info: Optional[bool] = None, attachments: Optional[bool] = None, conflicts: Optional[bool] = None, descending: Optional[bool] = None, include_docs: Optional[bool] = None, inclusive_end: Optional[bool] = None, limit: Optional[int] = None, skip: Optional[int] = None, update_seq: Optional[bool] = None, endkey: Optional[str] = None, key: Optional[str] = None, keys: Optional[List[str]] = None, startkey: Optional[str] = None, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Query a list of all documents in a database.
Queries the primary index (all document IDs). The results that match the request body parameters are returned in a JSON object, including a list of matching documents with basic contents, such as the ID and revision. When no request body parameters are specified, results for all documents in the database are returned. Optionally, document content or additional metadata can be included in the response.
- Parameters
db (str) – Path parameter to specify the database name.
att_encoding_info (bool) – (optional) Parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
attachments (bool) – (optional) Parameter to specify whether to include attachments bodies in a response.
conflicts (bool) – (optional) Parameter to specify whether to include a list of conflicted revisions in the _conflicts property of the returned document. Ignored if include_docs isn’t true.
descending (bool) – (optional) Parameter to specify whether to return the documents in descending by key order.
include_docs (bool) – (optional) Parameter to specify whether to include the full content of the documents in the response.
inclusive_end (bool) – (optional) Parameter to specify whether the specified end key should be included in the result.
limit (int) – (optional) Parameter to specify the number of returned documents to limit the result to.
skip (int) – (optional) Parameter to specify the number of records before starting to return the results.
update_seq (bool) – (optional) Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
endkey (str) – (optional) Schema for a document ID.
key (str) – (optional) Schema for a document ID.
keys (List[str]) – (optional) Schema for a list of document IDs.
startkey (str) – (optional) Schema for a document ID.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a AllDocsResult object
- post_all_docs_as_stream(db: str, *, att_encoding_info: Optional[bool] = None, attachments: Optional[bool] = None, conflicts: Optional[bool] = None, descending: Optional[bool] = None, include_docs: Optional[bool] = None, inclusive_end: Optional[bool] = None, limit: Optional[int] = None, skip: Optional[int] = None, update_seq: Optional[bool] = None, endkey: Optional[str] = None, key: Optional[str] = None, keys: Optional[List[str]] = None, startkey: Optional[str] = None, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Query a list of all documents in a database as stream.
Queries the primary index (all document IDs). The results that match the request body parameters are returned in a JSON object, including a list of matching documents with basic contents, such as the ID and revision. When no request body parameters are specified, results for all documents in the database are returned. Optionally, document content or additional metadata can be included in the response.
- Parameters
db (str) – Path parameter to specify the database name.
att_encoding_info (bool) – (optional) Parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
attachments (bool) – (optional) Parameter to specify whether to include attachments bodies in a response.
conflicts (bool) – (optional) Parameter to specify whether to include a list of conflicted revisions in the _conflicts property of the returned document. Ignored if include_docs isn’t true.
descending (bool) – (optional) Parameter to specify whether to return the documents in descending by key order.
include_docs (bool) – (optional) Parameter to specify whether to include the full content of the documents in the response.
inclusive_end (bool) – (optional) Parameter to specify whether the specified end key should be included in the result.
limit (int) – (optional) Parameter to specify the number of returned documents to limit the result to.
skip (int) – (optional) Parameter to specify the number of records before starting to return the results.
update_seq (bool) – (optional) Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
endkey (str) – (optional) Schema for a document ID.
key (str) – (optional) Schema for a document ID.
keys (List[str]) – (optional) Schema for a list of document IDs.
startkey (str) – (optional) Schema for a document ID.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with BinaryIO result
- post_all_docs_queries(db: str, queries: List[ibmcloudant.cloudant_v1.AllDocsQuery], **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Multi-query the list of all documents in a database.
Runs multiple queries using the primary index (all document IDs). Returns a JSON object that contains a list of result objects, one for each query, with a structure equivalent to that of a single _all_docs request. This enables you to request multiple queries in a single request, in place of multiple POST /{db}/_all_docs requests.
- Parameters
db (str) – Path parameter to specify the database name.
queries (List[AllDocsQuery]) – An array of query objects with fields for the parameters of each individual view query to be executed. The field names and their meaning are the same as the query parameters of a regular /_all_docs request.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a AllDocsQueriesResult object
- post_all_docs_queries_as_stream(db: str, queries: List[ibmcloudant.cloudant_v1.AllDocsQuery], **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Multi-query the list of all documents in a database as stream.
Runs multiple queries using the primary index (all document IDs). Returns a JSON object that contains a list of result objects, one for each query, with a structure equivalent to that of a single _all_docs request. This enables you to request multiple queries in a single request, in place of multiple POST /{db}/_all_docs requests.
- Parameters
db (str) – Path parameter to specify the database name.
queries (List[AllDocsQuery]) – An array of query objects with fields for the parameters of each individual view query to be executed. The field names and their meaning are the same as the query parameters of a regular /_all_docs request.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with BinaryIO result
- post_api_keys(**kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Generates API keys for apps or persons to enable database access.
Generates API keys to enable database access for a person or application, but without creating a new IBM Cloudant account for that person or application. An API key is a randomly generated username and password. The key is given the wanted access permissions for a database.
- Parameters
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a ApiKeysResult object
- post_bulk_docs(db: str, bulk_docs: Union[ibmcloudant.cloudant_v1.BulkDocs, BinaryIO], **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Bulk modify multiple documents in a database.
The bulk document API allows you to create and update multiple documents at the same time within a single request. The basic operation is similar to creating or updating a single document, except that you batch the document structure and information.
- Parameters
db (str) – Path parameter to specify the database name.
bulk_docs (BulkDocs) – HTTP request body for postBulkDocs.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with List[DocumentResult] result
- post_bulk_get(db: str, docs: List[ibmcloudant.cloudant_v1.BulkGetQueryDocument], *, attachments: Optional[bool] = None, att_encoding_info: Optional[bool] = None, latest: Optional[bool] = None, revs: Optional[bool] = None, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Bulk query revision information for multiple documents.
Fetch specific revisions or revision histories for multiple documents in bulk as replicators do.
- Parameters
db (str) – Path parameter to specify the database name.
docs (List[BulkGetQueryDocument]) – List of document items to get in bulk.
attachments (bool) – (optional) Query parameter to specify whether to include attachments bodies in a response.
att_encoding_info (bool) – (optional) Query parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
latest (bool) – (optional) Query parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested.
revs (bool) – (optional) Query parameter to specify whether to include a list of all known document revisions.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a BulkGetResult object
- post_bulk_get_as_mixed(db: str, docs: List[ibmcloudant.cloudant_v1.BulkGetQueryDocument], *, attachments: Optional[bool] = None, att_encoding_info: Optional[bool] = None, latest: Optional[bool] = None, revs: Optional[bool] = None, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Bulk query revision information for multiple documents as mixed.
Fetch specific revisions or revision histories for multiple documents in bulk as replicators do.
- Parameters
db (str) – Path parameter to specify the database name.
docs (List[BulkGetQueryDocument]) – List of document items to get in bulk.
attachments (bool) – (optional) Query parameter to specify whether to include attachments bodies in a response.
att_encoding_info (bool) – (optional) Query parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
latest (bool) – (optional) Query parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested.
revs (bool) – (optional) Query parameter to specify whether to include a list of all known document revisions.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with BinaryIO result
Bulk query revision information for multiple documents as related.
Fetch specific revisions or revision histories for multiple documents in bulk as replicators do.
- Parameters
db (str) – Path parameter to specify the database name.
docs (List[BulkGetQueryDocument]) – List of document items to get in bulk.
attachments (bool) – (optional) Query parameter to specify whether to include attachments bodies in a response.
att_encoding_info (bool) – (optional) Query parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
latest (bool) – (optional) Query parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested.
revs (bool) – (optional) Query parameter to specify whether to include a list of all known document revisions.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with BinaryIO result
- post_bulk_get_as_stream(db: str, docs: List[ibmcloudant.cloudant_v1.BulkGetQueryDocument], *, attachments: Optional[bool] = None, att_encoding_info: Optional[bool] = None, latest: Optional[bool] = None, revs: Optional[bool] = None, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Bulk query revision information for multiple documents as stream.
Fetch specific revisions or revision histories for multiple documents in bulk as replicators do.
- Parameters
db (str) – Path parameter to specify the database name.
docs (List[BulkGetQueryDocument]) – List of document items to get in bulk.
attachments (bool) – (optional) Query parameter to specify whether to include attachments bodies in a response.
att_encoding_info (bool) – (optional) Query parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
latest (bool) – (optional) Query parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested.
revs (bool) – (optional) Query parameter to specify whether to include a list of all known document revisions.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with BinaryIO result
- post_changes(db: str, *, doc_ids: Optional[List[str]] = None, fields: Optional[List[str]] = None, selector: Optional[dict] = None, last_event_id: Optional[str] = None, att_encoding_info: Optional[bool] = None, attachments: Optional[bool] = None, conflicts: Optional[bool] = None, descending: Optional[bool] = None, feed: Optional[str] = None, filter: Optional[str] = None, heartbeat: Optional[int] = None, include_docs: Optional[bool] = None, limit: Optional[int] = None, seq_interval: Optional[int] = None, since: Optional[str] = None, style: Optional[str] = None, timeout: Optional[int] = None, view: Optional[str] = None, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Query the database document changes feed.
Requests the database changes feed in the same way as GET /{db}/_changes does. It is widely used with the filter query parameter because it allows one to pass more information to the filter.
- Parameters
db (str) – Path parameter to specify the database name.
doc_ids (List[str]) – (optional) Schema for a list of document IDs.
fields (List[str]) – (optional) JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. If it is omitted, the entire document is returned.
selector (dict) –
(optional) JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data. The selector object must:
Be structured as valid JSON.
Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only. Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators. Operators are identified by the use of a dollar sign $ prefix in the name field. There are two core types of operators in the selector syntax: * Combination operators: applied at the topmost level of selection. They are used to combine selectors. In addition to the common boolean operators ($and, $or, $not, $nor) there are three combination operators: $all, $elemMatch, and $allMatch. A combination operator takes a single argument. The argument is either another selector, or an array of selectors. * Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic $eq operator matches when the specified field contains a value that is equal to the supplied argument.
last_event_id (str) – (optional) Header parameter to specify the ID of the last events received by the server on a previous connection. Overrides since query parameter.
att_encoding_info (bool) – (optional) Query parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
attachments (bool) – (optional) Query parameter to specify whether to include attachments bodies in a response.
conflicts (bool) – (optional) Query parameter to specify whether to include a list of conflicted revisions in the _conflicts property of the returned document. Ignored if include_docs isn’t true.
descending (bool) – (optional) Query parameter to specify whether to return the documents in descending by key order.
feed (str) – (optional) Query parameter to specify the changes feed type.
filter (str) –
(optional) Query parameter to specify a filter function from a design document that will filter the changes stream emitting only filtered events. For example: design_doc/filtername. Additionally, some keywords are reserved for built-in filters:
_design - Returns only changes to design documents.
_doc_ids - Returns changes for documents with an ID matching one
- specified in
doc_ids request body parameter.
- _selector - Returns changes for documents that match the selector
request body parameter. The selector syntax is the same as used for _find.
- _view - Returns changes for documents that match an existing map
function in the view specified by the query parameter view.
heartbeat (int) – (optional) Query parameter to specify the period in milliseconds after which an empty line is sent in the results. Only applicable for longpoll, continuous, and eventsource feeds. Overrides any timeout to keep the feed alive indefinitely. May also be true to use default value of 60000.
include_docs (bool) – (optional) Query parameter to specify whether to include the full content of the documents in the response.
limit (int) – (optional) Query parameter to specify the number of returned documents to limit the result to.
seq_interval (int) – (optional) Query parameter to specify that the update seq should only be calculated with every Nth result returned. When fetching changes in a batch, setting <code>seq_interval=<batch size></code>, where <batch size> is the number of results requested per batch, load can be reduced on the source database as computing the seq value across many shards (especially in highly-sharded databases) is expensive.
since (str) – (optional) Query parameter to specify to start the results from the change immediately after the given update sequence. Can be a valid update sequence or now value. Default is 0 i.e. all changes.
style (str) – (optional) Query parameter to specify how many revisions are returned in the changes array. The default, main_only, will only return the current “winning” revision; all_docs will return all leaf revisions (including conflicts and deleted former conflicts).
timeout (int) – (optional) Query parameter to specify the maximum period in milliseconds to wait for a change before the response is sent, even if there are no results. Only applicable for longpoll or continuous feeds. Default value is specified by httpd/changes_timeout configuration option. Note that 60000 value is also the default maximum timeout to prevent undetected dead connections.
view (str) – (optional) Query parameter to specify a view function as a filter. Documents pass the filter if the view’s map function emits at least one record for them.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a ChangesResult object
- post_changes_as_stream(db: str, *, doc_ids: Optional[List[str]] = None, fields: Optional[List[str]] = None, selector: Optional[dict] = None, last_event_id: Optional[str] = None, att_encoding_info: Optional[bool] = None, attachments: Optional[bool] = None, conflicts: Optional[bool] = None, descending: Optional[bool] = None, feed: Optional[str] = None, filter: Optional[str] = None, heartbeat: Optional[int] = None, include_docs: Optional[bool] = None, limit: Optional[int] = None, seq_interval: Optional[int] = None, since: Optional[str] = None, style: Optional[str] = None, timeout: Optional[int] = None, view: Optional[str] = None, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Query the database document changes feed as stream.
Requests the database changes feed in the same way as GET /{db}/_changes does. It is widely used with the filter query parameter because it allows one to pass more information to the filter.
- Parameters
db (str) – Path parameter to specify the database name.
doc_ids (List[str]) – (optional) Schema for a list of document IDs.
fields (List[str]) – (optional) JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. If it is omitted, the entire document is returned.
selector (dict) –
(optional) JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data. The selector object must:
Be structured as valid JSON.
Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only. Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators. Operators are identified by the use of a dollar sign $ prefix in the name field. There are two core types of operators in the selector syntax: * Combination operators: applied at the topmost level of selection. They are used to combine selectors. In addition to the common boolean operators ($and, $or, $not, $nor) there are three combination operators: $all, $elemMatch, and $allMatch. A combination operator takes a single argument. The argument is either another selector, or an array of selectors. * Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic $eq operator matches when the specified field contains a value that is equal to the supplied argument.
last_event_id (str) – (optional) Header parameter to specify the ID of the last events received by the server on a previous connection. Overrides since query parameter.
att_encoding_info (bool) – (optional) Query parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
attachments (bool) – (optional) Query parameter to specify whether to include attachments bodies in a response.
conflicts (bool) – (optional) Query parameter to specify whether to include a list of conflicted revisions in the _conflicts property of the returned document. Ignored if include_docs isn’t true.
descending (bool) – (optional) Query parameter to specify whether to return the documents in descending by key order.
feed (str) – (optional) Query parameter to specify the changes feed type.
filter (str) –
(optional) Query parameter to specify a filter function from a design document that will filter the changes stream emitting only filtered events. For example: design_doc/filtername. Additionally, some keywords are reserved for built-in filters:
_design - Returns only changes to design documents.
_doc_ids - Returns changes for documents with an ID matching one
- specified in
doc_ids request body parameter.
- _selector - Returns changes for documents that match the selector
request body parameter. The selector syntax is the same as used for _find.
- _view - Returns changes for documents that match an existing map
function in the view specified by the query parameter view.
heartbeat (int) – (optional) Query parameter to specify the period in milliseconds after which an empty line is sent in the results. Only applicable for longpoll, continuous, and eventsource feeds. Overrides any timeout to keep the feed alive indefinitely. May also be true to use default value of 60000.
include_docs (bool) – (optional) Query parameter to specify whether to include the full content of the documents in the response.
limit (int) – (optional) Query parameter to specify the number of returned documents to limit the result to.
seq_interval (int) – (optional) Query parameter to specify that the update seq should only be calculated with every Nth result returned. When fetching changes in a batch, setting <code>seq_interval=<batch size></code>, where <batch size> is the number of results requested per batch, load can be reduced on the source database as computing the seq value across many shards (especially in highly-sharded databases) is expensive.
since (str) – (optional) Query parameter to specify to start the results from the change immediately after the given update sequence. Can be a valid update sequence or now value. Default is 0 i.e. all changes.
style (str) – (optional) Query parameter to specify how many revisions are returned in the changes array. The default, main_only, will only return the current “winning” revision; all_docs will return all leaf revisions (including conflicts and deleted former conflicts).
timeout (int) – (optional) Query parameter to specify the maximum period in milliseconds to wait for a change before the response is sent, even if there are no results. Only applicable for longpoll or continuous feeds. Default value is specified by httpd/changes_timeout configuration option. Note that 60000 value is also the default maximum timeout to prevent undetected dead connections.
view (str) – (optional) Query parameter to specify a view function as a filter. Documents pass the filter if the view’s map function emits at least one record for them.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with BinaryIO result
- post_dbs_info(keys: List[str], **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Query information about multiple databases.
This operation enables you to request information about multiple databases in a single request, instead of issuing multiple GET /{db} requests. It returns a list that contains an information object for each database specified in the request.
- Parameters
keys (List[str]) – A list of database names.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with List[DbsInfoResult] result
- post_design_docs(db: str, *, att_encoding_info: Optional[bool] = None, attachments: Optional[bool] = None, conflicts: Optional[bool] = None, descending: Optional[bool] = None, include_docs: Optional[bool] = None, inclusive_end: Optional[bool] = None, limit: Optional[int] = None, skip: Optional[int] = None, update_seq: Optional[bool] = None, endkey: Optional[str] = None, key: Optional[str] = None, keys: Optional[List[str]] = None, startkey: Optional[str] = None, accept: Optional[str] = None, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Query a list of all design documents in a database.
Queries the index of all design document IDs. The results matching the request body parameters are returned in a JSON object, including a list of matching design documents with basic contents, such as the ID and revision. When no request body parameters are specified, results for all design documents in the database are returned. Optionally, the design document content or additional metadata can be included in the response.
- Parameters
db (str) – Path parameter to specify the database name.
att_encoding_info (bool) – (optional) Parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
attachments (bool) – (optional) Parameter to specify whether to include attachments bodies in a response.
conflicts (bool) – (optional) Parameter to specify whether to include a list of conflicted revisions in the _conflicts property of the returned document. Ignored if include_docs isn’t true.
descending (bool) – (optional) Parameter to specify whether to return the documents in descending by key order.
include_docs (bool) – (optional) Parameter to specify whether to include the full content of the documents in the response.
inclusive_end (bool) – (optional) Parameter to specify whether the specified end key should be included in the result.
limit (int) – (optional) Parameter to specify the number of returned documents to limit the result to.
skip (int) – (optional) Parameter to specify the number of records before starting to return the results.
update_seq (bool) – (optional) Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
endkey (str) – (optional) Schema for a document ID.
key (str) – (optional) Schema for a document ID.
keys (List[str]) – (optional) Schema for a list of document IDs.
startkey (str) – (optional) Schema for a document ID.
accept (str) – (optional) The type of the response: application/json or application/octet-stream.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a AllDocsResult object
- post_design_docs_queries(db: str, queries: List[ibmcloudant.cloudant_v1.AllDocsQuery], *, accept: Optional[str] = None, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Multi-query the list of all design documents.
This operation runs multiple view queries of all design documents in the database. This operation enables you to request numerous queries in a single request, in place of multiple POST /{db}/_design_docs requests.
- Parameters
db (str) – Path parameter to specify the database name.
queries (List[AllDocsQuery]) – An array of query objects with fields for the parameters of each individual view query to be executed. The field names and their meaning are the same as the query parameters of a regular /_all_docs request.
accept (str) – (optional) The type of the response: application/json or application/octet-stream.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a AllDocsQueriesResult object
- post_document(db: str, document: Union[ibmcloudant.cloudant_v1.Document, BinaryIO], *, content_type: Optional[str] = None, batch: Optional[str] = None, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Create or modify a document in a database.
Creates or modifies a document in the specified database by using the supplied JSON document. If the JSON document doesn’t specify an _id field, then the document is created with a new unique ID generated by the UUID algorithm that is configured for the server. If the document includes the _id field, then it is created with that _id or updated if the _id already exists, and an appropriate _rev is included in the JSON document. If the _id includes the _local or _design prefix, then this operation is used to create or modify local or design documents respectively.
- Parameters
db (str) – Path parameter to specify the database name.
document (Document) – HTTP request body for Document operations.
content_type (str) – (optional) The type of the input.
batch (str) – (optional) Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a DocumentResult object
- post_explain(db: str, selector: dict, *, bookmark: Optional[str] = None, conflicts: Optional[bool] = None, execution_stats: Optional[bool] = None, fields: Optional[List[str]] = None, limit: Optional[int] = None, skip: Optional[int] = None, sort: Optional[List[dict]] = None, stable: Optional[bool] = None, update: Optional[str] = None, use_index: Optional[List[str]] = None, r: Optional[int] = None, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Retrieve information about which index is used for a query.
Shows which index is being used by the query. Parameters are the same as the [_find endpoint](#query-an-index-by-using-selector-syntax).
- Parameters
db (str) – Path parameter to specify the database name.
selector (dict) –
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data. The selector object must:
Be structured as valid JSON.
Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only. Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators. Operators are identified by the use of a dollar sign $ prefix in the name field. There are two core types of operators in the selector syntax: * Combination operators: applied at the topmost level of selection. They are used to combine selectors. In addition to the common boolean operators ($and, $or, $not, $nor) there are three combination operators: $all, $elemMatch, and $allMatch. A combination operator takes a single argument. The argument is either another selector, or an array of selectors. * Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic $eq operator matches when the specified field contains a value that is equal to the supplied argument.
bookmark (str) – (optional) Opaque bookmark token used when paginating results.
conflicts (bool) – (optional) A boolean value that indicates whether or not to include information about existing conflicts in the document.
execution_stats (bool) – (optional) Use this option to find information about the query that was run. This information includes total key lookups, total document lookups (when include_docs=true is used), and total quorum document lookups (when each document replica is fetched).
fields (List[str]) – (optional) JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. If it is omitted, the entire document is returned.
limit (int) – (optional) Maximum number of results returned. The type: text indexes are limited to 200 results when queried.
skip (int) – (optional) Skip the first ‘n’ results, where ‘n’ is the value that is specified.
sort (List[dict]) – (optional) The sort field contains a list of pairs, each mapping a field name to a sort direction (asc or desc). The first field name and direction pair is the topmost level of sort. The second pair, if provided, is the next level of sort. The field can be any field, using dotted notation if desired for sub-document fields. For example in JSON: [{“fieldName1”: “desc”}, {“fieldName2.subFieldName1”: “desc”}] When sorting with multiple fields they must use the same sort direction, either all ascending or all descending.
stable (bool) – (optional) Whether or not the view results should be returned from a “stable” set of shards.
update (str) – (optional) Whether to update the index prior to returning the result.
use_index (List[str]) – (optional) Use this option to identify a specific index for query to run against, rather than by using the IBM Cloudant Query algorithm to find the best index.
r (int) – (optional) The read quorum that is needed for the result. The value defaults to 1, in which case the document that was found in the index is returned. If set to a higher value, each document is read from at least that many replicas before it is returned in the results. The request will take more time than using only the document that is stored locally with the index.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a ExplainResult object
- post_find(db: str, selector: dict, *, bookmark: Optional[str] = None, conflicts: Optional[bool] = None, execution_stats: Optional[bool] = None, fields: Optional[List[str]] = None, limit: Optional[int] = None, skip: Optional[int] = None, sort: Optional[List[dict]] = None, stable: Optional[bool] = None, update: Optional[str] = None, use_index: Optional[List[str]] = None, r: Optional[int] = None, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Query an index by using selector syntax.
Query documents by using a declarative JSON querying syntax. Queries can use the built-in _all_docs index or custom indices, specified by using the _index endpoint.
- Parameters
db (str) – Path parameter to specify the database name.
selector (dict) –
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data. The selector object must:
Be structured as valid JSON.
Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only. Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators. Operators are identified by the use of a dollar sign $ prefix in the name field. There are two core types of operators in the selector syntax: * Combination operators: applied at the topmost level of selection. They are used to combine selectors. In addition to the common boolean operators ($and, $or, $not, $nor) there are three combination operators: $all, $elemMatch, and $allMatch. A combination operator takes a single argument. The argument is either another selector, or an array of selectors. * Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic $eq operator matches when the specified field contains a value that is equal to the supplied argument.
bookmark (str) – (optional) Opaque bookmark token used when paginating results.
conflicts (bool) – (optional) A boolean value that indicates whether or not to include information about existing conflicts in the document.
execution_stats (bool) – (optional) Use this option to find information about the query that was run. This information includes total key lookups, total document lookups (when include_docs=true is used), and total quorum document lookups (when each document replica is fetched).
fields (List[str]) – (optional) JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. If it is omitted, the entire document is returned.
limit (int) – (optional) Maximum number of results returned. The type: text indexes are limited to 200 results when queried.
skip (int) – (optional) Skip the first ‘n’ results, where ‘n’ is the value that is specified.
sort (List[dict]) – (optional) The sort field contains a list of pairs, each mapping a field name to a sort direction (asc or desc). The first field name and direction pair is the topmost level of sort. The second pair, if provided, is the next level of sort. The field can be any field, using dotted notation if desired for sub-document fields. For example in JSON: [{“fieldName1”: “desc”}, {“fieldName2.subFieldName1”: “desc”}] When sorting with multiple fields they must use the same sort direction, either all ascending or all descending.
stable (bool) – (optional) Whether or not the view results should be returned from a “stable” set of shards.
update (str) – (optional) Whether to update the index prior to returning the result.
use_index (List[str]) – (optional) Use this option to identify a specific index for query to run against, rather than by using the IBM Cloudant Query algorithm to find the best index.
r (int) – (optional) The read quorum that is needed for the result. The value defaults to 1, in which case the document that was found in the index is returned. If set to a higher value, each document is read from at least that many replicas before it is returned in the results. The request will take more time than using only the document that is stored locally with the index.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a FindResult object
- post_find_as_stream(db: str, selector: dict, *, bookmark: Optional[str] = None, conflicts: Optional[bool] = None, execution_stats: Optional[bool] = None, fields: Optional[List[str]] = None, limit: Optional[int] = None, skip: Optional[int] = None, sort: Optional[List[dict]] = None, stable: Optional[bool] = None, update: Optional[str] = None, use_index: Optional[List[str]] = None, r: Optional[int] = None, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Query an index by using selector syntax as stream.
Query documents by using a declarative JSON querying syntax. Queries can use the built-in _all_docs index or custom indices, specified by using the _index endpoint.
- Parameters
db (str) – Path parameter to specify the database name.
selector (dict) –
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data. The selector object must:
Be structured as valid JSON.
Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only. Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators. Operators are identified by the use of a dollar sign $ prefix in the name field. There are two core types of operators in the selector syntax: * Combination operators: applied at the topmost level of selection. They are used to combine selectors. In addition to the common boolean operators ($and, $or, $not, $nor) there are three combination operators: $all, $elemMatch, and $allMatch. A combination operator takes a single argument. The argument is either another selector, or an array of selectors. * Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic $eq operator matches when the specified field contains a value that is equal to the supplied argument.
bookmark (str) – (optional) Opaque bookmark token used when paginating results.
conflicts (bool) – (optional) A boolean value that indicates whether or not to include information about existing conflicts in the document.
execution_stats (bool) – (optional) Use this option to find information about the query that was run. This information includes total key lookups, total document lookups (when include_docs=true is used), and total quorum document lookups (when each document replica is fetched).
fields (List[str]) – (optional) JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. If it is omitted, the entire document is returned.
limit (int) – (optional) Maximum number of results returned. The type: text indexes are limited to 200 results when queried.
skip (int) – (optional) Skip the first ‘n’ results, where ‘n’ is the value that is specified.
sort (List[dict]) – (optional) The sort field contains a list of pairs, each mapping a field name to a sort direction (asc or desc). The first field name and direction pair is the topmost level of sort. The second pair, if provided, is the next level of sort. The field can be any field, using dotted notation if desired for sub-document fields. For example in JSON: [{“fieldName1”: “desc”}, {“fieldName2.subFieldName1”: “desc”}] When sorting with multiple fields they must use the same sort direction, either all ascending or all descending.
stable (bool) – (optional) Whether or not the view results should be returned from a “stable” set of shards.
update (str) – (optional) Whether to update the index prior to returning the result.
use_index (List[str]) – (optional) Use this option to identify a specific index for query to run against, rather than by using the IBM Cloudant Query algorithm to find the best index.
r (int) – (optional) The read quorum that is needed for the result. The value defaults to 1, in which case the document that was found in the index is returned. If set to a higher value, each document is read from at least that many replicas before it is returned in the results. The request will take more time than using only the document that is stored locally with the index.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with BinaryIO result
- post_geo_cleanup(db: str, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Cleanup old geospatial indexes.
Cleanup old geospatial indexes from disk that have been superseded by newer index builds.
- Parameters
db (str) – Path parameter to specify the database name.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a Ok object
- post_index(db: str, index: ibmcloudant.cloudant_v1.IndexDefinition, *, ddoc: Optional[str] = None, def_: Optional[ibmcloudant.cloudant_v1.IndexDefinition] = None, name: Optional[str] = None, partitioned: Optional[bool] = None, type: Optional[str] = None, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Create a new index on a database.
Create a new index on a database.
- Parameters
db (str) – Path parameter to specify the database name.
index (IndexDefinition) – Schema for a json or text query index definition. Indexes of type text have additional configuration properties that do not apply to json indexes, these are: * default_analyzer - the default text analyzer to use * default_field - whether to index the text in all document fields and what analyzer to use for that purpose.
ddoc (str) – (optional) Name of the design document in which the index will be created.
def (IndexDefinition) – (optional) Schema for a json or text query index definition. Indexes of type text have additional configuration properties that do not apply to json indexes, these are: * default_analyzer - the default text analyzer to use * default_field - whether to index the text in all document fields and what analyzer to use for that purpose.
name (str) – (optional) name.
partitioned (bool) – (optional) The default value is true for databases with partitioned: true and false otherwise. For databases with partitioned: false if this option is specified the value must be false.
type (str) – (optional) Schema for the type of an index.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a IndexResult object
- post_partition_all_docs(db: str, partition_key: str, *, att_encoding_info: Optional[bool] = None, attachments: Optional[bool] = None, conflicts: Optional[bool] = None, descending: Optional[bool] = None, include_docs: Optional[bool] = None, inclusive_end: Optional[bool] = None, limit: Optional[int] = None, skip: Optional[int] = None, update_seq: Optional[bool] = None, endkey: Optional[str] = None, key: Optional[str] = None, keys: Optional[List[str]] = None, startkey: Optional[str] = None, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Query a list of all documents in a database partition.
Queries the primary index (all document IDs). The results that match the query parameters are returned in a JSON object, including a list of matching documents with basic contents, such as the ID and revision. When no query parameters are specified, results for all documents in the database partition are returned. Optionally, document content or additional metadata can be included in the response.
- Parameters
db (str) – Path parameter to specify the database name.
partition_key (str) – Path parameter to specify the database partition key.
att_encoding_info (bool) – (optional) Parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
attachments (bool) – (optional) Parameter to specify whether to include attachments bodies in a response.
conflicts (bool) – (optional) Parameter to specify whether to include a list of conflicted revisions in the _conflicts property of the returned document. Ignored if include_docs isn’t true.
descending (bool) – (optional) Parameter to specify whether to return the documents in descending by key order.
include_docs (bool) – (optional) Parameter to specify whether to include the full content of the documents in the response.
inclusive_end (bool) – (optional) Parameter to specify whether the specified end key should be included in the result.
limit (int) – (optional) Parameter to specify the number of returned documents to limit the result to.
skip (int) – (optional) Parameter to specify the number of records before starting to return the results.
update_seq (bool) – (optional) Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
endkey (str) – (optional) Schema for a document ID.
key (str) – (optional) Schema for a document ID.
keys (List[str]) – (optional) Schema for a list of document IDs.
startkey (str) – (optional) Schema for a document ID.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a AllDocsResult object
- post_partition_all_docs_as_stream(db: str, partition_key: str, *, att_encoding_info: Optional[bool] = None, attachments: Optional[bool] = None, conflicts: Optional[bool] = None, descending: Optional[bool] = None, include_docs: Optional[bool] = None, inclusive_end: Optional[bool] = None, limit: Optional[int] = None, skip: Optional[int] = None, update_seq: Optional[bool] = None, endkey: Optional[str] = None, key: Optional[str] = None, keys: Optional[List[str]] = None, startkey: Optional[str] = None, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Query a list of all documents in a database partition as stream.
Queries the primary index (all document IDs). The results that match the query parameters are returned in a JSON object, including a list of matching documents with basic contents, such as the ID and revision. When no query parameters are specified, results for all documents in the database partition are returned. Optionally, document content or additional metadata can be included in the response.
- Parameters
db (str) – Path parameter to specify the database name.
partition_key (str) – Path parameter to specify the database partition key.
att_encoding_info (bool) – (optional) Parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
attachments (bool) – (optional) Parameter to specify whether to include attachments bodies in a response.
conflicts (bool) – (optional) Parameter to specify whether to include a list of conflicted revisions in the _conflicts property of the returned document. Ignored if include_docs isn’t true.
descending (bool) – (optional) Parameter to specify whether to return the documents in descending by key order.
include_docs (bool) – (optional) Parameter to specify whether to include the full content of the documents in the response.
inclusive_end (bool) – (optional) Parameter to specify whether the specified end key should be included in the result.
limit (int) – (optional) Parameter to specify the number of returned documents to limit the result to.
skip (int) – (optional) Parameter to specify the number of records before starting to return the results.
update_seq (bool) – (optional) Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
endkey (str) – (optional) Schema for a document ID.
key (str) – (optional) Schema for a document ID.
keys (List[str]) – (optional) Schema for a list of document IDs.
startkey (str) – (optional) Schema for a document ID.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with BinaryIO result
- post_partition_find(db: str, partition_key: str, selector: dict, *, bookmark: Optional[str] = None, conflicts: Optional[bool] = None, execution_stats: Optional[bool] = None, fields: Optional[List[str]] = None, limit: Optional[int] = None, skip: Optional[int] = None, sort: Optional[List[dict]] = None, stable: Optional[bool] = None, update: Optional[str] = None, use_index: Optional[List[str]] = None, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Query a database partition index by using selector syntax (POST).
Query documents by using a declarative JSON querying syntax. Queries can use the built-in _all_docs index or custom indices, specified by using the _index endpoint.
- Parameters
db (str) – Path parameter to specify the database name.
partition_key (str) – Path parameter to specify the database partition key.
selector (dict) –
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data. The selector object must:
Be structured as valid JSON.
Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only. Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators. Operators are identified by the use of a dollar sign $ prefix in the name field. There are two core types of operators in the selector syntax: * Combination operators: applied at the topmost level of selection. They are used to combine selectors. In addition to the common boolean operators ($and, $or, $not, $nor) there are three combination operators: $all, $elemMatch, and $allMatch. A combination operator takes a single argument. The argument is either another selector, or an array of selectors. * Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic $eq operator matches when the specified field contains a value that is equal to the supplied argument.
bookmark (str) – (optional) Opaque bookmark token used when paginating results.
conflicts (bool) – (optional) A boolean value that indicates whether or not to include information about existing conflicts in the document.
execution_stats (bool) – (optional) Use this option to find information about the query that was run. This information includes total key lookups, total document lookups (when include_docs=true is used), and total quorum document lookups (when each document replica is fetched).
fields (List[str]) – (optional) JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. If it is omitted, the entire document is returned.
limit (int) – (optional) Maximum number of results returned. The type: text indexes are limited to 200 results when queried.
skip (int) – (optional) Skip the first ‘n’ results, where ‘n’ is the value that is specified.
sort (List[dict]) – (optional) The sort field contains a list of pairs, each mapping a field name to a sort direction (asc or desc). The first field name and direction pair is the topmost level of sort. The second pair, if provided, is the next level of sort. The field can be any field, using dotted notation if desired for sub-document fields. For example in JSON: [{“fieldName1”: “desc”}, {“fieldName2.subFieldName1”: “desc”}] When sorting with multiple fields they must use the same sort direction, either all ascending or all descending.
stable (bool) – (optional) Whether or not the view results should be returned from a “stable” set of shards.
update (str) – (optional) Whether to update the index prior to returning the result.
use_index (List[str]) – (optional) Use this option to identify a specific index for query to run against, rather than by using the IBM Cloudant Query algorithm to find the best index.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a FindResult object
- post_partition_find_as_stream(db: str, partition_key: str, selector: dict, *, bookmark: Optional[str] = None, conflicts: Optional[bool] = None, execution_stats: Optional[bool] = None, fields: Optional[List[str]] = None, limit: Optional[int] = None, skip: Optional[int] = None, sort: Optional[List[dict]] = None, stable: Optional[bool] = None, update: Optional[str] = None, use_index: Optional[List[str]] = None, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Query a database partition index by using selector syntax (POST) as stream.
Query documents by using a declarative JSON querying syntax. Queries can use the built-in _all_docs index or custom indices, specified by using the _index endpoint.
- Parameters
db (str) – Path parameter to specify the database name.
partition_key (str) – Path parameter to specify the database partition key.
selector (dict) –
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data. The selector object must:
Be structured as valid JSON.
Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only. Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators. Operators are identified by the use of a dollar sign $ prefix in the name field. There are two core types of operators in the selector syntax: * Combination operators: applied at the topmost level of selection. They are used to combine selectors. In addition to the common boolean operators ($and, $or, $not, $nor) there are three combination operators: $all, $elemMatch, and $allMatch. A combination operator takes a single argument. The argument is either another selector, or an array of selectors. * Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic $eq operator matches when the specified field contains a value that is equal to the supplied argument.
bookmark (str) – (optional) Opaque bookmark token used when paginating results.
conflicts (bool) – (optional) A boolean value that indicates whether or not to include information about existing conflicts in the document.
execution_stats (bool) – (optional) Use this option to find information about the query that was run. This information includes total key lookups, total document lookups (when include_docs=true is used), and total quorum document lookups (when each document replica is fetched).
fields (List[str]) – (optional) JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. If it is omitted, the entire document is returned.
limit (int) – (optional) Maximum number of results returned. The type: text indexes are limited to 200 results when queried.
skip (int) – (optional) Skip the first ‘n’ results, where ‘n’ is the value that is specified.
sort (List[dict]) – (optional) The sort field contains a list of pairs, each mapping a field name to a sort direction (asc or desc). The first field name and direction pair is the topmost level of sort. The second pair, if provided, is the next level of sort. The field can be any field, using dotted notation if desired for sub-document fields. For example in JSON: [{“fieldName1”: “desc”}, {“fieldName2.subFieldName1”: “desc”}] When sorting with multiple fields they must use the same sort direction, either all ascending or all descending.
stable (bool) – (optional) Whether or not the view results should be returned from a “stable” set of shards.
update (str) – (optional) Whether to update the index prior to returning the result.
use_index (List[str]) – (optional) Use this option to identify a specific index for query to run against, rather than by using the IBM Cloudant Query algorithm to find the best index.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with BinaryIO result
- post_partition_search(db: str, partition_key: str, ddoc: str, index: str, query: str, *, bookmark: Optional[str] = None, highlight_fields: Optional[List[str]] = None, highlight_number: Optional[int] = None, highlight_post_tag: Optional[str] = None, highlight_pre_tag: Optional[str] = None, highlight_size: Optional[int] = None, include_docs: Optional[bool] = None, include_fields: Optional[List[str]] = None, limit: Optional[int] = None, sort: Optional[List[str]] = None, stale: Optional[str] = None, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Query a database partition search index.
Partitioned Search indexes, which are defined in design documents, allow partition databases to be queried by using Lucene Query Parser Syntax. Search indexes are defined by an index function, similar to a map function in MapReduce views. The index function decides what data to index and store in the index.
- Parameters
db (str) – Path parameter to specify the database name.
partition_key (str) – Path parameter to specify the database partition key.
ddoc (str) – Path parameter to specify the design document name. The design document name is the design document ID excluding the _design/ prefix.
index (str) – Path parameter to specify the index name.
query (str) – The Lucene query to execute.
bookmark (str) – (optional) Opaque bookmark token used when paginating results.
highlight_fields (List[str]) – (optional) Specifies which fields to highlight. If specified, the result object contains a highlights field with an entry for each specified field.
highlight_number (int) – (optional) Number of fragments that are returned in highlights. If the search term occurs less often than the number of fragments that are specified, longer fragments are returned.
highlight_post_tag (str) – (optional) A string that is inserted after the highlighted word in the highlights output.
highlight_pre_tag (str) – (optional) A string that is inserted before the highlighted word in the highlights output.
highlight_size (int) – (optional) Number of characters in each fragment for highlights.
include_docs (bool) – (optional) Include the full content of the documents in the return.
include_fields (List[str]) – (optional) A JSON array of field names to include in search results. Any fields that are included must be indexed with the store:true option. The default is all fields.
limit (int) – (optional) Limit the number of the returned documents to the specified number.
sort (List[str]) – (optional) Specifies the sort order of the results. In a grouped search (when group_field is used), this parameter specifies the sort order within a group. The default sort order is relevance. A JSON string of the form “fieldname<type>” or “-fieldname<type>” for descending order, where fieldname is the name of a string or number field, and type is either a number, a string, or a JSON array of strings. The type part is optional, and defaults to number. Some examples are “foo”, “-foo”, “bar<string>”, “-foo<number>” and [“-foo<number>”, “bar<string>”]. String fields that are used for sorting must not be analyzed fields. Fields that are used for sorting must be indexed by the same indexer that is used for the search query.
stale (str) – (optional) Do not wait for the index to finish building to return results.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a SearchResult object
- post_partition_search_as_stream(db: str, partition_key: str, ddoc: str, index: str, query: str, *, bookmark: Optional[str] = None, highlight_fields: Optional[List[str]] = None, highlight_number: Optional[int] = None, highlight_post_tag: Optional[str] = None, highlight_pre_tag: Optional[str] = None, highlight_size: Optional[int] = None, include_docs: Optional[bool] = None, include_fields: Optional[List[str]] = None, limit: Optional[int] = None, sort: Optional[List[str]] = None, stale: Optional[str] = None, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Query a database partition search index as stream.
Partitioned Search indexes, which are defined in design documents, allow partition databases to be queried by using Lucene Query Parser Syntax. Search indexes are defined by an index function, similar to a map function in MapReduce views. The index function decides what data to index and store in the index.
- Parameters
db (str) – Path parameter to specify the database name.
partition_key (str) – Path parameter to specify the database partition key.
ddoc (str) – Path parameter to specify the design document name. The design document name is the design document ID excluding the _design/ prefix.
index (str) – Path parameter to specify the index name.
query (str) – The Lucene query to execute.
bookmark (str) – (optional) Opaque bookmark token used when paginating results.
highlight_fields (List[str]) – (optional) Specifies which fields to highlight. If specified, the result object contains a highlights field with an entry for each specified field.
highlight_number (int) – (optional) Number of fragments that are returned in highlights. If the search term occurs less often than the number of fragments that are specified, longer fragments are returned.
highlight_post_tag (str) – (optional) A string that is inserted after the highlighted word in the highlights output.
highlight_pre_tag (str) – (optional) A string that is inserted before the highlighted word in the highlights output.
highlight_size (int) – (optional) Number of characters in each fragment for highlights.
include_docs (bool) – (optional) Include the full content of the documents in the return.
include_fields (List[str]) – (optional) A JSON array of field names to include in search results. Any fields that are included must be indexed with the store:true option. The default is all fields.
limit (int) – (optional) Limit the number of the returned documents to the specified number.
sort (List[str]) – (optional) Specifies the sort order of the results. In a grouped search (when group_field is used), this parameter specifies the sort order within a group. The default sort order is relevance. A JSON string of the form “fieldname<type>” or “-fieldname<type>” for descending order, where fieldname is the name of a string or number field, and type is either a number, a string, or a JSON array of strings. The type part is optional, and defaults to number. Some examples are “foo”, “-foo”, “bar<string>”, “-foo<number>” and [“-foo<number>”, “bar<string>”]. String fields that are used for sorting must not be analyzed fields. Fields that are used for sorting must be indexed by the same indexer that is used for the search query.
stale (str) – (optional) Do not wait for the index to finish building to return results.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with BinaryIO result
- post_partition_view(db: str, partition_key: str, ddoc: str, view: str, *, att_encoding_info: Optional[bool] = None, attachments: Optional[bool] = None, conflicts: Optional[bool] = None, descending: Optional[bool] = None, include_docs: Optional[bool] = None, inclusive_end: Optional[bool] = None, limit: Optional[int] = None, skip: Optional[int] = None, update_seq: Optional[bool] = None, endkey: Optional[object] = None, endkey_docid: Optional[str] = None, group: Optional[bool] = None, group_level: Optional[int] = None, key: Optional[object] = None, keys: Optional[List[object]] = None, reduce: Optional[bool] = None, stable: Optional[bool] = None, startkey: Optional[object] = None, startkey_docid: Optional[str] = None, update: Optional[str] = None, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Query a database partition MapReduce view function.
Runs the specified view function from the specified design document. Unlike GET /{db}/_design/{ddoc}/_view/{view} for accessing views, the POST method supports the specification of explicit keys to be retrieved from the view results. The remainder of the POST view functionality is identical to the GET /{db}/_design/{ddoc}/_view/{view} API.
- Parameters
db (str) – Path parameter to specify the database name.
partition_key (str) – Path parameter to specify the database partition key.
ddoc (str) – Path parameter to specify the design document name. The design document name is the design document ID excluding the _design/ prefix.
view (str) – Path parameter to specify the map reduce view function name.
att_encoding_info (bool) – (optional) Parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
attachments (bool) – (optional) Parameter to specify whether to include attachments bodies in a response.
conflicts (bool) – (optional) Parameter to specify whether to include a list of conflicted revisions in the _conflicts property of the returned document. Ignored if include_docs isn’t true.
descending (bool) – (optional) Parameter to specify whether to return the documents in descending by key order.
include_docs (bool) – (optional) Parameter to specify whether to include the full content of the documents in the response.
inclusive_end (bool) – (optional) Parameter to specify whether the specified end key should be included in the result.
limit (int) – (optional) Parameter to specify the number of returned documents to limit the result to.
skip (int) – (optional) Parameter to specify the number of records before starting to return the results.
update_seq (bool) – (optional) Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
endkey (object) – (optional) Schema for any JSON type.
endkey_docid (str) – (optional) Schema for a document ID.
group (bool) – (optional) Parameter to specify whether to group the results using the reduce function to a group rather than a single row. Implies reduce is true and the maximum group_level.
group_level (int) – (optional) Parameter to specify the group level to be used. Implies group is true.
key (object) – (optional) Schema for any JSON type.
keys (List[object]) – (optional) Parameter to specify to return only documents that match the specified keys. String representation of a JSON array containing elements that match the key type emitted by the view function.
reduce (bool) – (optional) Parameter to specify whether to use the reduce function in a map-reduce view. Default is true when a reduce function is defined.
stable (bool) – (optional) Parameter to specify whether view results should be returned from a stable set of shards.
startkey (object) – (optional) Schema for any JSON type.
startkey_docid (str) – (optional) Schema for a document ID.
update (str) – (optional) Parameter to specify whether or not the view in question should be updated prior to responding to the user.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a ViewResult object
- post_partition_view_as_stream(db: str, partition_key: str, ddoc: str, view: str, *, att_encoding_info: Optional[bool] = None, attachments: Optional[bool] = None, conflicts: Optional[bool] = None, descending: Optional[bool] = None, include_docs: Optional[bool] = None, inclusive_end: Optional[bool] = None, limit: Optional[int] = None, skip: Optional[int] = None, update_seq: Optional[bool] = None, endkey: Optional[object] = None, endkey_docid: Optional[str] = None, group: Optional[bool] = None, group_level: Optional[int] = None, key: Optional[object] = None, keys: Optional[List[object]] = None, reduce: Optional[bool] = None, stable: Optional[bool] = None, startkey: Optional[object] = None, startkey_docid: Optional[str] = None, update: Optional[str] = None, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Query a database partition MapReduce view function as stream.
Runs the specified view function from the specified design document. Unlike GET /{db}/_design/{ddoc}/_view/{view} for accessing views, the POST method supports the specification of explicit keys to be retrieved from the view results. The remainder of the POST view functionality is identical to the GET /{db}/_design/{ddoc}/_view/{view} API.
- Parameters
db (str) – Path parameter to specify the database name.
partition_key (str) – Path parameter to specify the database partition key.
ddoc (str) – Path parameter to specify the design document name. The design document name is the design document ID excluding the _design/ prefix.
view (str) – Path parameter to specify the map reduce view function name.
att_encoding_info (bool) – (optional) Parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
attachments (bool) – (optional) Parameter to specify whether to include attachments bodies in a response.
conflicts (bool) – (optional) Parameter to specify whether to include a list of conflicted revisions in the _conflicts property of the returned document. Ignored if include_docs isn’t true.
descending (bool) – (optional) Parameter to specify whether to return the documents in descending by key order.
include_docs (bool) – (optional) Parameter to specify whether to include the full content of the documents in the response.
inclusive_end (bool) – (optional) Parameter to specify whether the specified end key should be included in the result.
limit (int) – (optional) Parameter to specify the number of returned documents to limit the result to.
skip (int) – (optional) Parameter to specify the number of records before starting to return the results.
update_seq (bool) – (optional) Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
endkey (object) – (optional) Schema for any JSON type.
endkey_docid (str) – (optional) Schema for a document ID.
group (bool) – (optional) Parameter to specify whether to group the results using the reduce function to a group rather than a single row. Implies reduce is true and the maximum group_level.
group_level (int) – (optional) Parameter to specify the group level to be used. Implies group is true.
key (object) – (optional) Schema for any JSON type.
keys (List[object]) – (optional) Parameter to specify to return only documents that match the specified keys. String representation of a JSON array containing elements that match the key type emitted by the view function.
reduce (bool) – (optional) Parameter to specify whether to use the reduce function in a map-reduce view. Default is true when a reduce function is defined.
stable (bool) – (optional) Parameter to specify whether view results should be returned from a stable set of shards.
startkey (object) – (optional) Schema for any JSON type.
startkey_docid (str) – (optional) Schema for a document ID.
update (str) – (optional) Parameter to specify whether or not the view in question should be updated prior to responding to the user.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with BinaryIO result
- post_revs_diff(db: str, document_revisions: dict, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Query the document revisions and possible ancestors missing from the database.
The replicator is the primary user of this operation. After receiving a set of new revision IDs from the source database, the replicator sends this set to the destination database’s _revs_diff to find out which of them already exists there. It can then avoid fetching and sending already-known document bodies.
- Parameters
db (str) – Path parameter to specify the database name.
document_revisions (dict) – HTTP request body for operations with Document revisions.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a dict object
- post_search(db: str, ddoc: str, index: str, query: str, *, bookmark: Optional[str] = None, highlight_fields: Optional[List[str]] = None, highlight_number: Optional[int] = None, highlight_post_tag: Optional[str] = None, highlight_pre_tag: Optional[str] = None, highlight_size: Optional[int] = None, include_docs: Optional[bool] = None, include_fields: Optional[List[str]] = None, limit: Optional[int] = None, sort: Optional[List[str]] = None, stale: Optional[str] = None, counts: Optional[List[str]] = None, drilldown: Optional[List[List[str]]] = None, group_field: Optional[str] = None, group_limit: Optional[int] = None, group_sort: Optional[List[str]] = None, ranges: Optional[dict] = None, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Query a search index.
Search indexes, which are defined in design documents, allow databases to be queried by using Lucene Query Parser Syntax. An index function defines a search index, similar to a map function in MapReduce views. The index function decides what data to index and what data to store in the index. The advantage of using the HTTP POST method is that the query is submitted as a JSON object in the request body. This avoids the limitations of passing query options as URL query parameters of a GET request.
- Parameters
db (str) – Path parameter to specify the database name.
ddoc (str) – Path parameter to specify the design document name. The design document name is the design document ID excluding the _design/ prefix.
index (str) – Path parameter to specify the index name.
query (str) – The Lucene query to execute.
bookmark (str) – (optional) Opaque bookmark token used when paginating results.
highlight_fields (List[str]) – (optional) Specifies which fields to highlight. If specified, the result object contains a highlights field with an entry for each specified field.
highlight_number (int) – (optional) Number of fragments that are returned in highlights. If the search term occurs less often than the number of fragments that are specified, longer fragments are returned.
highlight_post_tag (str) – (optional) A string that is inserted after the highlighted word in the highlights output.
highlight_pre_tag (str) – (optional) A string that is inserted before the highlighted word in the highlights output.
highlight_size (int) – (optional) Number of characters in each fragment for highlights.
include_docs (bool) – (optional) Include the full content of the documents in the return.
include_fields (List[str]) – (optional) A JSON array of field names to include in search results. Any fields that are included must be indexed with the store:true option. The default is all fields.
limit (int) – (optional) Limit the number of the returned documents to the specified number.
sort (List[str]) – (optional) Specifies the sort order of the results. In a grouped search (when group_field is used), this parameter specifies the sort order within a group. The default sort order is relevance. A JSON string of the form “fieldname<type>” or “-fieldname<type>” for descending order, where fieldname is the name of a string or number field, and type is either a number, a string, or a JSON array of strings. The type part is optional, and defaults to number. Some examples are “foo”, “-foo”, “bar<string>”, “-foo<number>” and [“-foo<number>”, “bar<string>”]. String fields that are used for sorting must not be analyzed fields. Fields that are used for sorting must be indexed by the same indexer that is used for the search query.
stale (str) – (optional) Do not wait for the index to finish building to return results.
counts (List[str]) – (optional) This field defines an array of names of string fields, for which counts are requested. The response contains counts for each unique value of this field name among the documents that match the search query. Faceting must be enabled for this parameter to function. This option is only available when making global queries.
drilldown (List[List[str]]) – (optional) Restrict results to documents with a dimension equal to the specified label(s). The search matches only documents containing the value that was provided in the named field. It differs from using “fieldname:value” in the q parameter only in that the values are not analyzed. Faceting must be enabled for this parameter to function.
group_field (str) – (optional) Field by which to group search matches. A string that contains the name of a string field. Fields containing other data such as numbers, objects, or arrays cannot be used. This option is only available when making global queries.
group_limit (int) – (optional) Maximum group count. This field can be used only if group_field is specified. This option is only available when making global queries.
group_sort (List[str]) – (optional) This field defines the order of the groups in a search that uses group_field. The default sort order is relevance. This field can have the same values as the sort field, so single fields and arrays of fields are supported. This option is only available when making global queries.
ranges (dict) – (optional) This field defines ranges for faceted, numeric search fields. The value is a JSON object where the fields names are faceted numeric search fields, and the values of the fields are JSON objects. The field names of the JSON objects are names for ranges. The values are strings that describe the range, for example “[0 TO 10]”. This option is only available when making global queries.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a SearchResult object
- post_search_analyze(analyzer: str, text: str, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Query tokenization of sample text.
Returns the results of analyzer tokenization of the provided sample text. This endpoint can be used for testing analyzer tokenization.
- Parameters
analyzer (str) – The analyzer type that is being used at the tokenization.
text (str) – The text to tokenize with the analyzer.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a SearchAnalyzeResult object
- post_search_as_stream(db: str, ddoc: str, index: str, query: str, *, bookmark: Optional[str] = None, highlight_fields: Optional[List[str]] = None, highlight_number: Optional[int] = None, highlight_post_tag: Optional[str] = None, highlight_pre_tag: Optional[str] = None, highlight_size: Optional[int] = None, include_docs: Optional[bool] = None, include_fields: Optional[List[str]] = None, limit: Optional[int] = None, sort: Optional[List[str]] = None, stale: Optional[str] = None, counts: Optional[List[str]] = None, drilldown: Optional[List[List[str]]] = None, group_field: Optional[str] = None, group_limit: Optional[int] = None, group_sort: Optional[List[str]] = None, ranges: Optional[dict] = None, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Query a search index as stream.
Search indexes, which are defined in design documents, allow databases to be queried by using Lucene Query Parser Syntax. An index function defines a search index, similar to a map function in MapReduce views. The index function decides what data to index and what data to store in the index. The advantage of using the HTTP POST method is that the query is submitted as a JSON object in the request body. This avoids the limitations of passing query options as URL query parameters of a GET request.
- Parameters
db (str) – Path parameter to specify the database name.
ddoc (str) – Path parameter to specify the design document name. The design document name is the design document ID excluding the _design/ prefix.
index (str) – Path parameter to specify the index name.
query (str) – The Lucene query to execute.
bookmark (str) – (optional) Opaque bookmark token used when paginating results.
highlight_fields (List[str]) – (optional) Specifies which fields to highlight. If specified, the result object contains a highlights field with an entry for each specified field.
highlight_number (int) – (optional) Number of fragments that are returned in highlights. If the search term occurs less often than the number of fragments that are specified, longer fragments are returned.
highlight_post_tag (str) – (optional) A string that is inserted after the highlighted word in the highlights output.
highlight_pre_tag (str) – (optional) A string that is inserted before the highlighted word in the highlights output.
highlight_size (int) – (optional) Number of characters in each fragment for highlights.
include_docs (bool) – (optional) Include the full content of the documents in the return.
include_fields (List[str]) – (optional) A JSON array of field names to include in search results. Any fields that are included must be indexed with the store:true option. The default is all fields.
limit (int) – (optional) Limit the number of the returned documents to the specified number.
sort (List[str]) – (optional) Specifies the sort order of the results. In a grouped search (when group_field is used), this parameter specifies the sort order within a group. The default sort order is relevance. A JSON string of the form “fieldname<type>” or “-fieldname<type>” for descending order, where fieldname is the name of a string or number field, and type is either a number, a string, or a JSON array of strings. The type part is optional, and defaults to number. Some examples are “foo”, “-foo”, “bar<string>”, “-foo<number>” and [“-foo<number>”, “bar<string>”]. String fields that are used for sorting must not be analyzed fields. Fields that are used for sorting must be indexed by the same indexer that is used for the search query.
stale (str) – (optional) Do not wait for the index to finish building to return results.
counts (List[str]) – (optional) This field defines an array of names of string fields, for which counts are requested. The response contains counts for each unique value of this field name among the documents that match the search query. Faceting must be enabled for this parameter to function. This option is only available when making global queries.
drilldown (List[List[str]]) – (optional) Restrict results to documents with a dimension equal to the specified label(s). The search matches only documents containing the value that was provided in the named field. It differs from using “fieldname:value” in the q parameter only in that the values are not analyzed. Faceting must be enabled for this parameter to function.
group_field (str) – (optional) Field by which to group search matches. A string that contains the name of a string field. Fields containing other data such as numbers, objects, or arrays cannot be used. This option is only available when making global queries.
group_limit (int) – (optional) Maximum group count. This field can be used only if group_field is specified. This option is only available when making global queries.
group_sort (List[str]) – (optional) This field defines the order of the groups in a search that uses group_field. The default sort order is relevance. This field can have the same values as the sort field, so single fields and arrays of fields are supported. This option is only available when making global queries.
ranges (dict) – (optional) This field defines ranges for faceted, numeric search fields. The value is a JSON object where the fields names are faceted numeric search fields, and the values of the fields are JSON objects. The field names of the JSON objects are names for ranges. The values are strings that describe the range, for example “[0 TO 10]”. This option is only available when making global queries.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with BinaryIO result
- post_view(db: str, ddoc: str, view: str, *, att_encoding_info: Optional[bool] = None, attachments: Optional[bool] = None, conflicts: Optional[bool] = None, descending: Optional[bool] = None, include_docs: Optional[bool] = None, inclusive_end: Optional[bool] = None, limit: Optional[int] = None, skip: Optional[int] = None, update_seq: Optional[bool] = None, endkey: Optional[object] = None, endkey_docid: Optional[str] = None, group: Optional[bool] = None, group_level: Optional[int] = None, key: Optional[object] = None, keys: Optional[List[object]] = None, reduce: Optional[bool] = None, stable: Optional[bool] = None, startkey: Optional[object] = None, startkey_docid: Optional[str] = None, update: Optional[str] = None, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Query a MapReduce view.
This operation queries the specified MapReduce view of the specified design document. By default, the map and reduce functions of the view are run to update the view before returning the response. The advantage of using the HTTP POST method is that the query is submitted as a JSON object in the request body. This avoids the limitations of passing query options as URL query parameters of a GET request.
- Parameters
db (str) – Path parameter to specify the database name.
ddoc (str) – Path parameter to specify the design document name. The design document name is the design document ID excluding the _design/ prefix.
view (str) – Path parameter to specify the map reduce view function name.
att_encoding_info (bool) – (optional) Parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
attachments (bool) – (optional) Parameter to specify whether to include attachments bodies in a response.
conflicts (bool) – (optional) Parameter to specify whether to include a list of conflicted revisions in the _conflicts property of the returned document. Ignored if include_docs isn’t true.
descending (bool) – (optional) Parameter to specify whether to return the documents in descending by key order.
include_docs (bool) – (optional) Parameter to specify whether to include the full content of the documents in the response.
inclusive_end (bool) – (optional) Parameter to specify whether the specified end key should be included in the result.
limit (int) – (optional) Parameter to specify the number of returned documents to limit the result to.
skip (int) – (optional) Parameter to specify the number of records before starting to return the results.
update_seq (bool) – (optional) Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
endkey (object) – (optional) Schema for any JSON type.
endkey_docid (str) – (optional) Schema for a document ID.
group (bool) – (optional) Parameter to specify whether to group the results using the reduce function to a group rather than a single row. Implies reduce is true and the maximum group_level.
group_level (int) – (optional) Parameter to specify the group level to be used. Implies group is true.
key (object) – (optional) Schema for any JSON type.
keys (List[object]) – (optional) Parameter to specify to return only documents that match the specified keys. String representation of a JSON array containing elements that match the key type emitted by the view function.
reduce (bool) – (optional) Parameter to specify whether to use the reduce function in a map-reduce view. Default is true when a reduce function is defined.
stable (bool) – (optional) Parameter to specify whether view results should be returned from a stable set of shards.
startkey (object) – (optional) Schema for any JSON type.
startkey_docid (str) – (optional) Schema for a document ID.
update (str) – (optional) Parameter to specify whether or not the view in question should be updated prior to responding to the user.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a ViewResult object
- post_view_as_stream(db: str, ddoc: str, view: str, *, att_encoding_info: Optional[bool] = None, attachments: Optional[bool] = None, conflicts: Optional[bool] = None, descending: Optional[bool] = None, include_docs: Optional[bool] = None, inclusive_end: Optional[bool] = None, limit: Optional[int] = None, skip: Optional[int] = None, update_seq: Optional[bool] = None, endkey: Optional[object] = None, endkey_docid: Optional[str] = None, group: Optional[bool] = None, group_level: Optional[int] = None, key: Optional[object] = None, keys: Optional[List[object]] = None, reduce: Optional[bool] = None, stable: Optional[bool] = None, startkey: Optional[object] = None, startkey_docid: Optional[str] = None, update: Optional[str] = None, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Query a MapReduce view as stream.
This operation queries the specified MapReduce view of the specified design document. By default, the map and reduce functions of the view are run to update the view before returning the response. The advantage of using the HTTP POST method is that the query is submitted as a JSON object in the request body. This avoids the limitations of passing query options as URL query parameters of a GET request.
- Parameters
db (str) – Path parameter to specify the database name.
ddoc (str) – Path parameter to specify the design document name. The design document name is the design document ID excluding the _design/ prefix.
view (str) – Path parameter to specify the map reduce view function name.
att_encoding_info (bool) – (optional) Parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
attachments (bool) – (optional) Parameter to specify whether to include attachments bodies in a response.
conflicts (bool) – (optional) Parameter to specify whether to include a list of conflicted revisions in the _conflicts property of the returned document. Ignored if include_docs isn’t true.
descending (bool) – (optional) Parameter to specify whether to return the documents in descending by key order.
include_docs (bool) – (optional) Parameter to specify whether to include the full content of the documents in the response.
inclusive_end (bool) – (optional) Parameter to specify whether the specified end key should be included in the result.
limit (int) – (optional) Parameter to specify the number of returned documents to limit the result to.
skip (int) – (optional) Parameter to specify the number of records before starting to return the results.
update_seq (bool) – (optional) Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
endkey (object) – (optional) Schema for any JSON type.
endkey_docid (str) – (optional) Schema for a document ID.
group (bool) – (optional) Parameter to specify whether to group the results using the reduce function to a group rather than a single row. Implies reduce is true and the maximum group_level.
group_level (int) – (optional) Parameter to specify the group level to be used. Implies group is true.
key (object) – (optional) Schema for any JSON type.
keys (List[object]) – (optional) Parameter to specify to return only documents that match the specified keys. String representation of a JSON array containing elements that match the key type emitted by the view function.
reduce (bool) – (optional) Parameter to specify whether to use the reduce function in a map-reduce view. Default is true when a reduce function is defined.
stable (bool) – (optional) Parameter to specify whether view results should be returned from a stable set of shards.
startkey (object) – (optional) Schema for any JSON type.
startkey_docid (str) – (optional) Schema for a document ID.
update (str) – (optional) Parameter to specify whether or not the view in question should be updated prior to responding to the user.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with BinaryIO result
- post_view_queries(db: str, ddoc: str, view: str, queries: List[ibmcloudant.cloudant_v1.ViewQuery], **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Multi-query a MapReduce view.
This operation runs multiple specified view queries against the view function from the specified design document.
- Parameters
db (str) – Path parameter to specify the database name.
ddoc (str) – Path parameter to specify the design document name. The design document name is the design document ID excluding the _design/ prefix.
view (str) – Path parameter to specify the map reduce view function name.
queries (List[ViewQuery]) – An array of query objects with fields for the parameters of each individual view query to be executed. The field names and their meaning are the same as the query parameters of a regular view request.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a ViewQueriesResult object
- post_view_queries_as_stream(db: str, ddoc: str, view: str, queries: List[ibmcloudant.cloudant_v1.ViewQuery], **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Multi-query a MapReduce view as stream.
This operation runs multiple specified view queries against the view function from the specified design document.
- Parameters
db (str) – Path parameter to specify the database name.
ddoc (str) – Path parameter to specify the design document name. The design document name is the design document ID excluding the _design/ prefix.
view (str) – Path parameter to specify the map reduce view function name.
queries (List[ViewQuery]) – An array of query objects with fields for the parameters of each individual view query to be executed. The field names and their meaning are the same as the query parameters of a regular view request.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with BinaryIO result
- prepare_request(method: str, url: str, *args, headers: Optional[dict] = None, params: Optional[dict] = None, data: Optional[Union[str, dict]] = None, files: Optional[Union[Dict[str, Tuple[str]], List[Tuple[str, Tuple[str, ...]]]]] = None, **kwargs) dict ¶
Build a dict that represents an HTTP service request.
Clean up headers, add default http configuration, convert data into json, process files, and merge all into a single request dict.
- Args:
method: The HTTP method of the request ex. GET, POST, etc. url: The origin + pathname according to WHATWG spec.
- Keyword Arguments:
headers: Headers of the request. params: Querystring data to be appended to the url. data: The request body. Converted to json if a dict. files: ‘files’ can be a dictionary (i.e { ‘<part-name>’: (<tuple>)}),
or a list of tuples [ (<part-name>, (<tuple>))… ]
- Returns:
Prepared request dictionary.
- put_attachment(db: str, doc_id: str, attachment_name: str, attachment: BinaryIO, content_type: str, *, if_match: Optional[str] = None, rev: Optional[str] = None, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Create or modify an attachment.
Uploads the supplied content as an attachment to the specified document. The attachment name that you provide must be a URL encoded string. You must supply the Content-Type header, and for an existing document, you must also supply either the rev query argument or the If-Match HTTP header. If you omit the revision, a new, otherwise empty, document is created with the provided attachment, or a conflict occurs. If the uploaded attachment uses an existing attachment name in the remote database, it updates the corresponding stored content of the database. Since you must supply the revision information to add an attachment to the document, this serves as validation to update the existing attachment.
- Parameters
db (str) – Path parameter to specify the database name.
doc_id (str) – Path parameter to specify the document ID.
attachment_name (str) – Path parameter to specify the attachment name.
attachment (BinaryIO) – HTTP request body for attachment operations.
content_type (str) – Content-Type of the attachment.
if_match (str) – (optional) Header parameter to specify the document revision. Alternative to rev query parameter.
rev (str) – (optional) Query parameter to specify a document revision.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a DocumentResult object
- put_capacity_throughput_configuration(blocks: int, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Update the target provisioned throughput capacity.
Sets the target provisioned throughput capacity for an IBM Cloudant instance. When target capacity is changed, the current capacity asynchronously changes to meet the target capacity.
- Parameters
blocks (int) – A number of blocks of throughput units. A block consists of 100 reads/sec, 50 writes/sec, and 5 global queries/sec of provisioned throughput capacity.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a CapacityThroughputInformation object
- put_cloudant_security_configuration(db: str, cloudant: dict, *, admins: Optional[ibmcloudant.cloudant_v1.SecurityObject] = None, members: Optional[ibmcloudant.cloudant_v1.SecurityObject] = None, couchdb_auth_only: Optional[bool] = None, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Modify only Cloudant related database permissions.
Modify only Cloudant related permissions to database. Be careful: by removing an API key from the list, you remove the API key from the list of users that have access to the database. ### Note about nobody role The nobody username applies to all unauthenticated connection attempts. For example, if an application tries to read data from a database, but did not identify itself, the task can continue only if the nobody user has the role _reader.
- Parameters
db (str) – Path parameter to specify the database name.
cloudant (dict) – Database permissions for Cloudant users and/or API keys.
admins (SecurityObject) – (optional) Schema for names and roles to map to a database permission.
members (SecurityObject) – (optional) Schema for names and roles to map to a database permission.
couchdb_auth_only (bool) – (optional) Manage permissions using the _users database only.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a Ok object
- put_cors_configuration(origins: List[str], *, allow_credentials: Optional[bool] = None, enable_cors: Optional[bool] = None, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Modify CORS configuration.
Sets the CORS configuration. The configuration applies to all databases and all account level endpoints in your account.
- Parameters
origins (List[str]) – An array of strings that contain allowed origin domains. You have to specify the full URL including the protocol. It is recommended that only the HTTPS protocol is used. Subdomains count as separate domains, so you have to specify all subdomains used.
allow_credentials (bool) – (optional) Boolean value to allow authentication credentials. If set to true, browser requests must be done by using withCredentials = true.
enable_cors (bool) – (optional) Boolean value to turn CORS on and off.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a Ok object
- put_database(db: str, *, partitioned: Optional[bool] = None, q: Optional[int] = None, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Create a database.
- Parameters
db (str) – Path parameter to specify the database name.
partitioned (bool) – (optional) Query parameter to specify whether to enable database partitions when creating a database.
q (int) – (optional) The number of shards in the database. Each shard is a partition of the hash value range. Its value is set by the service. For more information about modifying database configuration, contact IBM Cloudant support.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a Ok object
- put_design_document(db: str, ddoc: str, design_document: ibmcloudant.cloudant_v1.DesignDocument, *, if_match: Optional[str] = None, batch: Optional[str] = None, new_edits: Optional[bool] = None, rev: Optional[str] = None, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Create or modify a design document.
The PUT method creates a new named design document, or creates a new revision of the existing design document.
- Parameters
db (str) – Path parameter to specify the database name.
ddoc (str) – Path parameter to specify the design document name. The design document name is the design document ID excluding the _design/ prefix.
design_document (DesignDocument) – HTTP request body for DesignDocument operations.
if_match (str) – (optional) Header parameter to specify the document revision. Alternative to rev query parameter.
batch (str) – (optional) Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
new_edits (bool) – (optional) Query parameter to specify whether to prevent insertion of conflicting document revisions. If false, a well-formed _rev must be included in the document. False is used by the replicator to insert documents into the target database even if that leads to the creation of conflicts.
rev (str) – (optional) Query parameter to specify a document revision.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a DocumentResult object
- put_document(db: str, doc_id: str, document: Union[ibmcloudant.cloudant_v1.Document, BinaryIO], *, content_type: Optional[str] = None, if_match: Optional[str] = None, batch: Optional[str] = None, new_edits: Optional[bool] = None, rev: Optional[str] = None, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Create or modify a document.
The PUT method creates a new named document, or creates a new revision of the existing document. Unlike the POST /{db} request, you must specify the document ID in the request URL.
- Parameters
db (str) – Path parameter to specify the database name.
doc_id (str) – Path parameter to specify the document ID.
document (Document) – HTTP request body for Document operations.
content_type (str) – (optional) The type of the input.
if_match (str) – (optional) Header parameter to specify the document revision. Alternative to rev query parameter.
batch (str) – (optional) Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
new_edits (bool) – (optional) Query parameter to specify whether to prevent insertion of conflicting document revisions. If false, a well-formed _rev must be included in the document. False is used by the replicator to insert documents into the target database even if that leads to the creation of conflicts.
rev (str) – (optional) Query parameter to specify a document revision.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a DocumentResult object
- put_local_document(db: str, doc_id: str, document: Union[ibmcloudant.cloudant_v1.Document, BinaryIO], *, content_type: Optional[str] = None, batch: Optional[str] = None, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Create or modify a local document.
Stores the specified local document. The semantics are identical to storing a standard document in the specified database, except that the document is not replicated.
- Parameters
db (str) – Path parameter to specify the database name.
doc_id (str) – Path parameter to specify the document ID.
document (Document) – HTTP request body for Document operations.
content_type (str) – (optional) The type of the input.
batch (str) – (optional) Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a DocumentResult object
- put_replication_document(doc_id: str, replication_document: ibmcloudant.cloudant_v1.ReplicationDocument, *, if_match: Optional[str] = None, batch: Optional[str] = None, new_edits: Optional[bool] = None, rev: Optional[str] = None, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Create or modify a replication using a replication document.
Creates or modifies a document in the _replicator database to start a new replication or to edit an existing replication.
- Parameters
doc_id (str) – Path parameter to specify the document ID.
replication_document (ReplicationDocument) – HTTP request body for replication operations.
if_match (str) – (optional) Header parameter to specify the document revision. Alternative to rev query parameter.
batch (str) – (optional) Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
new_edits (bool) – (optional) Query parameter to specify whether to prevent insertion of conflicting document revisions. If false, a well-formed _rev must be included in the document. False is used by the replicator to insert documents into the target database even if that leads to the creation of conflicts.
rev (str) – (optional) Query parameter to specify a document revision.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a DocumentResult object
- put_security(db: str, *, admins: Optional[ibmcloudant.cloudant_v1.SecurityObject] = None, members: Optional[ibmcloudant.cloudant_v1.SecurityObject] = None, cloudant: Optional[dict] = None, couchdb_auth_only: Optional[bool] = None, **kwargs) ibm_cloud_sdk_core.detailed_response.DetailedResponse ¶
Modify database permissions.
Modify who has permission to read, write, or manage a database. This endpoint can be used to modify both Cloudant and CouchDB related permissions. Be careful: by removing a Cloudant API key, a member or an admin from the list of users that have access permissions, you remove it from the list of users that have access to the database. ### Note about nobody role The nobody username applies to all unauthenticated connection attempts. For example, if an application tries to read data from a database, but did not identify itself, the task can continue only if the nobody user has the role _reader.
- Parameters
db (str) – Path parameter to specify the database name.
admins (SecurityObject) – (optional) Schema for names and roles to map to a database permission.
members (SecurityObject) – (optional) Schema for names and roles to map to a database permission.
cloudant (dict) – (optional) Database permissions for Cloudant users and/or API keys.
couchdb_auth_only (bool) – (optional) Manage permissions using the _users database only.
headers (dict) – A dict containing the request headers
- Returns
A DetailedResponse containing the result, headers and HTTP status code.
- Return type
DetailedResponse with dict result representing a Ok object
- set_default_headers(headers: Dict[str, str])¶
Set http headers to be sent in every request.
- Arguments:
headers: A dictionary of headers
- set_service_url(service_url: str)¶
Set the url the service will make HTTP requests too.
- Arguments:
service_url: The WHATWG URL standard origin ex. https://example.service.com
- Raises:
ValueError: Improperly formatted service_url
- DEFAULT_SERVICE_NAME = 'cloudant'¶
- DEFAULT_SERVICE_URL = 'http://localhost:5984'¶
- class ibmcloudant.cloudant_v1.ContentInformationSizes(active: int, external: int, file: int)¶
Bases:
object
Schema for size information of content.
- Attr int active
The active size of the content, in bytes.
- Attr int external
The total uncompressed size of the content, in bytes.
- Attr int file
The total size of the content as stored on disk, in bytes.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.ContentInformationSizes ¶
Initialize a ContentInformationSizes object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.CorsInformation(allow_credentials: bool, enable_cors: bool, origins: List[str])¶
Bases:
object
Schema for information about the CORS configuration.
- Attr bool allow_credentials
Boolean value to allow authentication credentials. If set to true, browser requests must be done by using withCredentials = true.
- Attr bool enable_cors
Boolean value to turn CORS on and off.
- Attr List[str] origins
An array of strings that contain allowed origin domains. You have to specify the full URL including the protocol. It is recommended that only the HTTPS protocol is used. Subdomains count as separate domains, so you have to specify all subdomains used.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.CorsInformation ¶
Initialize a CorsInformation object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.CurrentThroughputInformation(throughput: ibmcloudant.cloudant_v1.CurrentThroughputInformationThroughput)¶
Bases:
object
Schema for information about current consumption of a provisioned throughput capacity.
- Attr CurrentThroughputInformationThroughput throughput
Detailed information about current consumption.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.CurrentThroughputInformation ¶
Initialize a CurrentThroughputInformation object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.CurrentThroughputInformationThroughput(query: int, read: int, write: int)¶
Bases:
object
Detailed information about current consumption.
- Attr int query
Number of global queries conducted against the instance for a given second.
- Attr int read
Number of reads conducted against the instance for a given second.
- Attr int write
Number of writes conducted against the instance for a given second.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.CurrentThroughputInformationThroughput ¶
Initialize a CurrentThroughputInformationThroughput object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.DatabaseInformation(cluster: ibmcloudant.cloudant_v1.DatabaseInformationCluster, compact_running: bool, db_name: str, disk_format_version: int, doc_count: int, doc_del_count: int, props: ibmcloudant.cloudant_v1.DatabaseInformationProps, sizes: ibmcloudant.cloudant_v1.ContentInformationSizes, update_seq: str, *, committed_update_seq: Optional[str] = None, compacted_seq: Optional[str] = None, engine: Optional[str] = None, uuid: Optional[str] = None)¶
Bases:
object
Schema for information about a database.
- Attr DatabaseInformationCluster cluster
Schema for database cluster information.
- Attr str committed_update_seq
(optional) An opaque string that describes the committed state of the database.
- Attr bool compact_running
True if the database compaction routine is operating on this database.
- Attr str compacted_seq
(optional) An opaque string that describes the compaction state of the database.
- Attr str db_name
The name of the database.
- Attr int disk_format_version
The version of the physical format used for the data when it is stored on disk.
- Attr int doc_count
A count of the documents in the specified database.
- Attr int doc_del_count
Number of deleted documents.
- Attr str engine
(optional) The engine used for the database.
- Attr DatabaseInformationProps props
Schema for database properties.
- Attr ContentInformationSizes sizes
Schema for size information of content.
- Attr str update_seq
An opaque string that describes the state of the database. Do not rely on this string for counting the number of updates.
- Attr str uuid
(optional) The UUID of the database.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.DatabaseInformation ¶
Initialize a DatabaseInformation object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.DatabaseInformationCluster(n: int, q: int, r: int, w: int)¶
Bases:
object
Schema for database cluster information.
- Attr int n
Schema for the number of replicas of a database in a cluster.
- Attr int q
Schema for the number of shards in a database. Each shard is a partition of the hash value range.
- Attr int r
Read quorum. The number of consistent copies of a document that need to be read before a successful reply.
- Attr int w
Write quorum. The number of copies of a document that need to be written before a successful reply.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.DatabaseInformationCluster ¶
Initialize a DatabaseInformationCluster object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.DatabaseInformationProps(*, partitioned: Optional[bool] = None)¶
Bases:
object
Schema for database properties.
- Attr bool partitioned
(optional) The value is true for a partitioned database.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.DatabaseInformationProps ¶
Initialize a DatabaseInformationProps object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.DbEvent(db_name: str, seq: str, type: str, *, account: Optional[str] = None)¶
Bases:
object
Schema for a database change event.
- Attr str account
(optional) Account name.
- Attr str db_name
Database name.
- Attr str seq
Sequence number.
- Attr str type
A database event.
- class TypeEnum(value)¶
Bases:
str
,enum.Enum
A database event.
- CREATED = 'created'¶
- DELETED = 'deleted'¶
- UPDATED = 'updated'¶
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.DbEvent ¶
Initialize a DbEvent object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.DbUpdates(last_seq: str, results: List[ibmcloudant.cloudant_v1.DbEvent])¶
Bases:
object
Schema for database updates.
- Attr str last_seq
Last sequence number.
- Attr List[DbEvent] results
results.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.DbUpdates ¶
Initialize a DbUpdates object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.DbsInfoResult(key: str, *, error: Optional[str] = None, info: Optional[ibmcloudant.cloudant_v1.DatabaseInformation] = None)¶
Bases:
object
Schema for database information keyed by database name.
- Attr str error
(optional) The name of the error.
- Attr DatabaseInformation info
(optional) Schema for information about a database.
- Attr str key
Database name.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.DbsInfoResult ¶
Initialize a DbsInfoResult object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.DeleteAttachmentEnums¶
Bases:
object
Enums for delete_attachment parameters.
- class ibmcloudant.cloudant_v1.DeleteDesignDocumentEnums¶
Bases:
object
Enums for delete_design_document parameters.
- class ibmcloudant.cloudant_v1.DeleteDocumentEnums¶
Bases:
object
Enums for delete_document parameters.
- class ibmcloudant.cloudant_v1.DeleteIndexEnums¶
Bases:
object
Enums for delete_index parameters.
- class ibmcloudant.cloudant_v1.DeleteLocalDocumentEnums¶
Bases:
object
Enums for delete_local_document parameters.
- class ibmcloudant.cloudant_v1.DeleteReplicationDocumentEnums¶
Bases:
object
Enums for delete_replication_document parameters.
- class ibmcloudant.cloudant_v1.DesignDocument(*, attachments: Optional[dict] = None, conflicts: Optional[List[str]] = None, deleted: Optional[bool] = None, deleted_conflicts: Optional[List[str]] = None, id: Optional[str] = None, local_seq: Optional[str] = None, rev: Optional[str] = None, revisions: Optional[ibmcloudant.cloudant_v1.Revisions] = None, revs_info: Optional[List[ibmcloudant.cloudant_v1.DocumentRevisionStatus]] = None, autoupdate: Optional[bool] = None, filters: Optional[dict] = None, indexes: Optional[dict] = None, language: Optional[str] = None, options: Optional[ibmcloudant.cloudant_v1.DesignDocumentOptions] = None, validate_doc_update: Optional[str] = None, views: Optional[dict] = None, st_indexes: Optional[dict] = None, **kwargs)¶
Bases:
object
Schema for a design document.
- Attr dict attachments
(optional) Schema for a map of attachment name to attachment metadata.
- Attr List[str] conflicts
(optional) Schema for a list of document revision identifiers.
- Attr bool deleted
(optional) Deletion flag. Available if document was removed.
- Attr List[str] deleted_conflicts
(optional) Schema for a list of document revision identifiers.
- Attr str id
(optional) Document ID.
- Attr str local_seq
(optional) Document’s update sequence in current database. Available if requested with local_seq=true query parameter.
- Attr str rev
(optional) Schema for a document revision identifier.
- Attr Revisions revisions
(optional) Schema for list of revision information.
- Attr List[DocumentRevisionStatus] revs_info
(optional) Schema for a list of objects with information about local revisions and their status.
- Attr bool autoupdate
(optional) Indicates whether to automatically build indexes defined in this design document.
- Attr dict filters
(optional) Schema for filter functions definition. This schema is a map where keys are the names of the filter functions and values are the function definition in string format. Filter function formats, or filters the changes feed that pass filter rules. The function takes 2 parameters:
doc: The document that is being processed.
req: A Request JavaScript object with these properties: * body - string, Request body data as string.
If the request method is GET this field contains the value “undefined”. If the method is DELETE or HEAD the value is “” (empty string).
cookie - Cookies object.
form - Form Data object, contains the decoded body as key-value pairs if the Content-Type header was application/x-www-form-urlencoded.
headers - Request Headers object.
id - string, requested document id if it was specified or null otherwise.
info - Database Information object, see DatabaseInformation.
method - string or an array of chars, request method. String value is a method as one of: HEAD, GET, POST, PUT, DELETE, OPTIONS, TRACE, COPY. For not supported methods it will be represented as an array of char codes e.g. for VIEW it will be 86,73,69,87.
path - array of strings, requested path sections.
peer - string, request source IP address.
query - string, URL query parameters object. Note that multiple keys are not supported and the last key value suppresses others.
requested_path - array of strings, actual requested path section.
raw_path - string, raw requested path.
userCtx: User Context Object, containing information about the user writing the document (if present), see the UserContext.
secObj: Security Object, with lists of database security roles, see the SecurityObject.
uuid - string, generated UUID by a specified algorithm in the config file.
Filter functions must return true if a document passed all the rules.
- Attr dict indexes
(optional) Search (text) index function definitions.
- Attr str language
(optional) Defines Query Server key to process design document functions.
- Attr DesignDocumentOptions options
(optional) Schema for design document options.
- Attr str validate_doc_update
(optional) Validate document update function can be used to prevent invalid or unauthorized document update requests from being stored. Validation functions typically examine the structure of the new document to ensure that required fields are present and to verify that the requesting user should be allowed to make changes to the document properties. When a write request is received for a given database, the validation function in each design document in that database is called in an unspecified order. If any of the validation functions throw an error, the write will not succeed. The validation function can abort the pending document write by throwing one of two error objects:
` // user is not authorized to make the change but may re-authenticate throw({ unauthorized: 'Error message here.' }); // change is not allowed throw({ forbidden: 'Error message here.' }); `
The function takes 4 parameters:newDoc - New version of document that will be stored from the update request.
oldDoc - Previous version of document that is already stored.
userCtx - User Context Object, containing information about the user writing the document (if present), see the UserContext.
secObj - Security Object, with lists of database security roles, see the SecurityObject.
- Attr dict views
(optional) Schema for design document views.
- Attr dict st_indexes
(optional) Schema for geospatial index function definitions.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.DesignDocument ¶
Initialize a DesignDocument object from a json dictionary.
- get_properties() Dict ¶
Return a dictionary of arbitrary properties from this instance of DesignDocument
- set_properties(_dict: dict)¶
Set a dictionary of arbitrary properties to this instance of DesignDocument
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.DesignDocumentInformation(name: str, view_index: ibmcloudant.cloudant_v1.DesignDocumentViewIndex)¶
Bases:
object
Schema for information about a design document.
- Attr str name
name.
- Attr DesignDocumentViewIndex view_index
View index information.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.DesignDocumentInformation ¶
Initialize a DesignDocumentInformation object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.DesignDocumentOptions(*, partitioned: Optional[bool] = None)¶
Bases:
object
Schema for design document options.
- Attr bool partitioned
(optional) Whether this design document describes partitioned or global indexes.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.DesignDocumentOptions ¶
Initialize a DesignDocumentOptions object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.DesignDocumentViewIndex(compact_running: bool, language: str, signature: str, sizes: ibmcloudant.cloudant_v1.ContentInformationSizes, updater_running: bool, waiting_clients: int, waiting_commit: bool)¶
Bases:
object
View index information.
- Attr bool compact_running
Indicates whether a compaction routine is currently running on the view.
- Attr str language
Language for the defined views.
- Attr str signature
MD5 signature of the views for the design document.
- Attr ContentInformationSizes sizes
Schema for size information of content.
- Attr bool updater_running
Indicates if the view is currently being updated.
- Attr int waiting_clients
Number of clients waiting on views from this design document.
- Attr bool waiting_commit
Indicates if there are outstanding commits to the underlying database that need to processed.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.DesignDocumentViewIndex ¶
Initialize a DesignDocumentViewIndex object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.DesignDocumentViewsMapReduce(map: str, *, reduce: Optional[str] = None)¶
Bases:
object
Schema for view functions definition.
- Attr str map
JavaScript map function as a string.
- Attr str reduce
(optional) JavaScript reduce function as a string.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.DesignDocumentViewsMapReduce ¶
Initialize a DesignDocumentViewsMapReduce object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.DocsResultRow(key: str, *, caused_by: Optional[str] = None, error: Optional[str] = None, reason: Optional[str] = None, doc: Optional[ibmcloudant.cloudant_v1.Document] = None, id: Optional[str] = None, value: Optional[ibmcloudant.cloudant_v1.DocsResultRowValue] = None)¶
Bases:
object
Schema for a row of document information in a DocsResult.
- Attr str caused_by
(optional) The cause of the error (if available).
- Attr str error
(optional) The name of the error.
- Attr str reason
(optional) The reason the error occurred (if available).
- Attr Document doc
(optional) Schema for a document.
- Attr str id
(optional) id.
- Attr str key
Document ID.
- Attr DocsResultRowValue value
(optional) Value of built-in /_all_docs style view.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.DocsResultRow ¶
Initialize a DocsResultRow object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.DocsResultRowValue(rev: str)¶
Bases:
object
Value of built-in /_all_docs style view.
- Attr str rev
Schema for a document revision identifier.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.DocsResultRowValue ¶
Initialize a DocsResultRowValue object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.Document(*, attachments: Optional[dict] = None, conflicts: Optional[List[str]] = None, deleted: Optional[bool] = None, deleted_conflicts: Optional[List[str]] = None, id: Optional[str] = None, local_seq: Optional[str] = None, rev: Optional[str] = None, revisions: Optional[ibmcloudant.cloudant_v1.Revisions] = None, revs_info: Optional[List[ibmcloudant.cloudant_v1.DocumentRevisionStatus]] = None, **kwargs)¶
Bases:
object
Schema for a document.
- Attr dict attachments
(optional) Schema for a map of attachment name to attachment metadata.
- Attr List[str] conflicts
(optional) Schema for a list of document revision identifiers.
- Attr bool deleted
(optional) Deletion flag. Available if document was removed.
- Attr List[str] deleted_conflicts
(optional) Schema for a list of document revision identifiers.
- Attr str id
(optional) Document ID.
- Attr str local_seq
(optional) Document’s update sequence in current database. Available if requested with local_seq=true query parameter.
- Attr str rev
(optional) Schema for a document revision identifier.
- Attr Revisions revisions
(optional) Schema for list of revision information.
- Attr List[DocumentRevisionStatus] revs_info
(optional) Schema for a list of objects with information about local revisions and their status.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.Document ¶
Initialize a Document object from a json dictionary.
- get_properties() Dict ¶
Return a dictionary of arbitrary properties from this instance of Document
- set_properties(_dict: dict)¶
Set a dictionary of arbitrary properties to this instance of Document
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.DocumentResult(id: str, *, rev: Optional[str] = None, ok: Optional[bool] = None, caused_by: Optional[str] = None, error: Optional[str] = None, reason: Optional[str] = None)¶
Bases:
object
Schema for the result of a document modification.
- Attr str id
Schema for a document ID.
- Attr str rev
(optional) Schema for a document revision identifier.
- Attr bool ok
(optional) ok.
- Attr str caused_by
(optional) The cause of the error (if available).
- Attr str error
(optional) The name of the error.
- Attr str reason
(optional) The reason the error occurred (if available).
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.DocumentResult ¶
Initialize a DocumentResult object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.DocumentRevisionStatus(rev: str, status: str)¶
Bases:
object
Schema for information about revisions and their status.
- Attr str rev
Schema for a document revision identifier.
- Attr str status
Status of the revision. May be one of: - available: Revision is available for retrieving with rev query parameter - missing: Revision is not available - deleted: Revision belongs to deleted document.
- class StatusEnum(value)¶
Bases:
str
,enum.Enum
Status of the revision. May be one of: - available: Revision is available for retrieving with rev query parameter - missing: Revision is not available - deleted: Revision belongs to deleted document.
- AVAILABLE = 'available'¶
- DELETED = 'deleted'¶
- MISSING = 'missing'¶
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.DocumentRevisionStatus ¶
Initialize a DocumentRevisionStatus object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.DocumentShardInfo(nodes: List[str], range: str)¶
Bases:
object
Schema for document shard information.
- Attr List[str] nodes
List of nodes serving a replica of the shard.
- Attr str range
The shard range in which the document is stored.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.DocumentShardInfo ¶
Initialize a DocumentShardInfo object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.ExecutionStats(execution_time_ms: float, results_returned: int, total_docs_examined: int, total_keys_examined: int, total_quorum_docs_examined: int)¶
Bases:
object
Schema for find query execution statistics.
- Attr float execution_time_ms
Time to execute the query.
- Attr int results_returned
Number of results returned.
- Attr int total_docs_examined
Number of documents fetched from the index.
- Attr int total_keys_examined
Number of rows scanned in the index.
- Attr int total_quorum_docs_examined
Number of documents fetched from the primary index with the specified read quorum.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.ExecutionStats ¶
Initialize a ExecutionStats object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.ExplainResult(dbname: str, fields: List[str], index: ibmcloudant.cloudant_v1.IndexInformation, limit: int, opts: dict, selector: dict, skip: int, *, range: Optional[ibmcloudant.cloudant_v1.ExplainResultRange] = None)¶
Bases:
object
Schema for information about the index used for a find query.
- Attr str dbname
dbname.
- Attr List[str] fields
fields.
- Attr IndexInformation index
Schema for information about an index.
- Attr int limit
limit.
- Attr dict opts
opts.
- Attr ExplainResultRange range
(optional) range.
- Attr dict selector
JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data. The selector object must:
Be structured as valid JSON.
Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only. Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators. Operators are identified by the use of a dollar sign $ prefix in the name field. There are two core types of operators in the selector syntax: * Combination operators: applied at the topmost level of selection. They are used to combine selectors. In addition to the common boolean operators ($and, $or, $not, $nor) there are three combination operators: $all, $elemMatch, and $allMatch. A combination operator takes a single argument. The argument is either another selector, or an array of selectors. * Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic $eq operator matches when the specified field contains a value that is equal to the supplied argument.
- Attr int skip
skip.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.ExplainResult ¶
Initialize a ExplainResult object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.ExplainResultRange(*, end_key: Optional[List[object]] = None, start_key: Optional[List[object]] = None)¶
Bases:
object
range.
- Attr List[object] end_key
(optional) end_key.
- Attr List[object] start_key
(optional) start_key.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.ExplainResultRange ¶
Initialize a ExplainResultRange object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.FindResult(bookmark: str, docs: List[ibmcloudant.cloudant_v1.Document], *, execution_stats: Optional[ibmcloudant.cloudant_v1.ExecutionStats] = None, warning: Optional[str] = None)¶
Bases:
object
Schema for the result of a query find operation.
- Attr str bookmark
Opaque bookmark token used when paginating results.
- Attr List[Document] docs
Documents matching the selector.
- Attr ExecutionStats execution_stats
(optional) Schema for find query execution statistics.
- Attr str warning
(optional) warning.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.FindResult ¶
Initialize a FindResult object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.GeoIndexDefinition(index: str)¶
Bases:
object
Schema for a geospatial index definition.
- Attr str index
String form of a JavaScript function that is called for each document in the database. The function takes the document as a parameter, extracts some geospatial data from it, and then calls the st_index function to index that data. The st_index takes a GeoJSON geometry as a parameter.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.GeoIndexDefinition ¶
Initialize a GeoIndexDefinition object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.GeoIndexInformation(geo_index: ibmcloudant.cloudant_v1.GeoIndexStats, name: str)¶
Bases:
object
Schema for information about a geospatial index.
- Attr GeoIndexStats geo_index
Schema for geospatial index statistics.
- Attr str name
The name of the geospatial index design document.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.GeoIndexInformation ¶
Initialize a GeoIndexInformation object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.GeoIndexStats(data_size: int, disk_size: int, doc_count: int)¶
Bases:
object
Schema for geospatial index statistics.
- Attr int data_size
The size of the geospatial index, in bytes.
- Attr int disk_size
The size of the geospatial index, as stored on disk, in bytes.
- Attr int doc_count
Number of documents in the geospatial index.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.GeoIndexStats ¶
Initialize a GeoIndexStats object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.GeoJsonFeature(geometry: ibmcloudant.cloudant_v1.GeoJsonGeometryObject, type: str, *, id: Optional[str] = None, rev: Optional[str] = None, bbox: Optional[List[float]] = None, properties: Optional[dict] = None, **kwargs)¶
Bases:
object
Schema for a GeoJSON feature object. Note that the content of the feature objects varies depending on the response format chosen and whether the include_docs parameter is true.
- Attr str id
(optional) Schema for a document ID.
- Attr str rev
(optional) Schema for a document revision identifier.
- Attr List[float] bbox
(optional) Schema for a GeoJSON bounding box.
- Attr GeoJsonGeometryObject geometry
Schema for a GeoJSON geometry object.
- Attr dict properties
(optional) Schema for the properties of a GeoJSON feature object.
- Attr str type
Declaration of the GeoJSON type: Feature Object.
- class TypeEnum(value)¶
Bases:
str
,enum.Enum
Declaration of the GeoJSON type: Feature Object.
- FEATURE = 'Feature'¶
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.GeoJsonFeature ¶
Initialize a GeoJsonFeature object from a json dictionary.
- get_properties() Dict ¶
Return a dictionary of arbitrary properties from this instance of GeoJsonFeature
- set_properties(_dict: dict)¶
Set a dictionary of arbitrary properties to this instance of GeoJsonFeature
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.GeoJsonGeometry(type: str, coordinates: List[object])¶
Bases:
ibmcloudant.cloudant_v1.GeoJsonGeometryObject
Schema for a GeoJSON geometry.
- Attr str type
The type of GeoJSON Geometry.
- Attr List[object] coordinates
Used for all geometry types except GeometryCollection. The structure of the elements in the array varies by geometry type.
- class TypeEnum(value)¶
Bases:
str
,enum.Enum
The type of GeoJSON Geometry.
- GEOMETRYCOLLECTION = 'GeometryCollection'¶
- LINESTRING = 'LineString'¶
- MULTILINESTRING = 'MultiLineString'¶
- MULTIPOINT = 'MultiPoint'¶
- MULTIPOLYGON = 'MultiPolygon'¶
- POINT = 'Point'¶
- POLYGON = 'Polygon'¶
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.GeoJsonGeometry ¶
Initialize a GeoJsonGeometry object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.GeoJsonGeometryCollection(type: str, geometries: List[ibmcloudant.cloudant_v1.GeoJsonGeometry])¶
Bases:
ibmcloudant.cloudant_v1.GeoJsonGeometryObject
Schema for a GeoJSON GeometryCollection type geometry.
- Attr str type
The type of GeoJSON Geometry.
- Attr List[GeoJsonGeometry] geometries
Used for the GeometryCollection type.
- class TypeEnum(value)¶
Bases:
str
,enum.Enum
The type of GeoJSON Geometry.
- GEOMETRYCOLLECTION = 'GeometryCollection'¶
- LINESTRING = 'LineString'¶
- MULTILINESTRING = 'MultiLineString'¶
- MULTIPOINT = 'MultiPoint'¶
- MULTIPOLYGON = 'MultiPolygon'¶
- POINT = 'Point'¶
- POLYGON = 'Polygon'¶
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.GeoJsonGeometryCollection ¶
Initialize a GeoJsonGeometryCollection object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.GeoJsonGeometryObject¶
Bases:
object
Schema for a GeoJSON geometry object.
- class ibmcloudant.cloudant_v1.GeoResult(bookmark: str, rows: List[ibmcloudant.cloudant_v1.GeoResultRow], *, features: Optional[List[ibmcloudant.cloudant_v1.GeoJsonFeature]] = None, type: Optional[str] = None)¶
Bases:
object
Schema for the result of a geospatial query operation. For the legacy, geojson, or application/vnd.geo+json format this is a GeoJson FeatureCollection with additional metadata in foreign members.
- Attr str bookmark
Opaque bookmark token used when paginating results.
- Attr List[GeoJsonFeature] features
(optional) The array of GeoJSON Feature Objects matching the geospatial query.
- Attr List[GeoResultRow] rows
The array of rows matching the geospatial query. Present only when using view format.
- Attr str type
(optional) Declaration of the GeoJSON type: FeatureCollection Object.
- class TypeEnum(value)¶
Bases:
str
,enum.Enum
Declaration of the GeoJSON type: FeatureCollection Object.
- FEATURECOLLECTION = 'FeatureCollection'¶
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.GeoResult ¶
Initialize a GeoResult object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.GeoResultRow(*, doc: Optional[ibmcloudant.cloudant_v1.Document] = None, geometry: Optional[ibmcloudant.cloudant_v1.GeoJsonGeometry] = None, id: Optional[str] = None, rev: Optional[str] = None)¶
Bases:
object
Schema for a row of a geospatial result using view format.
- Attr Document doc
(optional) Schema for a document.
- Attr GeoJsonGeometry geometry
(optional) Schema for a GeoJSON geometry.
- Attr str id
(optional) Schema for a document ID.
- Attr str rev
(optional) Schema for a document revision identifier.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.GeoResultRow ¶
Initialize a GeoResultRow object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.GetDbUpdatesEnums¶
Bases:
object
Enums for get_db_updates parameters.
- class ibmcloudant.cloudant_v1.GetGeoEnums¶
Bases:
object
Enums for get_geo_as_stream parameters.
- class Format(value)¶
Bases:
str
,enum.Enum
Query parameter that causes the geospatial query output to be returned in the specified format.
- APPLICATION_VND_GEO_JSON = 'application/vnd.geo+json'¶
- GEOJSON = 'geojson'¶
- LEGACY = 'legacy'¶
- VIEW = 'view'¶
- class Relation(value)¶
Bases:
str
,enum.Enum
Query parameter to specify the DE-9IM (Dimensionally Extended nine-Intersection Model)geospatial relationship between the query geometry and the result documents.
- CONTAINS = 'contains'¶
- CONTAINS_PROPERLY = 'contains_properly'¶
- COVERED_BY = 'covered_by'¶
- COVERS = 'covers'¶
- CROSSES = 'crosses'¶
- DISJOINT = 'disjoint'¶
- INTERSECTS = 'intersects'¶
- OVERLAPS = 'overlaps'¶
- TOUCHES = 'touches'¶
- WITHIN = 'within'¶
- class ibmcloudant.cloudant_v1.GetLocalDocumentEnums¶
Bases:
object
Enums for get_local_document parameters.
- class Accept(value)¶
Bases:
str
,enum.Enum
The type of the response: application/json, multipart/mixed, multipart/related, or application/octet-stream.
- APPLICATION_JSON = 'application/json'¶
- APPLICATION_OCTET_STREAM = 'application/octet-stream'¶
- MULTIPART_MIXED = 'multipart/mixed'¶
- MULTIPART_RELATED = 'multipart/related'¶
- class ibmcloudant.cloudant_v1.GetSchedulerDocsEnums¶
Bases:
object
Enums for get_scheduler_docs parameters.
- class States(value)¶
Bases:
str
,enum.Enum
Query parameter to include only replication documents in the specified states. String must be a comma-delimited string.
- COMPLETED = 'completed'¶
- CRASHING = 'crashing'¶
- ERROR = 'error'¶
- FAILED = 'failed'¶
- INITIALIZING = 'initializing'¶
- PENDING = 'pending'¶
- RUNNING = 'running'¶
- class ibmcloudant.cloudant_v1.IndexDefinition(*, default_analyzer: Optional[ibmcloudant.cloudant_v1.Analyzer] = None, default_field: Optional[ibmcloudant.cloudant_v1.IndexTextOperatorDefaultField] = None, fields: Optional[List[ibmcloudant.cloudant_v1.IndexField]] = None, index_array_lengths: Optional[bool] = None, partial_filter_selector: Optional[dict] = None)¶
Bases:
object
Schema for a json or text query index definition. Indexes of type text have additional configuration properties that do not apply to json indexes, these are: * default_analyzer - the default text analyzer to use * default_field - whether to index the text in all document fields and what analyzer to use for that purpose.
- Attr Analyzer default_analyzer
(optional) Schema for a full text search analyzer.
- Attr IndexTextOperatorDefaultField default_field
(optional) Schema for the text index default field configuration. The default field is used to index the text of all fields within a document for use with the $text operator.
- Attr List[IndexField] fields
(optional) List of field objects to index. Nested fields are also allowed, e.g. person.name. For “json” type indexes each object is a mapping of field name to sort direction (asc or desc). For “text” type indexes each object has a name property of the field name and a type property of the field type (string, number, or boolean).
- Attr bool index_array_lengths
(optional) Whether to scan every document for arrays and store the length for each array found. Set the index_array_lengths field to false if: * You do not need to know the length of an array. * You do not use the $size operator. * The documents in your database are complex, or not completely under your control. As a result, it is difficult to estimate the impact of the extra processing that is needed to determine and store the arrays lengths.
- Attr dict partial_filter_selector
(optional) JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data. The selector object must:
Be structured as valid JSON.
Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only. Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators. Operators are identified by the use of a dollar sign $ prefix in the name field. There are two core types of operators in the selector syntax: * Combination operators: applied at the topmost level of selection. They are used to combine selectors. In addition to the common boolean operators ($and, $or, $not, $nor) there are three combination operators: $all, $elemMatch, and $allMatch. A combination operator takes a single argument. The argument is either another selector, or an array of selectors. * Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic $eq operator matches when the specified field contains a value that is equal to the supplied argument.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.IndexDefinition ¶
Initialize a IndexDefinition object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.IndexField(*, name: Optional[str] = None, type: Optional[str] = None, **kwargs)¶
Bases:
object
Schema for indexed fields for use with declarative JSON query.
- Attr str name
(optional) Name of the field.
- Attr str type
(optional) The type of the named field.
- class TypeEnum(value)¶
Bases:
str
,enum.Enum
The type of the named field.
- BOOLEAN = 'boolean'¶
- NUMBER = 'number'¶
- STRING = 'string'¶
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.IndexField ¶
Initialize a IndexField object from a json dictionary.
- get_properties() Dict ¶
Return a dictionary of arbitrary properties from this instance of IndexField
- set_properties(_dict: dict)¶
Set a dictionary of arbitrary properties to this instance of IndexField
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.IndexInformation(ddoc: str, def_: ibmcloudant.cloudant_v1.IndexDefinition, name: str, type: str)¶
Bases:
object
Schema for information about an index.
- Attr str ddoc
Design document ID.
- Attr IndexDefinition defdef_
Schema for a json or text query index definition. Indexes of type text have additional configuration properties that do not apply to json indexes, these are: * default_analyzer - the default text analyzer to use * default_field - whether to index the text in all document fields and what analyzer to use for that purpose.
- Attr str name
Index name.
- Attr str type
Schema for the type of an index.
- class TypeEnum(value)¶
Bases:
str
,enum.Enum
Schema for the type of an index.
- JSON = 'json'¶
- SPECIAL = 'special'¶
- TEXT = 'text'¶
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.IndexInformation ¶
Initialize a IndexInformation object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.IndexResult(id: str, name: str, result: str)¶
Bases:
object
Schema for the result of creating an index.
- Attr str id
Id of the design document the index was created in.
- Attr str name
Name of the index created.
- Attr str result
Flag to show whether the index was created or one already exists.
- class ResultEnum(value)¶
Bases:
str
,enum.Enum
Flag to show whether the index was created or one already exists.
- CREATED = 'created'¶
- EXISTS = 'exists'¶
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.IndexResult ¶
Initialize a IndexResult object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.IndexTextOperatorDefaultField(*, analyzer: Optional[ibmcloudant.cloudant_v1.Analyzer] = None, enabled: Optional[bool] = None)¶
Bases:
object
Schema for the text index default field configuration. The default field is used to index the text of all fields within a document for use with the $text operator.
- Attr Analyzer analyzer
(optional) Schema for a full text search analyzer.
- Attr bool enabled
(optional) Whether or not the default_field is enabled.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.IndexTextOperatorDefaultField ¶
Initialize a IndexTextOperatorDefaultField object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.IndexesInformation(total_rows: int, indexes: List[ibmcloudant.cloudant_v1.IndexInformation])¶
Bases:
object
Schema for information about the indexes in a database.
- Attr int total_rows
Number of total rows.
- Attr List[IndexInformation] indexes
Indexes.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.IndexesInformation ¶
Initialize a IndexesInformation object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.MembershipInformation(all_nodes: List[str], cluster_nodes: List[str])¶
Bases:
object
Schema for information about known nodes and cluster membership.
- Attr List[str] all_nodes
List of nodes this node knows about, including the ones that are part of the cluster.
- Attr List[str] cluster_nodes
All cluster nodes.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.MembershipInformation ¶
Initialize a MembershipInformation object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.Ok(*, ok: Optional[bool] = None)¶
Bases:
object
Schema for an OK result.
- Attr bool ok
(optional) ok.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.Ok ¶
Initialize a Ok object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.PartitionInformation(db_name: str, doc_count: int, doc_del_count: int, partition: str, sizes: ibmcloudant.cloudant_v1.PartitionInformationSizes, *, partitioned_indexes: Optional[ibmcloudant.cloudant_v1.PartitionInformationIndexes] = None)¶
Bases:
object
Schema for information about a database partition.
- Attr str db_name
The name of the database.
- Attr int doc_count
A count of the documents in the specified database partition.
- Attr int doc_del_count
Number of deleted documents.
- Attr str partition
The name of the partition in the database.
- Attr PartitionInformationIndexes partitioned_indexes
(optional) Schema for information about the partition index count and limit in a database.
- Attr PartitionInformationSizes sizes
The size of active and external data, in bytes.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.PartitionInformation ¶
Initialize a PartitionInformation object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.PartitionInformationIndexes(*, count: Optional[int] = None, indexes: Optional[ibmcloudant.cloudant_v1.PartitionInformationIndexesIndexes] = None, limit: Optional[int] = None)¶
Bases:
object
Schema for information about the partition index count and limit in a database.
- Attr int count
(optional) Total count of the partitioned indexes.
- Attr PartitionInformationIndexesIndexes indexes
(optional) The count breakdown of partitioned indexes.
- Attr int limit
(optional) The partitioned index limit.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.PartitionInformationIndexes ¶
Initialize a PartitionInformationIndexes object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.PartitionInformationIndexesIndexes(*, search: Optional[int] = None, view: Optional[int] = None)¶
Bases:
object
The count breakdown of partitioned indexes.
- Attr int search
(optional) Number of partitioned search indexes.
- Attr int view
(optional) Number of partitioned view indexes.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.PartitionInformationIndexesIndexes ¶
Initialize a PartitionInformationIndexesIndexes object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.PartitionInformationSizes(*, active: Optional[int] = None, external: Optional[int] = None)¶
Bases:
object
The size of active and external data, in bytes.
- Attr int active
(optional) The size of live data inside the database, in bytes.
- Attr int external
(optional) The uncompressed size of database contents in bytes.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.PartitionInformationSizes ¶
Initialize a PartitionInformationSizes object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.PostChangesEnums¶
Bases:
object
Enums for post_changes_as_stream parameters.
- class ibmcloudant.cloudant_v1.PostDesignDocsEnums¶
Bases:
object
Enums for post_design_docs parameters.
- class ibmcloudant.cloudant_v1.PostDesignDocsQueriesEnums¶
Bases:
object
Enums for post_design_docs_queries parameters.
- class ibmcloudant.cloudant_v1.PostDocumentEnums¶
Bases:
object
Enums for post_document parameters.
- class ibmcloudant.cloudant_v1.PutDesignDocumentEnums¶
Bases:
object
Enums for put_design_document parameters.
- class ibmcloudant.cloudant_v1.PutDocumentEnums¶
Bases:
object
Enums for put_document parameters.
- class ibmcloudant.cloudant_v1.PutLocalDocumentEnums¶
Bases:
object
Enums for put_local_document parameters.
- class ibmcloudant.cloudant_v1.PutReplicationDocumentEnums¶
Bases:
object
Enums for put_replication_document parameters.
- class ibmcloudant.cloudant_v1.ReplicationCreateTargetParameters(*, n: Optional[int] = None, partitioned: Optional[bool] = None, q: Optional[int] = None)¶
Bases:
object
Request parameters to use during target database creation.
- Attr int n
(optional) Schema for the number of replicas of a database in a cluster.
- Attr bool partitioned
(optional) Parameter to specify whether to enable database partitions when creating the target database.
- Attr int q
(optional) Schema for the number of shards in a database. Each shard is a partition of the hash value range.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.ReplicationCreateTargetParameters ¶
Initialize a ReplicationCreateTargetParameters object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.ReplicationDatabase(url: str, *, auth: Optional[ibmcloudant.cloudant_v1.ReplicationDatabaseAuth] = None, headers_: Optional[dict] = None)¶
Bases:
object
Schema for a replication source or target database.
- Attr ReplicationDatabaseAuth auth
(optional) Schema for replication source or target database authentication.
- Attr dict headersheaders_
(optional) Replication request headers.
- Attr str url
Replication database URL.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.ReplicationDatabase ¶
Initialize a ReplicationDatabase object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.ReplicationDatabaseAuth(*, basic: Optional[ibmcloudant.cloudant_v1.ReplicationDatabaseAuthBasic] = None, iam: Optional[ibmcloudant.cloudant_v1.ReplicationDatabaseAuthIam] = None)¶
Bases:
object
Schema for replication source or target database authentication.
- Attr ReplicationDatabaseAuthBasic basic
(optional) Schema for basic authentication of replication source or target database.
- Attr ReplicationDatabaseAuthIam iam
(optional) Schema for an IAM API key for replication database authentication.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.ReplicationDatabaseAuth ¶
Initialize a ReplicationDatabaseAuth object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.ReplicationDatabaseAuthBasic(password: str, username: str)¶
Bases:
object
Schema for basic authentication of replication source or target database.
- Attr str password
The password associated with the username.
- Attr str username
The username.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.ReplicationDatabaseAuthBasic ¶
Initialize a ReplicationDatabaseAuthBasic object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.ReplicationDatabaseAuthIam(api_key: str)¶
Bases:
object
Schema for an IAM API key for replication database authentication.
- Attr str api_key
IAM API key.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.ReplicationDatabaseAuthIam ¶
Initialize a ReplicationDatabaseAuthIam object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.ReplicationDocument(source: ibmcloudant.cloudant_v1.ReplicationDatabase, target: ibmcloudant.cloudant_v1.ReplicationDatabase, *, attachments: Optional[dict] = None, conflicts: Optional[List[str]] = None, deleted: Optional[bool] = None, deleted_conflicts: Optional[List[str]] = None, id: Optional[str] = None, local_seq: Optional[str] = None, rev: Optional[str] = None, revisions: Optional[ibmcloudant.cloudant_v1.Revisions] = None, revs_info: Optional[List[ibmcloudant.cloudant_v1.DocumentRevisionStatus]] = None, cancel: Optional[bool] = None, checkpoint_interval: Optional[int] = None, connection_timeout: Optional[int] = None, continuous: Optional[bool] = None, create_target: Optional[bool] = None, create_target_params: Optional[ibmcloudant.cloudant_v1.ReplicationCreateTargetParameters] = None, doc_ids: Optional[List[str]] = None, filter: Optional[str] = None, http_connections: Optional[int] = None, query_params: Optional[dict] = None, retries_per_request: Optional[int] = None, selector: Optional[dict] = None, since_seq: Optional[str] = None, socket_options: Optional[str] = None, source_proxy: Optional[str] = None, target_proxy: Optional[str] = None, use_checkpoints: Optional[bool] = None, user_ctx: Optional[ibmcloudant.cloudant_v1.UserContext] = None, worker_batch_size: Optional[int] = None, worker_processes: Optional[int] = None, **kwargs)¶
Bases:
object
Schema for a replication document. Note that selector, doc_ids, and filter are incompatible with each other.
- Attr dict attachments
(optional) Schema for a map of attachment name to attachment metadata.
- Attr List[str] conflicts
(optional) Schema for a list of document revision identifiers.
- Attr bool deleted
(optional) Deletion flag. Available if document was removed.
- Attr List[str] deleted_conflicts
(optional) Schema for a list of document revision identifiers.
- Attr str id
(optional) Document ID.
- Attr str local_seq
(optional) Document’s update sequence in current database. Available if requested with local_seq=true query parameter.
- Attr str rev
(optional) Schema for a document revision identifier.
- Attr Revisions revisions
(optional) Schema for list of revision information.
- Attr List[DocumentRevisionStatus] revs_info
(optional) Schema for a list of objects with information about local revisions and their status.
- Attr bool cancel
(optional) Cancels the replication.
- Attr int checkpoint_interval
(optional) Defines replication checkpoint interval in milliseconds.
- Attr int connection_timeout
(optional) HTTP connection timeout per replication. Even for very fast/reliable networks it might need to be increased if a remote database is too busy.
- Attr bool continuous
(optional) Configure the replication to be continuous.
- Attr bool create_target
(optional) Creates the target database. Requires administrator privileges on target server.
- Attr ReplicationCreateTargetParameters create_target_params
(optional) Request parameters to use during target database creation.
- Attr List[str] doc_ids
(optional) Schema for a list of document IDs.
- Attr str filter
(optional) The name of a filter function which is defined in a design document in the source database in {ddoc_id}/{filter} format. It determines which documents get replicated. Using the selector option provides performance benefits when compared with using the filter option. Use the selector option when possible.
- Attr int http_connections
(optional) Maximum number of HTTP connections per replication.
- Attr dict query_params
(optional) Schema for a map of string key value pairs, such as query parameters.
- Attr int retries_per_request
(optional) Number of times a replication request is retried. The requests are retried with a doubling exponential backoff starting at 0.25 seconds, with a cap at 5 minutes.
- Attr dict selector
(optional) JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or other data. The selector object must:
Be structured as valid JSON.
Contain a valid query expression.
Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended option if filtering on document attributes only. Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for those fields. You can create more complex selector expressions by combining operators. Operators are identified by the use of a dollar sign $ prefix in the name field. There are two core types of operators in the selector syntax: * Combination operators: applied at the topmost level of selection. They are used to combine selectors. In addition to the common boolean operators ($and, $or, $not, $nor) there are three combination operators: $all, $elemMatch, and $allMatch. A combination operator takes a single argument. The argument is either another selector, or an array of selectors. * Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic $eq operator matches when the specified field contains a value that is equal to the supplied argument.
- Attr str since_seq
(optional) Start the replication at a specific sequence value.
- Attr str socket_options
(optional) Replication socket options.
- Attr ReplicationDatabase source
Schema for a replication source or target database.
- Attr str source_proxy
(optional) Address of a (http or socks5 protocol) proxy server through which replication with the source database should occur.
- Attr ReplicationDatabase target
Schema for a replication source or target database.
- Attr str target_proxy
(optional) Address of a (http or socks5 protocol) proxy server through which replication with the target database should occur.
- Attr bool use_checkpoints
(optional) Specify if checkpoints should be saved during replication. Using checkpoints means a replication can be efficiently resumed.
- Attr UserContext user_ctx
(optional) Schema for the user context of a session.
- Attr int worker_batch_size
(optional) Controls how many documents are processed. After each batch a checkpoint is written so this controls how frequently checkpointing occurs.
- Attr int worker_processes
(optional) Controls how many separate processes will read from the changes manager and write to the target. A higher number can improve throughput.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.ReplicationDocument ¶
Initialize a ReplicationDocument object from a json dictionary.
- get_properties() Dict ¶
Return a dictionary of arbitrary properties from this instance of ReplicationDocument
- set_properties(_dict: dict)¶
Set a dictionary of arbitrary properties to this instance of ReplicationDocument
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.Revisions(ids: List[str], start: int)¶
Bases:
object
Schema for list of revision information.
- Attr List[str] ids
Array of valid revision IDs, in reverse order (latest first).
- Attr int start
Prefix number for the latest revision.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.Revisions ¶
Initialize a Revisions object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.RevsDiff(*, missing: Optional[List[str]] = None, possible_ancestors: Optional[List[str]] = None)¶
Bases:
object
Schema for information about missing revs and possible ancestors.
- Attr List[str] missing
(optional) List of missing revisions.
- Attr List[str] possible_ancestors
(optional) List of possible ancestor revisions.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.RevsDiff ¶
Initialize a RevsDiff object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.SchedulerDocsResult(total_rows: int, docs: List[ibmcloudant.cloudant_v1.SchedulerDocument])¶
Bases:
object
Schema for a listing of replication scheduler documents.
- Attr int total_rows
Number of total rows.
- Attr List[SchedulerDocument] docs
Array of replication scheduler doc objects.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.SchedulerDocsResult ¶
Initialize a SchedulerDocsResult object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.SchedulerDocument(database: str, doc_id: str, error_count: int, id: str, info: ibmcloudant.cloudant_v1.SchedulerInfo, last_updated: datetime.datetime, start_time: datetime.datetime, state: str, *, node: Optional[str] = None, source: Optional[str] = None, source_proxy: Optional[str] = None, target: Optional[str] = None, target_proxy: Optional[str] = None)¶
Bases:
object
Schema for a replication scheduler document.
- Attr str database
Database where replication document came from.
- Attr str doc_id
Replication document ID.
- Attr int error_count
Consecutive errors count. Indicates how many times in a row this replication has crashed. Replication will be retried with an exponential backoff based on this number. As soon as the replication succeeds this count is reset to 0. To can be used to get an idea why a particular replication is not making progress.
- Attr str id
Replication ID, or null if state is completed or failed.
- Attr SchedulerInfo info
Schema for scheduler document information. A JSON object that may contain additional information about the state. For error states this will contain an error field and string value.
- Attr datetime last_updated
Timestamp of last state update.
- Attr str node
(optional) Cluster node where the job is running.
- Attr str source
(optional) Replication source.
- Attr str source_proxy
(optional) Address of the (http or socks5 protocol) proxy server through which replication with the source database occurs.
- Attr datetime start_time
Timestamp of when the replication was started.
- Attr str state
Schema for replication state.
- Attr str target
(optional) Replication target.
- Attr str target_proxy
(optional) Address of the (http or socks5 protocol) proxy server through which replication with the target database occurs.
- class StateEnum(value)¶
Bases:
str
,enum.Enum
Schema for replication state.
- COMPLETED = 'completed'¶
- CRASHING = 'crashing'¶
- ERROR = 'error'¶
- FAILED = 'failed'¶
- INITIALIZING = 'initializing'¶
- PENDING = 'pending'¶
- RUNNING = 'running'¶
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.SchedulerDocument ¶
Initialize a SchedulerDocument object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.SchedulerInfo(*, changes_pending: Optional[int] = None, checkpointed_source_seq: Optional[str] = None, doc_write_failures: Optional[int] = None, docs_read: Optional[int] = None, docs_written: Optional[int] = None, error: Optional[str] = None, missing_revisions_found: Optional[int] = None, revisions_checked: Optional[int] = None, source_seq: Optional[str] = None, through_seq: Optional[str] = None)¶
Bases:
object
Schema for scheduler document information. A JSON object that may contain additional information about the state. For error states this will contain an error field and string value.
- Attr int changes_pending
(optional) The count of changes not yet replicated.
- Attr str checkpointed_source_seq
(optional) The source sequence id which was last successfully replicated.
- Attr int doc_write_failures
(optional) The count of docs which failed to be written to the target.
- Attr int docs_read
(optional) The count of docs which have been read from the source.
- Attr int docs_written
(optional) The count of docs which have been written to the target.
- Attr str error
(optional) Replication error message.
- Attr int missing_revisions_found
(optional) The count of revisions which were found on the source, but missing from the target.
- Attr int revisions_checked
(optional) The count of revisions which have been checked since this replication began.
- Attr str source_seq
(optional) The last sequence number obtained from the source database changes feed.
- Attr str through_seq
(optional) The last sequence number processed by the replicator.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.SchedulerInfo ¶
Initialize a SchedulerInfo object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.SchedulerJob(database: str, doc_id: str, history: List[ibmcloudant.cloudant_v1.SchedulerJobEvent], id: str, info: ibmcloudant.cloudant_v1.SchedulerInfo, node: str, pid: str, source: str, start_time: datetime.datetime, target: str, user: str)¶
Bases:
object
Schema for a replication scheduler job.
- Attr str database
Replication document database.
- Attr str doc_id
Replication document ID.
- Attr List[SchedulerJobEvent] history
Timestamped history of events as a list of objects.
- Attr str id
Schema for a replication job id.
- Attr SchedulerInfo info
Schema for scheduler document information. A JSON object that may contain additional information about the state. For error states this will contain an error field and string value.
- Attr str node
Cluster node where the job is running.
- Attr str pid
Replication process ID.
- Attr str source
Replication source.
- Attr datetime start_time
Timestamp of when the replication was started.
- Attr str target
Replication target.
- Attr str user
Name of user running replication.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.SchedulerJob ¶
Initialize a SchedulerJob object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.SchedulerJobEvent(timestamp: datetime.datetime, type: str, *, reason: Optional[str] = None)¶
Bases:
object
Schema for a replication scheduler job event.
- Attr str reason
(optional) Reason for current state of event.
- Attr datetime timestamp
Timestamp of the event.
- Attr str type
Type of the event.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.SchedulerJobEvent ¶
Initialize a SchedulerJobEvent object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.SchedulerJobsResult(total_rows: int, jobs: List[ibmcloudant.cloudant_v1.SchedulerJob])¶
Bases:
object
Schema for a listing of replication scheduler jobs.
- Attr int total_rows
Number of total rows.
- Attr List[SchedulerJob] jobs
Array of replication job objects.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.SchedulerJobsResult ¶
Initialize a SchedulerJobsResult object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.SearchAnalyzeResult(tokens: List[str])¶
Bases:
object
Schema for the output of testing search analyzer tokenization.
- Attr List[str] tokens
tokens.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.SearchAnalyzeResult ¶
Initialize a SearchAnalyzeResult object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.SearchIndexDefinition(index: str, *, analyzer: Optional[ibmcloudant.cloudant_v1.AnalyzerConfiguration] = None)¶
Bases:
object
Schema for a search index definition.
- Attr AnalyzerConfiguration analyzer
(optional) Schema for a search analyzer configuration.
- Attr str index
String form of a JavaScript function that is called for each document in the database. The function takes the document as a parameter, extracts some data from it, and then calls the index function to index that data. The index function takes 2, or optionally 3, parameters. * The first parameter is the name of the field you intend to use when
querying the index. If the special value “default” is used when you define the name, you do not have to specify a field name at query time.
The second parameter is the data to be indexed. This data must be only a string, number, or boolean. Other types will cause an error to be thrown by the index function call.
The optional third parameter is a JavaScript object with these properties:
facet - boolean, default false - Creates a faceted index.
index - boolean, default true - If set to false, the data cannot be used for searches, but can still be retrieved from the index if store is set to true.
store - boolean, default true - If true, the value is returned in the search result; otherwise, the value is not returned.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.SearchIndexDefinition ¶
Initialize a SearchIndexDefinition object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.SearchIndexInfo(committed_seq: int, disk_size: int, doc_count: int, doc_del_count: int, pending_seq: int)¶
Bases:
object
Schema for metadata information about a search index.
- Attr int committed_seq
The committed sequence identifier.
- Attr int disk_size
The size of the search index on disk.
- Attr int doc_count
The count of the number of indexed documents.
- Attr int doc_del_count
The number of deleted documents.
- Attr int pending_seq
The pending sequence identifier.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.SearchIndexInfo ¶
Initialize a SearchIndexInfo object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.SearchInfoResult(name: str, search_index: ibmcloudant.cloudant_v1.SearchIndexInfo)¶
Bases:
object
Schema for search index information.
- Attr str name
The name of the search index prefixed by the design document ID where the index is stored.
- Attr SearchIndexInfo search_index
Schema for metadata information about a search index.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.SearchInfoResult ¶
Initialize a SearchInfoResult object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.SearchResult(total_rows: int, *, bookmark: Optional[str] = None, by: Optional[str] = None, counts: Optional[dict] = None, ranges: Optional[dict] = None, rows: Optional[List[ibmcloudant.cloudant_v1.SearchResultRow]] = None, groups: Optional[List[ibmcloudant.cloudant_v1.SearchResultProperties]] = None)¶
Bases:
object
Schema for the result of a query search operation.
- Attr int total_rows
Number of total rows.
- Attr str bookmark
(optional) Opaque bookmark token used when paginating results.
- Attr str by
(optional) Grouped search matches.
- Attr dict counts
(optional) The counts facet syntax returns the number of query results for each unique value of each named field.
- Attr dict ranges
(optional) The range facet syntax reuses the standard Lucene syntax for ranges to return counts of results that fit into each specified category.
- Attr List[SearchResultRow] rows
(optional) Array of row objects.
- Attr List[SearchResultProperties] groups
(optional) Array of grouped search matches.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.SearchResult ¶
Initialize a SearchResult object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.SearchResultProperties(total_rows: int, *, bookmark: Optional[str] = None, by: Optional[str] = None, counts: Optional[dict] = None, ranges: Optional[dict] = None, rows: Optional[List[ibmcloudant.cloudant_v1.SearchResultRow]] = None)¶
Bases:
object
Schema for the result of a query search operation.
- Attr int total_rows
Number of total rows.
- Attr str bookmark
(optional) Opaque bookmark token used when paginating results.
- Attr str by
(optional) Grouped search matches.
- Attr dict counts
(optional) The counts facet syntax returns the number of query results for each unique value of each named field.
- Attr dict ranges
(optional) The range facet syntax reuses the standard Lucene syntax for ranges to return counts of results that fit into each specified category.
- Attr List[SearchResultRow] rows
(optional) Array of row objects.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.SearchResultProperties ¶
Initialize a SearchResultProperties object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.SearchResultRow(fields: dict, id: str, *, doc: Optional[ibmcloudant.cloudant_v1.Document] = None, highlights: Optional[dict] = None)¶
Bases:
object
Schema for a row of the result of a query search operation.
- Attr Document doc
(optional) Schema for a document.
- Attr dict fields
Schema for the fields returned by a query search operation, a map of field name to value.
- Attr dict highlights
(optional) Returns the context in which a search term was mentioned so that you can display more emphasized results to a user.
- Attr str id
Schema for a document ID.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.SearchResultRow ¶
Initialize a SearchResultRow object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.Security(*, admins: Optional[ibmcloudant.cloudant_v1.SecurityObject] = None, members: Optional[ibmcloudant.cloudant_v1.SecurityObject] = None, cloudant: Optional[dict] = None, couchdb_auth_only: Optional[bool] = None)¶
Bases:
object
Schema for a security document.
- Attr SecurityObject admins
(optional) Schema for names and roles to map to a database permission.
- Attr SecurityObject members
(optional) Schema for names and roles to map to a database permission.
- Attr dict cloudant
(optional) Database permissions for Cloudant users and/or API keys.
- Attr bool couchdb_auth_only
(optional) Manage permissions using the _users database only.
- class CloudantEnum(value)¶
Bases:
str
,enum.Enum
Database permissions for Cloudant users and/or API keys.
- ADMIN = '_admin'¶
- DB_UPDATES = '_db_updates'¶
- DESIGN = '_design'¶
- READER = '_reader'¶
- REPLICATOR = '_replicator'¶
- SECURITY = '_security'¶
- SHARDS = '_shards'¶
- WRITER = '_writer'¶
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.Security ¶
Initialize a Security object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.SecurityObject(*, names: Optional[List[str]] = None, roles: Optional[List[str]] = None)¶
Bases:
object
Schema for names and roles to map to a database permission.
- Attr List[str] names
(optional) List of usernames.
- Attr List[str] roles
(optional) List of roles.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.SecurityObject ¶
Initialize a SecurityObject object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.ServerInformation(couchdb: str, features: List[str], vendor: ibmcloudant.cloudant_v1.ServerVendor, version: str, features_flags: List[str])¶
Bases:
object
Schema for information about the server instance.
- Attr str couchdb
Welcome message.
- Attr List[str] features
List of enabled optional features.
- Attr ServerVendor vendor
Schema for server vendor information.
- Attr str version
Apache CouchDB version.
- Attr List[str] features_flags
List of feature flags.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.ServerInformation ¶
Initialize a ServerInformation object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.ServerVendor(name: str, *, variant: Optional[str] = None, version: Optional[str] = None)¶
Bases:
object
Schema for server vendor information.
- Attr str name
Vendor name.
- Attr str variant
(optional) Vendor variant.
- Attr str version
(optional) Vendor version.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.ServerVendor ¶
Initialize a ServerVendor object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.SessionAuthentication(authentication_handlers: List[str], *, authenticated: Optional[str] = None, authentication_db: Optional[str] = None)¶
Bases:
object
Schema for session authentication information.
- Attr str authenticated
(optional) authenticated.
- Attr str authentication_db
(optional) authentication_db.
- Attr List[str] authentication_handlers
authentication_handlers.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.SessionAuthentication ¶
Initialize a SessionAuthentication object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.SessionInformation(ok: bool, info: ibmcloudant.cloudant_v1.SessionAuthentication, user_ctx: ibmcloudant.cloudant_v1.UserContext)¶
Bases:
object
Schema for information about a session.
- Attr bool ok
ok.
- Attr SessionAuthentication info
Schema for session authentication information.
- Attr UserContext user_ctx
Schema for the user context of a session.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.SessionInformation ¶
Initialize a SessionInformation object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.ShardsInformation(shards: dict)¶
Bases:
object
Schema for a shards object that maps the hash value range for each shard to the array of nodes that contain a copy of that shard.
- Attr dict shards
Mapping of shard hash value range to a list of nodes.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.ShardsInformation ¶
Initialize a ShardsInformation object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.ThroughputInformation(blocks: int, query: int, read: int, write: int)¶
Bases:
object
Schema for detailed information about throughput capacity with breakdown by specific throughput requests classes.
- Attr int blocks
A number of blocks of throughput units. A block consists of 100 reads/sec, 50 writes/sec, and 5 global queries/sec of provisioned throughput capacity.
- Attr int query
Provisioned global queries capacity in operations per second.
- Attr int read
Provisioned reads capacity in operations per second.
- Attr int write
Provisioned writes capacity in operations per second.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.ThroughputInformation ¶
Initialize a ThroughputInformation object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.UpInformation(seeds: object, status: str)¶
Bases:
object
Schema for information about the up state of the server.
- Attr object seeds
seeds.
- Attr str status
status.
- class StatusEnum(value)¶
Bases:
str
,enum.Enum
status.
- MAINTENANCE_MODE = 'maintenance_mode'¶
- NOLB = 'nolb'¶
- OK = 'ok'¶
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.UpInformation ¶
Initialize a UpInformation object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.UserContext(name: str, roles: List[str], *, db: Optional[str] = None)¶
Bases:
object
Schema for the user context of a session.
- Attr str db
(optional) Database name in the context of the provided operation.
- Attr str name
User name.
- Attr List[str] roles
List of user roles.
- class RolesEnum(value)¶
Bases:
str
,enum.Enum
Schema for a security role.
- ADMIN = '_admin'¶
- DB_UPDATES = '_db_updates'¶
- DESIGN = '_design'¶
- READER = '_reader'¶
- REPLICATOR = '_replicator'¶
- SECURITY = '_security'¶
- SHARDS = '_shards'¶
- WRITER = '_writer'¶
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.UserContext ¶
Initialize a UserContext object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.UuidsResult(uuids: List[str])¶
Bases:
object
Schema for a set of uuids generated by the server.
- Attr List[str] uuids
uuids.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.UuidsResult ¶
Initialize a UuidsResult object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.ViewQueriesResult(results: List[ibmcloudant.cloudant_v1.ViewResult])¶
Bases:
object
Schema for the results of a queries view operation.
- Attr List[ViewResult] results
An array of result objects - one for each query. Each result object contains the same fields as the response to a regular view request.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.ViewQueriesResult ¶
Initialize a ViewQueriesResult object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.ViewQuery(*, att_encoding_info: Optional[bool] = None, attachments: Optional[bool] = None, conflicts: Optional[bool] = None, descending: Optional[bool] = None, include_docs: Optional[bool] = None, inclusive_end: Optional[bool] = None, limit: Optional[int] = None, skip: Optional[int] = None, update_seq: Optional[bool] = None, endkey: Optional[object] = None, endkey_docid: Optional[str] = None, group: Optional[bool] = None, group_level: Optional[int] = None, key: Optional[object] = None, keys: Optional[List[object]] = None, reduce: Optional[bool] = None, stable: Optional[bool] = None, startkey: Optional[object] = None, startkey_docid: Optional[str] = None, update: Optional[str] = None)¶
Bases:
object
Schema for a query view operation.
- Attr bool att_encoding_info
(optional) Parameter to specify whether to include the encoding information in attachment stubs if the particular attachment is compressed.
- Attr bool attachments
(optional) Parameter to specify whether to include attachments bodies in a response.
- Attr bool conflicts
(optional) Parameter to specify whether to include a list of conflicted revisions in the _conflicts property of the returned document. Ignored if include_docs isn’t true.
- Attr bool descending
(optional) Parameter to specify whether to return the documents in descending by key order.
- Attr bool include_docs
(optional) Parameter to specify whether to include the full content of the documents in the response.
- Attr bool inclusive_end
(optional) Parameter to specify whether the specified end key should be included in the result.
- Attr int limit
(optional) Parameter to specify the number of returned documents to limit the result to.
- Attr int skip
(optional) Parameter to specify the number of records before starting to return the results.
- Attr bool update_seq
(optional) Parameter to specify whether to include in the response an update_seq value indicating the sequence id of the database the view reflects.
- Attr object endkey
(optional) Schema for any JSON type.
- Attr str endkey_docid
(optional) Schema for a document ID.
- Attr bool group
(optional) Parameter to specify whether to group the results using the reduce function to a group rather than a single row. Implies reduce is true and the maximum group_level.
- Attr int group_level
(optional) Parameter to specify the group level to be used. Implies group is true.
- Attr object key
(optional) Schema for any JSON type.
- Attr List[object] keys
(optional) Parameter to specify to return only documents that match the specified keys. String representation of a JSON array containing elements that match the key type emitted by the view function.
- Attr bool reduce
(optional) Parameter to specify whether to use the reduce function in a map-reduce view. Default is true when a reduce function is defined.
- Attr bool stable
(optional) Parameter to specify whether view results should be returned from a stable set of shards.
- Attr object startkey
(optional) Schema for any JSON type.
- Attr str startkey_docid
(optional) Schema for a document ID.
- Attr str update
(optional) Parameter to specify whether or not the view in question should be updated prior to responding to the user.
- class UpdateEnum(value)¶
Bases:
str
,enum.Enum
Parameter to specify whether or not the view in question should be updated prior to responding to the user.
- FALSE = 'false'¶
- LAZY = 'lazy'¶
- TRUE = 'true'¶
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.ViewQuery ¶
Initialize a ViewQuery object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.ViewResult(rows: List[ibmcloudant.cloudant_v1.ViewResultRow], *, total_rows: Optional[int] = None, update_seq: Optional[str] = None)¶
Bases:
object
Schema for the result of a query view operation.
- Attr int total_rows
(optional) Number of total rows.
- Attr str update_seq
(optional) Current update sequence for the database.
- Attr List[ViewResultRow] rows
rows.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.ViewResult ¶
Initialize a ViewResult object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.ViewResultRow(key: object, value: object, *, caused_by: Optional[str] = None, error: Optional[str] = None, reason: Optional[str] = None, doc: Optional[ibmcloudant.cloudant_v1.Document] = None, id: Optional[str] = None)¶
Bases:
object
Schema for a row of a view result.
- Attr str caused_by
(optional) The cause of the error (if available).
- Attr str error
(optional) The name of the error.
- Attr str reason
(optional) The reason the error occurred (if available).
- Attr Document doc
(optional) Schema for a document.
- Attr str id
(optional) Schema for a document ID.
- Attr object key
Schema for any JSON type.
- Attr object value
Schema for any JSON type.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.ViewResultRow ¶
Initialize a ViewResultRow object from a json dictionary.
- to_dict() Dict ¶
Return a json dictionary representing this model.
ibmcloudant.couchdb_session_authenticator module¶
Module for handling session authentication
- class ibmcloudant.couchdb_session_authenticator.CouchDbSessionAuthenticator(username: str, password: str)¶
Bases:
ibm_cloud_sdk_core.authenticators.authenticator.Authenticator
The CouchDbSessionAuthenticator utilizes a server url and a username and password pair to obtain a session token, and adds it to requests.
- Args:
username: The CouchDB username password: The CouchDB password
Attributes: token_manager (ibmcloudantsdk.couchdb_session_token_manager.CouchDbSessionTokenManager): Retrieves and manages CouchDB session tokens.
- Raises:
ValueError: The supplied username, and/or password are not valid.
- authenticate(req: requests.models.Request)¶
Adds session authentication information to the request.
The session token will be added as an update to the BaseService cookie jar.
- Args:
req: Ignored. BaseService uses the cookie jar for every request
- authentication_type() str ¶
Returns this authenticator’s type (‘COUCHDB_SESSION’).
- set_jar(jar)¶
Sets the cookie jar for the authenticator. This is an internal method called by BaseService. Not to be called directly.
- validate()¶
Validates the username, and password for session token requests.
Ensure both the username and password are set.
- Raises:
ValueError: The supplied username, and/or password are not valid.
- AUTHTYPE_COUCHDB_SESSION = 'COUCHDB_SESSION'¶
ibmcloudant.couchdb_session_token_manager module¶
Module for managing session authentication token
- class ibmcloudant.couchdb_session_token_manager.CouchDbSessionTokenManager(username: str, password: str, url: Optional[str] = None)¶
Bases:
ibm_cloud_sdk_core.token_managers.token_manager.TokenManager
The SessionTokenManager takes a username and password and performs the necessary interactions with the CouchDB service to obtain and store a session token.
If the current stored session token has expired a new session token will be retrieved.
This class is used by CouchDbSessionAuthenticator and is internal.
- Attributes:
url (str): The CouchDB service URL for token requests. username (str): The CouchDB username to obtain the session token for password (str): The CouchDB password to obtain the session token for http_config (dict): A dictionary containing values that control the timeout, proxies, and etc of HTTP requests. headers (dict): A dictionary containing values that specify custom headers used for HTTP requests.
- Args:
username: The CouchDB username to obtain the session token for password: The CouchDB password to obtain the session token for
- request_token()¶
Request a CouchDB session token given an username and password.
- Returns:
A CookieJar of Cookies the server sent back.
- set_default_headers(headers)¶
- set_service_url(service_url)¶
Module contents¶
Python client library for the IBM Cloudant