Class Google::Cloud::Logging::V2::ConfigService::Client (v0.5.6)

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

#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 bucket that can be used to store log entries. Once a bucket has been created, the region 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 bucket:

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

    Example: "projects/my-logging-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 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]"
    

    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]"
    

    Examples: "projects/my-logging-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 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 logs in a bucket. A bucket may contain a maximum of 50 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]"
    

    Example: "projects/my-logging-project/locations/my-location/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 bucket. Moves the bucket to the DELETE_REQUESTED state. After 7 days, the bucket will be purged and all logs 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]"
    

    Example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id".

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.

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]"
    

    Example: "projects/my-project-id/exclusions/my-exclusion-id".

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]"
    

    Example: "projects/my-project-id/sinks/my-sink-id".

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 from a bucket.

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]"
    

    Example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id/views/my-view-id".

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 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]"
    

    Example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id".

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 Logs Router CMEK settings for the given resource.

Note: CMEK for the Logs Router can currently only be configured for GCP organizations. Once configured, it applies to all projects and folders in the GCP organization.

See Enabling CMEK for Logs 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"
    

    Example: "organizations/12345/cmekSettings".

    Note: CMEK for the Logs Router can currently only be configured for GCP organizations. Once configured, it applies to all projects and folders in the GCP 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.

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]"
    

    Example: "projects/my-project-id/exclusions/my-exclusion-id".

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_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]"
    

    Example: "projects/my-project-id/sinks/my-sink-id".

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.

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]"
    

    Example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id/views/my-view-id".

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 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 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 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::ListExclusionsRequest.new

# Call the list_exclusions method.
result = client.list_exclusions 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::LogExclusion.
  p response
end

#list_sinks

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

Lists sinks.

