Cloud Logging V2 API - Class Google::Cloud::Logging::V2::ConfigService::Client (v0.7.0)

Reference documentation and code samples for the Cloud Logging V2 API class Google::Cloud::Logging::V2::ConfigService::Client.

Client for the ConfigService service.

Service for configuring sinks used to route log entries.

Inherits

  • Object

Methods

.configure

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

Configure the ConfigService 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 ConfigService clients
::Google::Cloud::Logging::V2::ConfigService::Client.configure do |config|
  config.timeout = 10.0
end

#configure

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

Configure the ConfigService 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

#copy_log_entries

def copy_log_entries(request, options = nil) -> ::Gapic::Operation
def copy_log_entries(name: nil, filter: nil, destination: nil) -> ::Gapic::Operation

Copies a set of log entries from a log bucket to a Cloud Storage bucket.

Overloads
def copy_log_entries(request, options = nil) -> ::Gapic::Operation
Pass arguments to copy_log_entries via a request object, either of type Google::Cloud::Logging::V2::CopyLogEntriesRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Logging::V2::CopyLogEntriesRequest, ::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 copy_log_entries(name: nil, filter: nil, destination: nil) -> ::Gapic::Operation
Pass arguments to copy_log_entries 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. Log bucket from which to copy log entries.

    For example:

    "projects/my-project/locations/global/buckets/my-source-bucket"

  • filter (::String) — Optional. A filter specifying which log entries to copy. The filter must be no more than 20k characters. An empty filter matches all log entries.
  • destination (::String) — Required. Destination to which to copy log entries.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/logging/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Logging::V2::ConfigService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Logging::V2::CopyLogEntriesRequest.new

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

# The returned object is of type Gapic::Operation. You can use this
# object to check the status of an operation, cancel it, or wait
# for results. Here is how to block until completion:
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "Error!"
end

#create_bucket

def create_bucket(request, options = nil) -> ::Google::Cloud::Logging::V2::LogBucket
def create_bucket(parent: nil, bucket_id: nil, bucket: nil) -> ::Google::Cloud::Logging::V2::LogBucket

Creates a log bucket that can be used to store log entries. After a bucket has been created, the bucket's location cannot be changed.

Overloads
def create_bucket(request, options = nil) -> ::Google::Cloud::Logging::V2::LogBucket
Pass arguments to create_bucket via a request object, either of type Google::Cloud::Logging::V2::CreateBucketRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Logging::V2::CreateBucketRequest, ::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_bucket(parent: nil, bucket_id: nil, bucket: nil) -> ::Google::Cloud::Logging::V2::LogBucket
Pass arguments to create_bucket 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. The resource in which to create the log bucket:

    "projects/[PROJECT_ID]/locations/[LOCATION_ID]"
    

    For example:

    "projects/my-project/locations/global"

  • bucket_id (::String) — Required. A client-assigned identifier such as "my-bucket". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods.
  • bucket (::Google::Cloud::Logging::V2::LogBucket, ::Hash) — Required. The new bucket. The region specified in the new bucket must be compliant with any Location Restriction Org Policy. The name field in the bucket is ignored.
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/logging/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Logging::V2::ConfigService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Logging::V2::CreateBucketRequest.new

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

# The returned object is of type Google::Cloud::Logging::V2::LogBucket.
p result

#create_exclusion

def create_exclusion(request, options = nil) -> ::Google::Cloud::Logging::V2::LogExclusion
def create_exclusion(parent: nil, exclusion: nil) -> ::Google::Cloud::Logging::V2::LogExclusion

Creates a new exclusion in the _Default sink in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource.

