Class: Google::Cloud::Logging::V2::ConfigService::Client

Inherits:
Object
  • Object
show all
Includes:
Paths
Defined in:
lib/google/cloud/logging/v2/config_service/client.rb

Overview

Client for the ConfigService service.

Service for configuring sinks used to route log entries.

Defined Under Namespace

Classes: Configuration

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Paths

#billing_account_location_path, #billing_account_path, #cmek_settings_path, #folder_location_path, #folder_path, #link_path, #location_path, #log_bucket_path, #log_exclusion_path, #log_sink_path, #log_view_path, #organization_location_path, #organization_path, #project_path, #settings_path

Constructor Details

#initialize {|config| ... } ⇒ Client

Create a new ConfigService client object.

Examples:


# 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

Yields:

  • (config)

    Configure the ConfigService client.

Yield Parameters:



150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
# File 'lib/google/cloud/logging/v2/config_service/client.rb', line 150

def initialize
  # These require statements are intentionally placed here to initialize
  # the gRPC module only when it's required.
  # See https://github.com/googleapis/toolkit/issues/446
  require "gapic/grpc"
  require "google/logging/v2/logging_config_services_pb"

  # Create the configuration object
  @config = Configuration.new Client.configure

  # Yield the configuration if needed
  yield @config if block_given?

  # Create credentials
  credentials = @config.credentials
  # Use self-signed JWT if the endpoint is unchanged from default,
  # but only if the default endpoint does not have a region prefix.
  enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
                           !@config.endpoint.split(".").first.include?("-")
  credentials ||= Credentials.default scope: @config.scope,
                                      enable_self_signed_jwt: enable_self_signed_jwt
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
    credentials = Credentials.new credentials, scope: @config.scope
  end
  @quota_project_id = @config.quota_project
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id

  @operations_client = Operations.new do |config|
    config.credentials = credentials
    config.quota_project = @quota_project_id
    config.endpoint = @config.endpoint
  end

  @config_service_stub = ::Gapic::ServiceStub.new(
    ::Google::Cloud::Logging::V2::ConfigServiceV2::Stub,
    credentials:  credentials,
    endpoint:     @config.endpoint,
    channel_args: @config.channel_args,
    interceptors: @config.interceptors,
    channel_pool_config: @config.channel_pool
  )
end

Instance Attribute Details

#operations_client::Google::Cloud::Logging::V2::ConfigService::Operations (readonly)

Get the associated client for long-running operations.



198
199
200
# File 'lib/google/cloud/logging/v2/config_service/client.rb', line 198

def operations_client
  @operations_client
end

Class Method Details

.configure {|config| ... } ⇒ Client::Configuration

Configure the ConfigService Client class.

See Configuration for a description of the configuration fields.

Examples:


# Modify the configuration for all ConfigService clients
::Google::Cloud::Logging::V2::ConfigService::Client.configure do |config|
  config.timeout = 10.0
end

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# File 'lib/google/cloud/logging/v2/config_service/client.rb', line 56

def self.configure
  @configure ||= begin
    namespace = ["Google", "Cloud", "Logging", "V2"]
    parent_config = while namespace.any?
                      parent_name = namespace.join "::"
                      parent_const = const_get parent_name
                      break parent_const.configure if parent_const.respond_to? :configure
                      namespace.pop
                    end
    default_config = Client::Configuration.new parent_config

    default_config.rpcs.list_sinks.timeout = 60.0
    default_config.rpcs.list_sinks.retry_policy = {
      initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 13, 14]
    }

    default_config.rpcs.get_sink.timeout = 60.0
    default_config.rpcs.get_sink.retry_policy = {
      initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 13, 14]
    }

    default_config.rpcs.create_sink.timeout = 120.0

    default_config.rpcs.update_sink.timeout = 60.0
    default_config.rpcs.update_sink.retry_policy = {
      initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 13, 14]
    }

    default_config.rpcs.delete_sink.timeout = 60.0
    default_config.rpcs.delete_sink.retry_policy = {
      initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 13, 14]
    }

    default_config.rpcs.list_exclusions.timeout = 60.0
    default_config.rpcs.list_exclusions.retry_policy = {
      initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 13, 14]
    }

    default_config.rpcs.get_exclusion.timeout = 60.0
    default_config.rpcs.get_exclusion.retry_policy = {
      initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 13, 14]
    }

    default_config.rpcs.create_exclusion.timeout = 120.0

    default_config.rpcs.update_exclusion.timeout = 120.0

    default_config.rpcs.delete_exclusion.timeout = 60.0
    default_config.rpcs.delete_exclusion.retry_policy = {
      initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 13, 14]
    }

    default_config
  end
  yield @configure if block_given?
  @configure
