TableUsageRequest

class borneo.TableUsageRequest[source]

Bases: borneo.operations.Request

Cloud service only.

Represents the argument of a NoSQLHandle.get_table_usage() operation which returns dynamic information associated with a table, as returned in TableUsageResult. This information includes a time series of usage snapshots, each indicating data such as read and write throughput, throttling events, etc, as found in TableUsageResult.table_usage().

It is possible to return a range of usage records or, by default, only the most recent usage record. Usage records are created on a regular basis and maintained for a period of time. Only records for time periods that have completed are returned so that a user never sees changing data for a specific range.

The table name is required parameter.

Methods Summary

get_compartment() Cloud service only.
get_end_time() Returns the end time to use for the request in milliseconds since the Epoch.
get_end_time_string() Returns the end time as an ISO 8601 formatted string.
get_limit() Returns the limit to the number of usage records desired.
get_start_time() Returns the start time to use for the request in milliseconds since the Epoch.
get_start_time_string() Returns the start time as an ISO 8601 formatted string.
get_table_name() Returns the table name to use for the operation.
get_timeout() Returns the timeout to use for the operation, in milliseconds.
set_compartment(compartment) Cloud service only.
set_end_time(end_time) Sets the end time to use for the request in milliseconds since the Epoch in UTC time or an ISO 8601 formatted string accurate to milliseconds.
set_limit(limit) Sets the limit to the number of usage records desired.
set_start_time(start_time) Sets the start time to use for the request in milliseconds since the Epoch in UTC time or an ISO 8601 formatted string accurate to milliseconds.
set_table_name(table_name) Sets the table name to use for the request.
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_end_time()[source]

Returns the end time to use for the request in milliseconds since the Epoch.

Returns:the end time.
Return type:int
get_end_time_string()[source]

Returns the end time as an ISO 8601 formatted string. If the end timestamp is not set, None is returned.

Returns:the end time, or None if not set.
Return type:str
get_limit()[source]

Returns the limit to the number of usage records desired.

Returns:the numeric limit.
Return type:int
get_start_time()[source]

Returns the start time to use for the request in milliseconds since the Epoch.

Returns:the start time.
Return type:int
get_start_time_string()[source]

Returns the start time as an ISO 8601 formatted string. If the start timestamp is not set, None is returned.

Returns:the start time, or None if not set.
Return type:str
get_table_name()

Returns the table name to use for the operation.

Returns:the table name, or None if not set.
Returns:str
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 value.
Return type:int
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_end_time(end_time)[source]

Sets the end time to use for the request in milliseconds since the Epoch in UTC time or an ISO 8601 formatted string accurate to milliseconds. If timezone is not specified it is interpreted as UTC.

If no time range is set for this request the most recent complete usage record is returned.

Parameters:end_time (str) – the end time.
Returns:self.
Raises:IllegalArgumentException – raises the exception if end_time is a negative number and is not an ISO 8601 formatted string.
set_limit(limit)[source]

Sets the limit to the number of usage records desired. If this value is 0 there is no limit, but not all usage records may be returned in a single request due to size limitations.

Parameters:limit (int) – the numeric limit.
Returns:self.
Raises:IllegalArgumentException – raises the exception if limit is a negative number.
set_start_time(start_time)[source]

Sets the start time to use for the request in milliseconds since the Epoch in UTC time or an ISO 8601 formatted string accurate to milliseconds. If timezone is not specified it is interpreted as UTC.

If no time range is set for this request the most recent complete usage record is returned.

Parameters:start_time (str) – the start time.
Returns:self.
Raises:IllegalArgumentException – raises the exception if start_time is a negative number and is not an ISO 8601 formatted string.
set_table_name(table_name)[source]

Sets the table name to use for the request. 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.