Overloads
def create_exclusion(request, options = nil) -> ::Google::Cloud::Logging::V2::LogExclusion
Pass arguments to create_exclusion via a request object, either of type Google::Cloud::Logging::V2::CreateExclusionRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Logging::V2::CreateExclusionRequest, ::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_exclusion(parent: nil, exclusion: nil) -> ::Google::Cloud::Logging::V2::LogExclusion
Pass arguments to create_exclusion 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. The parent resource in which to create the exclusion:

    "projects/[PROJECT_ID]"
    "organizations/[ORGANIZATION_ID]"
    "billingAccounts/[BILLING_ACCOUNT_ID]"
    "folders/[FOLDER_ID]"
    

    For examples:

    "projects/my-logging-project" "organizations/123456789"

  • exclusion (::Google::Cloud::Logging::V2::LogExclusion, ::Hash) — Required. The new exclusion, whose name parameter is an exclusion name that is not already used in the parent 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/logging/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Logging::V2::ConfigService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Logging::V2::CreateExclusionRequest.new

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

# The returned object is of type Google::Cloud::Logging::V2::LogExclusion.
p result

#create_sink

def create_sink(request, options = nil) -> ::Google::Cloud::Logging::V2::LogSink
def create_sink(parent: nil, sink: nil, unique_writer_identity: nil) -> ::Google::Cloud::Logging::V2::LogSink

Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink.

Overloads
def create_sink(request, options = nil) -> ::Google::Cloud::Logging::V2::LogSink
Pass arguments to create_sink via a request object, either of type Google::Cloud::Logging::V2::CreateSinkRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Logging::V2::CreateSinkRequest, ::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_sink(parent: nil, sink: nil, unique_writer_identity: nil) -> ::Google::Cloud::Logging::V2::LogSink
Pass arguments to create_sink 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. The resource in which to create the sink:

    "projects/[PROJECT_ID]"
    "organizations/[ORGANIZATION_ID]"
    "billingAccounts/[BILLING_ACCOUNT_ID]"
    "folders/[FOLDER_ID]"
    

    For examples:

    "projects/my-project" "organizations/123456789"

  • sink (::Google::Cloud::Logging::V2::LogSink, ::Hash) — Required. The new sink, whose name parameter is a sink identifier that is not already in use.
  • unique_writer_identity (::Boolean) — Optional. Determines the kind of IAM identity returned as writer_identity in the new sink. If this value is omitted or set to false, and if the sink's parent is a project, then the value returned as writer_identity is the same group or service account used by Cloud Logging before the addition of writer identities to this API. The sink's destination must be in the same project as the sink itself.

    If this field is set to true, or if the sink is owned by a non-project resource such as an organization, then the value of writer_identity will be a unique service account used only for exports from the new sink. For more information, see writer_identity in LogSink.

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/logging/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Logging::V2::ConfigService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Logging::V2::CreateSinkRequest.new

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

# The returned object is of type Google::Cloud::Logging::V2::LogSink.
p result

#create_view

def create_view(request, options = nil) -> ::Google::Cloud::Logging::V2::LogView
def create_view(parent: nil, view_id: nil, view: nil) -> ::Google::Cloud::Logging::V2::LogView

Creates a view over log entries in a log bucket. A bucket may contain a maximum of 30 views.

Overloads
def create_view(request, options = nil) -> ::Google::Cloud::Logging::V2::LogView
Pass arguments to create_view via a request object, either of type Google::Cloud::Logging::V2::CreateViewRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Logging::V2::CreateViewRequest, ::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_view(parent: nil, view_id: nil, view: nil) -> ::Google::Cloud::Logging::V2::LogView
Pass arguments to create_view 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. The bucket in which to create the view

    `"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"`
    

    For example:

    "projects/my-project/locations/global/buckets/my-bucket"

  • view_id (::String) — Required. The id to use for this view.
  • view (::Google::Cloud::Logging::V2::LogView, ::Hash) — Required. The new view.
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/logging/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Logging::V2::ConfigService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Logging::V2::CreateViewRequest.new

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

# The returned object is of type Google::Cloud::Logging::V2::LogView.
p result

#delete_bucket

def delete_bucket(request, options = nil) -> ::Google::Protobuf::Empty
def delete_bucket(name: nil) -> ::Google::Protobuf::Empty