end

Instance Method Details

#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 configure.

See Configuration for a description of the configuration fields.

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



129
130
131
132
# File 'lib/google/cloud/logging/v2/config_service/client.rb', line 129

def configure
  yield @config if block_given?
  @config
end

#copy_log_entries(request, options = nil) ⇒ ::Gapic::Operation #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.

Examples:

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 it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #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) (defaults to: nil)

      Required. Log bucket from which to copy log entries.

      For example:

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

    • filter (::String) (defaults to: nil)

      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) (defaults to: nil)

      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.



3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
# File 'lib/google/cloud/logging/v2/config_service/client.rb', line 3485

def copy_log_entries request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::CopyLogEntriesRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.copy_log_entries..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Logging::V2::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.copy_log_entries.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.copy_log_entries.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @config_service_stub.call_rpc :copy_log_entries, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#create_bucket(request, options = nil) ⇒ ::Google::Cloud::Logging::V2::LogBucket #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.

Examples:

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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #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) (defaults to: nil)

      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) (defaults to: nil)

      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) (defaults to: nil)

      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:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
# File 'lib/google/cloud/logging/v2/config_service/client.rb', line 690

def create_bucket request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::CreateBucketRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_bucket..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Logging::V2::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.create_bucket.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_bucket.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @config_service_stub.call_rpc :create_bucket, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#create_bucket_async(request, options = nil) ⇒ ::Gapic::Operation #create_bucket_async(parent: nil, bucket_id: nil, bucket: nil) ⇒ ::Gapic::Operation

Creates a log bucket asynchronously that can be used to store log entries.

After a bucket has been created, the bucket's location cannot be changed.

Examples:

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_async method.
result = client.create_bucket_async request

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

Overloads:

  • #create_bucket_async(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to create_bucket_async 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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #create_bucket_async(parent: nil, bucket_id: nil, bucket: nil) ⇒ ::Gapic::Operation

    Pass arguments to create_bucket_async 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) (defaults to: nil)

      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) (defaults to: nil)

      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) (defaults to: nil)

      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:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
# File 'lib/google/cloud/logging/v2/config_service/client.rb', line 471

def create_bucket_async request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::CreateBucketRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_bucket_async..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Logging::V2::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.create_bucket_async.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_bucket_async.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @config_service_stub.call_rpc :create_bucket_async, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#create_exclusion(request, options = nil) ⇒ ::Google::Cloud::Logging::V2::LogExclusion #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.

Examples:

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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #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) (defaults to: nil)

      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) (defaults to: nil)

      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:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
# File 'lib/google/cloud/logging/v2/config_service/client.rb', line 2717

def create_exclusion request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::CreateExclusionRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_exclusion..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Logging::V2::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.create_exclusion.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_exclusion.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @config_service_stub.call_rpc :create_exclusion, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

Asynchronously creates a linked dataset in BigQuery which makes it possible to use BigQuery to read the logs stored in the log bucket. A log bucket may currently only contain one link.

Examples:

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

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

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

Overloads:

  • #create_link(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to create_link via a request object, either of type Google::Cloud::Logging::V2::CreateLinkRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Logging::V2::CreateLinkRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #create_link(parent: nil, link: nil, link_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to create_link 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) (defaults to: nil)

      Required. The full resource name of the bucket to create a link for.

      "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]"
      
    • link (::Google::Cloud::Logging::V2::Link, ::Hash) (defaults to: nil)

      Required. The new link.

    • link_id (::String) (defaults to: nil)

      Required. The ID to use for the link. The link_id can have up to 100 characters. A valid link_id must only have alphanumeric characters and underscores within it.

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.



2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
# File 'lib/google/cloud/logging/v2/config_service/client.rb', line 2128

def create_link request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::CreateLinkRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_link..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Logging::V2::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.create_link.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_link.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @config_service_stub.call_rpc :create_link, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#create_sink(request, options = nil) ⇒ ::Google::Cloud::Logging::V2::LogSink #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.

Examples:

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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #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) (defaults to: nil)

      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) (defaults to: nil)

      Required. The new sink, whose name parameter is a sink identifier that is not already in use.

    • unique_writer_identity (::Boolean) (defaults to: nil)

      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:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
