class OCI::Nosql::NosqlClient
The control plane API for NoSQL Database
Cloud Service HTTPS provides endpoints to perform NDCS operations, including creation and deletion of tables and indexes; population and access of data in tables; and access of table usage metrics.
Attributes
Client used to make HTTP requests. @return [OCI::ApiClient]
Fully qualified endpoint URL @return [String]
The region, which will usually correspond to a value in {OCI::Regions::REGION_ENUM}. @return [String]
The default retry configuration to apply to all operations in this service client. This can be overridden on a per-operation basis. The default retry configuration value is `nil`, which means that an operation will not perform any retries @return [OCI::Retry::RetryConfig]
Public Class Methods
Creates a new NosqlClient
. Notes:
If a config is not specified, then the global OCI.config will be used. This client is not thread-safe Either a region or an endpoint must be specified. If an endpoint is specified, it will be used instead of the region. A region may be specified in the config or via or the region parameter. If specified in both, then the region parameter will be used.
@param [Config] config A Config
object. @param [String] region A region used to determine the service endpoint. This will usually
correspond to a value in {OCI::Regions::REGION_ENUM}, but may be an arbitrary string.
@param [String] endpoint The fully qualified endpoint URL @param [OCI::BaseSigner] signer A signer implementation which can be used by this client. If this is not provided then
a signer will be constructed via the provided config. One use case of this parameter is instance principals authentication, so that the instance principals signer can be provided to the client
@param [OCI::ApiClientProxySettings] proxy_settings If your environment requires you to use a proxy server for outgoing HTTP requests
the details for the proxy can be provided in this parameter
@param [OCI::Retry::RetryConfig] retry_config
The retry configuration for this service client. This represents the default retry configuration to
apply across all operations. This can be overridden on a per-operation basis. The default retry configuration value is `nil`, which means that an operation will not perform any retries
# File lib/oci/nosql/nosql_client.rb, line 56 def initialize(config: nil, region: nil, endpoint: nil, signer: nil, proxy_settings: nil, retry_config: nil) # If the signer is an InstancePrincipalsSecurityTokenSigner or SecurityTokenSigner and no config was supplied (they are self-sufficient signers) # then create a dummy config to pass to the ApiClient constructor. If customers wish to create a client which uses instance principals # and has config (either populated programmatically or loaded from a file), they must construct that config themselves and then # pass it to this constructor. # # If there is no signer (or the signer is not an instance principals signer) and no config was supplied, this is not valid # so try and load the config from the default file. config = OCI::Config.validate_and_build_config_with_signer(config, signer) signer = OCI::Signer.config_file_auth_builder(config) if signer.nil? @api_client = OCI::ApiClient.new(config, signer, proxy_settings: proxy_settings) @retry_config = retry_config if endpoint @endpoint = endpoint + '/20190828' else region ||= config.region region ||= signer.region if signer.respond_to?(:region) self.region = region end logger.info "NosqlClient endpoint set to '#{@endpoint}'." if logger end
Public Instance Methods
Change a table's compartment. @param [String] table_name_or_id A table name within the compartment, or a table OCID. @param [OCI::Nosql::Models::ChangeTableCompartmentDetails] change_table_compartment_details Specifications of the source and target compartments. @param [Hash] opts the optional parameters @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
@option opts [String] :opc_retry_token A token that uniquely identifies a request so it can be retried
in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations. For example, if a resource has been deleted and purged from the system, then a retry of the original creation request might be rejected.
@option opts [String] :if_match For optimistic concurrency control. In the PUT or DELETE call
for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value. (default to false)
@option opts [String] :opc_request_id The client request ID for tracing. @return [Response] A Response
object with data of type nil @note Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/nosql/change_table_compartment.rb.html) to see an example of how to use change_table_compartment
API.
# File lib/oci/nosql/nosql_client.rb, line 127 def change_table_compartment(table_name_or_id, change_table_compartment_details, opts = {}) logger.debug 'Calling operation NosqlClient#change_table_compartment.' if logger raise "Missing the required parameter 'table_name_or_id' when calling change_table_compartment." if table_name_or_id.nil? raise "Missing the required parameter 'change_table_compartment_details' when calling change_table_compartment." if change_table_compartment_details.nil? raise "Parameter value for 'table_name_or_id' must not be blank" if OCI::Internal::Util.blank_string?(table_name_or_id) path = '/tables/{tableNameOrId}/actions/changeCompartment'.sub('{tableNameOrId}', table_name_or_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token] header_params[:'if-match'] = opts[:if_match] if opts[:if_match] header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] # rubocop:enable Style/NegatedIf header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token post_body = @api_client.object_to_http_body(change_table_compartment_details) # rubocop:disable Metrics/BlockLength OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'NosqlClient#change_table_compartment') do @api_client.call_api( :POST, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body ) end # rubocop:enable Metrics/BlockLength end
Create a new index on the table identified by tableNameOrId. @param [String] table_name_or_id A table name within the compartment, or a table OCID. @param [OCI::Nosql::Models::CreateIndexDetails] create_index_details Specifications for the new index. @param [Hash] opts the optional parameters @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
@option opts [String] :opc_retry_token A token that uniquely identifies a request so it can be retried
in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations. For example, if a resource has been deleted and purged from the system, then a retry of the original creation request might be rejected.
@option opts [String] :opc_request_id The client request ID for tracing. @return [Response] A Response
object with data of type nil @note Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/nosql/create_index.rb.html) to see an example of how to use create_index
API.
# File lib/oci/nosql/nosql_client.rb, line 193 def create_index(table_name_or_id, create_index_details, opts = {}) logger.debug 'Calling operation NosqlClient#create_index.' if logger raise "Missing the required parameter 'table_name_or_id' when calling create_index." if table_name_or_id.nil? raise "Missing the required parameter 'create_index_details' when calling create_index." if create_index_details.nil? raise "Parameter value for 'table_name_or_id' must not be blank" if OCI::Internal::Util.blank_string?(table_name_or_id) path = '/tables/{tableNameOrId}/indexes'.sub('{tableNameOrId}', table_name_or_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token] header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] # rubocop:enable Style/NegatedIf header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token post_body = @api_client.object_to_http_body(create_index_details) # rubocop:disable Metrics/BlockLength OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'NosqlClient#create_index') do @api_client.call_api( :POST, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body ) end # rubocop:enable Metrics/BlockLength end
Create a new table. @param [OCI::Nosql::Models::CreateTableDetails] create_table_details Specifications for the new table. @param [Hash] opts the optional parameters @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
@option opts [String] :opc_retry_token A token that uniquely identifies a request so it can be retried
in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations. For example, if a resource has been deleted and purged from the system, then a retry of the original creation request might be rejected.
@option opts [String] :opc_request_id The client request ID for tracing. @return [Response] A Response
object with data of type nil @note Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/nosql/create_table.rb.html) to see an example of how to use create_table
API.
# File lib/oci/nosql/nosql_client.rb, line 257 def create_table(create_table_details, opts = {}) logger.debug 'Calling operation NosqlClient#create_table.' if logger raise "Missing the required parameter 'create_table_details' when calling create_table." if create_table_details.nil? path = '/tables' operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token] header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] # rubocop:enable Style/NegatedIf header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token post_body = @api_client.object_to_http_body(create_table_details) # rubocop:disable Metrics/BlockLength OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'NosqlClient#create_table') do @api_client.call_api( :POST, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body ) end # rubocop:enable Metrics/BlockLength end
Delete an index from the table identified by tableNameOrId. @param [String] table_name_or_id A table name within the compartment, or a table OCID. @param [String] index_name The name of a table's index. @param [Hash] opts the optional parameters @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
@option opts [String] :compartment_id The ID of a table's compartment. When a table is identified
by name, the compartmentId is often needed to provide context for interpreting the name.
@option opts [BOOLEAN] :is_if_exists Set as true to select "if exists" behavior. (default to false) @option opts [String] :if_match For optimistic concurrency control. In the PUT or DELETE call
for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value. (default to false)
@option opts [String] :opc_request_id The client request ID for tracing. @return [Response] A Response
object with data of type nil @note Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/nosql/delete_index.rb.html) to see an example of how to use delete_index
API.
# File lib/oci/nosql/nosql_client.rb, line 323 def delete_index(table_name_or_id, index_name, opts = {}) logger.debug 'Calling operation NosqlClient#delete_index.' if logger raise "Missing the required parameter 'table_name_or_id' when calling delete_index." if table_name_or_id.nil? raise "Missing the required parameter 'index_name' when calling delete_index." if index_name.nil? raise "Parameter value for 'table_name_or_id' must not be blank" if OCI::Internal::Util.blank_string?(table_name_or_id) raise "Parameter value for 'index_name' must not be blank" if OCI::Internal::Util.blank_string?(index_name) path = '/tables/{tableNameOrId}/indexes/{indexName}'.sub('{tableNameOrId}', table_name_or_id.to_s).sub('{indexName}', index_name.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:compartmentId] = opts[:compartment_id] if opts[:compartment_id] query_params[:isIfExists] = opts[:is_if_exists] if !opts[:is_if_exists].nil? # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'if-match'] = opts[:if_match] if opts[:if_match] header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] # rubocop:enable Style/NegatedIf post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'NosqlClient#delete_index') do @api_client.call_api( :DELETE, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body ) end # rubocop:enable Metrics/BlockLength end
Delete a single row from the table, by primary key. @param [String] table_name_or_id A table name within the compartment, or a table OCID. @param [Array<String>] key An array of strings, each of the format "column-name:value",
representing the primary key of the row.
@param [Hash] opts the optional parameters @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
@option opts [String] :compartment_id The ID of a table's compartment. When a table is identified
by name, the compartmentId is often needed to provide context for interpreting the name.
@option opts [BOOLEAN] :is_get_return_row If true, and the operation fails due to an option setting
(ifVersion et al), then the existing row will be returned. (default to false)
@option opts [Integer] :timeout_in_ms Timeout setting for this operation. (default to 5000) @option opts [String] :if_match For optimistic concurrency control. In the PUT or DELETE call
for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value. (default to false)
@option opts [String] :opc_request_id The client request ID for tracing. @return [Response] A Response
object with data of type {OCI::Nosql::Models::DeleteRowResult DeleteRowResult} @note Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/nosql/delete_row.rb.html) to see an example of how to use delete_row
API.
# File lib/oci/nosql/nosql_client.rb, line 398 def delete_row(table_name_or_id, key, opts = {}) logger.debug 'Calling operation NosqlClient#delete_row.' if logger raise "Missing the required parameter 'table_name_or_id' when calling delete_row." if table_name_or_id.nil? raise "Missing the required parameter 'key' when calling delete_row." if key.nil? raise "Parameter value for 'table_name_or_id' must not be blank" if OCI::Internal::Util.blank_string?(table_name_or_id) path = '/tables/{tableNameOrId}/rows'.sub('{tableNameOrId}', table_name_or_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:key] = OCI::ApiClient.build_collection_params(key, :multi) query_params[:compartmentId] = opts[:compartment_id] if opts[:compartment_id] query_params[:isGetReturnRow] = opts[:is_get_return_row] if !opts[:is_get_return_row].nil? query_params[:timeoutInMs] = opts[:timeout_in_ms] if opts[:timeout_in_ms] # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'if-match'] = opts[:if_match] if opts[:if_match] header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] # rubocop:enable Style/NegatedIf post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'NosqlClient#delete_row') do @api_client.call_api( :DELETE, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::Nosql::Models::DeleteRowResult' ) end # rubocop:enable Metrics/BlockLength end
Delete a table by tableNameOrId. @param [String] table_name_or_id A table name within the compartment, or a table OCID. @param [Hash] opts the optional parameters @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
@option opts [String] :compartment_id The ID of a table's compartment. When a table is identified
by name, the compartmentId is often needed to provide context for interpreting the name.
@option opts [BOOLEAN] :is_if_exists Set as true to select "if exists" behavior. (default to false) @option opts [String] :if_match For optimistic concurrency control. In the PUT or DELETE call
for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value. (default to false)
@option opts [String] :opc_request_id The client request ID for tracing. @return [Response] A Response
object with data of type nil @note Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/nosql/delete_table.rb.html) to see an example of how to use delete_table
API.
# File lib/oci/nosql/nosql_client.rb, line 469 def delete_table(table_name_or_id, opts = {}) logger.debug 'Calling operation NosqlClient#delete_table.' if logger raise "Missing the required parameter 'table_name_or_id' when calling delete_table." if table_name_or_id.nil? raise "Parameter value for 'table_name_or_id' must not be blank" if OCI::Internal::Util.blank_string?(table_name_or_id) path = '/tables/{tableNameOrId}'.sub('{tableNameOrId}', table_name_or_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:compartmentId] = opts[:compartment_id] if opts[:compartment_id] query_params[:isIfExists] = opts[:is_if_exists] if !opts[:is_if_exists].nil? # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'if-match'] = opts[:if_match] if opts[:if_match] header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] # rubocop:enable Style/NegatedIf post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'NosqlClient#delete_table') do @api_client.call_api( :DELETE, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body ) end # rubocop:enable Metrics/BlockLength end
Cancel a work request operation with the given ID. @param [String] work_request_id The ID of the asynchronous request. @param [Hash] opts the optional parameters @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
@option opts [String] :if_match For optimistic concurrency control. In the PUT or DELETE call
for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value. (default to false)
@option opts [String] :opc_request_id The client request ID for tracing. @return [Response] A Response
object with data of type nil @note Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/nosql/delete_work_request.rb.html) to see an example of how to use delete_work_request
API.
# File lib/oci/nosql/nosql_client.rb, line 531 def delete_work_request(work_request_id, opts = {}) logger.debug 'Calling operation NosqlClient#delete_work_request.' if logger raise "Missing the required parameter 'work_request_id' when calling delete_work_request." if work_request_id.nil? raise "Parameter value for 'work_request_id' must not be blank" if OCI::Internal::Util.blank_string?(work_request_id) path = '/workRequests/{workRequestId}'.sub('{workRequestId}', work_request_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'if-match'] = opts[:if_match] if opts[:if_match] header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] # rubocop:enable Style/NegatedIf post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'NosqlClient#delete_work_request') do @api_client.call_api( :DELETE, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body ) end # rubocop:enable Metrics/BlockLength end
Get information about a single index. @param [String] table_name_or_id A table name within the compartment, or a table OCID. @param [String] index_name The name of a table's index. @param [Hash] opts the optional parameters @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
@option opts [String] :compartment_id The ID of a table's compartment. When a table is identified
by name, the compartmentId is often needed to provide context for interpreting the name.
@option opts [String] :opc_request_id The client request ID for tracing. @return [Response] A Response
object with data of type {OCI::Nosql::Models::Index Index} @note Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/nosql/get_index.rb.html) to see an example of how to use get_index
API.
# File lib/oci/nosql/nosql_client.rb, line 590 def get_index(table_name_or_id, index_name, opts = {}) logger.debug 'Calling operation NosqlClient#get_index.' if logger raise "Missing the required parameter 'table_name_or_id' when calling get_index." if table_name_or_id.nil? raise "Missing the required parameter 'index_name' when calling get_index." if index_name.nil? raise "Parameter value for 'table_name_or_id' must not be blank" if OCI::Internal::Util.blank_string?(table_name_or_id) raise "Parameter value for 'index_name' must not be blank" if OCI::Internal::Util.blank_string?(index_name) path = '/tables/{tableNameOrId}/indexes/{indexName}'.sub('{tableNameOrId}', table_name_or_id.to_s).sub('{indexName}', index_name.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:compartmentId] = opts[:compartment_id] if opts[:compartment_id] # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] # rubocop:enable Style/NegatedIf post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'NosqlClient#get_index') do @api_client.call_api( :GET, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::Nosql::Models::Index' ) end # rubocop:enable Metrics/BlockLength end
Get a single row from the table by primary key. @param [String] table_name_or_id A table name within the compartment, or a table OCID. @param [Array<String>] key An array of strings, each of the format "column-name:value",
representing the primary key of the row.
@param [Hash] opts the optional parameters @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
@option opts [String] :compartment_id The ID of a table's compartment. When a table is identified
by name, the compartmentId is often needed to provide context for interpreting the name.
@option opts [String] :consistency Consistency requirement for a read operation. (default to EVENTUAL)
Allowed values are: EVENTUAL, ABSOLUTE
@option opts [Integer] :timeout_in_ms Timeout setting for this operation. (default to 5000) @option opts [String] :opc_request_id The client request ID for tracing. @return [Response] A Response
object with data of type {OCI::Nosql::Models::Row Row} @note Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/nosql/get_row.rb.html) to see an example of how to use get_row
API.
# File lib/oci/nosql/nosql_client.rb, line 657 def get_row(table_name_or_id, key, opts = {}) logger.debug 'Calling operation NosqlClient#get_row.' if logger raise "Missing the required parameter 'table_name_or_id' when calling get_row." if table_name_or_id.nil? raise "Missing the required parameter 'key' when calling get_row." if key.nil? if opts[:consistency] && !%w[EVENTUAL ABSOLUTE].include?(opts[:consistency]) raise 'Invalid value for "consistency", must be one of EVENTUAL, ABSOLUTE.' end raise "Parameter value for 'table_name_or_id' must not be blank" if OCI::Internal::Util.blank_string?(table_name_or_id) path = '/tables/{tableNameOrId}/rows'.sub('{tableNameOrId}', table_name_or_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:key] = OCI::ApiClient.build_collection_params(key, :multi) query_params[:compartmentId] = opts[:compartment_id] if opts[:compartment_id] query_params[:consistency] = opts[:consistency] if opts[:consistency] query_params[:timeoutInMs] = opts[:timeout_in_ms] if opts[:timeout_in_ms] # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] # rubocop:enable Style/NegatedIf post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'NosqlClient#get_row') do @api_client.call_api( :GET, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::Nosql::Models::Row' ) end # rubocop:enable Metrics/BlockLength end
Get table info by identifier. @param [String] table_name_or_id A table name within the compartment, or a table OCID. @param [Hash] opts the optional parameters @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
@option opts [String] :compartment_id The ID of a table's compartment. When a table is identified
by name, the compartmentId is often needed to provide context for interpreting the name.
@option opts [String] :opc_request_id The client request ID for tracing. @return [Response] A Response
object with data of type {OCI::Nosql::Models::Table Table} @note Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/nosql/get_table.rb.html) to see an example of how to use get_table
API.
# File lib/oci/nosql/nosql_client.rb, line 724 def get_table(table_name_or_id, opts = {}) logger.debug 'Calling operation NosqlClient#get_table.' if logger raise "Missing the required parameter 'table_name_or_id' when calling get_table." if table_name_or_id.nil? raise "Parameter value for 'table_name_or_id' must not be blank" if OCI::Internal::Util.blank_string?(table_name_or_id) path = '/tables/{tableNameOrId}'.sub('{tableNameOrId}', table_name_or_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:compartmentId] = opts[:compartment_id] if opts[:compartment_id] # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] # rubocop:enable Style/NegatedIf post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'NosqlClient#get_table') do @api_client.call_api( :GET, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::Nosql::Models::Table' ) end # rubocop:enable Metrics/BlockLength end
Get the status of the work request with the given ID. @param [String] work_request_id The ID of the asynchronous request. @param [Hash] opts the optional parameters @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
@option opts [String] :opc_request_id The client request ID for tracing. @return [Response] A Response
object with data of type {OCI::Nosql::Models::WorkRequest WorkRequest} @note Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/nosql/get_work_request.rb.html) to see an example of how to use get_work_request
API.
# File lib/oci/nosql/nosql_client.rb, line 779 def get_work_request(work_request_id, opts = {}) logger.debug 'Calling operation NosqlClient#get_work_request.' if logger raise "Missing the required parameter 'work_request_id' when calling get_work_request." if work_request_id.nil? raise "Parameter value for 'work_request_id' must not be blank" if OCI::Internal::Util.blank_string?(work_request_id) path = '/workRequests/{workRequestId}'.sub('{workRequestId}', work_request_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] # rubocop:enable Style/NegatedIf post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'NosqlClient#get_work_request') do @api_client.call_api( :GET, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::Nosql::Models::WorkRequest' ) end # rubocop:enable Metrics/BlockLength end
Get a list of indexes on a table. @param [String] table_name_or_id A table name within the compartment, or a table OCID. @param [Hash] opts the optional parameters @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
@option opts [String] :compartment_id The ID of a table's compartment. When a table is identified
by name, the compartmentId is often needed to provide context for interpreting the name.
@option opts [String] :name A shell-globbing-style (*?[]) filter for names. (default to *) @option opts [String] :lifecycle_state Filter list by the lifecycle state of the item. (default to ALL)
Allowed values are: ALL, CREATING, UPDATING, ACTIVE, DELETING, DELETED, FAILED, INACTIVE
@option opts [Integer] :limit The maximum number of items to return. (default to 1000) @option opts [String] :page The page token representing the page at which to start
retrieving results. This is usually retrieved from a previous list call.
@option opts [String] :sort_order The sort order to use, either 'ASC' or 'DESC'. (default to DESC)
Allowed values are: ASC, DESC
@option opts [String] :sort_by The field to sort by. Only one sort order may be
provided. Default order for timeCreated is descending. Default order for name is ascending. If no value is specified timeCreated is default. (default to timeCreated) Allowed values are: timeCreated, name
@option opts [String] :opc_request_id The client request ID for tracing. @return [Response] A Response
object with data of type {OCI::Nosql::Models::IndexCollection IndexCollection} @note Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/nosql/list_indexes.rb.html) to see an example of how to use list_indexes
API.
# File lib/oci/nosql/nosql_client.rb, line 853 def list_indexes(table_name_or_id, opts = {}) logger.debug 'Calling operation NosqlClient#list_indexes.' if logger raise "Missing the required parameter 'table_name_or_id' when calling list_indexes." if table_name_or_id.nil? if opts[:lifecycle_state] && !%w[ALL CREATING UPDATING ACTIVE DELETING DELETED FAILED INACTIVE].include?(opts[:lifecycle_state]) raise 'Invalid value for "lifecycle_state", must be one of ALL, CREATING, UPDATING, ACTIVE, DELETING, DELETED, FAILED, INACTIVE.' end if opts[:sort_order] && !%w[ASC DESC].include?(opts[:sort_order]) raise 'Invalid value for "sort_order", must be one of ASC, DESC.' end if opts[:sort_by] && !%w[timeCreated name].include?(opts[:sort_by]) raise 'Invalid value for "sort_by", must be one of timeCreated, name.' end raise "Parameter value for 'table_name_or_id' must not be blank" if OCI::Internal::Util.blank_string?(table_name_or_id) path = '/tables/{tableNameOrId}/indexes'.sub('{tableNameOrId}', table_name_or_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:compartmentId] = opts[:compartment_id] if opts[:compartment_id] query_params[:name] = opts[:name] if opts[:name] query_params[:lifecycleState] = opts[:lifecycle_state] if opts[:lifecycle_state] query_params[:limit] = opts[:limit] if opts[:limit] query_params[:page] = opts[:page] if opts[:page] query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order] query_params[:sortBy] = opts[:sort_by] if opts[:sort_by] # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] # rubocop:enable Style/NegatedIf post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'NosqlClient#list_indexes') do @api_client.call_api( :GET, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::Nosql::Models::IndexCollection' ) end # rubocop:enable Metrics/BlockLength end
Get table usage info. @param [String] table_name_or_id A table name within the compartment, or a table OCID. @param [Hash] opts the optional parameters @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
@option opts [String] :compartment_id The ID of a table's compartment. When a table is identified
by name, the compartmentId is often needed to provide context for interpreting the name.
@option opts [String] :opc_request_id The client request ID for tracing. @option opts [DateTime] :time_start The start time to use for the request. If no time range
is set for this request, the most recent complete usage record is returned.
@option opts [DateTime] :time_end The end time to use for the request. @option opts [Integer] :limit The maximum number of items to return. (default to 1000) @option opts [String] :page The page token representing the page at which to start
retrieving results. This is usually retrieved from a previous list call.
@return [Response] A Response
object with data of type {OCI::Nosql::Models::TableUsageCollection TableUsageCollection} @note Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/nosql/list_table_usage.rb.html) to see an example of how to use list_table_usage
API.
# File lib/oci/nosql/nosql_client.rb, line 940 def list_table_usage(table_name_or_id, opts = {}) logger.debug 'Calling operation NosqlClient#list_table_usage.' if logger raise "Missing the required parameter 'table_name_or_id' when calling list_table_usage." if table_name_or_id.nil? raise "Parameter value for 'table_name_or_id' must not be blank" if OCI::Internal::Util.blank_string?(table_name_or_id) path = '/tables/{tableNameOrId}/usage'.sub('{tableNameOrId}', table_name_or_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:compartmentId] = opts[:compartment_id] if opts[:compartment_id] query_params[:timeStart] = opts[:time_start] if opts[:time_start] query_params[:timeEnd] = opts[:time_end] if opts[:time_end] query_params[:limit] = opts[:limit] if opts[:limit] query_params[:page] = opts[:page] if opts[:page] # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] # rubocop:enable Style/NegatedIf post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'NosqlClient#list_table_usage') do @api_client.call_api( :GET, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::Nosql::Models::TableUsageCollection' ) end # rubocop:enable Metrics/BlockLength end
Get a list of tables in a compartment. @param [String] compartment_id The ID of a table's compartment. @param [Hash] opts the optional parameters @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
@option opts [String] :name A shell-globbing-style (*?[]) filter for names. (default to *) @option opts [Integer] :limit The maximum number of items to return. (default to 1000) @option opts [String] :page The page token representing the page at which to start
retrieving results. This is usually retrieved from a previous list call.
@option opts [String] :sort_order The sort order to use, either 'ASC' or 'DESC'. (default to DESC)
Allowed values are: ASC, DESC
@option opts [String] :sort_by The field to sort by. Only one sort order may be
provided. Default order for timeCreated is descending. Default order for name is ascending. If no value is specified timeCreated is default. (default to timeCreated) Allowed values are: timeCreated, name
@option opts [String] :opc_request_id The client request ID for tracing. @option opts [String] :lifecycle_state Filter list by the lifecycle state of the item. (default to ALL)
Allowed values are: ALL, CREATING, UPDATING, ACTIVE, DELETING, DELETED, FAILED, INACTIVE
@return [Response] A Response
object with data of type {OCI::Nosql::Models::TableCollection TableCollection} @note Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/nosql/list_tables.rb.html) to see an example of how to use list_tables
API.
# File lib/oci/nosql/nosql_client.rb, line 1015 def list_tables(compartment_id, opts = {}) logger.debug 'Calling operation NosqlClient#list_tables.' if logger raise "Missing the required parameter 'compartment_id' when calling list_tables." if compartment_id.nil? if opts[:sort_order] && !%w[ASC DESC].include?(opts[:sort_order]) raise 'Invalid value for "sort_order", must be one of ASC, DESC.' end if opts[:sort_by] && !%w[timeCreated name].include?(opts[:sort_by]) raise 'Invalid value for "sort_by", must be one of timeCreated, name.' end if opts[:lifecycle_state] && !%w[ALL CREATING UPDATING ACTIVE DELETING DELETED FAILED INACTIVE].include?(opts[:lifecycle_state]) raise 'Invalid value for "lifecycle_state", must be one of ALL, CREATING, UPDATING, ACTIVE, DELETING, DELETED, FAILED, INACTIVE.' end path = '/tables' operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:compartmentId] = compartment_id query_params[:name] = opts[:name] if opts[:name] query_params[:limit] = opts[:limit] if opts[:limit] query_params[:page] = opts[:page] if opts[:page] query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order] query_params[:sortBy] = opts[:sort_by] if opts[:sort_by] query_params[:lifecycleState] = opts[:lifecycle_state] if opts[:lifecycle_state] # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] # rubocop:enable Style/NegatedIf post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'NosqlClient#list_tables') do @api_client.call_api( :GET, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::Nosql::Models::TableCollection' ) end # rubocop:enable Metrics/BlockLength end
Return a (paginated) list of errors for a given work request.
@param [String] work_request_id The ID of the asynchronous request. @param [Hash] opts the optional parameters @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
@option opts [String] :opc_request_id The client request ID for tracing. @option opts [String] :page The page token representing the page at which to start
retrieving results. This is usually retrieved from a previous list call.
@option opts [Integer] :limit The maximum number of items to return. (default to 1000) @return [Response] A Response
object with data of type {OCI::Nosql::Models::WorkRequestErrorCollection WorkRequestErrorCollection} @note Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/nosql/list_work_request_errors.rb.html) to see an example of how to use list_work_request_errors
API.
# File lib/oci/nosql/nosql_client.rb, line 1093 def list_work_request_errors(work_request_id, opts = {}) logger.debug 'Calling operation NosqlClient#list_work_request_errors.' if logger raise "Missing the required parameter 'work_request_id' when calling list_work_request_errors." if work_request_id.nil? raise "Parameter value for 'work_request_id' must not be blank" if OCI::Internal::Util.blank_string?(work_request_id) path = '/workRequests/{workRequestId}/errors'.sub('{workRequestId}', work_request_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:page] = opts[:page] if opts[:page] query_params[:limit] = opts[:limit] if opts[:limit] # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] # rubocop:enable Style/NegatedIf post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'NosqlClient#list_work_request_errors') do @api_client.call_api( :GET, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::Nosql::Models::WorkRequestErrorCollection' ) end # rubocop:enable Metrics/BlockLength end
Return a (paginated) list of logs for a given work request.
@param [String] work_request_id The ID of the asynchronous request. @param [Hash] opts the optional parameters @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
@option opts [String] :opc_request_id The client request ID for tracing. @option opts [String] :page The page token representing the page at which to start
retrieving results. This is usually retrieved from a previous list call.
@option opts [Integer] :limit The maximum number of items to return. (default to 1000) @return [Response] A Response
object with data of type {OCI::Nosql::Models::WorkRequestLogEntryCollection WorkRequestLogEntryCollection} @note Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/nosql/list_work_request_logs.rb.html) to see an example of how to use list_work_request_logs
API.
# File lib/oci/nosql/nosql_client.rb, line 1155 def list_work_request_logs(work_request_id, opts = {}) logger.debug 'Calling operation NosqlClient#list_work_request_logs.' if logger raise "Missing the required parameter 'work_request_id' when calling list_work_request_logs." if work_request_id.nil? raise "Parameter value for 'work_request_id' must not be blank" if OCI::Internal::Util.blank_string?(work_request_id) path = '/workRequests/{workRequestId}/logs'.sub('{workRequestId}', work_request_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:page] = opts[:page] if opts[:page] query_params[:limit] = opts[:limit] if opts[:limit] # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] # rubocop:enable Style/NegatedIf post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'NosqlClient#list_work_request_logs') do @api_client.call_api( :GET, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::Nosql::Models::WorkRequestLogEntryCollection' ) end # rubocop:enable Metrics/BlockLength end
List the work requests in a compartment. @param [String] compartment_id The ID of a table's compartment. @param [Hash] opts the optional parameters @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
@option opts [String] :opc_request_id The client request ID for tracing. @option opts [String] :page The page token representing the page at which to start
retrieving results. This is usually retrieved from a previous list call.
@option opts [Integer] :limit The maximum number of items to return. (default to 1000) @return [Response] A Response
object with data of type {OCI::Nosql::Models::WorkRequestCollection WorkRequestCollection} @note Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/nosql/list_work_requests.rb.html) to see an example of how to use list_work_requests
API.
# File lib/oci/nosql/nosql_client.rb, line 1216 def list_work_requests(compartment_id, opts = {}) logger.debug 'Calling operation NosqlClient#list_work_requests.' if logger raise "Missing the required parameter 'compartment_id' when calling list_work_requests." if compartment_id.nil? path = '/workRequests' operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:compartmentId] = compartment_id query_params[:page] = opts[:page] if opts[:page] query_params[:limit] = opts[:limit] if opts[:limit] # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] # rubocop:enable Style/NegatedIf post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'NosqlClient#list_work_requests') do @api_client.call_api( :GET, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::Nosql::Models::WorkRequestCollection' ) end # rubocop:enable Metrics/BlockLength end
@return [Logger] The logger for this client. May be nil.
# File lib/oci/nosql/nosql_client.rb, line 95 def logger @api_client.config.logger end
Prepare a SQL statement for use in a query with variable substitution.
@param [String] compartment_id The ID of a table's compartment. @param [String] statement A NoSQL SQL statement. @param [Hash] opts the optional parameters @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
@option opts [String] :opc_request_id The client request ID for tracing. @return [Response] A Response
object with data of type {OCI::Nosql::Models::PreparedStatement PreparedStatement} @note Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/nosql/prepare_statement.rb.html) to see an example of how to use prepare_statement
API.
# File lib/oci/nosql/nosql_client.rb, line 1274 def prepare_statement(compartment_id, statement, opts = {}) logger.debug 'Calling operation NosqlClient#prepare_statement.' if logger raise "Missing the required parameter 'compartment_id' when calling prepare_statement." if compartment_id.nil? raise "Missing the required parameter 'statement' when calling prepare_statement." if statement.nil? path = '/query/prepare' operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:compartmentId] = compartment_id query_params[:statement] = statement # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] # rubocop:enable Style/NegatedIf post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'NosqlClient#prepare_statement') do @api_client.call_api( :GET, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::Nosql::Models::PreparedStatement' ) end # rubocop:enable Metrics/BlockLength end
Execute a SQL query. @param [OCI::Nosql::Models::QueryDetails] query_details SQL query statement and ancillary information. @param [Hash] opts the optional parameters @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
@option opts [Integer] :limit The maximum number of items to return. (default to 1000) @option opts [String] :page The page token representing the page at which to start
retrieving results. This is usually retrieved from a previous list call.
@option opts [String] :opc_request_id The client request ID for tracing. @return [Response] A Response
object with data of type {OCI::Nosql::Models::QueryResultCollection QueryResultCollection} @note Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/nosql/query.rb.html) to see an example of how to use query API.
# File lib/oci/nosql/nosql_client.rb, line 1335 def query(query_details, opts = {}) logger.debug 'Calling operation NosqlClient#query.' if logger raise "Missing the required parameter 'query_details' when calling query." if query_details.nil? path = '/query' operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:limit] = opts[:limit] if opts[:limit] query_params[:page] = opts[:page] if opts[:page] # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] # rubocop:enable Style/NegatedIf post_body = @api_client.object_to_http_body(query_details) # rubocop:disable Metrics/BlockLength OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'NosqlClient#query') do @api_client.call_api( :POST, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::Nosql::Models::QueryResultCollection' ) end # rubocop:enable Metrics/BlockLength end
Set the region that will be used to determine the service endpoint. This will usually correspond to a value in {OCI::Regions::REGION_ENUM}, but may be an arbitrary string.
# File lib/oci/nosql/nosql_client.rb, line 85 def region=(new_region) @region = new_region raise 'A region must be specified.' unless @region @endpoint = OCI::Regions.get_service_endpoint_for_template(@region, 'https://nosql.{region}.oci.{secondLevelDomain}') + '/20190828' logger.info "NosqlClient endpoint set to '#{@endpoint} from region #{@region}'." if logger end
Check the syntax and return a brief summary of a SQL statement.
@param [String] compartment_id The ID of a table's compartment. @param [String] statement A NoSQL SQL statement. @param [Hash] opts the optional parameters @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
@option opts [String] :opc_request_id The client request ID for tracing. @return [Response] A Response
object with data of type {OCI::Nosql::Models::StatementSummary StatementSummary} @note Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/nosql/summarize_statement.rb.html) to see an example of how to use summarize_statement
API.
# File lib/oci/nosql/nosql_client.rb, line 1392 def summarize_statement(compartment_id, statement, opts = {}) logger.debug 'Calling operation NosqlClient#summarize_statement.' if logger raise "Missing the required parameter 'compartment_id' when calling summarize_statement." if compartment_id.nil? raise "Missing the required parameter 'statement' when calling summarize_statement." if statement.nil? path = '/query/summarize' operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:compartmentId] = compartment_id query_params[:statement] = statement # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] # rubocop:enable Style/NegatedIf post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'NosqlClient#summarize_statement') do @api_client.call_api( :GET, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::Nosql::Models::StatementSummary' ) end # rubocop:enable Metrics/BlockLength end
Write a single row into the table. @param [String] table_name_or_id A table name within the compartment, or a table OCID. @param [OCI::Nosql::Models::UpdateRowDetails] update_row_details Specifications for the putting of a table row. @param [Hash] opts the optional parameters @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
@option opts [String] :if_match For optimistic concurrency control. In the PUT or DELETE call
for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value. (default to false)
@option opts [String] :opc_request_id The client request ID for tracing. @return [Response] A Response
object with data of type {OCI::Nosql::Models::UpdateRowResult UpdateRowResult} @note Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/nosql/update_row.rb.html) to see an example of how to use update_row
API.
# File lib/oci/nosql/nosql_client.rb, line 1455 def update_row(table_name_or_id, update_row_details, opts = {}) logger.debug 'Calling operation NosqlClient#update_row.' if logger raise "Missing the required parameter 'table_name_or_id' when calling update_row." if table_name_or_id.nil? raise "Missing the required parameter 'update_row_details' when calling update_row." if update_row_details.nil? raise "Parameter value for 'table_name_or_id' must not be blank" if OCI::Internal::Util.blank_string?(table_name_or_id) path = '/tables/{tableNameOrId}/rows'.sub('{tableNameOrId}', table_name_or_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'if-match'] = opts[:if_match] if opts[:if_match] header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] # rubocop:enable Style/NegatedIf post_body = @api_client.object_to_http_body(update_row_details) # rubocop:disable Metrics/BlockLength OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'NosqlClient#update_row') do @api_client.call_api( :PUT, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::Nosql::Models::UpdateRowResult' ) end # rubocop:enable Metrics/BlockLength end
Alter the table identified by tableNameOrId, changing schema, limits, or tags
@param [String] table_name_or_id A table name within the compartment, or a table OCID. @param [OCI::Nosql::Models::UpdateTableDetails] update_table_details Specifications for the alteration. @param [Hash] opts the optional parameters @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
@option opts [String] :if_match For optimistic concurrency control. In the PUT or DELETE call
for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value. (default to false)
@option opts [String] :opc_request_id The client request ID for tracing. @return [Response] A Response
object with data of type nil @note Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/nosql/update_table.rb.html) to see an example of how to use update_table
API.
# File lib/oci/nosql/nosql_client.rb, line 1520 def update_table(table_name_or_id, update_table_details, opts = {}) logger.debug 'Calling operation NosqlClient#update_table.' if logger raise "Missing the required parameter 'table_name_or_id' when calling update_table." if table_name_or_id.nil? raise "Missing the required parameter 'update_table_details' when calling update_table." if update_table_details.nil? raise "Parameter value for 'table_name_or_id' must not be blank" if OCI::Internal::Util.blank_string?(table_name_or_id) path = '/tables/{tableNameOrId}'.sub('{tableNameOrId}', table_name_or_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'if-match'] = opts[:if_match] if opts[:if_match] header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] # rubocop:enable Style/NegatedIf post_body = @api_client.object_to_http_body(update_table_details) # rubocop:disable Metrics/BlockLength OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'NosqlClient#update_table') do @api_client.call_api( :PUT, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body ) end # rubocop:enable Metrics/BlockLength end
Private Instance Methods
rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists rubocop:enable Metrics/MethodLength, Layout/EmptyLines
# File lib/oci/nosql/nosql_client.rb, line 1564 def applicable_retry_config(opts = {}) return @retry_config unless opts.key?(:retry_config) opts[:retry_config] end