Storage Insights V1 API - Class Google::Cloud::StorageInsights::V1::StorageInsights::Client (v0.6.0)

Reference documentation and code samples for the Storage Insights V1 API class Google::Cloud::StorageInsights::V1::StorageInsights::Client.

Client for the StorageInsights service.

Service describing handlers for resources

Inherits

  • Object

Methods

.configure

def self.configure() { |config| ... } -> Client::Configuration

Configure the StorageInsights Client class.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter
Example
# Modify the configuration for all StorageInsights clients
::Google::Cloud::StorageInsights::V1::StorageInsights::Client.configure do |config|
  config.timeout = 10.0
end

#configure

def configure() { |config| ... } -> Client::Configuration

Configure the StorageInsights Client instance.

The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on Client.configure.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter

#create_report_config

def create_report_config(request, options = nil) -> ::Google::Cloud::StorageInsights::V1::ReportConfig
def create_report_config(parent: nil, report_config: nil, request_id: nil) -> ::Google::Cloud::StorageInsights::V1::ReportConfig

Creates a new ReportConfig in a given project and location.

Overloads
def create_report_config(request, options = nil) -> ::Google::Cloud::StorageInsights::V1::ReportConfig
Pass arguments to create_report_config via a request object, either of type CreateReportConfigRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::StorageInsights::V1::CreateReportConfigRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def create_report_config(parent: nil, report_config: nil, request_id: nil) -> ::Google::Cloud::StorageInsights::V1::ReportConfig
Pass arguments to create_report_config via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. Value for parent.
  • report_config (::Google::Cloud::StorageInsights::V1::ReportConfig, ::Hash) — Required. The resource being created
  • request_id (::String) — Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request.

    For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

    The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/storage_insights/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::StorageInsights::V1::CreateReportConfigRequest.new

# Call the create_report_config method.
result = client.create_report_config request

# The returned object is of type Google::Cloud::StorageInsights::V1::ReportConfig.
p result

#delete_report_config

def delete_report_config(request, options = nil) -> ::Google::Protobuf::Empty
def delete_report_config(name: nil, force: nil, request_id: nil) -> ::Google::Protobuf::Empty

Deletes a single ReportConfig.