# File 'lib/google/cloud/logging/v2/config_service/client.rb', line 1796

def create_sink request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::CreateSinkRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_sink..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Logging::V2::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.create_sink.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_sink.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @config_service_stub.call_rpc :create_sink, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#create_view(request, options = nil) ⇒ ::Google::Cloud::Logging::V2::LogView #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.

Examples:

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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #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) (defaults to: nil)

      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) (defaults to: nil)

      Required. A client-assigned identifier such as "my-view". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods.

    • view (::Google::Cloud::Logging::V2::LogView, ::Hash) (defaults to: nil)

      Required. The new view.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
# File 'lib/google/cloud/logging/v2/config_service/client.rb', line 1284

def create_view request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::CreateViewRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_view..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Logging::V2::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.create_view.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_view.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @config_service_stub.call_rpc :create_view, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_bucket(request, options = nil) ⇒ ::Google::Protobuf::Empty #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.

Examples:

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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #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).

    Parameters:

    • name (::String) (defaults to: nil)

      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:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
# File 'lib/google/cloud/logging/v2/config_service/client.rb', line 898

def delete_bucket request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::DeleteBucketRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_bucket..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Logging::V2::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.delete_bucket.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_bucket.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @config_service_stub.call_rpc :delete_bucket, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_exclusion(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_exclusion(name: nil) ⇒ ::Google::Protobuf::Empty

Deletes an exclusion in the _Default sink.

Examples:

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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #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).

    Parameters:

    • name (::String) (defaults to: nil)

      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:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
# File 'lib/google/cloud/logging/v2/config_service/client.rb', line 2918

def delete_exclusion request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::DeleteExclusionRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_exclusion..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Logging::V2::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.delete_exclusion.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_exclusion.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @config_service_stub.call_rpc :delete_exclusion, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

Deletes a link. This will also delete the corresponding BigQuery linked dataset.

Examples:

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

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

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

Overloads:

  • #delete_link(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_link via a request object, either of type DeleteLinkRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Logging::V2::DeleteLinkRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #delete_link(name: nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_link 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) (defaults to: nil)

      Required. The full resource name of the link to delete.

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

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.



2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
# File 'lib/google/cloud/logging/v2/config_service/client.rb', line 2227

def delete_link request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::DeleteLinkRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_link..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Logging::V2::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.delete_link.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_link.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @config_service_stub.call_rpc :delete_link, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_sink(request, options = nil) ⇒ ::Google::Protobuf::Empty #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.

Examples:

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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #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).

    Parameters:

    • sink_name (::String) (defaults to: nil)

      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:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
# File 'lib/google/cloud/logging/v2/config_service/client.rb', line 2023

def delete_sink request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::DeleteSinkRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_sink..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Logging::V2::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.sink_name
    header_params["sink_name"] = request.sink_name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.delete_sink.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_sink.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @config_service_stub.call_rpc :delete_sink, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_view(request, options = nil) ⇒ ::Google::Protobuf::Empty #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.

Examples:

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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #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).

    Parameters:

    • name (::String) (defaults to: nil)

      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:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
# File 'lib/google/cloud/logging/v2/config_service/client.rb', line 1484

def delete_view request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::DeleteViewRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_view..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Logging::V2::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.delete_view.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_view.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @config_service_stub.call_rpc :delete_view, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_bucket(request, options = nil) ⇒ ::Google::Cloud::Logging::V2::LogBucket #get_bucket(name: nil) ⇒ ::Google::Cloud::Logging::V2::LogBucket

Gets a log bucket.

Examples:

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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #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).

    Parameters:

    • name (::String) (defaults to: nil)

      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:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
# File 'lib/google/cloud/logging/v2/config_service/client.rb', line 363

def get_bucket request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::GetBucketRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_bucket..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Logging::V2::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_bucket.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_bucket.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @config_service_stub.call_rpc :get_bucket, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_cmek_settings(request, options = nil) ⇒ ::Google::Cloud::Logging::V2::CmekSettings #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.

Examples:

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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #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).

    Parameters:

    • name (::String) (defaults to: nil)

      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:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
# File 'lib/google/cloud/logging/v2/config_service/client.rb', line 3026

def get_cmek_settings request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::GetCmekSettingsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_cmek_settings..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Logging::V2::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_cmek_settings.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_cmek_settings.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @config_service_stub.call_rpc :get_cmek_settings, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_exclusion(request, options = nil) ⇒ ::Google::Cloud::Logging::V2::LogExclusion #get_exclusion(name: nil) ⇒ ::Google::Cloud::Logging::V2::LogExclusion

Gets the description of an exclusion in the _Default sink.

Examples:

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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #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).

    Parameters:

    • name (::String) (defaults to: nil)

      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:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
# File 'lib/google/cloud/logging/v2/config_service/client.rb', line 2617

def get_exclusion request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::GetExclusionRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_exclusion..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Logging::V2::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_exclusion.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_exclusion.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @config_service_stub.call_rpc :get_exclusion, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

Gets a link.

Examples:

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

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

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

Overloads:

  • #get_link(request, options = nil) ⇒ ::Google::Cloud::Logging::V2::Link

    Pass arguments to get_link via a request object, either of type GetLinkRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Logging::V2::GetLinkRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #get_link(name: nil) ⇒ ::Google::Cloud::Logging::V2::Link

    Pass arguments to get_link 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) (defaults to: nil)

      Required. The resource name of the link:

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

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
# File 'lib/google/cloud/logging/v2/config_service/client.rb', line 2419

