Options

Option Classes

ClusterOptions

class couchbase_analytics.options.ClusterOptions(**kwargs: Unpack[ClusterOptionsKwargs])

Available options to set when creating a cluster.

Cluster options enable the configuration of various global cluster settings. Some options can be set globally for the cluster, but overridden for a specific request (i.e. TimeoutOptions).

Note

Options and methods marked VOLATILE are subject to change at any time.

Parameters:
  • deserializer (Optional[Deserializer]) – Set to configure global serializer to translate JSON to Python objects. Defaults to None (DefaultJsonDeserializer).

  • max_retries (Optional[int]) – VOLATILE Set to configure the maximum number of retries for a request. Defaults to 7.

  • security_options (Optional[SecurityOptions]) – Security options for SDK connection.

  • timeout_options (Optional[TimeoutOptions]) – Timeout options for the various stages of a request. See TimeoutOptions for details.

SecurityOptions

class couchbase_analytics.options.SecurityOptions(**kwargs: Unpack[SecurityOptionsKwargs])

Available security options to set when creating a cluster.

All options are optional and not required to be specified. By default the SDK will trust only the Capella CA certificate(s). Only a single option related to which certificate(s) the SDK should trust can be used. The disable_server_certificate_verification option can either be enabled or disabled for any of the specified trust settings.

Parameters:
  • trust_only_capella (Optional[bool]) – If enabled, SDK will trust only the Capella CA certificate(s). Defaults to True (enabled).

  • trust_only_pem_file (Optional[str]) – If set, SDK will trust only the PEM-encoded certificate(s) at the specified file path. Defaults to None.

  • trust_only_pem_str (Optional[str]) – If set, SDK will trust only the PEM-encoded certificate(s) in the specified str. Defaults to None.

  • trust_only_certificates (Optional[List[str]]) – If set, SDK will trust only the PEM-encoded certificate(s) specified. Defaults to None.

  • disable_server_certificate_verification (Optional[bool]) – If disabled, SDK will trust any certificate regardless of validity. Should not be disabled in production environments. Defaults to True (enabled).

TimeoutOptions

class couchbase_analytics.options.TimeoutOptions(**kwargs: Unpack[TimeoutOptionsKwargs])

Available timeout options to set when creating a cluster.

These options set the default timeouts for operations for the cluster. Some operations allow the timeout to be overridden on a per operation basis. All options are optional and default to None.

Note

Options marked VOLATILE are subject to change at any time.

Parameters:
  • connect_timeout (Optional[timedelta]) – Set to configure the period of time allowed to make a connection. Defaults to None (10s).

  • query_timeout (Optional[timedelta]) – Set to configure the period of time allowed for query operations. Defaults to None (10m).

QueryOptions

class couchbase_analytics.options.QueryOptions(**kwargs: Unpack[QueryOptionsKwargs])

Available options for Analytics query operation.

Timeout will default to cluster setting if not set for the operation.

Note

Options marked VOLATILE are subject to change at any time.

Parameters:
  • client_context_id (Optional[str]) – Set to configure a unique identifier for this query request. Defaults to None (autogenerated by client).

  • deserializer (Optional[Deserializer]) – Specifies a Deserializer to apply to results. Defaults to None (DefaultJsonDeserializer).

  • lazy_execute (Optional[bool]) – VOLATILE If enabled, the query will not execute until the application begins to iterate over results. Defaulst to None (disabled).

  • max_retries (Optional[int]) – VOLATILE Set to configure the maximum number of retries for a request.

  • named_parameters (Optional[Dict[str, JSONType]]) – Values to use for positional placeholders in query.

  • positional_parameters (Optional[List[JSONType]]) – , optional): Values to use for named placeholders in query.

  • query_context (Optional[str]) – Specifies the context within which this query should be executed.

  • raw (Optional[Dict[str, Any]]) – Specifies any additional parameters which should be passed to the Analytics engine when executing the query.

  • readonly (Optional[bool]) – Specifies that this query should be executed in read-only mode, disabling the ability for the query to make any changes to the data.

  • scan_consistency (Optional[QueryScanConsistency]) – Specifies the consistency requirements when executing the query.

  • timeout (Optional[timedelta]) – Set to configure allowed time for operation to complete. Defaults to None (75s).

  • stream_config (Optional[JsonStreamConfig]) – VOLATILE Configuration for JSON stream processing. Defaults to None (default configuration). See JsonStreamConfig for details.

Option TypeDict Classes

ClusterOptionsKwargs

class couchbase_analytics.options.ClusterOptionsKwargs
deserializer: Optional[Deserializer]
max_retries: Optional[int]
security_options: Optional[SecurityOptionsBase]
timeout_options: Optional[TimeoutOptionsBase]

SecurityOptionsKwargs

class couchbase_analytics.options.SecurityOptionsKwargs
disable_server_certificate_verification: Optional[bool]
trust_only_capella: Optional[bool]
trust_only_certificates: Optional[List[str]]
trust_only_pem_file: Optional[str]
trust_only_pem_str: Optional[str]

TimeoutOptionsKwargs

class couchbase_analytics.options.TimeoutOptionsKwargs
connect_timeout: Optional[timedelta]
query_timeout: Optional[timedelta]

QueryOptionsKwargs

class couchbase_analytics.options.QueryOptionsKwargs
client_context_id: Optional[str]
deserializer: Optional[Deserializer]
lazy_execute: Optional[bool]
max_retries: Optional[int]
named_parameters: Optional[Dict[str, JSONType]]
positional_parameters: Optional[Iterable[JSONType]]
query_context: Optional[str]
raw: Optional[Dict[str, Any]]
readonly: Optional[bool]
scan_consistency: Optional[Union[QueryScanConsistency, str]]
stream_config: Optional[JsonStreamConfig]
timeout: Optional[timedelta]