Overloads
def list_sinks(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Logging::V2::LogSink>
Pass arguments to list_sinks via a request object, either of type ListSinksRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Logging::V2::ListSinksRequest, ::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_sinks(parent: nil, page_token: nil, page_size: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Logging::V2::LogSink>
Pass arguments to list_sinks 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 sinks 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 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::ListSinksRequest.new

# Call the list_sinks method.
result = client.list_sinks 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::LogSink.
  p response
end

#list_views

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

Lists views on a bucket.

Overloads
def list_views(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Logging::V2::LogView>
Pass arguments to list_views via a request object, either of type ListViewsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Logging::V2::ListViewsRequest, ::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_views(parent: nil, page_token: nil, page_size: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Logging::V2::LogView>
Pass arguments to list_views 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 whose views are to be listed:

    "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_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 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::ListViewsRequest.new

# Call the list_views method.
result = client.list_views 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::LogView.
  p response
end

#undelete_bucket

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

Undeletes a bucket. A bucket that has been deleted may be undeleted within the grace period of 7 days.

Overloads
def undelete_bucket(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to undelete_bucket via a request object, either of type UndeleteBucketRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Logging::V2::UndeleteBucketRequest, ::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 undelete_bucket(name: nil) -> ::Google::Protobuf::Empty
Pass arguments to undelete_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 undelete.

    "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]"
    

    Example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id".

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::UndeleteBucketRequest.new

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

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

#update_bucket

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

Updates a bucket. This method replaces the following fields in the existing bucket with values from the new bucket: retention_period

If the retention period is decreased and the bucket is locked, FAILED_PRECONDITION will be returned.

If the bucket has a LifecycleState of DELETE_REQUESTED, FAILED_PRECONDITION will be returned.

A buckets region may not be modified after it is created.

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

    "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]"
    

    Example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id". Also requires permission "resourcemanager.projects.updateLiens" to set the locked property

  • bucket (::Google::Cloud::Logging::V2::LogBucket, ::Hash) — Required. The updated bucket.
  • update_mask (::Google::Protobuf::FieldMask, ::Hash) — Required. Field mask that specifies the fields in bucket that need an update. A bucket field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.

    For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask

    Example: updateMask=retention_days.

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::UpdateBucketRequest.new

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

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

#update_cmek_settings

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

Updates the Logs Router CMEK settings for the given resource.

Note: CMEK for the Logs Router can currently only be configured for GCP organizations. Once configured, it applies to all projects and folders in the GCP organization.

{::Google::Cloud::Logging::V2::ConfigServiceV2::Client#update_cmek_settings UpdateCmekSettings} will fail if 1) kms_key_name is invalid, or 2) the associated service account does not have the required roles/cloudkms.cryptoKeyEncrypterDecrypter role assigned for the key, or 3) access to the key is disabled.

See Enabling CMEK for Logs Router for more information.

Overloads
def update_cmek_settings(request, options = nil) -> ::Google::Cloud::Logging::V2::CmekSettings
Pass arguments to update_cmek_settings via a request object, either of type UpdateCmekSettingsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Logging::V2::UpdateCmekSettingsRequest, ::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_cmek_settings(name: nil, cmek_settings: nil, update_mask: nil) -> ::Google::Cloud::Logging::V2::CmekSettings
Pass arguments to update_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).
Parameters
  • name (::String) — Required. The resource name for the CMEK settings to update.

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

    Example: "organizations/12345/cmekSettings".

    Note: CMEK for the Logs Router can currently only be configured for GCP organizations. Once configured, it applies to all projects and folders in the GCP organization.

  • cmek_settings (::Google::Cloud::Logging::V2::CmekSettings, ::Hash) — Required. The CMEK settings to update.

    See Enabling CMEK for Logs Router for more information.

  • update_mask (::Google::Protobuf::FieldMask, ::Hash) — Optional. Field mask identifying which fields from cmek_settings should be updated. A field will be overwritten if and only if it is in the update mask. Output only fields cannot be updated.

    See FieldMask for more information.

    Example: "updateMask=kmsKeyName"

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::UpdateCmekSettingsRequest.new

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

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

#update_exclusion

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

Changes one or more properties of an existing exclusion.

Overloads
def update_exclusion(request, options = nil) -> ::Google::Cloud::Logging::V2::LogExclusion
Pass arguments to update_exclusion via a request object, either of type UpdateExclusionRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Logging::V2::UpdateExclusionRequest, ::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_exclusion(name: nil, exclusion: nil, update_mask: nil) -> ::Google::Cloud::Logging::V2::LogExclusion
Pass arguments to update_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
  • name (::String) — Required. The resource name of the exclusion to update:

    "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]"
    

    Example: "projects/my-project-id/exclusions/my-exclusion-id".

  • exclusion (::Google::Cloud::Logging::V2::LogExclusion, ::Hash) — Required. New values for the existing exclusion. Only the fields specified in update_mask are relevant.
  • update_mask (::Google::Protobuf::FieldMask, ::Hash) — Required. A non-empty list of fields to change in the existing exclusion. New values for the fields are taken from the corresponding fields in the LogExclusion included in this request. Fields not mentioned in update_mask are not changed and are ignored in the request.

    For example, to change the filter and description of an exclusion, specify an update_mask of "filter,description".

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::UpdateExclusionRequest.new

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

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

#update_sink

def update_sink(request, options = nil) -> ::Google::Cloud::Logging::V2::LogSink
def update_sink(sink_name: nil, sink: nil, unique_writer_identity: nil, update_mask: nil) -> ::Google::Cloud::Logging::V2::LogSink

Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.

The updated sink might also have a new writer_identity; see the unique_writer_identity field.

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

    Example: "projects/my-project-id/sinks/my-sink-id".

  • sink (::Google::Cloud::Logging::V2::LogSink, ::Hash) — Required. The updated sink, whose name is the same identifier that appears as part of sink_name.
  • unique_writer_identity (::Boolean) —

    Optional. See {::Google::Cloud::Logging::V2::ConfigServiceV2::Client#create_sink sinks.create} for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field:

    • If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity.
    • If the old value is false and the new value is true, then writer_identity is changed to a unique service account.
    • It is an error if the old value is true and the new value is set to false or defaulted to false.
  • update_mask (::Google::Protobuf::FieldMask, ::Hash) — Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.

    An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.

    For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask

    Example: updateMask=filter.

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::UpdateSinkRequest.new

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

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

#update_view

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

Updates a view. This method replaces the following fields in the existing view with values from the new view: filter.

Overloads
def update_view(request, options = nil) -> ::Google::Cloud::Logging::V2::LogView
Pass arguments to update_view via a request object, either of type UpdateViewRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Logging::V2::UpdateViewRequest, ::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_view(name: nil, view: nil, update_mask: nil) -> ::Google::Cloud::Logging::V2::LogView
Pass arguments to update_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
  • name (::String) — Required. The full resource name of the view to update

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

    Example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id/views/my-view-id".

  • view (::Google::Cloud::Logging::V2::LogView, ::Hash) — Required. The updated view.
  • update_mask (::Google::Protobuf::FieldMask, ::Hash) — Optional. Field mask that specifies the fields in view that need an update. A field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.

    For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask

    Example: updateMask=filter.

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::UpdateViewRequest.new

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

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