def get_link request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::GetLinkRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_link..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Logging::V2::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_link.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_link.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @config_service_stub.call_rpc :get_link, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_settings(request, options = nil) ⇒ ::Google::Cloud::Logging::V2::Settings #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.

Examples:

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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #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).

    Parameters:

    • name (::String) (defaults to: nil)

      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:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
# File 'lib/google/cloud/logging/v2/config_service/client.rb', line 3260

def get_settings request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::GetSettingsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_settings..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Logging::V2::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_settings.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_settings.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @config_service_stub.call_rpc :get_settings, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_sink(request, options = nil) ⇒ ::Google::Cloud::Logging::V2::LogSink #get_sink(sink_name: nil) ⇒ ::Google::Cloud::Logging::V2::LogSink

Gets a sink.

Examples:

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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #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).

    Parameters:

    • sink_name (::String) (defaults to: nil)

      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:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
# File 'lib/google/cloud/logging/v2/config_service/client.rb', line 1682

def get_sink request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::GetSinkRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_sink..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Logging::V2::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.sink_name
    header_params["sink_name"] = request.sink_name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_sink.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_sink.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @config_service_stub.call_rpc :get_sink, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_view(request, options = nil) ⇒ ::Google::Cloud::Logging::V2::LogView #get_view(name: nil) ⇒ ::Google::Cloud::Logging::V2::LogView

Gets a view on a log bucket..

Examples:

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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #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).

    Parameters:

    • name (::String) (defaults to: nil)

      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:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
# File 'lib/google/cloud/logging/v2/config_service/client.rb', line 1186

def get_view request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::GetViewRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_view..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Logging::V2::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_view.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_view.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @config_service_stub.call_rpc :get_view, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

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

Lists log buckets.

Examples:

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 elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Logging::V2::LogBucket.
  p item
end

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #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) (defaults to: nil)

      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) (defaults to: nil)

      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) (defaults to: nil)

      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.



268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
# File 'lib/google/cloud/logging/v2/config_service/client.rb', line 268

def list_buckets request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::ListBucketsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_buckets..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Logging::V2::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_buckets.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_buckets.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @config_service_stub.call_rpc :list_buckets, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @config_service_stub, :list_buckets, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_exclusions(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Logging::V2::LogExclusion> #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.

Examples:

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 elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Logging::V2::LogExclusion.
  p item
end

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #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) (defaults to: nil)

      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) (defaults to: nil)

      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) (defaults to: nil)

      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.



2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
# File 'lib/google/cloud/logging/v2/config_service/client.rb', line 2522

def list_exclusions request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::ListExclusionsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_exclusions..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Logging::V2::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_exclusions.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_exclusions.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @config_service_stub.call_rpc :list_exclusions, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @config_service_stub, :list_exclusions, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

Lists links.

Examples:

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

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

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

Overloads:

  • #list_links(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Logging::V2::Link>

    Pass arguments to list_links via a request object, either of type ListLinksRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Logging::V2::ListLinksRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #list_links(parent: nil, page_token: nil, page_size: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Logging::V2::Link>

    Pass arguments to list_links 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) (defaults to: nil)

      Required. The parent resource whose links are to be listed:

      "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/" "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]/

    • page_token (::String) (defaults to: nil)

      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.

    • page_size (::Integer) (defaults to: nil)

      Optional. The maximum number of results to return from this request.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
