GetRequest¶
- class borneo.GetRequest[source]¶
Bases:
ReadRequest
Represents the input to a
NoSQLHandle.get()
operation which returns a single row based on the specified key.The table name and key are required parameters.
Methods Summary
Cloud service only.
get_key
()Returns the primary key used for the operation.
Returns the timeout to use for the operation, in milliseconds.
set_consistency
(consistency)Sets the consistency to use for the operation.
set_compartment
(compartment)Cloud service only.
set_key
(key)Sets the primary key used for the get operation.
set_key_from_json
(json_key)Sets the key to use for the get operation based on a JSON string.
set_table_name
(table_name)Sets the table name to use for the operation.
set_timeout
(timeout_ms)Sets the request timeout value, in milliseconds.
Methods Documentation
- get_compartment()¶
Cloud service only.
Get the compartment id or name if set for the request.
- Returns:
compartment id or name if set for the request, otherwise None if not set.
- Return type:
str
- get_key()[source]¶
Returns the primary key used for the operation. This is a required parameter.
- Returns:
the key.
- Return type:
dict
- get_timeout()[source]¶
Returns the timeout to use for the operation, in milliseconds. A value of 0 indicates that the timeout has not been set.
- Returns:
the timeout value.
- Return type:
int
- set_consistency(consistency)[source]¶
Sets the consistency to use for the operation. This parameter is optional and if not set the default consistency configured for the
NoSQLHandle
is used.- Parameters:
consistency (Consistency) – the consistency.
- Returns:
self.
- Raises:
IllegalArgumentException – raises the exception if consistency is not Consistency.ABSOLUTE or Consistency.EVENTUAL.
- set_compartment(compartment)[source]¶
Cloud service only.
Sets the name or id of a compartment to be used for this operation.
The compartment may be specified as either a name (or path for nested compartments) or as an id (OCID). A name (vs id) can only be used when authenticated using a specific user identity. It is not available if authenticated as an Instance Principal which can be done when calling the service from a compute instance in the Oracle Cloud Infrastructure. See
borneo.iam.SignatureProvider.create_with_instance_principal()
.- Parameters:
compartment (str) – the compartment name or id. If using a nested compartment, specify the full compartment path compartmentA.compartmentB, but exclude the name of the root compartment (tenant).
- Returns:
self.
- Raises:
IllegalArgumentException – raises the exception if compartment is not a str.
- set_key(key)[source]¶
Sets the primary key used for the get operation. This is a required parameter.
- Parameters:
key (dict) – the primary key.
- Returns:
self.
- Raises:
IllegalArgumentException – raises the exception if key is not a dictionary.
- set_key_from_json(json_key)[source]¶
Sets the key to use for the get operation based on a JSON string.
- Parameters:
json_key (str) – the key as a JSON string.
- Returns:
self.
- Raises:
IllegalArgumentException – raises the exception if json_key is not a string.
- set_table_name(table_name)[source]¶
Sets the table name to use for the operation. This is a required parameter.
- Parameters:
table_name (str) – the table name.
- Returns:
self.
- Raises:
IllegalArgumentException – raises the exception if table_name is not a string.
- set_timeout(timeout_ms)[source]¶
Sets the request timeout value, in milliseconds. This overrides any default value set in
NoSQLHandleConfig
. The value must be positive.- Parameters:
timeout_ms (int) – the timeout value, in milliseconds.
- Returns:
self.
- Raises:
IllegalArgumentException – raises the exception if the timeout value is less than or equal to 0.