Overloads
def delete_report_config(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_report_config via a request object, either of type DeleteReportConfigRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::StorageInsights::V1::DeleteReportConfigRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def delete_report_config(name: nil, force: nil, request_id: nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_report_config via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • name (::String) — Required. Name of the resource
  • force (::Boolean) — Optional. If set, all ReportDetails for this ReportConfig will be deleted.
  • request_id (::String) — Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes after the first request.

    For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

    The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/storage_insights/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::StorageInsights::V1::DeleteReportConfigRequest.new

# Call the delete_report_config method.
result = client.delete_report_config request

# The returned object is of type Google::Protobuf::Empty.
p result

#get_report_config

def get_report_config(request, options = nil) -> ::Google::Cloud::StorageInsights::V1::ReportConfig
def get_report_config(name: nil) -> ::Google::Cloud::StorageInsights::V1::ReportConfig

Gets details of a single ReportConfig.

Overloads
def get_report_config(request, options = nil) -> ::Google::Cloud::StorageInsights::V1::ReportConfig
Pass arguments to get_report_config via a request object, either of type GetReportConfigRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::StorageInsights::V1::GetReportConfigRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def get_report_config(name: nil) -> ::Google::Cloud::StorageInsights::V1::ReportConfig
Pass arguments to get_report_config via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. Name of the resource
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/storage_insights/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::StorageInsights::V1::GetReportConfigRequest.new

# Call the get_report_config method.
result = client.get_report_config request

# The returned object is of type Google::Cloud::StorageInsights::V1::ReportConfig.
p result

#get_report_detail

def get_report_detail(request, options = nil) -> ::Google::Cloud::StorageInsights::V1::ReportDetail
def get_report_detail(name: nil) -> ::Google::Cloud::StorageInsights::V1::ReportDetail

Gets details of a single ReportDetail.

Overloads
def get_report_detail(request, options = nil) -> ::Google::Cloud::StorageInsights::V1::ReportDetail
Pass arguments to get_report_detail via a request object, either of type GetReportDetailRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::StorageInsights::V1::GetReportDetailRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def get_report_detail(name: nil) -> ::Google::Cloud::StorageInsights::V1::ReportDetail
Pass arguments to get_report_detail via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. Name of the resource
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/storage_insights/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::StorageInsights::V1::GetReportDetailRequest.new

# Call the get_report_detail method.
result = client.get_report_detail request

# The returned object is of type Google::Cloud::StorageInsights::V1::ReportDetail.
p result

#initialize

def initialize() { |config| ... } -> Client

Create a new StorageInsights client object.

Yields
  • (config) — Configure the StorageInsights client.
Yield Parameter
Returns
  • (Client) — a new instance of Client
Example
# Create a client using the default configuration
client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Client.new do |config|
  config.timeout = 10.0
end

#list_report_configs

def list_report_configs(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::StorageInsights::V1::ReportConfig>
def list_report_configs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::StorageInsights::V1::ReportConfig>

Lists ReportConfigs in a given project and location.

Overloads
def list_report_configs(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::StorageInsights::V1::ReportConfig>
Pass arguments to list_report_configs via a request object, either of type ListReportConfigsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::StorageInsights::V1::ListReportConfigsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def list_report_configs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::StorageInsights::V1::ReportConfig>
Pass arguments to list_report_configs via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. Parent value for ListReportConfigsRequest
  • page_size (::Integer) — Requested page size. Server may return fewer items than requested. If unspecified, server will pick an appropriate default.
  • page_token (::String) — A token identifying a page of results the server should return.
  • filter (::String) — Filtering results
  • order_by (::String) — Hint for how to order the results
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/storage_insights/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::StorageInsights::V1::ListReportConfigsRequest.new

# Call the list_report_configs method.
result = client.list_report_configs request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::StorageInsights::V1::ReportConfig.
  p item
end

#list_report_details

def list_report_details(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::StorageInsights::V1::ReportDetail>
def list_report_details(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::StorageInsights::V1::ReportDetail>

Lists ReportDetails in a given project and location.

Overloads
def list_report_details(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::StorageInsights::V1::ReportDetail>
Pass arguments to list_report_details via a request object, either of type ListReportDetailsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::StorageInsights::V1::ListReportDetailsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def list_report_details(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::StorageInsights::V1::ReportDetail>
Pass arguments to list_report_details via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. Parent value for ListReportDetailsRequest
  • page_size (::Integer) — Requested page size. Server may return fewer items than requested. If unspecified, server will pick an appropriate default.
  • page_token (::String) — A token identifying a page of results the server should return.
  • filter (::String) — Filtering results
  • order_by (::String) — Hint for how to order the results
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/storage_insights/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::StorageInsights::V1::ListReportDetailsRequest.new

# Call the list_report_details method.
result = client.list_report_details request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::StorageInsights::V1::ReportDetail.
  p item
end

#location_client

def location_client() -> Google::Cloud::Location::Locations::Client

Get the associated client for mix-in of the Locations.

Returns
  • (Google::Cloud::Location::Locations::Client)

#logger

def logger() -> Logger

The logger used for request/response debug logging.

Returns
  • (Logger)

#universe_domain

def universe_domain() -> String

The effective universe domain

Returns
  • (String)

#update_report_config

def update_report_config(request, options = nil) -> ::Google::Cloud::StorageInsights::V1::ReportConfig
def update_report_config(update_mask: nil, report_config: nil, request_id: nil) -> ::Google::Cloud::StorageInsights::V1::ReportConfig

Updates the parameters of a single ReportConfig.

Overloads
def update_report_config(request, options = nil) -> ::Google::Cloud::StorageInsights::V1::ReportConfig
Pass arguments to update_report_config via a request object, either of type UpdateReportConfigRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::StorageInsights::V1::UpdateReportConfigRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def update_report_config(update_mask: nil, report_config: nil, request_id: nil) -> ::Google::Cloud::StorageInsights::V1::ReportConfig
Pass arguments to update_report_config via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • update_mask (::Google::Protobuf::FieldMask, ::Hash) — Required. Field mask is used to specify the fields to be overwritten in the ReportConfig resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten.
  • report_config (::Google::Cloud::StorageInsights::V1::ReportConfig, ::Hash) — Required. The resource being updated
  • request_id (::String) — Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request.

    For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

    The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/storage_insights/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::StorageInsights::V1::UpdateReportConfigRequest.new

# Call the update_report_config method.
result = client.update_report_config request

# The returned object is of type Google::Cloud::StorageInsights::V1::ReportConfig.
p result