# File 'lib/google/cloud/logging/v2/config_service/client.rb', line 2328

def list_links request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::ListLinksRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_links..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Logging::V2::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_links.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_links.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @config_service_stub.call_rpc :list_links, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @config_service_stub, :list_links, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

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

Lists sinks.

Examples:

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 elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Logging::V2::LogSink.
  p item
end

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #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) (defaults to: nil)

      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) (defaults to: nil)

      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) (defaults to: nil)

      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.



1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
# File 'lib/google/cloud/logging/v2/config_service/client.rb', line 1587

def list_sinks request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::ListSinksRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_sinks..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Logging::V2::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_sinks.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_sinks.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @config_service_stub.call_rpc :list_sinks, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @config_service_stub, :list_sinks, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

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

Lists views on a log bucket.

Examples:

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 elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Logging::V2::LogView.
  p item
end

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #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) (defaults to: nil)

      Required. The bucket whose views are to be listed:

      "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
      
    • page_token (::String) (defaults to: nil)

      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) (defaults to: nil)

      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.



1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
# File 'lib/google/cloud/logging/v2/config_service/client.rb', line 1094

def list_views request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::ListViewsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_views..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Logging::V2::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_views.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_views.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @config_service_stub.call_rpc :list_views, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @config_service_stub, :list_views, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#undelete_bucket(request, options = nil) ⇒ ::Google::Protobuf::Empty #undelete_bucket(name: nil) ⇒ ::Google::Protobuf::Empty

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

Examples:

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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #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).

    Parameters:

    • name (::String) (defaults to: nil)

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

      For example:

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

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
# File 'lib/google/cloud/logging/v2/config_service/client.rb', line 993

def undelete_bucket request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::UndeleteBucketRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.undelete_bucket..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Logging::V2::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.undelete_bucket.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.undelete_bucket.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @config_service_stub.call_rpc :undelete_bucket, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#update_bucket(request, options = nil) ⇒ ::Google::Cloud::Logging::V2::LogBucket #update_bucket(name: nil, bucket: nil, update_mask: nil) ⇒ ::Google::Cloud::Logging::V2::LogBucket

Updates a log bucket.

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

After a bucket has been created, the bucket's location cannot be changed.

Examples:

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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #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) (defaults to: nil)

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

      For example:

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

    • bucket (::Google::Cloud::Logging::V2::LogBucket, ::Hash) (defaults to: nil)

      Required. The updated bucket.

    • update_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      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

      For example: updateMask=retention_days

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
# File 'lib/google/cloud/logging/v2/config_service/client.rb', line 800

def update_bucket request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::UpdateBucketRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_bucket..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Logging::V2::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.update_bucket.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_bucket.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @config_service_stub.call_rpc :update_bucket, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#update_bucket_async(request, options = nil) ⇒ ::Gapic::Operation #update_bucket_async(name: nil, bucket: nil, update_mask: nil) ⇒ ::Gapic::Operation

Updates a log bucket asynchronously.

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

After a bucket has been created, the bucket's location cannot be changed.

Examples:

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_async method.
result = client.update_bucket_async request

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

Overloads:

  • #update_bucket_async(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to update_bucket_async 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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #update_bucket_async(name: nil, bucket: nil, update_mask: nil) ⇒ ::Gapic::Operation

    Pass arguments to update_bucket_async 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) (defaults to: nil)

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

      For example:

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

    • bucket (::Google::Cloud::Logging::V2::LogBucket, ::Hash) (defaults to: nil)

      Required. The updated bucket.

    • update_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      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

      For example: updateMask=retention_days

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.



589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
# File 'lib/google/cloud/logging/v2/config_service/client.rb', line 589

def update_bucket_async request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::UpdateBucketRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_bucket_async..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Logging::V2::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.update_bucket_async.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_bucket_async.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @config_service_stub.call_rpc :update_bucket_async, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#update_cmek_settings(request, options = nil) ⇒ ::Google::Cloud::Logging::V2::CmekSettings #update_cmek_settings(name: nil, cmek_settings: nil, update_mask: nil) ⇒ ::Google::Cloud::Logging::V2::CmekSettings

Updates the Log Router CMEK settings for the given resource.

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

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 Log Router for more information.