Deletes a log bucket.

Changes the bucket's lifecycle_state to the DELETE_REQUESTED state. After 7 days, the bucket will be purged and all log entries in the bucket will be permanently deleted.

Overloads
def delete_bucket(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_bucket via a request object, either of type DeleteBucketRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Logging::V2::DeleteBucketRequest, ::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_bucket(name: nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_bucket 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. The full resource name of the bucket to delete.

    "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
    "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
    "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
    "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
    

    For example:

    "projects/my-project/locations/global/buckets/my-bucket"

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/logging/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Logging::V2::ConfigService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Logging::V2::DeleteBucketRequest.new

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

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

#delete_exclusion

def delete_exclusion(request, options = nil) -> ::Google::Protobuf::Empty
def delete_exclusion(name: nil) -> ::Google::Protobuf::Empty

Deletes an exclusion in the _Default sink.

Overloads
def delete_exclusion(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_exclusion via a request object, either of type DeleteExclusionRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Logging::V2::DeleteExclusionRequest, ::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_exclusion(name: nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_exclusion 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. The resource name of an existing exclusion to delete:

    "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
    "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
    "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
    "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
    

    For example:

    "projects/my-project/exclusions/my-exclusion"

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/logging/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Logging::V2::ConfigService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Logging::V2::DeleteExclusionRequest.new

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

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

#delete_sink

def delete_sink(request, options = nil) -> ::Google::Protobuf::Empty
def delete_sink(sink_name: nil) -> ::Google::Protobuf::Empty

Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted.

Overloads
def delete_sink(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_sink via a request object, either of type DeleteSinkRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Logging::V2::DeleteSinkRequest, ::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_sink(sink_name: nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_sink 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
  • sink_name (::String) — Required. The full resource name of the sink to delete, including the parent resource and the sink identifier:

    "projects/[PROJECT_ID]/sinks/[SINK_ID]"
    "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
    "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
    "folders/[FOLDER_ID]/sinks/[SINK_ID]"
    

    For example:

    "projects/my-project/sinks/my-sink"

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/logging/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Logging::V2::ConfigService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Logging::V2::DeleteSinkRequest.new

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

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

#delete_view

def delete_view(request, options = nil) -> ::Google::Protobuf::Empty
def delete_view(name: nil) -> ::Google::Protobuf::Empty

Deletes a view on a log bucket. If an UNAVAILABLE error is returned, this indicates that system is not in a state where it can delete the view. If this occurs, please try again in a few minutes.

Overloads
def delete_view(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_view via a request object, either of type DeleteViewRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Logging::V2::DeleteViewRequest, ::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_view(name: nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_view 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. The full resource name of the view to delete:

    "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]"
    

    For example:

    "projects/my-project/locations/global/buckets/my-bucket/views/my-view"

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/logging/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Logging::V2::ConfigService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Logging::V2::DeleteViewRequest.new

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

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

#get_bucket

def get_bucket(request, options = nil) -> ::Google::Cloud::Logging::V2::LogBucket
def get_bucket(name: nil) -> ::Google::Cloud::Logging::V2::LogBucket

Gets a log bucket.

Overloads
def get_bucket(request, options = nil) -> ::Google::Cloud::Logging::V2::LogBucket
Pass arguments to get_bucket via a request object, either of type GetBucketRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Logging::V2::GetBucketRequest, ::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_bucket(name: nil) -> ::Google::Cloud::Logging::V2::LogBucket
Pass arguments to get_bucket 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. The resource name of the bucket:

    "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
    "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
    "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
    "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
    

    For example:

    "projects/my-project/locations/global/buckets/my-bucket"

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/logging/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Logging::V2::ConfigService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Logging::V2::GetBucketRequest.new

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

# The returned object is of type Google::Cloud::Logging::V2::LogBucket.
p result

#get_cmek_settings

def get_cmek_settings(request, options = nil) -> ::Google::Cloud::Logging::V2::CmekSettings
def get_cmek_settings(name: nil) -> ::Google::Cloud::Logging::V2::CmekSettings

Gets the Logging CMEK settings for the given resource.

Note: CMEK for the Log Router can be configured for Google Cloud projects, folders, organizations and billing accounts. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.

See Enabling CMEK for Log Router for more information.

Overloads
def get_cmek_settings(request, options = nil) -> ::Google::Cloud::Logging::V2::CmekSettings
Pass arguments to get_cmek_settings via a request object, either of type GetCmekSettingsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Logging::V2::GetCmekSettingsRequest, ::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_cmek_settings(name: nil) -> ::Google::Cloud::Logging::V2::CmekSettings
Pass arguments to get_cmek_settings 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. The resource for which to retrieve CMEK settings.

    "projects/[PROJECT_ID]/cmekSettings"
    "organizations/[ORGANIZATION_ID]/cmekSettings"
    "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings"
    "folders/[FOLDER_ID]/cmekSettings"
    

    For example:

    "organizations/12345/cmekSettings"

    Note: CMEK for the Log Router can be configured for Google Cloud projects, folders, organizations and billing accounts. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.

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/logging/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Logging::V2::ConfigService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Logging::V2::GetCmekSettingsRequest.new

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

# The returned object is of type Google::Cloud::Logging::V2::CmekSettings.
p result

#get_exclusion

def get_exclusion(request, options = nil) -> ::Google::Cloud::Logging::V2::LogExclusion
def get_exclusion(name: nil) -> ::Google::Cloud::Logging::V2::LogExclusion

Gets the description of an exclusion in the _Default sink.

Overloads
def get_exclusion(request, options = nil) -> ::Google::Cloud::Logging::V2::LogExclusion
Pass arguments to get_exclusion via a request object, either of type GetExclusionRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Logging::V2::GetExclusionRequest, ::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_exclusion(name: nil) -> ::Google::Cloud::Logging::V2::LogExclusion
Pass arguments to get_exclusion 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. The resource name of an existing exclusion:

    "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
    "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
    "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
    "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
    

    For example:

    "projects/my-project/exclusions/my-exclusion"

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/logging/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Logging::V2::ConfigService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Logging::V2::GetExclusionRequest.new

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

# The returned object is of type Google::Cloud::Logging::V2::LogExclusion.
p result

#get_settings

def get_settings(request, options = nil) -> ::Google::Cloud::Logging::V2::Settings
def get_settings(name: nil) -> ::Google::Cloud::Logging::V2::Settings

Gets the Log Router settings for the given resource.

Note: Settings for the Log Router can be get for Google Cloud projects, folders, organizations and billing accounts. Currently it can only be configured for organizations. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.

See Enabling CMEK for Log Router for more information.

Overloads
def get_settings(request, options = nil) -> ::Google::Cloud::Logging::V2::Settings
Pass arguments to get_settings via a request object, either of type GetSettingsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Logging::V2::GetSettingsRequest, ::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_settings(name: nil) -> ::Google::Cloud::Logging::V2::Settings
Pass arguments to get_settings 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. The resource for which to retrieve settings.

    "projects/[PROJECT_ID]/settings"
    "organizations/[ORGANIZATION_ID]/settings"
    "billingAccounts/[BILLING_ACCOUNT_ID]/settings"
    "folders/[FOLDER_ID]/settings"
    

    For example:

    "organizations/12345/settings"

    Note: Settings for the Log Router can be get for Google Cloud projects, folders, organizations and billing accounts. Currently it can only be configured for organizations. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.

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/logging/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Logging::V2::ConfigService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Logging::V2::GetSettingsRequest.new

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

# The returned object is of type Google::Cloud::Logging::V2::Settings.
p result

#get_sink

def get_sink(request, options = nil) -> ::Google::Cloud::Logging::V2::LogSink
def get_sink(sink_name: nil) -> ::Google::Cloud::Logging::V2::LogSink

Gets a sink.

Overloads
def get_sink(request, options = nil) -> ::Google::Cloud::Logging::V2::LogSink
Pass arguments to get_sink via a request object, either of type GetSinkRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Logging::V2::GetSinkRequest, ::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_sink(sink_name: nil) -> ::Google::Cloud::Logging::V2::LogSink
Pass arguments to get_sink 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
  • sink_name (::String) — Required. The resource name of the sink:

    "projects/[PROJECT_ID]/sinks/[SINK_ID]"
    "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
    "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
    "folders/[FOLDER_ID]/sinks/[SINK_ID]"
    

    For example:

    "projects/my-project/sinks/my-sink"

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/logging/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Logging::V2::ConfigService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Logging::V2::GetSinkRequest.new

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

# The returned object is of type Google::Cloud::Logging::V2::LogSink.
p result

#get_view

def get_view(request, options = nil) -> ::Google::Cloud::Logging::V2::LogView
def get_view(name: nil) -> ::Google::Cloud::Logging::V2::LogView

Gets a view on a log bucket..

Overloads
def get_view(request, options = nil) -> ::Google::Cloud::Logging::V2::LogView
Pass arguments to get_view via a request object, either of type GetViewRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Logging::V2::GetViewRequest, ::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_view(name: nil) -> ::Google::Cloud::Logging::V2::LogView
Pass arguments to get_view 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. The resource name of the policy:

    "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]"
    

    For example:

    "projects/my-project/locations/global/buckets/my-bucket/views/my-view"

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/logging/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Logging::V2::ConfigService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Logging::V2::GetViewRequest.new

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

# The returned object is of type Google::Cloud::Logging::V2::LogView.
p result

#initialize

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

Create a new ConfigService client object.

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

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

#list_buckets

def list_buckets(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Logging::V2::LogBucket>
def list_buckets(parent: nil, page_token: nil, page_size: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Logging::V2::LogBucket>

Lists log buckets.

Overloads
def list_buckets(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Logging::V2::LogBucket>
Pass arguments to list_buckets via a request object, either of type ListBucketsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Logging::V2::ListBucketsRequest, ::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_buckets(parent: nil, page_token: nil, page_size: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Logging::V2::LogBucket>
Pass arguments to list_buckets 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. The parent resource whose buckets are to be listed:

    "projects/[PROJECT_ID]/locations/[LOCATION_ID]"
    "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]"
    "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]"
    "folders/[FOLDER_ID]/locations/[LOCATION_ID]"
    

    Note: The locations portion of the resource must be specified, but supplying the character - in place of [LOCATION_ID] will return all buckets.

  • page_token (::String) — Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.
  • page_size (::Integer) — Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.
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/logging/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Logging::V2::ConfigService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Logging::V2::ListBucketsRequest.new

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

# The returned object is of type Gapic::PagedEnumerable. You can
# iterate over all elements by calling #each, and the enumerable
# will lazily make API calls to fetch subsequent pages. Other
# methods are also available for managing paging directly.
result.each do |response|
  # Each element is of type ::Google::Cloud::Logging::V2::LogBucket.
  p response
end

#list_exclusions

def list_exclusions(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Logging::V2::LogExclusion>
def list_exclusions(parent: nil, page_token: nil, page_size: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Logging::V2::LogExclusion>

Lists all the exclusions on the _Default sink in a parent resource.

Overloads
def list_exclusions(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Logging::V2::LogExclusion>
Pass arguments to list_exclusions via a request object, either of type ListExclusionsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Logging::V2::ListExclusionsRequest, ::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_exclusions(parent: nil, page_token: nil, page_size: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Logging::V2::LogExclusion>
Pass arguments to list_exclusions 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. The parent resource whose exclusions are to be listed.

    "projects/[PROJECT_ID]"
    "organizations/[ORGANIZATION_ID]"
    "billingAccounts/[BILLING_ACCOUNT_ID]"
    "folders/[FOLDER_ID]"
    
  • page_token (::String) — Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.
  • page_size (::Integer) — Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPage