ibmcloudant.cloudant_v1
NoSQL database based on Apache CouchDB
See: https://cloud.ibm.com/docs/services/Cloudant/
Module Contents
Classes
Schema for information about a running task. |
|
Schema for Activity Tracker events. |
|
Schema for the result of an all documents queries operation. |
|
Schema for an all documents query operation. |
|
Schema for the result of an all documents operation. |
|
Schema for a full text search analyzer. |
|
Schema for a search analyzer configuration. |
|
Schema for api keys. |
|
Schema for an attachment. |
|
Schema for submitting documents for bulk modifications. |
|
Schema for a document item in a bulk get query. |
|
Schema for the results object of a bulk get operation. |
|
Schema for BulkGetResult object containing a successfully retrieved document or error information. |
|
Schema for the document revisions information from a bulk get operation. |
|
Schema for information about the currently provisioned and target throughput capacity. |
|
Detailed information about provisioned throughput capacity. |
|
Detailed information about target throughput capacity. |
|
Schema for a document leaf with single field rev. |
|
Schema for normal changes feed result. |
|
Schema for an item in the changes results array. |
|
The Cloudant V1 service. |
|
Schema for size information of content. |
|
Schema for information about the CORS configuration. |
|
Schema for information about current consumption of a provisioned throughput capacity. |
|
Detailed information about current consumption. |
|
Schema for information about a database. |
|
Schema for database cluster information. |
|
Schema for database properties. |
|
Schema for a database change event. |
|
Schema for database updates. |
|
Schema for database information keyed by database name. |
|
Enums for delete_attachment parameters. |
|
Enums for delete_design_document parameters. |
|
Enums for delete_document parameters. |
|
Enums for delete_index parameters. |
|
Enums for delete_local_document parameters. |
|
Enums for delete_replication_document parameters. |
|
Schema for a design document. |
|
Schema for information about a design document. |
|
Schema for design document options. |
|
View index information. |
|
Schema for view functions definition. |
|
Schema for a row of document information in a DocsResult. |
|
Value of built-in |
|
Schema for a document. |
|
Schema for the result of a document modification. |
|
Schema for information about revisions and their status. |
|
Schema for document shard information. |
|
Schema for find query execution statistics. |
|
Schema for information about the index used for a find query. |
|
Arguments passed to the underlying view. |
|
Options used for the request. |
|
Schema for the result of a query find operation. |
|
Enums for get_db_updates parameters. |
|
Enums for get_local_document parameters. |
|
Enums for get_scheduler_docs parameters. |
|
Schema for a |
|
Schema for indexed fields for use with declarative JSON query. |
|
Schema for information about an index. |
|
Schema for the result of creating an index. |
|
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 |
|
Schema for information about the indexes in a database. |
|
Schema for information about known nodes and cluster membership. |
|
Schema for an OK result. |
|
Schema for information about a database partition. |
|
Schema for information about the partition index count and limit in a database. |
|
The count breakdown of partitioned indexes. |
|
The size of active and external data, in bytes. |
|
Number of partitioned indexes by type. |
|
Information about database’s partitioned indexes. |
|
Enums for post_changes_as_stream parameters. |
|
Enums for post_changes parameters. |
|
Enums for post_design_docs parameters. |
|
Enums for post_design_docs_queries parameters. |
|
Enums for post_document parameters. |
|
Enums for put_design_document parameters. |
|
Enums for put_document parameters. |
|
Enums for put_local_document parameters. |
|
Enums for put_replication_document parameters. |
|
Request parameters to use during target database creation. |
|
Schema for a replication source or target database. |
|
Schema for replication source or target database authentication. |
|
Schema for basic authentication of replication source or target database. |
|
Schema for an IAM API key for replication database authentication. |
|
Schema for a replication document. Note that |
|
Schema for list of revision information. |
|
Schema for information about missing revs and possible ancestors. |
|
Schema for a listing of replication scheduler documents. |
|
Schema for a replication scheduler document. |
|
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. |
|
Schema for a replication scheduler job. |
|
Schema for a replication scheduler job event. |
|
Schema for a listing of replication scheduler jobs. |
|
Schema for the output of testing search analyzer tokenization. |
|
Schema for a search index definition. |
|
Schema for metadata information about a search index. |
|
Schema for search index information. |
|
Schema for the result of a query search operation. |
|
Schema for the result of a query search operation. |
|
Schema for a row of the result of a query search operation. |
|
Schema for a security document. |
|
Schema for names and roles to map to a database permission. |
|
Schema for information about the server instance. |
|
Schema for server vendor information. |
|
Schema for session authentication information. |
|
Schema for information about a session. |
|
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. |
|
Schema for detailed information about throughput capacity with breakdown by specific throughput requests classes. |
|
Schema for information about the up state of the server. |
|
Schema for an ability to tell if view is up-to-date without querying it. |
|
Schema for the user context of a session. |
|
Schema for a set of uuids generated by the server. |
|
Schema for the results of a queries view operation. |
|
Schema for a query view operation. |
|
Schema for the result of a query view operation. |
|
Schema for a row of a view result. |
API
- class ibmcloudant.cloudant_v1.ActiveTask(database: str, node: str, pid: str, started_on: int, type: str, updated_on: int, *, bulk_get_attempts: Optional[int] = None, bulk_get_docs: Optional[int] = None, changes_done: Optional[int] = None, changes_pending: Optional[int] = None, checkpoint_interval: Optional[int] = None, checkpointed_source_seq: Optional[str] = None, continuous: Optional[bool] = None, design_document: Optional[str] = None, doc_id: Optional[str] = None, doc_write_failures: Optional[int] = None, docs_read: Optional[int] = None, docs_written: Optional[int] = None, index: Optional[str] = None, indexer_pid: Optional[str] = None, missing_revisions_found: Optional[int] = None, phase: Optional[str] = None, process_status: Optional[str] = None, progress: Optional[int] = None, replication_id: Optional[str] = None, retry: Optional[bool] = None, revisions_checked: Optional[int] = None, source: Optional[str] = None, source_seq: Optional[str] = None, target: Optional[str] = None, through_seq: Optional[str] = None, total_changes: Optional[int] = None, user: Optional[str] = None, view: Optional[int] = None)
Schema for information about a running task.
- Parameters:
bulk_get_attempts (int) – (optional) The total count of attempted doc revisions fetched with
_bulk_get
. Available forreplication
type tasks.bulk_get_docs (int) – (optional) The total count of successful docs fetched with
_bulk_get
. Available forreplication
type tasks.changes_done (int) – (optional) Processed changes. Available for
database_compaction
,indexer
,search_indexer
,view_compaction
type tasks.changes_pending (int) – (optional) The count of changes not yet replicated. Available for
replication
type tasks.checkpoint_interval (int) – (optional) Specifies the checkpoint interval in ms. Available for
replication
type tasks.checkpointed_source_seq (str) – (optional) The source sequence id which was last successfully replicated. Available for
replication
type tasks.continuous (bool) – (optional) The replication configured to be continuous. Available for
replication
type tasks.database (str) – Source database.
design_document (str) – (optional) The design document that belongs to this task. Available for
indexer
,search_indexer
,view_compaction
type tasks.doc_id (str) – (optional) Replication document ID. Available for
replication
type tasks.doc_write_failures (int) – (optional) Number of document write failures. Available for
replication
type tasks.docs_read (int) – (optional) Number of documents read. Available for
replication
type tasks.docs_written (int) – (optional) Number of documents written to target. Available for
replication
type tasks.index (str) – (optional) The search index that belongs to this task. Available for
search_indexer
type tasks.indexer_pid (str) – (optional) Indexer process ID. Available for
indexer
type tasks.missing_revisions_found (int) – (optional) The count of docs which have been read from the source. Available for
replication
type tasks.node (str) – Cluster node where the task is running.
phase (str) – (optional) The phase the active task is in.
docid_sort
,docid_copy
,document_copy
phases are available fordatabase_compaction
, whileids
andview
phases are available forview_compaction
type tasks.pid (str) – Process ID.
process_status (str) – (optional) Process status.
progress (int) – (optional) Current percentage progress. Available for
database_compaction
,indexer
,search_indexer
,view_compaction
type tasks.replication_id (str) – (optional) Replication ID. Available for
replication
type tasks.retry (bool) – (optional) Indicates whether a compaction retry is currently running on the database. Available for
database_compaction
type tasks.revisions_checked (int) – (optional) The count of revisions which have been checked since this replication began. Available for
replication
type tasks.source (str) – (optional) Replication source. Available for
replication
type tasks.source_seq (str) – (optional) The last sequence number obtained from the source database changes feed. Available for
replication
type tasks.started_on (int) – Schema for a Unix epoch timestamp.
target (str) – (optional) Replication target. Available for
replication
type tasks.through_seq (str) – (optional) The last sequence number processed by the replicator. Available for
replication
type tasks.total_changes (int) – (optional) Total changes to process. Available for
database_compaction
,indexer
,search_indexer
,view_compaction
type tasks.type (str) – Operation type.
updated_on (int) – Schema for a Unix epoch timestamp.
user (str) – (optional) Name of user running replication or owning the indexer. Available for
indexer
,replication
type tasks.view (int) – (optional) Number of view indexes. Available for
view_compaction
type tasks.
Initialization
Initialize a ActiveTask object.
- Parameters:
database (str) – Source database.
node (str) – Cluster node where the task is running.
pid (str) – Process ID.
started_on (int) – Schema for a Unix epoch timestamp.
type (str) – Operation type.
updated_on (int) – Schema for a Unix epoch timestamp.
bulk_get_attempts (int) – (optional) The total count of attempted doc revisions fetched with
_bulk_get
. Available forreplication
type tasks.bulk_get_docs (int) – (optional) The total count of successful docs fetched with
_bulk_get
. Available forreplication
type tasks.changes_done (int) – (optional) Processed changes. Available for
database_compaction
,indexer
,search_indexer
,view_compaction
type tasks.changes_pending (int) – (optional) The count of changes not yet replicated. Available for
replication
type tasks.checkpoint_interval (int) – (optional) Specifies the checkpoint interval in ms. Available for
replication
type tasks.checkpointed_source_seq (str) – (optional) The source sequence id which was last successfully replicated. Available for
replication
type tasks.continuous (bool) – (optional) The replication configured to be continuous. Available for
replication
type tasks.design_document (str) – (optional) The design document that belongs to this task. Available for
indexer
,search_indexer
,view_compaction
type tasks.doc_id (str) – (optional) Replication document ID. Available for
replication
type tasks.doc_write_failures (int) – (optional) Number of document write failures. Available for
replication
type tasks.docs_read (int) – (optional) Number of documents read. Available for
replication
type tasks.docs_written (int) – (optional) Number of documents written to target. Available for
replication
type tasks.index (str) – (optional) The search index that belongs to this task. Available for
search_indexer
type tasks.indexer_pid (str) – (optional) Indexer process ID. Available for
indexer
type tasks.missing_revisions_found (int) – (optional) The count of docs which have been read from the source. Available for
replication
type tasks.phase (str) – (optional) The phase the active task is in.
docid_sort
,docid_copy
,document_copy
phases are available fordatabase_compaction
, whileids
andview
phases are available forview_compaction
type tasks.process_status (str) – (optional) Process status.
progress (int) – (optional) Current percentage progress. Available for
database_compaction
,indexer
,search_indexer
,view_compaction
type tasks.replication_id (str) – (optional) Replication ID. Available for
replication
type tasks.retry (bool) – (optional) Indicates whether a compaction retry is currently running on the database. Available for
database_compaction
type tasks.revisions_checked (int) – (optional) The count of revisions which have been checked since this replication began. Available for
replication
type tasks.source (str) – (optional) Replication source. Available for
replication
type tasks.source_seq (str) – (optional) The last sequence number obtained from the source database changes feed. Available for
replication
type tasks.target (str) – (optional) Replication target. Available for
replication
type tasks.through_seq (str) – (optional) The last sequence number processed by the replicator. Available for
replication
type tasks.total_changes (int) – (optional) Total changes to process. Available for
database_compaction
,indexer
,search_indexer
,view_compaction
type tasks.user (str) – (optional) Name of user running replication or owning the indexer. Available for
indexer
,replication
type tasks.view (int) – (optional) Number of view indexes. Available for
view_compaction
type tasks.
- class PhaseEnum
Bases:
str
,enum.Enum
The phase the active task is in.
docid_sort
,docid_copy
,document_copy
phases are available fordatabase_compaction
, whileids
andview
phases are available forview_compaction
type tasks.Initialization
Initialize self. See help(type(self)) for accurate signature.
- DOCID_COPY = 'docid_copy'
- DOCID_SORT = 'docid_sort'
- DOCUMENT_COPY = 'document_copy'
- IDS = 'ids'
- VIEW = 'view'
- class ProcessStatusEnum
Bases:
str
,enum.Enum
Process status.
Initialization
Initialize self. See help(type(self)) for accurate signature.
- EXITING = 'exiting'
- GARBAGE_COLLECTING = 'garbage_collecting'
- RUNNABLE = 'runnable'
- RUNNING = 'running'
- SUSPENDED = 'suspended'
- WAITING = 'waiting'
- class TypeEnum
Bases:
str
,enum.Enum
Operation type.
Initialization
Initialize self. See help(type(self)) for accurate signature.
- DATABASE_COMPACTION = 'database_compaction'
- INDEXER = 'indexer'
- REPLICATION = 'replication'
- SEARCH_INDEXER = 'search_indexer'
- VIEW_COMPACTION = 'view_compaction'
- 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])
Schema for Activity Tracker events.
- 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.
Initialization
Initialize a ActivityTrackerEvents object.
- 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.
- class TypesEnum
Bases:
str
,enum.Enum
types.
Initialization
Initialize self. See help(type(self)) for accurate signature.
- DATA = 'data'
- MANAGEMENT = 'management'
- 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])
Schema for the result of an all documents queries operation.
- Parameters:
results (List[AllDocsResult]) – 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.
Initialization
Initialize a AllDocsQueriesResult object.
- Parameters:
results (List[AllDocsResult]) – 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, end_key: Optional[str] = None, key: Optional[str] = None, keys: Optional[List[str]] = None, start_key: Optional[str] = None)
Schema for an all documents query operation.
- Parameters:
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 each returned document. Active only when
include_docs
istrue
.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.
end_key (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.
start_key (str) – (optional) Schema for a document ID.
Initialization
Initialize a AllDocsQuery object.
- Parameters:
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 each returned document. Active only when
include_docs
istrue
.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.
end_key (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.
start_key (str) – (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)
Schema for the result of an all documents operation.
- Parameters:
total_rows (int) – Number of total rows.
rows (List[DocsResultRow]) – List of doc results.
update_seq (str) – (optional) Current update sequence for the database.
Initialization
Initialize a AllDocsResult object.
- Parameters:
total_rows (int) – Number of total rows.
rows (List[DocsResultRow]) – List of doc results.
update_seq (str) – (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)
Schema for a full text search analyzer.
- Parameters:
name (str) –
(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 iskeyword
* For a query text index default_field the default isstandard
.
stopwords (List[str]) – (optional) Custom stopwords to use with the named analyzer.
Initialization
Initialize a Analyzer object.
- Parameters:
name (str) –
(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 iskeyword
* For a query text index default_field the default isstandard
.
stopwords (List[str]) – (optional) Custom stopwords to use with the named analyzer.
- class NameEnum
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 iskeyword
* For a query text index default_field the default isstandard
.
Initialization
Initialize self. See help(type(self)) for accurate signature.
- 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)
Schema for a search analyzer configuration.
- Parameters:
name (str) –
(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 iskeyword
* For a query text index default_field the default isstandard
.
stopwords (List[str]) – (optional) Custom stopwords to use with the named analyzer.
fields (dict) – (optional) Schema for mapping a field name to a per field analyzer.
Initialization
Initialize a AnalyzerConfiguration object.
- Parameters:
name (str) –
(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 iskeyword
* For a query text index default_field the default isstandard
.
stopwords (List[str]) – (optional) Custom stopwords to use with the named analyzer.
fields (dict) – (optional) Schema for mapping a field name to a per field analyzer.
- class NameEnum
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 iskeyword
* For a query text index default_field the default isstandard
.
Initialization
Initialize self. See help(type(self)) for accurate signature.
- 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)
Schema for api keys.
- Parameters:
ok (bool) – ok.
key (str) – The generated api key.
password (str) – The password associated with the api key.
Initialization
Initialize a ApiKeysResult object.
- Parameters:
ok (bool) – ok.
key (str) – The generated api key.
password (str) – 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)
Schema for an attachment.
- Parameters:
content_type (str) – (optional) Attachment MIME type.
data (bytes) – (optional) Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.digest (str) – (optional) Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.encoded_length (int) – (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
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.encoding (str) – (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
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.follows (bool) – (optional) True if the attachment follows in a multipart request or response.
length (int) – (optional) Real attachment size in bytes. Not available if inline attachment content requested.
revpos (int) – (optional) Revision number when attachment was added.
stub (bool) – (optional) Has
true
value if object contains stub info and no content. Otherwise omitted in response.
Initialization
Initialize a Attachment object.
- Parameters:
content_type (str) – (optional) Attachment MIME type.
data (bytes) – (optional) Base64-encoded content. Available if attachment content is requested by using the query parameters
attachments=true
oratts_since
. Note that when used with a view or changes feedinclude_docs
must also betrue
.digest (str) – (optional) Content hash digest. It starts with prefix which announce hash type (e.g.
md5-
) and continues with Base64-encoded hash digest.encoded_length (int) – (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
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.encoding (str) – (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
istrue
. Note that when used with a view or changes feedinclude_docs
must also betrue
.follows (bool) – (optional) True if the attachment follows in a multipart request or response.
length (int) – (optional) Real attachment size in bytes. Not available if inline attachment content requested.
revpos (int) – (optional) Revision number when attachment was added.
stub (bool) – (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)
Schema for submitting documents for bulk modifications.
- Parameters:
docs (List[Document]) – Array of documents.
new_edits (bool) – (optional) If
false
, prevents the database from assigning them new revision IDs. Default istrue
.
Initialization
Initialize a BulkDocs object.
- Parameters:
docs (List[Document]) – Array of documents.
new_edits (bool) – (optional) If
false
, prevents the database from assigning them new revision IDs. Default istrue
.
- 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)
Schema for a document item in a bulk get query.
- Parameters:
atts_since (List[str]) – (optional) Includes attachments only since specified revisions.
id (str) – Schema for a document ID.
rev (str) – (optional) Schema for a document revision identifier.
Initialization
Initialize a BulkGetQueryDocument object.
- Parameters:
id (str) – Schema for a document ID.
atts_since (List[str]) – (optional) Includes attachments only since specified revisions.
rev (str) – (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])
Schema for the results object of a bulk get operation.
- Parameters:
results (List[BulkGetResultItem]) – Results.
Initialization
Initialize a BulkGetResult object.
- Parameters:
results (List[BulkGetResultItem]) – 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)
Schema for BulkGetResult object containing a successfully retrieved document or error information.
- Parameters:
error (DocumentResult) – (optional) Schema for the result of a document modification.
ok (Document) – (optional) Schema for a document.
Initialization
Initialize a BulkGetResultDocument object.
- Parameters:
error (DocumentResult) – (optional) Schema for the result of a document modification.
ok (Document) – (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)
Schema for the document revisions information from a bulk get operation.
- Parameters:
docs (List[BulkGetResultDocument]) – Array of document revisions or error information.
id (str) – Schema for a document ID.
Initialization
Initialize a BulkGetResultItem object.
- Parameters:
docs (List[BulkGetResultDocument]) – Array of document revisions or error information.
id (str) – 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)
Schema for information about the currently provisioned and target throughput capacity.
- Parameters:
current (CapacityThroughputInformationCurrent) – Detailed information about provisioned throughput capacity.
target (CapacityThroughputInformationTarget) – (optional) Detailed information about target throughput capacity.
Initialization
Initialize a CapacityThroughputInformation object.
- Parameters:
current (CapacityThroughputInformationCurrent) – Detailed information about provisioned throughput capacity.
target (CapacityThroughputInformationTarget) – (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)
Detailed information about provisioned throughput capacity.
- Parameters:
throughput (ThroughputInformation) – Schema for detailed information about throughput capacity with breakdown by specific throughput requests classes.
Initialization
Initialize a CapacityThroughputInformationCurrent object.
- Parameters:
throughput (ThroughputInformation) – 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)
Detailed information about target throughput capacity.
- Parameters:
throughput (ThroughputInformation) – Schema for detailed information about throughput capacity with breakdown by specific throughput requests classes.
Initialization
Initialize a CapacityThroughputInformationTarget object.
- Parameters:
throughput (ThroughputInformation) – 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)
Schema for a document leaf with single field rev.
- Parameters:
rev (str) – Schema for a document revision identifier.
Initialization
Initialize a Change object.
- Parameters:
rev (str) – 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])
Schema for normal changes feed result.
- Parameters:
last_seq (str) – last_seq.
pending (int) – pending.
results (List[ChangesResultItem]) – results.
Initialization
Initialize a ChangesResult object.
- Parameters:
last_seq (str) – last_seq.
pending (int) – pending.
results (List[ChangesResultItem]) – 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)
Schema for an item in the changes results array.
- Parameters:
Initialization
Initialize a ChangesResultItem object.
- Parameters:
- 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: ibm_cloud_sdk_core.authenticators.authenticator.Authenticator = None)
Bases:
ibm_cloud_sdk_core.BaseService
The Cloudant V1 service.
Initialization
Construct a new client for the Cloudant service.
- Parameters:
authenticator (Authenticator) – The authenticator specifies the authentication mechanism. Get up to date information from https://github.com/IBM/python-sdk-core/blob/main/README.md about initializing the authenticator of your choice.
- DEFAULT_SERVICE_NAME = 'cloudant'
- DEFAULT_SERVICE_URL = 'http://localhost:5984'
- 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.DetailedResponse
Delete an attachment.
Deletes the attachment with the filename,
{attachment_name}
, from the specified doc. You must supply therev
query parameter orIf-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 aDocumentResult
object
- delete_database(db: str, **kwargs) ibm_cloud_sdk_core.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 aOk
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.DetailedResponse
Delete a design document.
Marks the specified design document as deleted by adding a
_deleted
field with the valuetrue
. Documents with this field are not returned with requests but stay in the database. You must supply the current (latest) revision, either by using therev
parameter or by using theIf-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 aDocumentResult
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.DetailedResponse
Delete a document.
Marks the specified document as deleted by adding a
_deleted
field with the valuetrue
. 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 therev
parameter or by using theIf-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 aDocumentResult
object
- delete_index(db: str, ddoc: str, type: str, index: str, **kwargs) ibm_cloud_sdk_core.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 aOk
object
- delete_local_document(db: str, doc_id: str, *, batch: Optional[str] = None, **kwargs) ibm_cloud_sdk_core.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 aDocumentResult
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.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 aDocumentResult
object
- get_active_tasks(**kwargs) ibm_cloud_sdk_core.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.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 aActivityTrackerEvents
object
- get_all_dbs(*, descending: Optional[bool] = None, end_key: Optional[str] = None, limit: Optional[int] = None, skip: Optional[int] = None, start_key: Optional[str] = None, **kwargs) ibm_cloud_sdk_core.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.
end_key (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.
start_key (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.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.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 aCapacityThroughputInformation
object
- get_cors_information(**kwargs) ibm_cloud_sdk_core.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 aCorsInformation
object
- get_current_throughput_information(**kwargs) ibm_cloud_sdk_core.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 aCurrentThroughputInformation
object
- get_database_information(db: str, **kwargs) ibm_cloud_sdk_core.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 aDatabaseInformation
object
- get_db_updates(*, descending: Optional[bool] = None, feed: Optional[str] = None, heartbeat: Optional[int] = None, limit: Optional[int] = None, timeout: Optional[int] = None, since: Optional[str] = None, **kwargs) ibm_cloud_sdk_core.DetailedResponse
Retrieve change events for all databases.
This endpoint is not available in IBM Cloudant. 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.
- Parameters:
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.
heartbeat (int) –
(optional) Query parameter to specify the period in milliseconds after which an empty line is sent in the results. Off by default and only applicable for
continuous
andeventsource
feeds. Overrides any timeout to keep the feed alive indefinitely. May also betrue
to use a value of60000
. Note: Delivery of heartbeats cannot be relied on at specific intervals. If your application runs in an environment where idle network connections may break,heartbeat
is not suitable as a keepalive mechanism. Instead, consider one of the following options:Use the
timeout
parameter with a value that is compatible with your network environment.Switch to scheduled usage of one of the non-continuous changes feed types (
normal
orlongpoll
).Use TCP keepalive.
limit (int) – (optional) Query parameter to specify the number of returned documents to limit the result to.
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
orcontinuous
feeds. Default value is specified byhttpd/changes_timeout
configuration option. Note that60000
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 is0
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 aDbUpdates
object
Deprecated: this method is deprecated and may be removed in a future release.
- 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.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 each returned document. Active only when
include_docs
istrue
.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 aDesignDocument
object
- get_design_document_information(db: str, ddoc: str, **kwargs) ibm_cloud_sdk_core.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 aDesignDocumentInformation
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.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 each returned document. Active only when
include_docs
istrue
.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 aDocument
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.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 each returned document. Active only when
include_docs
istrue
.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 each returned document. Active only when
include_docs
istrue
.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.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 each returned document. Active only when
include_docs
istrue
.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.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 aDocumentShardInfo
object
- get_indexes_information(db: str, **kwargs) ibm_cloud_sdk_core.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 theindexes
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 aIndexesInformation
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.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 aDocument
object
- get_membership_information(**kwargs) ibm_cloud_sdk_core.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 aMembershipInformation
object
- get_partition_information(db: str, partition_key: str, **kwargs) ibm_cloud_sdk_core.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 aPartitionInformation
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.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 each returned document. Active only when
include_docs
istrue
.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 aReplicationDocument
object
- get_scheduler_docs(*, limit: Optional[int] = None, skip: Optional[int] = None, states: Optional[List[str]] = None, **kwargs) ibm_cloud_sdk_core.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 aSchedulerDocsResult
object
- get_scheduler_document(doc_id: str, **kwargs) ibm_cloud_sdk_core.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 aSchedulerDocument
object
- get_scheduler_job(job_id: str, **kwargs) ibm_cloud_sdk_core.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 aSchedulerJob
object
- get_scheduler_jobs(*, limit: Optional[int] = None, skip: Optional[int] = None, **kwargs) ibm_cloud_sdk_core.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 jobs 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 aSchedulerJobsResult
object
- get_search_info(db: str, ddoc: str, index: str, **kwargs) ibm_cloud_sdk_core.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 aSearchInfoResult
object
- get_security(db: str, **kwargs) ibm_cloud_sdk_core.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 aSecurity
object
- get_server_information(**kwargs) ibm_cloud_sdk_core.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. Tip: The authentication for this endpoint is only enforced when using IAM.
- 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 aServerInformation
object
- get_session_information(**kwargs) ibm_cloud_sdk_core.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 aSessionInformation
object
- get_shards_information(db: str, **kwargs) ibm_cloud_sdk_core.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 aShardsInformation
object
- get_up_information(**kwargs) ibm_cloud_sdk_core.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
istrue
ornolb
, the endpoint returns a 404 response. Tip: The authentication for this endpoint is only enforced when using IAM.- 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 aUpInformation
object
- get_uuids(*, count: Optional[int] = None, **kwargs) ibm_cloud_sdk_core.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. Tip: The authentication for this endpoint is only enforced when using IAM.
- 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 aUuidsResult
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.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.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.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.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.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.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 theGET /_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.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.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.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 = DEFAULT_SERVICE_NAME) 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.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 aOk
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, end_key: Optional[str] = None, key: Optional[str] = None, keys: Optional[List[str]] = None, start_key: Optional[str] = None, **kwargs) ibm_cloud_sdk_core.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 each returned document. Active only when
include_docs
istrue
.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.
end_key (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.
start_key (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 aAllDocsResult
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, end_key: Optional[str] = None, key: Optional[str] = None, keys: Optional[List[str]] = None, start_key: Optional[str] = None, **kwargs) ibm_cloud_sdk_core.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 each returned document. Active only when
include_docs
istrue
.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.
end_key (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.
start_key (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.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 multiplePOST /{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 aAllDocsQueriesResult
object
- post_all_docs_queries_as_stream(db: str, queries: List[ibmcloudant.cloudant_v1.AllDocsQuery], **kwargs) ibm_cloud_sdk_core.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 multiplePOST /{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.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 aApiKeysResult
object
- post_bulk_docs(db: str, bulk_docs: Union[ibmcloudant.cloudant_v1.BulkDocs, BinaryIO], **kwargs) ibm_cloud_sdk_core.DetailedResponse
Bulk modify multiple documents in a database.
The bulk document API allows you to create, update, and delete multiple documents at the same time within a single request. The basic operation is similar to creating, updating, or deleting 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.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 aBulkGetResult
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.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.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.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 thefilter
query parameter because it allows one to pass more information to the filter.Tip
Before using the changes feed we recommend reading the FAQs to understand the limitations and appropriate use cases.
- 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 or empty, 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. 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. See the Cloudant Docs for a list of all available combination and conditional operators.Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. For further reference see selector syntax.
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 each returned document. Active only when
include_docs
istrue
.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 indoc_ids
request body parameter._selector
- Returns changes for documents that match theselector
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 parameterview
.
heartbeat (int) –
(optional) Query parameter to specify the period in milliseconds after which an empty line is sent in the results. Off by default and only applicable for
continuous
andeventsource
feeds. Overrides any timeout to keep the feed alive indefinitely. May also betrue
to use a value of60000
. Note: Delivery of heartbeats cannot be relied on at specific intervals. If your application runs in an environment where idle network connections may break,heartbeat
is not suitable as a keepalive mechanism. Instead, consider one of the following options:Use the
timeout
parameter with a value that is compatible with your network environment.Switch to scheduled usage of one of the non-continuous changes feed types (
normal
orlongpoll
).Use TCP keepalive.
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
seq_interval=<batch size>
, 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 is0
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
orcontinuous
feeds. Default value is specified byhttpd/changes_timeout
configuration option. Note that60000
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 aChangesResult
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.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 thefilter
query parameter because it allows one to pass more information to the filter.Tip
Before using the changes feed we recommend reading the FAQs to understand the limitations and appropriate use cases.
- 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 or empty, 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. 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. See the Cloudant Docs for a list of all available combination and conditional operators.Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. For further reference see selector syntax.
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 each returned document. Active only when
include_docs
istrue
.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 indoc_ids
request body parameter._selector
- Returns changes for documents that match theselector
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 parameterview
.
heartbeat (int) –
(optional) Query parameter to specify the period in milliseconds after which an empty line is sent in the results. Off by default and only applicable for
continuous
andeventsource
feeds. Overrides any timeout to keep the feed alive indefinitely. May also betrue
to use a value of60000
. Note: Delivery of heartbeats cannot be relied on at specific intervals. If your application runs in an environment where idle network connections may break,heartbeat
is not suitable as a keepalive mechanism. Instead, consider one of the following options:Use the
timeout
parameter with a value that is compatible with your network environment.Switch to scheduled usage of one of the non-continuous changes feed types (
normal
orlongpoll
).Use TCP keepalive.
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
seq_interval=<batch size>
, 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 is0
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
orcontinuous
feeds. Default value is specified byhttpd/changes_timeout
configuration option. Note that60000
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.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, end_key: Optional[str] = None, key: Optional[str] = None, keys: Optional[List[str]] = None, start_key: Optional[str] = None, accept: Optional[str] = None, **kwargs) ibm_cloud_sdk_core.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 each returned document. Active only when
include_docs
istrue
.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.
end_key (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.
start_key (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 aAllDocsResult
object
- post_design_docs_queries(db: str, queries: List[ibmcloudant.cloudant_v1.AllDocsQuery], *, accept: Optional[str] = None, **kwargs) ibm_cloud_sdk_core.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 aAllDocsQueriesResult
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.DetailedResponse
Create or modify a document in a database.
Creates or modifies a document in the specified database by using the supplied JSON document. For creation, you may specify the document ID but you should not specify the revision. If you don’t specify the document ID, then the server generates an ID for your document. For modification, you must specify the document ID and a revision identifier in the JSON document. If your document ID includes the
_local/
or_design/
prefix, then this operation creates or modifies a local or a design document 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 aDocumentResult
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.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.- 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. 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. See the Cloudant Docs for a list of all available combination and conditional operators.Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. For further reference see selector syntax.
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 or empty, 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, ensure that there is an index already defined with all the sort fields in the same order and each object in the sort array has a single key or at least one of the sort fields is included in the selector. All sorting fields 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 aExplainResult
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.DetailedResponse
Query an index by using selector syntax.
Query documents by using a declarative JSON querying syntax. It’s best practice to create an appropriate index for all fields in selector by using the
_index
endpoint. Queries without an appropriate backing index will fallback to using the built-in_all_docs
index. This is not recommended because it has a significant performance impact causing a full scan of the database with each request. In this case the response body will include a warning field recommending that an index is created.- 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. 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. See the Cloudant Docs for a list of all available combination and conditional operators.Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. For further reference see selector syntax.
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 or empty, 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, ensure that there is an index already defined with all the sort fields in the same order and each object in the sort array has a single key or at least one of the sort fields is included in the selector. All sorting fields 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 aFindResult
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.DetailedResponse
Query an index by using selector syntax as stream.
Query documents by using a declarative JSON querying syntax. It’s best practice to create an appropriate index for all fields in selector by using the
_index
endpoint. Queries without an appropriate backing index will fallback to using the built-in_all_docs
index. This is not recommended because it has a significant performance impact causing a full scan of the database with each request. In this case the response body will include a warning field recommending that an index is created.- 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. 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. See the Cloudant Docs for a list of all available combination and conditional operators.Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. For further reference see selector syntax.
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 or empty, 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, ensure that there is an index already defined with all the sort fields in the same order and each object in the sort array has a single key or at least one of the sort fields is included in the selector. All sorting fields 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_index(db: str, index: ibmcloudant.cloudant_v1.IndexDefinition, *, ddoc: Optional[str] = None, name: Optional[str] = None, partitioned: Optional[bool] = None, type: Optional[str] = None, **kwargs) ibm_cloud_sdk_core.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
ortext
query index definition. Indexes of typetext
have additional configuration properties that do not apply tojson
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) Specifies the design document name in which the index will be created. The design document name is the design document ID excluding the
_design/
prefix.name (str) – (optional) name.
partitioned (bool) – (optional) The default value is
true
for databases withpartitioned: true
andfalse
otherwise. For databases withpartitioned: false
if this option is specified the value must befalse
.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 aIndexResult
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, end_key: Optional[str] = None, key: Optional[str] = None, keys: Optional[List[str]] = None, start_key: Optional[str] = None, **kwargs) ibm_cloud_sdk_core.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 each returned document. Active only when
include_docs
istrue
.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.
end_key (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.
start_key (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 aAllDocsResult
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, end_key: Optional[str] = None, key: Optional[str] = None, keys: Optional[List[str]] = None, start_key: Optional[str] = None, **kwargs) ibm_cloud_sdk_core.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 each returned document. Active only when
include_docs
istrue
.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.
end_key (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.
start_key (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_explain(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.DetailedResponse
Retrieve information about which partition index is used for a query.
Shows which index is being used by the query. Parameters are the same as the
/{db}/_partition/{partition_key}/_find
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. 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. See the Cloudant Docs for a list of all available combination and conditional operators.Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. For further reference see selector syntax.
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 or empty, 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, ensure that there is an index already defined with all the sort fields in the same order and each object in the sort array has a single key or at least one of the sort fields is included in the selector. All sorting fields 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 aExplainResult
object
- 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.DetailedResponse
Query a database partition index by using selector syntax.
Query documents by using a declarative JSON querying syntax. It’s best practice to create an appropriate index for all fields in selector by using the
_index
endpoint. Queries without an appropriate backing index will fallback to using the built-in_all_docs
index. This is not recommended because it has a noticeable performance impact causing a full scan of the partition with each request. In this case the response body will include a warning field recommending that an index is created.- 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. 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. See the Cloudant Docs for a list of all available combination and conditional operators.Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. For further reference see selector syntax.
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 or empty, 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, ensure that there is an index already defined with all the sort fields in the same order and each object in the sort array has a single key or at least one of the sort fields is included in the selector. All sorting fields 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 aFindResult
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.DetailedResponse
Query a database partition index by using selector syntax as stream.
Query documents by using a declarative JSON querying syntax. It’s best practice to create an appropriate index for all fields in selector by using the
_index
endpoint. Queries without an appropriate backing index will fallback to using the built-in_all_docs
index. This is not recommended because it has a noticeable performance impact causing a full scan of the partition with each request. In this case the response body will include a warning field recommending that an index is created.- 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. 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. See the Cloudant Docs for a list of all available combination and conditional operators.Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. For further reference see selector syntax.
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 or empty, 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, ensure that there is an index already defined with all the sort fields in the same order and each object in the sort array has a single key or at least one of the sort fields is included in the selector. All sorting fields 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.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 aSearchResult
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.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, end_key: Optional[object] = None, end_key_doc_id: 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, start_key: Optional[object] = None, start_key_doc_id: Optional[str] = None, update: Optional[str] = None, **kwargs) ibm_cloud_sdk_core.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 theGET /{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 each returned document. Active only when
include_docs
istrue
.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.
end_key (object) – (optional) Schema for any JSON type.
end_key_doc_id (str) – (optional) Schema for a document ID.
group (bool) – (optional) Parameter to specify whether to group reduced results by key. Valid only if a reduce function defined in the view. If the view emits key in JSON array format, then it is possible to reduce groups further based on the number of array elements with the
group_level
parameter.group_level (int) – (optional) Parameter to specify a group level to be used. Only applicable if the view uses keys that are JSON arrays. Implies group is
true
. Group level groups the reduced results by the specified number of array elements. If unset, results are grouped by the entire array key, returning a reduced value for each complete key.key (object) – (optional) Schema for any JSON type.
keys (List[object]) – (optional) Parameter to specify returning only documents that match any of the specified keys. A JSON array of keys 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.
start_key (object) – (optional) Schema for any JSON type.
start_key_doc_id (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.
true
- Return results after the view is updated.false
- Return results without updating the view.lazy
- Return the view results without waiting for an update, but update them immediately after the 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 aViewResult
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, end_key: Optional[object] = None, end_key_doc_id: 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, start_key: Optional[object] = None, start_key_doc_id: Optional[str] = None, update: Optional[str] = None, **kwargs) ibm_cloud_sdk_core.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 theGET /{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 each returned document. Active only when
include_docs
istrue
.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.
end_key (object) – (optional) Schema for any JSON type.
end_key_doc_id (str) – (optional) Schema for a document ID.
group (bool) – (optional) Parameter to specify whether to group reduced results by key. Valid only if a reduce function defined in the view. If the view emits key in JSON array format, then it is possible to reduce groups further based on the number of array elements with the
group_level
parameter.group_level (int) – (optional) Parameter to specify a group level to be used. Only applicable if the view uses keys that are JSON arrays. Implies group is
true
. Group level groups the reduced results by the specified number of array elements. If unset, results are grouped by the entire array key, returning a reduced value for each complete key.key (object) – (optional) Schema for any JSON type.
keys (List[object]) – (optional) Parameter to specify returning only documents that match any of the specified keys. A JSON array of keys 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.
start_key (object) – (optional) Schema for any JSON type.
start_key_doc_id (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.
true
- Return results after the view is updated.false
- Return results without updating the view.lazy
- Return the view results without waiting for an update, but update them immediately after the 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_revs_diff(db: str, document_revisions: dict, **kwargs) ibm_cloud_sdk_core.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 adict
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.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 aGET
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 aSearchResult
object
- post_search_analyze(analyzer: str, text: str, **kwargs) ibm_cloud_sdk_core.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 aSearchAnalyzeResult
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.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 aGET
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, end_key: Optional[object] = None, end_key_doc_id: 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, start_key: Optional[object] = None, start_key_doc_id: Optional[str] = None, update: Optional[str] = None, **kwargs) ibm_cloud_sdk_core.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 aGET
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 each returned document. Active only when
include_docs
istrue
.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.
end_key (object) – (optional) Schema for any JSON type.
end_key_doc_id (str) – (optional) Schema for a document ID.
group (bool) – (optional) Parameter to specify whether to group reduced results by key. Valid only if a reduce function defined in the view. If the view emits key in JSON array format, then it is possible to reduce groups further based on the number of array elements with the
group_level
parameter.group_level (int) – (optional) Parameter to specify a group level to be used. Only applicable if the view uses keys that are JSON arrays. Implies group is
true
. Group level groups the reduced results by the specified number of array elements. If unset, results are grouped by the entire array key, returning a reduced value for each complete key.key (object) – (optional) Schema for any JSON type.
keys (List[object]) – (optional) Parameter to specify returning only documents that match any of the specified keys. A JSON array of keys 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) Query parameter to specify whether use the same replica of the index on each request. The default value
false
contacts all replicas and returns the result from the first, fastest, responder. Setting it totrue
when used in conjunction withupdate=false
may improve consistency at the expense of increased latency and decreased throughput if the selected replica is not the fastest of the available replicas. Note: In general settingtrue
is discouraged and is strictly not recommended when usingupdate=true
.start_key (object) – (optional) Schema for any JSON type.
start_key_doc_id (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.
true
- Return results after the view is updated.false
- Return results without updating the view.lazy
- Return the view results without waiting for an update, but update them immediately after the 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 aViewResult
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, end_key: Optional[object] = None, end_key_doc_id: 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, start_key: Optional[object] = None, start_key_doc_id: Optional[str] = None, update: Optional[str] = None, **kwargs) ibm_cloud_sdk_core.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 aGET
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 each returned document. Active only when
include_docs
istrue
.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.
end_key (object) – (optional) Schema for any JSON type.
end_key_doc_id (str) – (optional) Schema for a document ID.
group (bool) – (optional) Parameter to specify whether to group reduced results by key. Valid only if a reduce function defined in the view. If the view emits key in JSON array format, then it is possible to reduce groups further based on the number of array elements with the
group_level
parameter.group_level (int) – (optional) Parameter to specify a group level to be used. Only applicable if the view uses keys that are JSON arrays. Implies group is
true
. Group level groups the reduced results by the specified number of array elements. If unset, results are grouped by the entire array key, returning a reduced value for each complete key.key (object) – (optional) Schema for any JSON type.
keys (List[object]) – (optional) Parameter to specify returning only documents that match any of the specified keys. A JSON array of keys 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) Query parameter to specify whether use the same replica of the index on each request. The default value
false
contacts all replicas and returns the result from the first, fastest, responder. Setting it totrue
when used in conjunction withupdate=false
may improve consistency at the expense of increased latency and decreased throughput if the selected replica is not the fastest of the available replicas. Note: In general settingtrue
is discouraged and is strictly not recommended when usingupdate=true
.start_key (object) – (optional) Schema for any JSON type.
start_key_doc_id (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.
true
- Return results after the view is updated.false
- Return results without updating the view.lazy
- Return the view results without waiting for an update, but update them immediately after the 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_view_queries(db: str, ddoc: str, view: str, queries: List[ibmcloudant.cloudant_v1.ViewQuery], **kwargs) ibm_cloud_sdk_core.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 aViewQueriesResult
object
- post_view_queries_as_stream(db: str, ddoc: str, view: str, queries: List[ibmcloudant.cloudant_v1.ViewQuery], **kwargs) ibm_cloud_sdk_core.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
- 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.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 theIf-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 aDocumentResult
object
- put_capacity_throughput_configuration(blocks: int, **kwargs) ibm_cloud_sdk_core.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 aCapacityThroughputInformation
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.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.
Tip
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 thenobody
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 aOk
object
- put_cors_configuration(origins: List[str], *, allow_credentials: Optional[bool] = None, enable_cors: Optional[bool] = None, **kwargs) ibm_cloud_sdk_core.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 aOk
object
- put_database(db: str, *, partitioned: Optional[bool] = None, q: Optional[int] = None, **kwargs) ibm_cloud_sdk_core.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. Cloudant recommends using the default value for most databases. However, if your database is expected to be larger than 250 GB or have a lot of indexes, you may need to adjust the settings. In these cases, it’s best to reach out to IBM Cloudant customer support for guidance on how to meet your specific needs and requirements.
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 aOk
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.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 aDocumentResult
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.DetailedResponse
Create or modify a document.
Creates or modifies a document in the specified database. For creation, you must specify the document ID but you should not specify the revision. For modification, you must specify the document ID and a revision identifier.
- 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 aDocumentResult
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.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 aDocumentResult
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.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 aDocumentResult
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.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.
Tip
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 thenobody
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 aOk
object
- class ibmcloudant.cloudant_v1.ContentInformationSizes(active: int, external: int, file: int)
Schema for size information of content.
- Parameters:
active (int) – The active size of the content, in bytes.
external (int) – The total uncompressed size of the content, in bytes.
file (int) – The total size of the content as stored on disk, in bytes.
Initialization
Initialize a ContentInformationSizes object.
- Parameters:
active (int) – The active size of the content, in bytes.
external (int) – The total uncompressed size of the content, in bytes.
file (int) – 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])
Schema for information about the CORS configuration.
- Parameters:
allow_credentials (bool) – Boolean value to allow authentication credentials. If set to true, browser requests must be done by using withCredentials = true.
enable_cors (bool) – Boolean value to turn CORS on and off.
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.
Initialization
Initialize a CorsInformation object.
- Parameters:
allow_credentials (bool) – Boolean value to allow authentication credentials. If set to true, browser requests must be done by using withCredentials = true.
enable_cors (bool) – Boolean value to turn CORS on and off.
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.
- 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)
Schema for information about current consumption of a provisioned throughput capacity.
- Parameters:
throughput (CurrentThroughputInformationThroughput) – Detailed information about current consumption.
Initialization
Initialize a CurrentThroughputInformation object.
- Parameters:
throughput (CurrentThroughputInformationThroughput) – 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)
Detailed information about current consumption.
- Parameters:
query (int) – Number of global queries conducted against the instance for a given second.
read (int) – Number of reads conducted against the instance for a given second.
write (int) – Number of writes conducted against the instance for a given second.
Initialization
Initialize a CurrentThroughputInformationThroughput object.
- Parameters:
query (int) – Number of global queries conducted against the instance for a given second.
read (int) – Number of reads conducted against the instance for a given second.
write (int) – 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, partitioned_indexes: Optional[ibmcloudant.cloudant_v1.PartitionedIndexesInformation] = None)
Schema for information about a database.
- Parameters:
cluster (DatabaseInformationCluster) – Schema for database cluster information.
committed_update_seq (str) – (optional) An opaque string that describes the committed state of the database.
compact_running (bool) – True if the database compaction routine is operating on this database.
compacted_seq (str) – (optional) An opaque string that describes the compaction state of the database.
db_name (str) – The name of the database.
disk_format_version (int) – The version of the physical format used for the data when it is stored on disk.
doc_count (int) – A count of the documents in the specified database.
doc_del_count (int) – Number of deleted documents.
engine (str) – (optional) The engine used for the database.
props (DatabaseInformationProps) – Schema for database properties.
sizes (ContentInformationSizes) – Schema for size information of content.
update_seq (str) – An opaque string that describes the state of the database. Do not rely on this string for counting the number of updates.
uuid (str) – (optional) The UUID of the database.
partitioned_indexes (PartitionedIndexesInformation) – (optional) Information about database’s partitioned indexes.
Initialization
Initialize a DatabaseInformation object.
- Parameters:
cluster (DatabaseInformationCluster) – Schema for database cluster information.
compact_running (bool) – True if the database compaction routine is operating on this database.
db_name (str) – The name of the database.
disk_format_version (int) – The version of the physical format used for the data when it is stored on disk.
doc_count (int) – A count of the documents in the specified database.
doc_del_count (int) – Number of deleted documents.
props (DatabaseInformationProps) – Schema for database properties.
sizes (ContentInformationSizes) – Schema for size information of content.
update_seq (str) – An opaque string that describes the state of the database. Do not rely on this string for counting the number of updates.
committed_update_seq (str) – (optional) An opaque string that describes the committed state of the database.
compacted_seq (str) – (optional) An opaque string that describes the compaction state of the database.
engine (str) – (optional) The engine used for the database.
uuid (str) – (optional) The UUID of the database.
partitioned_indexes (PartitionedIndexesInformation) – (optional) Information about database’s partitioned indexes.
- 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)
Schema for database cluster information.
- Parameters:
n (int) – Schema for the number of replicas of a database in a cluster. The cluster is using the default value and it cannot be changed by the user.
q (int) – Schema for the number of shards in a database. Each shard is a partition of the hash value range.
r (int) – Read quorum. The number of consistent copies of a document that need to be read before a successful reply.
w (int) – Write quorum. The number of copies of a document that need to be written before a successful reply.
Initialization
Initialize a DatabaseInformationCluster object.
- Parameters:
n (int) – Schema for the number of replicas of a database in a cluster. The cluster is using the default value and it cannot be changed by the user.
q (int) – Schema for the number of shards in a database. Each shard is a partition of the hash value range.
r (int) – Read quorum. The number of consistent copies of a document that need to be read before a successful reply.
w (int) – 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)
Schema for database properties.
- Parameters:
partitioned (bool) – (optional) The value is
true
for a partitioned database.
Initialization
Initialize a DatabaseInformationProps object.
- Parameters:
partitioned (bool) – (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)
Schema for a database change event.
- Parameters:
db_name (str) – Database name.
seq (str) – Sequence number.
type (str) – A database event.
Initialization
Initialize a DbEvent object.
- Parameters:
db_name (str) – Database name.
seq (str) – Sequence number.
type (str) – A database event.
- class TypeEnum
Bases:
str
,enum.Enum
A database event.
Initialization
Initialize self. See help(type(self)) for accurate signature.
- 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])
Schema for database updates.
- Parameters:
last_seq (str) – Last sequence number.
results (List[DbEvent]) – results.
Initialization
Initialize a DbUpdates object.
- Parameters:
last_seq (str) – Last sequence number.
results (List[DbEvent]) – 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)
Schema for database information keyed by database name.
- Parameters:
error (str) – (optional) The name of the error.
info (DatabaseInformation) – (optional) Schema for information about a database.
key (str) – Database name.
Initialization
Initialize a DbsInfoResult object.
- Parameters:
key (str) – Database name.
error (str) – (optional) The name of the error.
info (DatabaseInformation) – (optional) Schema for information about a database.
- 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
Enums for delete_attachment parameters.
- class ibmcloudant.cloudant_v1.DeleteDesignDocumentEnums
Enums for delete_design_document parameters.
- class ibmcloudant.cloudant_v1.DeleteDocumentEnums
Enums for delete_document parameters.
- class ibmcloudant.cloudant_v1.DeleteIndexEnums
Enums for delete_index parameters.
- class ibmcloudant.cloudant_v1.DeleteLocalDocumentEnums
Enums for delete_local_document parameters.
- class ibmcloudant.cloudant_v1.DeleteReplicationDocumentEnums
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, **kwargs)
Schema for a design document.
- Parameters:
attachments (dict) – (optional) Schema for a map of attachment name to attachment metadata.
conflicts (List[str]) – (optional) Schema for a list of document revision identifiers.
deleted (bool) – (optional) Deletion flag. Available if document was removed.
deleted_conflicts (List[str]) – (optional) Schema for a list of document revision identifiers.
id (str) – (optional) Document ID.
local_seq (str) – (optional) Document’s update sequence in current database. Available if requested with local_seq=true query parameter.
rev (str) – (optional) Schema for a document revision identifier.
revisions (Revisions) – (optional) Schema for list of revision information.
revs_info (List[DocumentRevisionStatus]) – (optional) Schema for a list of objects with information about local revisions and their status.
autoupdate (bool) – (optional) Indicates whether to automatically build indexes defined in this design document.
filters (dict) –
(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, seeDatabaseInformation
.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 theUserContext
.secObj
: Security Object, with lists of database security roles, see theSecurityObject
.uuid
- string, generated UUID by a specified algorithm in the config file. Filter functions must return true if a document passed all the rules.
indexes (dict) – (optional) Search (text) index function definitions.
language (str) – (optional) Defines Query Server key to process design document functions.
options (DesignDocumentOptions) – (optional) Schema for design document options.
validate_doc_update (str) –
(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 theUserContext
.secObj
- Security Object, with lists of database security roles, see theSecurityObject
.
views (dict) – (optional) Schema for design document views.
Initialization
Initialize a DesignDocument object.
- Parameters:
attachments (dict) – (optional) Schema for a map of attachment name to attachment metadata.
conflicts (List[str]) – (optional) Schema for a list of document revision identifiers.
deleted (bool) – (optional) Deletion flag. Available if document was removed.
deleted_conflicts (List[str]) – (optional) Schema for a list of document revision identifiers.
id (str) – (optional) Document ID.
local_seq (str) – (optional) Document’s update sequence in current database. Available if requested with local_seq=true query parameter.
rev (str) – (optional) Schema for a document revision identifier.
revisions (Revisions) – (optional) Schema for list of revision information.
revs_info (List[DocumentRevisionStatus]) – (optional) Schema for a list of objects with information about local revisions and their status.
autoupdate (bool) – (optional) Indicates whether to automatically build indexes defined in this design document.
filters (dict) –
(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, seeDatabaseInformation
.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 theUserContext
.secObj
: Security Object, with lists of database security roles, see theSecurityObject
.uuid
- string, generated UUID by a specified algorithm in the config file. Filter functions must return true if a document passed all the rules.
indexes (dict) – (optional) Search (text) index function definitions.
language (str) – (optional) Defines Query Server key to process design document functions.
options (DesignDocumentOptions) – (optional) Schema for design document options.
validate_doc_update (str) –
(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 theUserContext
.secObj
- Security Object, with lists of database security roles, see theSecurityObject
.
views (dict) – (optional) Schema for design document views.
**kwargs – (optional) Any additional properties.
- 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)
Schema for information about a design document.
- Parameters:
name (str) – name.
view_index (DesignDocumentViewIndex) – View index information.
Initialization
Initialize a DesignDocumentInformation object.
- Parameters:
name (str) – name.
view_index (DesignDocumentViewIndex) – 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)
Schema for design document options.
- Parameters:
partitioned (bool) – (optional) Whether this design document describes partitioned or global indexes.
Initialization
Initialize a DesignDocumentOptions object.
- Parameters:
partitioned (bool) – (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(collator_versions: List[str], compact_running: bool, language: str, signature: str, sizes: ibmcloudant.cloudant_v1.ContentInformationSizes, updater_running: bool, updates_pending: ibmcloudant.cloudant_v1.UpdatesPending, waiting_clients: int, waiting_commit: bool)
View index information.
- Parameters:
collator_versions (List[str]) – List of collator versions. If there are multiple entries this implies a libicu upgrade has occurred but compaction has not run yet.
compact_running (bool) – Indicates whether a compaction routine is currently running on the view.
language (str) – Language for the defined views.
signature (str) – MD5 signature of the views for the design document.
sizes (ContentInformationSizes) – Schema for size information of content.
updater_running (bool) – Indicates if the view is currently being updated.
updates_pending (UpdatesPending) – Schema for an ability to tell if view is up-to-date without querying it.
waiting_clients (int) – Number of clients waiting on views from this design document.
waiting_commit (bool) – Indicates if there are outstanding commits to the underlying database that need to processed.
Initialization
Initialize a DesignDocumentViewIndex object.
- Parameters:
collator_versions (List[str]) – List of collator versions. If there are multiple entries this implies a libicu upgrade has occurred but compaction has not run yet.
compact_running (bool) – Indicates whether a compaction routine is currently running on the view.
language (str) – Language for the defined views.
signature (str) – MD5 signature of the views for the design document.
sizes (ContentInformationSizes) – Schema for size information of content.
updater_running (bool) – Indicates if the view is currently being updated.
updates_pending (UpdatesPending) – Schema for an ability to tell if view is up-to-date without querying it.
waiting_clients (int) – Number of clients waiting on views from this design document.
waiting_commit (bool) – 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)
Schema for view functions definition.
- Parameters:
map (str) – JavaScript map function as a string.
reduce (str) – (optional) JavaScript reduce function as a string.
Initialization
Initialize a DesignDocumentViewsMapReduce object.
- Parameters:
map (str) – JavaScript map function as a string.
reduce (str) – (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)
Schema for a row of document information in a DocsResult.
- Parameters:
caused_by (str) – (optional) The cause of the error (if available).
error (str) – (optional) The name of the error.
reason (str) – (optional) The reason the error occurred (if available).
doc (Document) – (optional) Schema for a document.
id (str) – (optional) id.
key (str) – Document ID.
value (DocsResultRowValue) – (optional) Value of built-in
/_all_docs
style view.
Initialization
Initialize a DocsResultRow object.
- Parameters:
key (str) – Document ID.
caused_by (str) – (optional) The cause of the error (if available).
error (str) – (optional) The name of the error.
reason (str) – (optional) The reason the error occurred (if available).
doc (Document) – (optional) Schema for a document.
id (str) – (optional) id.
value (DocsResultRowValue) – (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, *, deleted: Optional[bool] = None)
Value of built-in
/_all_docs
style view.- Parameters:
deleted (bool) – (optional) If
true
then the document is deleted. Not present for undeleted documents.rev (str) – Schema for a document revision identifier.
Initialization
Initialize a DocsResultRowValue object.
- Parameters:
rev (str) – Schema for a document revision identifier.
deleted (bool) – (optional) If
true
then the document is deleted. Not present for undeleted documents.
- 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)
Schema for a document.
- Parameters:
attachments (dict) – (optional) Schema for a map of attachment name to attachment metadata.
conflicts (List[str]) – (optional) Schema for a list of document revision identifiers.
deleted (bool) – (optional) Deletion flag. Available if document was removed.
deleted_conflicts (List[str]) – (optional) Schema for a list of document revision identifiers.
id (str) – (optional) Document ID.
local_seq (str) – (optional) Document’s update sequence in current database. Available if requested with local_seq=true query parameter.
rev (str) – (optional) Schema for a document revision identifier.
revisions (Revisions) – (optional) Schema for list of revision information.
revs_info (List[DocumentRevisionStatus]) – (optional) Schema for a list of objects with information about local revisions and their status.
Initialization
Initialize a Document object.
- Parameters:
attachments (dict) – (optional) Schema for a map of attachment name to attachment metadata.
conflicts (List[str]) – (optional) Schema for a list of document revision identifiers.
deleted (bool) – (optional) Deletion flag. Available if document was removed.
deleted_conflicts (List[str]) – (optional) Schema for a list of document revision identifiers.
id (str) – (optional) Document ID.
local_seq (str) – (optional) Document’s update sequence in current database. Available if requested with local_seq=true query parameter.
rev (str) – (optional) Schema for a document revision identifier.
revisions (Revisions) – (optional) Schema for list of revision information.
revs_info (List[DocumentRevisionStatus]) – (optional) Schema for a list of objects with information about local revisions and their status.
**kwargs – (optional) Any additional properties.
- 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)
Schema for the result of a document modification.
- Parameters:
id (str) – Schema for a document ID.
rev (str) – (optional) Schema for a document revision identifier.
ok (bool) – (optional) ok.
caused_by (str) – (optional) The cause of the error (if available).
error (str) – (optional) The name of the error.
reason (str) – (optional) The reason the error occurred (if available).
Initialization
Initialize a DocumentResult object.
- Parameters:
id (str) – Schema for a document ID.
rev (str) – (optional) Schema for a document revision identifier.
ok (bool) – (optional) ok.
caused_by (str) – (optional) The cause of the error (if available).
error (str) – (optional) The name of the error.
reason (str) – (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)
Schema for information about revisions and their status.
- Parameters:
rev (str) – Schema for a document revision identifier.
status (str) – 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.
Initialization
Initialize a DocumentRevisionStatus object.
- Parameters:
rev (str) – Schema for a document revision identifier.
status (str) – 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
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.Initialization
Initialize self. See help(type(self)) for accurate signature.
- 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)
Schema for document shard information.
- Parameters:
nodes (List[str]) – List of nodes serving a replica of the shard.
range (str) – The shard range in which the document is stored.
Initialization
Initialize a DocumentShardInfo object.
- Parameters:
nodes (List[str]) – List of nodes serving a replica of the shard.
range (str) – 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)
Schema for find query execution statistics.
- Parameters:
execution_time_ms (float) – Time to execute the query.
results_returned (int) – Number of results returned.
total_docs_examined (int) – Number of documents fetched from the index.
total_keys_examined (int) – Number of rows scanned in the index.
total_quorum_docs_examined (int) – Number of documents fetched from the primary index with the specified read quorum.
Initialization
Initialize a ExecutionStats object.
- Parameters:
execution_time_ms (float) – Time to execute the query.
results_returned (int) – Number of results returned.
total_docs_examined (int) – Number of documents fetched from the index.
total_keys_examined (int) – Number of rows scanned in the index.
total_quorum_docs_examined (int) – 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(covering: bool, dbname: str, fields: List[str], index: ibmcloudant.cloudant_v1.IndexInformation, limit: int, opts: ibmcloudant.cloudant_v1.ExplainResultOpts, selector: dict, skip: int, *, mrargs: Optional[ibmcloudant.cloudant_v1.ExplainResultMrArgs] = None, partitioned: Optional[object] = None)
Schema for information about the index used for a find query.
- Parameters:
covering (bool) – When
true
, the query is answered using the index only and no documents are fetched.dbname (str) – Name of database.
fields (List[str]) – Fields that were requested to be projected from the document. If no fields were requested to be projected this will be empty and all fields will be returned.
index (IndexInformation) – Schema for information about an index.
limit (int) – The used maximum number of results returned.
mrargs (ExplainResultMrArgs) – (optional) Arguments passed to the underlying view.
opts (ExplainResultOpts) – Options used for the request.
partitioned (object) – (optional) Schema for any JSON type.
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. 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. See the Cloudant Docs for a list of all available combination and conditional operators.Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. For further reference see selector syntax.
skip (int) – Skip parameter used.
Initialization
Initialize a ExplainResult object.
- Parameters:
covering (bool) – When
true
, the query is answered using the index only and no documents are fetched.dbname (str) – Name of database.
fields (List[str]) – Fields that were requested to be projected from the document. If no fields were requested to be projected this will be empty and all fields will be returned.
index (IndexInformation) – Schema for information about an index.
limit (int) – The used maximum number of results returned.
opts (ExplainResultOpts) – Options used for the request.
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. 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. See the Cloudant Docs for a list of all available combination and conditional operators.Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. For further reference see selector syntax.
skip (int) – Skip parameter used.
mrargs (ExplainResultMrArgs) – (optional) Arguments passed to the underlying view.
partitioned (object) – (optional) Schema for any JSON type.
- 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.ExplainResultMrArgs(*, conflicts: Optional[object] = None, direction: Optional[str] = None, end_key: Optional[object] = None, include_docs: Optional[bool] = None, partition: Optional[str] = None, reduce: Optional[bool] = None, stable: Optional[bool] = None, start_key: Optional[object] = None, update: Optional[object] = None, view_type: Optional[str] = None)
Arguments passed to the underlying view.
- Parameters:
conflicts (object) – (optional) Schema for any JSON type.
direction (str) – (optional) Direction parameter passed to the underlying view.
end_key (object) – (optional) Schema for any JSON type.
include_docs (bool) – (optional) A parameter that specifies whether to include the full content of the documents in the response in the underlying view.
partition (str) – (optional) Partition parameter passed to the underlying view.
reduce (bool) – (optional) A parameter that specifies returning only documents that match any of the specified keys in the underlying view.
stable (bool) – (optional) A parameter that specifies whether the view results should be returned form a “stable” set of shards passed to the underlying view.
start_key (object) – (optional) Schema for any JSON type.
update (object) – (optional) Schema for any JSON type.
view_type (str) – (optional) The type of the underlying view.
Initialization
Initialize a ExplainResultMrArgs object.
- Parameters:
conflicts (object) – (optional) Schema for any JSON type.
direction (str) – (optional) Direction parameter passed to the underlying view.
end_key (object) – (optional) Schema for any JSON type.
include_docs (bool) – (optional) A parameter that specifies whether to include the full content of the documents in the response in the underlying view.
partition (str) – (optional) Partition parameter passed to the underlying view.
reduce (bool) – (optional) A parameter that specifies returning only documents that match any of the specified keys in the underlying view.
stable (bool) – (optional) A parameter that specifies whether the view results should be returned form a “stable” set of shards passed to the underlying view.
start_key (object) – (optional) Schema for any JSON type.
update (object) – (optional) Schema for any JSON type.
view_type (str) – (optional) The type of the underlying view.
- class ViewTypeEnum
Bases:
str
,enum.Enum
The type of the underlying view.
Initialization
Initialize self. See help(type(self)) for accurate signature.
- MAP = 'map'
- REDUCE = 'reduce'
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.ExplainResultMrArgs
Initialize a ExplainResultMrArgs object from a json dictionary.
- to_dict() Dict
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.ExplainResultOpts(bookmark: str, conflicts: bool, execution_stats: bool, fields: List[str], limit: int, partition: str, r: int, skip: int, sort: object, stable: bool, stale: bool, update: bool, use_index: List[str])
Options used for the request.
- Parameters:
bookmark (str) – Opaque bookmark token used when paginating results.
conflicts (bool) – Conflicts used in the request query.
execution_stats (bool) – Execution statistics used in the request query.
fields (List[str]) – JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. If it is omitted or empty, the entire document is returned.
limit (int) – Limit used in the request query.
partition (str) – On which database partition the request was used. If it was not used on a database partition, it returns with
""
.r (int) – The read quorum that is needed for the result.
skip (int) – Skip used in the request query.
sort (object) – Schema for any JSON type.
stable (bool) – Stable used in the request query.
stale (bool) – Deprecated: Stale used in the request query.
update (bool) – Update used in the request query.
use_index (List[str]) – Use index used in the request query.
Initialization
Initialize a ExplainResultOpts object.
- Parameters:
bookmark (str) – Opaque bookmark token used when paginating results.
conflicts (bool) – Conflicts used in the request query.
execution_stats (bool) – Execution statistics used in the request query.
fields (List[str]) – JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. If it is omitted or empty, the entire document is returned.
limit (int) – Limit used in the request query.
partition (str) – On which database partition the request was used. If it was not used on a database partition, it returns with
""
.r (int) – The read quorum that is needed for the result.
skip (int) – Skip used in the request query.
sort (object) – Schema for any JSON type.
stable (bool) – Stable used in the request query.
stale (bool) – Deprecated: Stale used in the request query.
update (bool) – Update used in the request query.
use_index (List[str]) – Use index used in the request query.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.ExplainResultOpts
Initialize a ExplainResultOpts 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)
Schema for the result of a query find operation.
- Parameters:
bookmark (str) – Opaque bookmark token used when paginating results.
docs (List[Document]) – Documents matching the selector.
execution_stats (ExecutionStats) – (optional) Schema for find query execution statistics.
warning (str) – (optional) warning.
Initialization
Initialize a FindResult object.
- Parameters:
bookmark (str) – Opaque bookmark token used when paginating results.
docs (List[Document]) – Documents matching the selector.
execution_stats (ExecutionStats) – (optional) Schema for find query execution statistics.
warning (str) – (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.GetDbUpdatesEnums
Enums for get_db_updates parameters.
- class ibmcloudant.cloudant_v1.GetLocalDocumentEnums
Enums for get_local_document parameters.
- class Accept
Bases:
str
,enum.Enum
The type of the response: application/json, multipart/mixed, multipart/related, or application/octet-stream.
Initialization
Initialize self. See help(type(self)) for accurate signature.
- APPLICATION_JSON = 'application/json'
- APPLICATION_OCTET_STREAM = 'application/octet-stream'
- MULTIPART_MIXED = 'multipart/mixed'
- MULTIPART_RELATED = 'multipart/related'
- class ibmcloudant.cloudant_v1.GetSchedulerDocsEnums
Enums for get_scheduler_docs parameters.
- class States
Bases:
str
,enum.Enum
Query parameter to include only replication documents in the specified states. String must be a comma-delimited string.
Initialization
Initialize self. See help(type(self)) for accurate signature.
- 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)
Schema for a
json
ortext
query index definition. Indexes of typetext
have additional configuration properties that do not apply tojson
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.
- Parameters:
default_analyzer (Analyzer) – (optional) Schema for a full text search analyzer.
default_field (IndexTextOperatorDefaultField) – (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.fields (List[IndexField]) – (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 aname
property of the field name and atype
property of the field type (string, number, or boolean).index_array_lengths (bool) –
(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.
partial_filter_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. 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. See the Cloudant Docs for a list of all available combination and conditional operators.Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. For further reference see selector syntax.
Initialization
Initialize a IndexDefinition object.
- Parameters:
default_analyzer (Analyzer) – (optional) Schema for a full text search analyzer.
default_field (IndexTextOperatorDefaultField) – (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.fields (List[IndexField]) – (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 aname
property of the field name and atype
property of the field type (string, number, or boolean).index_array_lengths (bool) –
(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.
partial_filter_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. 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. See the Cloudant Docs for a list of all available combination and conditional operators.Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. For further reference see selector syntax.
- 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)
Schema for indexed fields for use with declarative JSON query.
- Parameters:
name (str) – (optional) Name of the field.
type (str) – (optional) The type of the named field.
Initialization
Initialize a IndexField object.
- Parameters:
name (str) – (optional) Name of the field.
type (str) – (optional) The type of the named field.
**kwargs – (optional) Any additional properties.
- class TypeEnum
Bases:
str
,enum.Enum
The type of the named field.
Initialization
Initialize self. See help(type(self)) for accurate signature.
- 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, *, partitioned: Optional[bool] = None)
Schema for information about an index.
- Parameters:
ddoc (str) – Design document ID including a
_design/
prefix.def_ (IndexDefinition) –
Schema for a
json
ortext
query index definition. Indexes of typetext
have additional configuration properties that do not apply tojson
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) – Index name.
partitioned (bool) – (optional) Indicates if index is partitioned.
type (str) – Schema for the type of an index.
Initialization
Initialize a IndexInformation object.
- Parameters:
ddoc (str) – Design document ID including a
_design/
prefix.def_ (IndexDefinition) –
Schema for a
json
ortext
query index definition. Indexes of typetext
have additional configuration properties that do not apply tojson
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) – Index name.
type (str) – Schema for the type of an index.
partitioned (bool) – (optional) Indicates if index is partitioned.
- class TypeEnum
Bases:
str
,enum.Enum
Schema for the type of an index.
Initialization
Initialize self. See help(type(self)) for accurate signature.
- 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)
Schema for the result of creating an index.
- Parameters:
id (str) – Id of the design document the index was created in.
name (str) – Name of the index created.
result (str) – Flag to show whether the index was created or one already exists.
Initialization
Initialize a IndexResult object.
- Parameters:
id (str) – Id of the design document the index was created in.
name (str) – Name of the index created.
result (str) – Flag to show whether the index was created or one already exists.
- class ResultEnum
Bases:
str
,enum.Enum
Flag to show whether the index was created or one already exists.
Initialization
Initialize self. See help(type(self)) for accurate signature.
- 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)
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.- Parameters:
analyzer (Analyzer) – (optional) Schema for a full text search analyzer.
enabled (bool) – (optional) Whether or not the default_field is enabled.
Initialization
Initialize a IndexTextOperatorDefaultField object.
- Parameters:
analyzer (Analyzer) – (optional) Schema for a full text search analyzer.
enabled (bool) – (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])
Schema for information about the indexes in a database.
- Parameters:
total_rows (int) – Number of total rows.
indexes (List[IndexInformation]) – Indexes.
Initialization
Initialize a IndexesInformation object.
- Parameters:
total_rows (int) – Number of total rows.
indexes (List[IndexInformation]) – 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])
Schema for information about known nodes and cluster membership.
- Parameters:
all_nodes (List[str]) – List of nodes this node knows about, including the ones that are part of the cluster.
cluster_nodes (List[str]) – All cluster nodes.
Initialization
Initialize a MembershipInformation object.
- Parameters:
all_nodes (List[str]) – List of nodes this node knows about, including the ones that are part of the cluster.
cluster_nodes (List[str]) – 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)
Schema for an OK result.
- Parameters:
ok (bool) – (optional) ok.
Initialization
Initialize a Ok object.
- Parameters:
ok (bool) – (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)
Schema for information about a database partition.
- Parameters:
db_name (str) – The name of the database.
doc_count (int) – A count of the documents in the specified database partition.
doc_del_count (int) – Number of deleted documents.
partition (str) – The name of the partition in the database.
partitioned_indexes (PartitionInformationIndexes) – (optional) Schema for information about the partition index count and limit in a database.
sizes (PartitionInformationSizes) – The size of active and external data, in bytes.
Initialization
Initialize a PartitionInformation object.
- Parameters:
db_name (str) – The name of the database.
doc_count (int) – A count of the documents in the specified database partition.
doc_del_count (int) – Number of deleted documents.
partition (str) – The name of the partition in the database.
sizes (PartitionInformationSizes) – The size of active and external data, in bytes.
partitioned_indexes (PartitionInformationIndexes) – (optional) Schema for information about the partition index count and limit in a database.
- 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)
Schema for information about the partition index count and limit in a database.
- Parameters:
count (int) – (optional) Total count of the partitioned indexes.
indexes (PartitionInformationIndexesIndexes) – (optional) The count breakdown of partitioned indexes.
limit (int) – (optional) The partitioned index limit.
Initialization
Initialize a PartitionInformationIndexes object.
- Parameters:
count (int) – (optional) Total count of the partitioned indexes.
indexes (PartitionInformationIndexesIndexes) – (optional) The count breakdown of partitioned indexes.
limit (int) – (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)
The count breakdown of partitioned indexes.
- Parameters:
search (int) – (optional) Number of partitioned search indexes.
view (int) – (optional) Number of partitioned view indexes.
Initialization
Initialize a PartitionInformationIndexesIndexes object.
- Parameters:
search (int) – (optional) Number of partitioned search indexes.
view (int) – (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)
The size of active and external data, in bytes.
- Parameters:
active (int) – (optional) The size of live data inside the database, in bytes.
external (int) – (optional) The uncompressed size of database contents in bytes.
Initialization
Initialize a PartitionInformationSizes object.
- Parameters:
active (int) – (optional) The size of live data inside the database, in bytes.
external (int) – (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.PartitionedIndexesDetailedInformation(*, search: Optional[int] = None, view: Optional[int] = None)
Number of partitioned indexes by type.
- Parameters:
search (int) – (optional) Number of partitioned indexes of search type.
view (int) – (optional) Number of partitioned indexes of view type.
Initialization
Initialize a PartitionedIndexesDetailedInformation object.
- Parameters:
search (int) – (optional) Number of partitioned indexes of search type.
view (int) – (optional) Number of partitioned indexes of view type.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.PartitionedIndexesDetailedInformation
Initialize a PartitionedIndexesDetailedInformation object from a json dictionary.
- to_dict() Dict
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.PartitionedIndexesInformation(*, count: Optional[int] = None, indexes: Optional[ibmcloudant.cloudant_v1.PartitionedIndexesDetailedInformation] = None, limit: Optional[int] = None)
Information about database’s partitioned indexes.
- Parameters:
count (int) – (optional) Total number of partitioned indexes in the database.
indexes (PartitionedIndexesDetailedInformation) – (optional) Number of partitioned indexes by type.
limit (int) – (optional) Maximum allowed number of partitioned indexes in the database.
Initialization
Initialize a PartitionedIndexesInformation object.
- Parameters:
count (int) – (optional) Total number of partitioned indexes in the database.
indexes (PartitionedIndexesDetailedInformation) – (optional) Number of partitioned indexes by type.
limit (int) – (optional) Maximum allowed number of partitioned indexes in the database.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.PartitionedIndexesInformation
Initialize a PartitionedIndexesInformation object from a json dictionary.
- to_dict() Dict
Return a json dictionary representing this model.
- class ibmcloudant.cloudant_v1.PostChangesAsStreamEnums
Enums for post_changes_as_stream parameters.
- class ibmcloudant.cloudant_v1.PostChangesEnums
Enums for post_changes parameters.
- class ibmcloudant.cloudant_v1.PostDesignDocsEnums
Enums for post_design_docs parameters.
- class ibmcloudant.cloudant_v1.PostDesignDocsQueriesEnums
Enums for post_design_docs_queries parameters.
- class ibmcloudant.cloudant_v1.PostDocumentEnums
Enums for post_document parameters.
- class Batch
Bases:
str
,enum.Enum
Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
Initialization
Initialize self. See help(type(self)) for accurate signature.
- OK = 'ok'
- class ContentType
Bases:
str
,enum.Enum
The type of the input.
Initialization
Initialize self. See help(type(self)) for accurate signature.
- APPLICATION_JSON = 'application/json'
- APPLICATION_OCTET_STREAM = 'application/octet-stream'
- MULTIPART_MIXED = 'multipart/mixed'
- MULTIPART_RELATED = 'multipart/related'
- class ibmcloudant.cloudant_v1.PutDesignDocumentEnums
Enums for put_design_document parameters.
- class ibmcloudant.cloudant_v1.PutDocumentEnums
Enums for put_document parameters.
- class Batch
Bases:
str
,enum.Enum
Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
Initialization
Initialize self. See help(type(self)) for accurate signature.
- OK = 'ok'
- class ContentType
Bases:
str
,enum.Enum
The type of the input.
Initialization
Initialize self. See help(type(self)) for accurate signature.
- APPLICATION_JSON = 'application/json'
- APPLICATION_OCTET_STREAM = 'application/octet-stream'
- MULTIPART_MIXED = 'multipart/mixed'
- MULTIPART_RELATED = 'multipart/related'
- class ibmcloudant.cloudant_v1.PutLocalDocumentEnums
Enums for put_local_document parameters.
- class Batch
Bases:
str
,enum.Enum
Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately.
Initialization
Initialize self. See help(type(self)) for accurate signature.
- OK = 'ok'
- class ContentType
Bases:
str
,enum.Enum
The type of the input.
Initialization
Initialize self. See help(type(self)) for accurate signature.
- APPLICATION_JSON = 'application/json'
- APPLICATION_OCTET_STREAM = 'application/octet-stream'
- MULTIPART_MIXED = 'multipart/mixed'
- MULTIPART_RELATED = 'multipart/related'
- class ibmcloudant.cloudant_v1.PutReplicationDocumentEnums
Enums for put_replication_document parameters.
- class ibmcloudant.cloudant_v1.ReplicationCreateTargetParameters(*, n: Optional[int] = None, partitioned: Optional[bool] = None, q: Optional[int] = None)
Request parameters to use during target database creation.
- Parameters:
n (int) – (optional) Schema for the number of replicas of a database in a cluster. The cluster is using the default value and it cannot be changed by the user.
partitioned (bool) – (optional) Parameter to specify whether to enable database partitions when creating the target database.
q (int) – (optional) Schema for the number of shards in a database. Each shard is a partition of the hash value range.
Initialization
Initialize a ReplicationCreateTargetParameters object.
- Parameters:
n (int) – (optional) Schema for the number of replicas of a database in a cluster. The cluster is using the default value and it cannot be changed by the user.
partitioned (bool) – (optional) Parameter to specify whether to enable database partitions when creating the target database.
q (int) – (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)
Schema for a replication source or target database.
- Parameters:
auth (ReplicationDatabaseAuth) – (optional) Schema for replication source or target database authentication.
headers_ (dict) – (optional) Replication request headers.
url (str) – Replication database URL.
Initialization
Initialize a ReplicationDatabase object.
- Parameters:
url (str) – Replication database URL.
auth (ReplicationDatabaseAuth) – (optional) Schema for replication source or target database authentication.
headers_ (dict) – (optional) Replication request headers.
- 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)
Schema for replication source or target database authentication.
- Parameters:
basic (ReplicationDatabaseAuthBasic) – (optional) Schema for basic authentication of replication source or target database.
iam (ReplicationDatabaseAuthIam) – (optional) Schema for an IAM API key for replication database authentication.
Initialization
Initialize a ReplicationDatabaseAuth object.
- Parameters:
basic (ReplicationDatabaseAuthBasic) – (optional) Schema for basic authentication of replication source or target database.
iam (ReplicationDatabaseAuthIam) – (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)
Schema for basic authentication of replication source or target database.
- Parameters:
password (str) – The password associated with the username.
username (str) – The username.
Initialization
Initialize a ReplicationDatabaseAuthBasic object.
- Parameters:
password (str) – The password associated with the username.
username (str) – 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)
Schema for an IAM API key for replication database authentication.
- Parameters:
api_key (str) – IAM API key.
Initialization
Initialize a ReplicationDatabaseAuthIam object.
- Parameters:
api_key (str) – 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_bulk_get: Optional[bool] = None, use_checkpoints: Optional[bool] = None, user_ctx: Optional[ibmcloudant.cloudant_v1.UserContext] = None, winning_revs_only: Optional[bool] = None, worker_batch_size: Optional[int] = None, worker_processes: Optional[int] = None, **kwargs)
Schema for a replication document. Note that
selector
,doc_ids
, andfilter
are incompatible with each other.- Parameters:
attachments (dict) – (optional) Schema for a map of attachment name to attachment metadata.
conflicts (List[str]) – (optional) Schema for a list of document revision identifiers.
deleted (bool) – (optional) Deletion flag. Available if document was removed.
deleted_conflicts (List[str]) – (optional) Schema for a list of document revision identifiers.
id (str) – (optional) Document ID.
local_seq (str) – (optional) Document’s update sequence in current database. Available if requested with local_seq=true query parameter.
rev (str) – (optional) Schema for a document revision identifier.
revisions (Revisions) – (optional) Schema for list of revision information.
revs_info (List[DocumentRevisionStatus]) – (optional) Schema for a list of objects with information about local revisions and their status.
cancel (bool) – (optional) Cancels the replication.
checkpoint_interval (int) – (optional) Defines replication checkpoint interval in milliseconds.
connection_timeout (int) – (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.
continuous (bool) – (optional) Configure the replication to be continuous.
create_target (bool) – (optional) Creates the target database. Requires administrator privileges on target server.
create_target_params (ReplicationCreateTargetParameters) – (optional) Request parameters to use during target database creation.
doc_ids (List[str]) – (optional) Schema for a list of document IDs.
filter (str) – (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.
http_connections (int) – (optional) Maximum number of HTTP connections per replication.
query_params (dict) – (optional) Schema for a map of string key value pairs, such as query parameters.
retries_per_request (int) – (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.
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. 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. See the Cloudant Docs for a list of all available combination and conditional operators.Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. For further reference see selector syntax.
since_seq (str) – (optional) Start the replication at a specific sequence value.
socket_options (str) – (optional) Replication socket options.
source (ReplicationDatabase) – Schema for a replication source or target database.
source_proxy (str) – (optional) Deprecated: This setting is forbidden in IBM Cloudant replication documents. This setting may be used with alternative replication mediators. Address of a (http or socks5 protocol) proxy server through which replication with the source database should occur.
target (ReplicationDatabase) – Schema for a replication source or target database.
target_proxy (str) – (optional) Deprecated: This setting is forbidden in IBM Cloudant replication documents. This setting may be used with alternative replication mediators. Address of a (http or socks5 protocol) proxy server through which replication with the target database should occur.
use_bulk_get (bool) – (optional) Specify whether to use _bulk_get for fetching documents from the source. If unset, the server configured default will be used.
use_checkpoints (bool) – (optional) Specify if checkpoints should be saved during replication. Using checkpoints means a replication can be efficiently resumed.
user_ctx (UserContext) – (optional) Schema for the user context of a session.
winning_revs_only (bool) – (optional) Replicate only the winning revisions. Replication with this mode discards conflicting revisions. Replication IDs and checkpoints generated by this mode are different to those generated by default, so it is possible to first replicate the winning revisions then later backfill remaining revisions with a regular replication job.
worker_batch_size (int) – (optional) Controls how many documents are processed. After each batch a checkpoint is written so this controls how frequently checkpointing occurs.
worker_processes (int) – (optional) Controls how many separate processes will read from the changes manager and write to the target. A higher number can improve throughput.
Initialization
Initialize a ReplicationDocument object.
- Parameters:
source (ReplicationDatabase) – Schema for a replication source or target database.
target (ReplicationDatabase) – Schema for a replication source or target database.
attachments (dict) – (optional) Schema for a map of attachment name to attachment metadata.
conflicts (List[str]) – (optional) Schema for a list of document revision identifiers.
deleted (bool) – (optional) Deletion flag. Available if document was removed.
deleted_conflicts (List[str]) – (optional) Schema for a list of document revision identifiers.
id (str) – (optional) Document ID.
local_seq (str) – (optional) Document’s update sequence in current database. Available if requested with local_seq=true query parameter.
rev (str) – (optional) Schema for a document revision identifier.
revisions (Revisions) – (optional) Schema for list of revision information.
revs_info (List[DocumentRevisionStatus]) – (optional) Schema for a list of objects with information about local revisions and their status.
cancel (bool) – (optional) Cancels the replication.
checkpoint_interval (int) – (optional) Defines replication checkpoint interval in milliseconds.
connection_timeout (int) – (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.
continuous (bool) – (optional) Configure the replication to be continuous.
create_target (bool) – (optional) Creates the target database. Requires administrator privileges on target server.
create_target_params (ReplicationCreateTargetParameters) – (optional) Request parameters to use during target database creation.
doc_ids (List[str]) – (optional) Schema for a list of document IDs.
filter (str) – (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.
http_connections (int) – (optional) Maximum number of HTTP connections per replication.
query_params (dict) – (optional) Schema for a map of string key value pairs, such as query parameters.
retries_per_request (int) – (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.
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. 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. See the Cloudant Docs for a list of all available combination and conditional operators.Only equality operators such as
$eq
,$gt
,$gte
,$lt
, and$lte
(but not$ne
) can be used as the basis of a query. You should include at least one of these in a selector. For further reference see selector syntax.
since_seq (str) – (optional) Start the replication at a specific sequence value.
socket_options (str) – (optional) Replication socket options.
source_proxy (str) – (optional) Deprecated: This setting is forbidden in IBM Cloudant replication documents. This setting may be used with alternative replication mediators. Address of a (http or socks5 protocol) proxy server through which replication with the source database should occur.
target_proxy (str) – (optional) Deprecated: This setting is forbidden in IBM Cloudant replication documents. This setting may be used with alternative replication mediators. Address of a (http or socks5 protocol) proxy server through which replication with the target database should occur.
use_bulk_get (bool) – (optional) Specify whether to use _bulk_get for fetching documents from the source. If unset, the server configured default will be used.
use_checkpoints (bool) – (optional) Specify if checkpoints should be saved during replication. Using checkpoints means a replication can be efficiently resumed.
user_ctx (UserContext) – (optional) Schema for the user context of a session.
winning_revs_only (bool) – (optional) Replicate only the winning revisions. Replication with this mode discards conflicting revisions. Replication IDs and checkpoints generated by this mode are different to those generated by default, so it is possible to first replicate the winning revisions then later backfill remaining revisions with a regular replication job.
worker_batch_size (int) – (optional) Controls how many documents are processed. After each batch a checkpoint is written so this controls how frequently checkpointing occurs.
worker_processes (int) – (optional) Controls how many separate processes will read from the changes manager and write to the target. A higher number can improve throughput.
**kwargs – (optional) Any additional properties.
- 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)
Schema for list of revision information.
- Parameters:
ids (List[str]) – Array of valid revision IDs, in reverse order (latest first).
start (int) – Prefix number for the latest revision.
Initialization
Initialize a Revisions object.
- Parameters:
ids (List[str]) – Array of valid revision IDs, in reverse order (latest first).
start (int) – 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)
Schema for information about missing revs and possible ancestors.
- Parameters:
missing (List[str]) – (optional) List of missing revisions.
possible_ancestors (List[str]) – (optional) List of possible ancestor revisions.
Initialization
Initialize a RevsDiff object.
- Parameters:
missing (List[str]) – (optional) List of missing revisions.
possible_ancestors (List[str]) – (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])
Schema for a listing of replication scheduler documents.
- Parameters:
total_rows (int) – Number of total rows.
docs (List[SchedulerDocument]) – Array of replication scheduler doc objects.
Initialization
Initialize a SchedulerDocsResult object.
- Parameters:
total_rows (int) – Number of total rows.
docs (List[SchedulerDocument]) – 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)
Schema for a replication scheduler document.
- Parameters:
database (str) – Database where replication document came from.
doc_id (str) – Replication document ID.
error_count (int) – 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.
id (str) – Replication ID, or null if state is completed or failed.
info (SchedulerInfo) – 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.
last_updated (datetime) – Timestamp of last state update.
node (str) – (optional) Cluster node where the job is running.
source (str) – (optional) Replication source.
source_proxy (str) – (optional) Deprecated: Forbidden in IBM Cloudant mediated replications. Address of the (http or socks5 protocol) proxy server through which replication with the source database occurs.
start_time (datetime) – Timestamp of when the replication was started.
state (str) – Schema for replication state.
target (str) – (optional) Replication target.
target_proxy (str) – (optional) Deprecated: Forbidden in IBM Cloudant mediated replications. Address of the (http or socks5 protocol) proxy server through which replication with the target database occurs.
Initialization
Initialize a SchedulerDocument object.
- Parameters:
database (str) – Database where replication document came from.
doc_id (str) – Replication document ID.
error_count (int) – 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.
id (str) – Replication ID, or null if state is completed or failed.
info (SchedulerInfo) – 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.
last_updated (datetime) – Timestamp of last state update.
start_time (datetime) – Timestamp of when the replication was started.
state (str) – Schema for replication state.
node (str) – (optional) Cluster node where the job is running.
source (str) – (optional) Replication source.
source_proxy (str) – (optional) Deprecated: Forbidden in IBM Cloudant mediated replications. Address of the (http or socks5 protocol) proxy server through which replication with the source database occurs.
target (str) – (optional) Replication target.
target_proxy (str) – (optional) Deprecated: Forbidden in IBM Cloudant mediated replications. Address of the (http or socks5 protocol) proxy server through which replication with the target database occurs.
- class StateEnum
Bases:
str
,enum.Enum
Schema for replication state.
Initialization
Initialize self. See help(type(self)) for accurate signature.
- 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)
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.
- Parameters:
changes_pending (int) – (optional) The count of changes not yet replicated.
checkpointed_source_seq (str) – (optional) The source sequence id which was last successfully replicated.
doc_write_failures (int) – (optional) The count of docs which failed to be written to the target.
docs_read (int) – (optional) The count of docs which have been read from the source.
docs_written (int) – (optional) The count of docs which have been written to the target.
error (str) – (optional) Replication error message.
missing_revisions_found (int) – (optional) The count of revisions which were found on the source, but missing from the target.
revisions_checked (int) – (optional) The count of revisions which have been checked since this replication began.
source_seq (str) – (optional) The last sequence number obtained from the source database changes feed.
through_seq (str) – (optional) The last sequence number processed by the replicator.
Initialization
Initialize a SchedulerInfo object.
- Parameters:
changes_pending (int) – (optional) The count of changes not yet replicated.
checkpointed_source_seq (str) – (optional) The source sequence id which was last successfully replicated.
doc_write_failures (int) – (optional) The count of docs which failed to be written to the target.
docs_read (int) – (optional) The count of docs which have been read from the source.
docs_written (int) – (optional) The count of docs which have been written to the target.
error (str) – (optional) Replication error message.
missing_revisions_found (int) – (optional) The count of revisions which were found on the source, but missing from the target.
revisions_checked (int) – (optional) The count of revisions which have been checked since this replication began.
source_seq (str) – (optional) The last sequence number obtained from the source database changes feed.
through_seq (str) – (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)
Schema for a replication scheduler job.
- Parameters:
database (str) – Replication document database.
doc_id (str) – Replication document ID.
history (List[SchedulerJobEvent]) – Timestamped history of events as a list of objects.
id (str) – Schema for a replication job id.
info (SchedulerInfo) – 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.
node (str) – Cluster node where the job is running.
pid (str) – Replication process ID.
source (str) – Replication source.
start_time (datetime) – Timestamp of when the replication was started.
target (str) – Replication target.
user (str) – Name of user running replication.
Initialization
Initialize a SchedulerJob object.
- Parameters:
database (str) – Replication document database.
doc_id (str) – Replication document ID.
history (List[SchedulerJobEvent]) – Timestamped history of events as a list of objects.
id (str) – Schema for a replication job id.
info (SchedulerInfo) – 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.
node (str) – Cluster node where the job is running.
pid (str) – Replication process ID.
source (str) – Replication source.
start_time (datetime) – Timestamp of when the replication was started.
target (str) – Replication target.
user (str) – 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)
Schema for a replication scheduler job event.
- Parameters:
reason (str) – (optional) Reason for current state of event.
timestamp (datetime) – Timestamp of the event.
type (str) – Type of the event.
Initialization
Initialize a SchedulerJobEvent object.
- Parameters:
timestamp (datetime) – Timestamp of the event.
type (str) – Type of the event.
reason (str) – (optional) Reason for current state of 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])
Schema for a listing of replication scheduler jobs.
- Parameters:
total_rows (int) – Number of total rows.
jobs (List[SchedulerJob]) – Array of replication job objects.
Initialization
Initialize a SchedulerJobsResult object.
- Parameters:
total_rows (int) – Number of total rows.
jobs (List[SchedulerJob]) – 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])
Schema for the output of testing search analyzer tokenization.
- Parameters:
tokens (List[str]) – tokens.
Initialization
Initialize a SearchAnalyzeResult object.
- Parameters:
tokens (List[str]) – 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)
Schema for a search index definition.
- Parameters:
analyzer (AnalyzerConfiguration) – (optional) Schema for a search analyzer configuration.
index (str) –
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, defaultfalse
- Creates a faceted index.index
- boolean, defaulttrue
- If set tofalse
, the data cannot be used for searches, but can still be retrieved from the index ifstore
is set totrue
.store
- boolean, defaulttrue
- If true, the value is returned in the search result; otherwise, the value is not returned.
Initialization
Initialize a SearchIndexDefinition object.
- Parameters:
index (str) –
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, defaultfalse
- Creates a faceted index.index
- boolean, defaulttrue
- If set tofalse
, the data cannot be used for searches, but can still be retrieved from the index ifstore
is set totrue
.store
- boolean, defaulttrue
- If true, the value is returned in the search result; otherwise, the value is not returned.
analyzer (AnalyzerConfiguration) – (optional) Schema for a search analyzer configuration.
- 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, signature: str)
Schema for metadata information about a search index.
- Parameters:
committed_seq (int) – The committed sequence identifier.
disk_size (int) – The size of the search index on disk.
doc_count (int) – The count of the number of indexed documents.
doc_del_count (int) – The number of deleted documents.
pending_seq (int) – The pending sequence identifier.
signature (str) – Unique signature of the search index.
Initialization
Initialize a SearchIndexInfo object.
- Parameters:
committed_seq (int) – The committed sequence identifier.
disk_size (int) – The size of the search index on disk.
doc_count (int) – The count of the number of indexed documents.
doc_del_count (int) – The number of deleted documents.
pending_seq (int) – The pending sequence identifier.
signature (str) – Unique signature of the search index.
- 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)
Schema for search index information.
- Parameters:
name (str) – The name of the search index prefixed by the design document ID where the index is stored.
search_index (SearchIndexInfo) – Schema for metadata information about a search index.
Initialization
Initialize a SearchInfoResult object.
- Parameters:
name (str) – The name of the search index prefixed by the design document ID where the index is stored.
search_index (SearchIndexInfo) – 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)
Schema for the result of a query search operation.
- Parameters:
total_rows (int) – Number of total rows.
bookmark (str) – (optional) Opaque bookmark token used when paginating results.
by (str) – (optional) Grouped search matches.
counts (dict) – (optional) The counts facet syntax returns the number of query results for each unique value of each named field.
ranges (dict) – (optional) The range facet syntax reuses the standard Lucene syntax for ranges to return counts of results that fit into each specified category.
rows (List[SearchResultRow]) – (optional) Array of row objects.
groups (List[SearchResultProperties]) – (optional) Array of grouped search matches.
Initialization
Initialize a SearchResult object.
- Parameters:
total_rows (int) – Number of total rows.
bookmark (str) – (optional) Opaque bookmark token used when paginating results.
by (str) – (optional) Grouped search matches.
counts (dict) – (optional) The counts facet syntax returns the number of query results for each unique value of each named field.
ranges (dict) – (optional) The range facet syntax reuses the standard Lucene syntax for ranges to return counts of results that fit into each specified category.
rows (List[SearchResultRow]) – (optional) Array of row objects.
groups (List[SearchResultProperties]) – (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)
Schema for the result of a query search operation.
- Parameters:
total_rows (int) – Number of total rows.
bookmark (str) – (optional) Opaque bookmark token used when paginating results.
by (str) – (optional) Grouped search matches.
counts (dict) – (optional) The counts facet syntax returns the number of query results for each unique value of each named field.
ranges (dict) – (optional) The range facet syntax reuses the standard Lucene syntax for ranges to return counts of results that fit into each specified category.
rows (List[SearchResultRow]) – (optional) Array of row objects.
Initialization
Initialize a SearchResultProperties object.
- Parameters:
total_rows (int) – Number of total rows.
bookmark (str) – (optional) Opaque bookmark token used when paginating results.
by (str) – (optional) Grouped search matches.
counts (dict) – (optional) The counts facet syntax returns the number of query results for each unique value of each named field.
ranges (dict) – (optional) The range facet syntax reuses the standard Lucene syntax for ranges to return counts of results that fit into each specified category.
rows (List[SearchResultRow]) – (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)
Schema for a row of the result of a query search operation.
- Parameters:
doc (Document) – (optional) Schema for a document.
fields (dict) – Schema for the fields returned by a query search operation, a map of field name to value.
highlights (dict) – (optional) Returns the context in which a search term was mentioned so that you can display more emphasized results to a user.
id (str) – Schema for a document ID.
Initialization
Initialize a SearchResultRow object.
- Parameters:
fields (dict) – Schema for the fields returned by a query search operation, a map of field name to value.
id (str) – Schema for a document ID.
doc (Document) – (optional) Schema for a document.
highlights (dict) – (optional) Returns the context in which a search term was mentioned so that you can display more emphasized results to a user.
- 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)
Schema for a security document.
- Parameters:
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.
Initialization
Initialize a Security object.
- Parameters:
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.
- class CloudantEnum
Bases:
str
,enum.Enum
Database permissions for Cloudant users and/or API keys.
Initialization
Initialize self. See help(type(self)) for accurate signature.
- 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)
Schema for names and roles to map to a database permission.
- Parameters:
names (List[str]) – (optional) List of usernames.
roles (List[str]) – (optional) List of roles.
Initialization
Initialize a SecurityObject object.
- Parameters:
names (List[str]) – (optional) List of usernames.
roles (List[str]) – (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])
Schema for information about the server instance.
- Parameters:
couchdb (str) – Welcome message.
features (List[str]) – List of enabled optional features.
vendor (ServerVendor) – Schema for server vendor information.
version (str) – Apache CouchDB version.
features_flags (List[str]) – List of feature flags.
Initialization
Initialize a ServerInformation object.
- Parameters:
couchdb (str) – Welcome message.
features (List[str]) – List of enabled optional features.
vendor (ServerVendor) – Schema for server vendor information.
version (str) – Apache CouchDB version.
features_flags (List[str]) – 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)
Schema for server vendor information.
- Parameters:
name (str) – Vendor name.
variant (str) – (optional) Vendor variant.
version (str) – (optional) Vendor version.
Initialization
Initialize a ServerVendor object.
- Parameters:
name (str) – Vendor name.
variant (str) – (optional) Vendor variant.
version (str) – (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)
Schema for session authentication information.
- Parameters:
authenticated (str) – (optional) authenticated.
authentication_db (str) – (optional) authentication_db.
authentication_handlers (List[str]) – authentication_handlers.
Initialization
Initialize a SessionAuthentication object.
- Parameters:
authentication_handlers (List[str]) – authentication_handlers.
authenticated (str) – (optional) authenticated.
authentication_db (str) – (optional) authentication_db.
- 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)
Schema for information about a session.
- Parameters:
ok (bool) – ok.
info (SessionAuthentication) – Schema for session authentication information.
user_ctx (UserContext) – Schema for the user context of a session.
Initialization
Initialize a SessionInformation object.
- Parameters:
ok (bool) – ok.
info (SessionAuthentication) – Schema for session authentication information.
user_ctx (UserContext) – 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)
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.
- Parameters:
shards (dict) – Mapping of shard hash value range to a list of nodes.
Initialization
Initialize a ShardsInformation object.
- Parameters:
shards (dict) – 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)
Schema for detailed information about throughput capacity with breakdown by specific throughput requests classes.
- 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.
query (int) – Provisioned global queries capacity in operations per second.
read (int) – Provisioned reads capacity in operations per second.
write (int) – Provisioned writes capacity in operations per second.
Initialization
Initialize a ThroughputInformation object.
- 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.
query (int) – Provisioned global queries capacity in operations per second.
read (int) – Provisioned reads capacity in operations per second.
write (int) – 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: dict, status: str)
Schema for information about the up state of the server.
- Parameters:
seeds (dict) – seeds.
status (str) – status.
Initialization
Initialize a UpInformation object.
- Parameters:
seeds (dict) – seeds.
status (str) – status.
- class StatusEnum
Bases:
str
,enum.Enum
status.
Initialization
Initialize self. See help(type(self)) for accurate signature.
- 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.UpdatesPending(minimum: int, preferred: int, total: int)
Schema for an ability to tell if view is up-to-date without querying it.
- Parameters:
minimum (int) – Sum of shard copies with the least amount of work to do.
preferred (int) – Sum of unique shards. This value is zero when at least one copy of every shard range is up-to-date and the view is able to answer a query without index building delays.
total (int) – Sum of all shard copies.
Initialization
Initialize a UpdatesPending object.
- Parameters:
minimum (int) – Sum of shard copies with the least amount of work to do.
preferred (int) – Sum of unique shards. This value is zero when at least one copy of every shard range is up-to-date and the view is able to answer a query without index building delays.
total (int) – Sum of all shard copies.
- classmethod from_dict(_dict: Dict) ibmcloudant.cloudant_v1.UpdatesPending
Initialize a UpdatesPending 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)
Schema for the user context of a session.
- Parameters:
db (str) – (optional) Database name in the context of the provided operation.
name (str) – User name.
roles (List[str]) – List of user roles.
Initialization
Initialize a UserContext object.
- Parameters:
name (str) – User name.
roles (List[str]) – List of user roles.
db (str) – (optional) Database name in the context of the provided operation.
- class RolesEnum
Bases:
str
,enum.Enum
Schema for a security role.
Initialization
Initialize self. See help(type(self)) for accurate signature.
- 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])
Schema for a set of uuids generated by the server.
- Parameters:
uuids (List[str]) – uuids.
Initialization
Initialize a UuidsResult object.
- Parameters:
uuids (List[str]) – 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])
Schema for the results of a queries view operation.
- Parameters:
results (List[ViewResult]) – An array of result objects - one for each query. Each result object contains the same fields as the response to a regular view request.
Initialization
Initialize a ViewQueriesResult object.
- Parameters:
results (List[ViewResult]) – 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, end_key: Optional[object] = None, end_key_doc_id: 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, start_key: Optional[object] = None, start_key_doc_id: Optional[str] = None, update: Optional[str] = None)
Schema for a query view operation.
- Parameters:
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 each returned document. Active only when
include_docs
istrue
.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.
end_key (object) – (optional) Schema for any JSON type.
end_key_doc_id (str) – (optional) Schema for a document ID.
group (bool) – (optional) Parameter to specify whether to group reduced results by key. Valid only if a reduce function defined in the view. If the view emits key in JSON array format, then it is possible to reduce groups further based on the number of array elements with the
group_level
parameter.group_level (int) – (optional) Parameter to specify a group level to be used. Only applicable if the view uses keys that are JSON arrays. Implies group is
true
. Group level groups the reduced results by the specified number of array elements. If unset, results are grouped by the entire array key, returning a reduced value for each complete key.key (object) – (optional) Schema for any JSON type.
keys (List[object]) – (optional) Parameter to specify returning only documents that match any of the specified keys. A JSON array of keys 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) Query parameter to specify whether use the same replica of the index on each request. The default value
false
contacts all replicas and returns the result from the first, fastest, responder. Setting it totrue
when used in conjunction withupdate=false
may improve consistency at the expense of increased latency and decreased throughput if the selected replica is not the fastest of the available replicas. Note: In general settingtrue
is discouraged and is strictly not recommended when usingupdate=true
.start_key (object) – (optional) Schema for any JSON type.
start_key_doc_id (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.
true
- Return results after the view is updated.false
- Return results without updating the view.lazy
- Return the view results without waiting for an update, but update them immediately after the request.
Initialization
Initialize a ViewQuery object.
- Parameters:
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 each returned document. Active only when
include_docs
istrue
.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.
end_key (object) – (optional) Schema for any JSON type.
end_key_doc_id (str) – (optional) Schema for a document ID.
group (bool) – (optional) Parameter to specify whether to group reduced results by key. Valid only if a reduce function defined in the view. If the view emits key in JSON array format, then it is possible to reduce groups further based on the number of array elements with the
group_level
parameter.group_level (int) – (optional) Parameter to specify a group level to be used. Only applicable if the view uses keys that are JSON arrays. Implies group is
true
. Group level groups the reduced results by the specified number of array elements. If unset, results are grouped by the entire array key, returning a reduced value for each complete key.key (object) – (optional) Schema for any JSON type.
keys (List[object]) – (optional) Parameter to specify returning only documents that match any of the specified keys. A JSON array of keys 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) Query parameter to specify whether use the same replica of the index on each request. The default value
false
contacts all replicas and returns the result from the first, fastest, responder. Setting it totrue
when used in conjunction withupdate=false
may improve consistency at the expense of increased latency and decreased throughput if the selected replica is not the fastest of the available replicas. Note: In general settingtrue
is discouraged and is strictly not recommended when usingupdate=true
.start_key (object) – (optional) Schema for any JSON type.
start_key_doc_id (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.
true
- Return results after the view is updated.false
- Return results without updating the view.lazy
- Return the view results without waiting for an update, but update them immediately after the request.
- class UpdateEnum
Bases:
str
,enum.Enum
Parameter to specify whether or not the view in question should be updated prior to responding to the user.
true
- Return results after the view is updated.false
- Return results without updating the view.lazy
- Return the view results without waiting for an update, but update them immediately after the request.
Initialization
Initialize self. See help(type(self)) for accurate signature.
- 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)
Schema for the result of a query view operation.
- Parameters:
total_rows (int) – (optional) Number of total rows.
update_seq (str) – (optional) Current update sequence for the database.
rows (List[ViewResultRow]) – rows.
Initialization
Initialize a ViewResult object.
- Parameters:
rows (List[ViewResultRow]) – rows.
total_rows (int) – (optional) Number of total rows.
update_seq (str) – (optional) Current update sequence for the database.
- 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)
Schema for a row of a view result.
- Parameters:
caused_by (str) – (optional) The cause of the error (if available).
error (str) – (optional) The name of the error.
reason (str) – (optional) The reason the error occurred (if available).
doc (Document) – (optional) Schema for a document.
id (str) – (optional) Schema for a document ID.
key (object) – Schema for any JSON type.
value (object) – Schema for any JSON type.
Initialization
Initialize a ViewResultRow object.
- Parameters:
key (object) – Schema for any JSON type.
value (object) – Schema for any JSON type.
caused_by (str) – (optional) The cause of the error (if available).
error (str) – (optional) The name of the error.
reason (str) – (optional) The reason the error occurred (if available).
doc (Document) – (optional) Schema for a document.
id (str) – (optional) Schema for a document ID.
- 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.