Examples:

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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #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) (defaults to: nil)

      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"
      

      For example:

      "organizations/12345/cmekSettings"

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

    • cmek_settings (::Google::Cloud::Logging::V2::CmekSettings, ::Hash) (defaults to: nil)

      Required. The CMEK settings to update.

      See Enabling CMEK for Log Router for more information.

    • update_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      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.

      For example: "updateMask=kmsKeyName"

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
# File 'lib/google/cloud/logging/v2/config_service/client.rb', line 3152

def update_cmek_settings request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::UpdateCmekSettingsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_cmek_settings..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Logging::V2::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.update_cmek_settings.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_cmek_settings.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @config_service_stub.call_rpc :update_cmek_settings, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#update_exclusion(request, options = nil) ⇒ ::Google::Cloud::Logging::V2::LogExclusion #update_exclusion(name: nil, exclusion: nil, update_mask: nil) ⇒ ::Google::Cloud::Logging::V2::LogExclusion

Changes one or more properties of an existing exclusion in the _Default sink.

Examples:

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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #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) (defaults to: nil)

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

      For example:

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

    • exclusion (::Google::Cloud::Logging::V2::LogExclusion, ::Hash) (defaults to: nil)

      Required. New values for the existing exclusion. Only the fields specified in update_mask are relevant.

    • update_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      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:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
# File 'lib/google/cloud/logging/v2/config_service/client.rb', line 2824

def update_exclusion request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::UpdateExclusionRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_exclusion..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Logging::V2::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.update_exclusion.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_exclusion.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @config_service_stub.call_rpc :update_exclusion, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#update_settings(request, options = nil) ⇒ ::Google::Cloud::Logging::V2::Settings #update_settings(name: nil, settings: nil, update_mask: nil) ⇒ ::Google::Cloud::Logging::V2::Settings

Updates the Log Router settings for the given resource.

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

UpdateSettings 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. 4) location_id is not supported by Logging. 5) location_id violate OrgPolicy.

See Enabling CMEK for Log Router for more information.

Examples:

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

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

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

Overloads:

  • #update_settings(request, options = nil) ⇒ ::Google::Cloud::Logging::V2::Settings

    Pass arguments to update_settings via a request object, either of type UpdateSettingsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Logging::V2::UpdateSettingsRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #update_settings(name: nil, settings: nil, update_mask: nil) ⇒ ::Google::Cloud::Logging::V2::Settings

    Pass arguments to update_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) (defaults to: nil)

      Required. The resource name for the settings to update.

      "organizations/[ORGANIZATION_ID]/settings"
      

      For example:

      "organizations/12345/settings"

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

    • settings (::Google::Cloud::Logging::V2::Settings, ::Hash) (defaults to: nil)

      Required. The settings to update.

      See Enabling CMEK for Log Router for more information.

    • update_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      Optional. Field mask identifying which fields from 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.

      For example: "updateMask=kmsKeyName"

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
# File 'lib/google/cloud/logging/v2/config_service/client.rb', line 3384

def update_settings request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::UpdateSettingsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_settings..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Logging::V2::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.update_settings.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_settings.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @config_service_stub.call_rpc :update_settings, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#update_sink(request, options = nil) ⇒ ::Google::Cloud::Logging::V2::LogSink #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.

Examples:

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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #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) (defaults to: nil)

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

      For example:

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

    • sink (::Google::Cloud::Logging::V2::LogSink, ::Hash) (defaults to: nil)

      Required. The updated sink, whose name is the same identifier that appears as part of sink_name.

    • unique_writer_identity (::Boolean) (defaults to: nil)

      Optional. See 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) (defaults to: nil)

      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

      For example: updateMask=filter

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
# File 'lib/google/cloud/logging/v2/config_service/client.rb', line 1927

def update_sink request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::UpdateSinkRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_sink..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Logging::V2::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.sink_name
    header_params["sink_name"] = request.sink_name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.update_sink.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_sink.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @config_service_stub.call_rpc :update_sink, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#update_view(request, options = nil) ⇒ ::Google::Cloud::Logging::V2::LogView #update_view(name: nil, view: nil, update_mask: nil) ⇒ ::Google::Cloud::Logging::V2::LogView

Updates a view on a log bucket. This method replaces the following fields in the existing view with values from the new view: filter. If an UNAVAILABLE error is returned, this indicates that system is not in a state where it can update the view. If this occurs, please try again in a few minutes.

Examples:

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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #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:

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
# File 'lib/google/cloud/logging/v2/config_service/client.rb', line 1390

def update_view request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::UpdateViewRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_view..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Logging::V2::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.update_view.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_view.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @config_service_stub.call_rpc :update_view, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end