google-cloud-logging-v2-1.5.1/0000755000004100000410000000000015143461113016076 5ustar www-datawww-datagoogle-cloud-logging-v2-1.5.1/AUTHENTICATION.md0000644000004100000410000001174615143461113020550 0ustar www-datawww-data# Authentication The recommended way to authenticate to the google-cloud-logging-v2 library is to use [Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials). To review all of your authentication options, see [Credentials lookup](#credential-lookup). ## Quickstart The following example shows how to set up authentication for a local development environment with your user credentials. **NOTE:** This method is _not_ recommended for running in production. User credentials should be used only during development. 1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk). 2. Set up a local ADC file with your user credentials: ```sh gcloud auth application-default login ``` 3. Write code as if already authenticated. For more information about setting up authentication for a local development environment, see [Set up Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-dev). ## Credential Lookup The google-cloud-logging-v2 library provides several mechanisms to configure your system. Generally, using Application Default Credentials to facilitate automatic credentials discovery is the easist method. But if you need to explicitly specify credentials, there are several methods available to you. Credentials are accepted in the following ways, in the following order or precedence: 1. Credentials specified in method arguments 2. Credentials specified in configuration 3. Credentials pointed to or included in environment variables 4. Credentials found in local ADC file 5. Credentials returned by the metadata server for the attached service account (GCP) ### Configuration You can configure a path to a JSON credentials file, either for an individual client object or globally, for all client objects. The JSON file can contain credentials created for [workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), [workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a [service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). Note: Service account keys are a security risk if not managed correctly. You should [choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) whenever possible. To configure a credentials file for an individual client initialization: ```ruby require "google/cloud/logging/v2" client = ::Google::Cloud::Logging::V2::LoggingService::Client.new do |config| config.credentials = "path/to/credentialfile.json" end ``` To configure a credentials file globally for all clients: ```ruby require "google/cloud/logging/v2" ::Google::Cloud::Logging::V2::LoggingService::Client.configure do |config| config.credentials = "path/to/credentialfile.json" end client = ::Google::Cloud::Logging::V2::LoggingService::Client.new ``` ### Environment Variables You can also use an environment variable to provide a JSON credentials file. The environment variable can contain a path to the credentials file or, for environments such as Docker containers where writing files is not encouraged, you can include the credentials file itself. The JSON file can contain credentials created for [workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), [workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a [service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). Note: Service account keys are a security risk if not managed correctly. You should [choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) whenever possible. The environment variables that google-cloud-logging-v2 checks for credentials are: * `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents * `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file ```ruby require "google/cloud/logging/v2" ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" client = ::Google::Cloud::Logging::V2::LoggingService::Client.new ``` ### Local ADC file You can set up a local ADC file with your user credentials for authentication during development. If credentials are not provided in code or in environment variables, then the local ADC credentials are discovered. Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. ### Google Cloud Platform environments When running on Google Cloud Platform (GCP), including Google Compute Engine (GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud Functions (GCF) and Cloud Run, credentials are retrieved from the attached service account automatically. Code should be written as if already authenticated. For more information, see [Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa). google-cloud-logging-v2-1.5.1/google-cloud-logging-v2.gemspec0000644000004100000410000000766415143461113024011 0ustar www-datawww-data######################################################### # This file has been automatically generated by gem2tgz # ######################################################### # -*- encoding: utf-8 -*- # stub: google-cloud-logging-v2 1.5.1 ruby lib Gem::Specification.new do |s| s.name = "google-cloud-logging-v2".freeze s.version = "1.5.1".freeze s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version= s.require_paths = ["lib".freeze] s.authors = ["Google LLC".freeze] s.date = "1980-01-02" s.description = "The Cloud Logging API lets you programmatically read and write log entries, set up exclusions, create logs-based metrics, and manage export sinks. Note that google-cloud-logging-v2 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-logging instead. See the readme for more details.".freeze s.email = "googleapis-packages@google.com".freeze s.files = [".yardopts".freeze, "AUTHENTICATION.md".freeze, "LICENSE.md".freeze, "README.md".freeze, "lib/google-cloud-logging-v2.rb".freeze, "lib/google/cloud/logging/v2.rb".freeze, "lib/google/cloud/logging/v2/config_service.rb".freeze, "lib/google/cloud/logging/v2/config_service/client.rb".freeze, "lib/google/cloud/logging/v2/config_service/credentials.rb".freeze, "lib/google/cloud/logging/v2/config_service/operations.rb".freeze, "lib/google/cloud/logging/v2/config_service/paths.rb".freeze, "lib/google/cloud/logging/v2/logging_service.rb".freeze, "lib/google/cloud/logging/v2/logging_service/client.rb".freeze, "lib/google/cloud/logging/v2/logging_service/credentials.rb".freeze, "lib/google/cloud/logging/v2/logging_service/paths.rb".freeze, "lib/google/cloud/logging/v2/metrics_service.rb".freeze, "lib/google/cloud/logging/v2/metrics_service/client.rb".freeze, "lib/google/cloud/logging/v2/metrics_service/credentials.rb".freeze, "lib/google/cloud/logging/v2/metrics_service/paths.rb".freeze, "lib/google/cloud/logging/v2/version.rb".freeze, "lib/google/logging/v2/log_entry_pb.rb".freeze, "lib/google/logging/v2/logging_config_pb.rb".freeze, "lib/google/logging/v2/logging_config_services_pb.rb".freeze, "lib/google/logging/v2/logging_metrics_pb.rb".freeze, "lib/google/logging/v2/logging_metrics_services_pb.rb".freeze, "lib/google/logging/v2/logging_pb.rb".freeze, "lib/google/logging/v2/logging_services_pb.rb".freeze, "proto_docs/README.md".freeze, "proto_docs/google/api/client.rb".freeze, "proto_docs/google/api/distribution.rb".freeze, "proto_docs/google/api/field_behavior.rb".freeze, "proto_docs/google/api/label.rb".freeze, "proto_docs/google/api/launch_stage.rb".freeze, "proto_docs/google/api/metric.rb".freeze, "proto_docs/google/api/monitored_resource.rb".freeze, "proto_docs/google/api/resource.rb".freeze, "proto_docs/google/logging/type/http_request.rb".freeze, "proto_docs/google/logging/type/log_severity.rb".freeze, "proto_docs/google/logging/v2/log_entry.rb".freeze, "proto_docs/google/logging/v2/logging.rb".freeze, "proto_docs/google/logging/v2/logging_config.rb".freeze, "proto_docs/google/logging/v2/logging_metrics.rb".freeze, "proto_docs/google/longrunning/operations.rb".freeze, "proto_docs/google/protobuf/any.rb".freeze, "proto_docs/google/protobuf/duration.rb".freeze, "proto_docs/google/protobuf/empty.rb".freeze, "proto_docs/google/protobuf/field_mask.rb".freeze, "proto_docs/google/protobuf/struct.rb".freeze, "proto_docs/google/protobuf/timestamp.rb".freeze, "proto_docs/google/rpc/status.rb".freeze] s.homepage = "https://github.com/googleapis/google-cloud-ruby".freeze s.licenses = ["Apache-2.0".freeze] s.required_ruby_version = Gem::Requirement.new(">= 3.1".freeze) s.rubygems_version = "3.6.9".freeze s.summary = "Writes log entries and manages your Cloud Logging configuration.".freeze s.specification_version = 4 s.add_runtime_dependency(%q.freeze, ["~> 1.2".freeze]) s.add_runtime_dependency(%q.freeze, ["~> 1.0".freeze]) end google-cloud-logging-v2-1.5.1/lib/0000755000004100000410000000000015143461113016644 5ustar www-datawww-datagoogle-cloud-logging-v2-1.5.1/lib/google/0000755000004100000410000000000015143461113020120 5ustar www-datawww-datagoogle-cloud-logging-v2-1.5.1/lib/google/cloud/0000755000004100000410000000000015143461113021226 5ustar www-datawww-datagoogle-cloud-logging-v2-1.5.1/lib/google/cloud/logging/0000755000004100000410000000000015143461113022654 5ustar www-datawww-datagoogle-cloud-logging-v2-1.5.1/lib/google/cloud/logging/v2/0000755000004100000410000000000015143461113023203 5ustar www-datawww-datagoogle-cloud-logging-v2-1.5.1/lib/google/cloud/logging/v2/metrics_service/0000755000004100000410000000000015143461113026371 5ustar www-datawww-datagoogle-cloud-logging-v2-1.5.1/lib/google/cloud/logging/v2/metrics_service/paths.rb0000644000004100000410000000353315143461113030041 0ustar www-datawww-data# frozen_string_literal: true # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Auto-generated by gapic-generator-ruby. DO NOT EDIT! module Google module Cloud module Logging module V2 module MetricsService # Path helper methods for the MetricsService API. module Paths ## # Create a fully-qualified LogMetric resource string. # # The resource will be in the following format: # # `projects/{project}/metrics/{metric}` # # @param project [String] # @param metric [String] # # @return [::String] def log_metric_path project:, metric: raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" "projects/#{project}/metrics/#{metric}" end ## # Create a fully-qualified Project resource string. # # The resource will be in the following format: # # `projects/{project}` # # @param project [String] # # @return [::String] def project_path project: "projects/#{project}" end extend self end end end end end end google-cloud-logging-v2-1.5.1/lib/google/cloud/logging/v2/metrics_service/client.rb0000644000004100000410000013042415143461113030200 0ustar www-datawww-data# frozen_string_literal: true # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Auto-generated by gapic-generator-ruby. DO NOT EDIT! require "google/cloud/errors" require "google/logging/v2/logging_metrics_pb" module Google module Cloud module Logging module V2 module MetricsService ## # Client for the MetricsService service. # # Service for configuring logs-based metrics. # class Client # @private API_VERSION = "" # @private DEFAULT_ENDPOINT_TEMPLATE = "logging.$UNIVERSE_DOMAIN$" include Paths # @private attr_reader :metrics_service_stub ## # Configure the MetricsService Client class. # # See {::Google::Cloud::Logging::V2::MetricsService::Client::Configuration} # for a description of the configuration fields. # # @example # # # Modify the configuration for all MetricsService clients # ::Google::Cloud::Logging::V2::MetricsService::Client.configure do |config| # config.timeout = 10.0 # end # # @yield [config] Configure the Client client. # @yieldparam config [Client::Configuration] # # @return [Client::Configuration] # 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_log_metrics.timeout = 60.0 default_config.rpcs.list_log_metrics.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 13, 14] } default_config.rpcs.get_log_metric.timeout = 60.0 default_config.rpcs.get_log_metric.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 13, 14] } default_config.rpcs.create_log_metric.timeout = 60.0 default_config.rpcs.update_log_metric.timeout = 60.0 default_config.rpcs.update_log_metric.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 13, 14] } default_config.rpcs.delete_log_metric.timeout = 60.0 default_config.rpcs.delete_log_metric.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 ## # Configure the MetricsService Client instance. # # The configuration is set to the derived mode, meaning that values can be changed, # but structural changes (adding new fields, etc.) are not allowed. Structural changes # should be made on {Client.configure}. # # See {::Google::Cloud::Logging::V2::MetricsService::Client::Configuration} # for a description of the configuration fields. # # @yield [config] Configure the Client client. # @yieldparam config [Client::Configuration] # # @return [Client::Configuration] # def configure yield @config if block_given? @config end ## # The effective universe domain # # @return [String] # def universe_domain @metrics_service_stub.universe_domain end ## # Create a new MetricsService client object. # # @example # # # Create a client using the default configuration # client = ::Google::Cloud::Logging::V2::MetricsService::Client.new # # # Create a client using a custom configuration # client = ::Google::Cloud::Logging::V2::MetricsService::Client.new do |config| # config.timeout = 10.0 # end # # @yield [config] Configure the MetricsService client. # @yieldparam config [Client::Configuration] # 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_metrics_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.nil? || (@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 @metrics_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Logging::V2::MetricsServiceV2::Stub, credentials: credentials, endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, channel_args: @config.channel_args, interceptors: @config.interceptors, channel_pool_config: @config.channel_pool, logger: @config.logger ) @metrics_service_stub.stub_logger&.info do |entry| entry.set_system_name entry.set_service entry.message = "Created client for #{entry.service}" entry.set_credentials_fields credentials entry.set "customEndpoint", @config.endpoint if @config.endpoint entry.set "defaultTimeout", @config.timeout if @config.timeout entry.set "quotaProject", @quota_project_id if @quota_project_id end end ## # The logger used for request/response debug logging. # # @return [Logger] # def logger @metrics_service_stub.logger end # Service calls ## # Lists logs-based metrics. # # @overload list_log_metrics(request, options = nil) # Pass arguments to `list_log_metrics` via a request object, either of type # {::Google::Cloud::Logging::V2::ListLogMetricsRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Logging::V2::ListLogMetricsRequest, ::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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload list_log_metrics(parent: nil, page_token: nil, page_size: nil) # Pass arguments to `list_log_metrics` 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). # # @param parent [::String] # Required. The name of the project containing the metrics: # # "projects/[PROJECT_ID]" # @param page_token [::String] # Optional. If present, then retrieve the next batch of results from the # preceding call to this method. `pageToken` must be the value of # `nextPageToken` from the previous response. The values of other method # parameters should be identical to those in the previous call. # @param page_size [::Integer] # Optional. The maximum number of results to return from this request. # Non-positive values are ignored. The presence of `nextPageToken` in the # response indicates that more results might be available. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Logging::V2::LogMetric>] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Gapic::PagedEnumerable<::Google::Cloud::Logging::V2::LogMetric>] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/logging/v2" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Logging::V2::MetricsService::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Logging::V2::ListLogMetricsRequest.new # # # Call the list_log_metrics method. # result = client.list_log_metrics 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::LogMetric. # p item # end # def list_log_metrics request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::ListLogMetricsRequest # 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 metadata = @config.rpcs.list_log_metrics.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers metadata[:"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 metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"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("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.list_log_metrics.timeout, metadata: metadata, retry_policy: @config.rpcs.list_log_metrics.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @metrics_service_stub.call_rpc :list_log_metrics, request, options: options do |response, operation| response = ::Gapic::PagedEnumerable.new @metrics_service_stub, :list_log_metrics, request, response, operation, options yield response, operation if block_given? throw :response, response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Gets a logs-based metric. # # @overload get_log_metric(request, options = nil) # Pass arguments to `get_log_metric` via a request object, either of type # {::Google::Cloud::Logging::V2::GetLogMetricRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Logging::V2::GetLogMetricRequest, ::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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload get_log_metric(metric_name: nil) # Pass arguments to `get_log_metric` 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). # # @param metric_name [::String] # Required. The resource name of the desired metric: # # "projects/[PROJECT_ID]/metrics/[METRIC_ID]" # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::Logging::V2::LogMetric] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Cloud::Logging::V2::LogMetric] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/logging/v2" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Logging::V2::MetricsService::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Logging::V2::GetLogMetricRequest.new # # # Call the get_log_metric method. # result = client.get_log_metric request # # # The returned object is of type Google::Cloud::Logging::V2::LogMetric. # p result # def get_log_metric request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::GetLogMetricRequest # 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 metadata = @config.rpcs.get_log_metric.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers metadata[:"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 metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.metric_name header_params["metric_name"] = request.metric_name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.get_log_metric.timeout, metadata: metadata, retry_policy: @config.rpcs.get_log_metric.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @metrics_service_stub.call_rpc :get_log_metric, request, options: options do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Creates a logs-based metric. # # @overload create_log_metric(request, options = nil) # Pass arguments to `create_log_metric` via a request object, either of type # {::Google::Cloud::Logging::V2::CreateLogMetricRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Logging::V2::CreateLogMetricRequest, ::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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload create_log_metric(parent: nil, metric: nil) # Pass arguments to `create_log_metric` 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). # # @param parent [::String] # Required. The resource name of the project in which to create the metric: # # "projects/[PROJECT_ID]" # # The new metric must be provided in the request. # @param metric [::Google::Cloud::Logging::V2::LogMetric, ::Hash] # Required. The new logs-based metric, which must not have an identifier that # already exists. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::Logging::V2::LogMetric] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Cloud::Logging::V2::LogMetric] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/logging/v2" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Logging::V2::MetricsService::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Logging::V2::CreateLogMetricRequest.new # # # Call the create_log_metric method. # result = client.create_log_metric request # # # The returned object is of type Google::Cloud::Logging::V2::LogMetric. # p result # def create_log_metric request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::CreateLogMetricRequest # 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 metadata = @config.rpcs.create_log_metric.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers metadata[:"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 metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"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("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.create_log_metric.timeout, metadata: metadata, retry_policy: @config.rpcs.create_log_metric.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @metrics_service_stub.call_rpc :create_log_metric, request, options: options do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Creates or updates a logs-based metric. # # @overload update_log_metric(request, options = nil) # Pass arguments to `update_log_metric` via a request object, either of type # {::Google::Cloud::Logging::V2::UpdateLogMetricRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Logging::V2::UpdateLogMetricRequest, ::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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload update_log_metric(metric_name: nil, metric: nil) # Pass arguments to `update_log_metric` 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). # # @param metric_name [::String] # Required. The resource name of the metric to update: # # "projects/[PROJECT_ID]/metrics/[METRIC_ID]" # # The updated metric must be provided in the request and it's # `name` field must be the same as `[METRIC_ID]` If the metric # does not exist in `[PROJECT_ID]`, then a new metric is created. # @param metric [::Google::Cloud::Logging::V2::LogMetric, ::Hash] # Required. The updated metric. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::Logging::V2::LogMetric] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Cloud::Logging::V2::LogMetric] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/logging/v2" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Logging::V2::MetricsService::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Logging::V2::UpdateLogMetricRequest.new # # # Call the update_log_metric method. # result = client.update_log_metric request # # # The returned object is of type Google::Cloud::Logging::V2::LogMetric. # p result # def update_log_metric request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::UpdateLogMetricRequest # 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 metadata = @config.rpcs.update_log_metric.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers metadata[:"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 metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.metric_name header_params["metric_name"] = request.metric_name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.update_log_metric.timeout, metadata: metadata, retry_policy: @config.rpcs.update_log_metric.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @metrics_service_stub.call_rpc :update_log_metric, request, options: options do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Deletes a logs-based metric. # # @overload delete_log_metric(request, options = nil) # Pass arguments to `delete_log_metric` via a request object, either of type # {::Google::Cloud::Logging::V2::DeleteLogMetricRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Logging::V2::DeleteLogMetricRequest, ::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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload delete_log_metric(metric_name: nil) # Pass arguments to `delete_log_metric` 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). # # @param metric_name [::String] # Required. The resource name of the metric to delete: # # "projects/[PROJECT_ID]/metrics/[METRIC_ID]" # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Protobuf::Empty] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/logging/v2" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Logging::V2::MetricsService::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Logging::V2::DeleteLogMetricRequest.new # # # Call the delete_log_metric method. # result = client.delete_log_metric request # # # The returned object is of type Google::Protobuf::Empty. # p result # def delete_log_metric request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::DeleteLogMetricRequest # 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 metadata = @config.rpcs.delete_log_metric.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers metadata[:"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 metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.metric_name header_params["metric_name"] = request.metric_name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.delete_log_metric.timeout, metadata: metadata, retry_policy: @config.rpcs.delete_log_metric.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @metrics_service_stub.call_rpc :delete_log_metric, request, options: options do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Configuration class for the MetricsService API. # # This class represents the configuration for MetricsService, # providing control over timeouts, retry behavior, logging, transport # parameters, and other low-level controls. Certain parameters can also be # applied individually to specific RPCs. See # {::Google::Cloud::Logging::V2::MetricsService::Client::Configuration::Rpcs} # for a list of RPCs that can be configured independently. # # Configuration can be applied globally to all clients, or to a single client # on construction. # # @example # # # Modify the global config, setting the timeout for # # list_log_metrics to 20 seconds, # # and all remaining timeouts to 10 seconds. # ::Google::Cloud::Logging::V2::MetricsService::Client.configure do |config| # config.timeout = 10.0 # config.rpcs.list_log_metrics.timeout = 20.0 # end # # # Apply the above configuration only to a new client. # client = ::Google::Cloud::Logging::V2::MetricsService::Client.new do |config| # config.timeout = 10.0 # config.rpcs.list_log_metrics.timeout = 20.0 # end # # @!attribute [rw] endpoint # A custom service endpoint, as a hostname or hostname:port. The default is # nil, indicating to use the default endpoint in the current universe domain. # @return [::String,nil] # @!attribute [rw] credentials # Credentials to send with calls. You may provide any of the following types: # * (`Google::Auth::Credentials`) A googleauth credentials object # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) # * (`Signet::OAuth2::Client`) A signet oauth2 client object # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) # * (`GRPC::Core::Channel`) a gRPC channel with included credentials # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object # * (`nil`) indicating no credentials # # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials # is deprecated. Providing an unvalidated credential configuration to # Google APIs can compromise the security of your systems and data. # # @example # # # The recommended way to provide credentials is to use the `make_creds` method # # on the appropriate credentials class for your environment. # # require "googleauth" # # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( # json_key_io: ::File.open("/path/to/keyfile.json") # ) # # client = ::Google::Cloud::Logging::V2::MetricsService::Client.new do |config| # config.credentials = credentials # end # # @note Warning: If you accept a credential configuration (JSON file or Hash) from an # external source for authentication to Google Cloud, you must validate it before # providing it to a Google API client library. Providing an unvalidated credential # configuration to Google APIs can compromise the security of your systems and data. # For more information, refer to [Validate credential configurations from external # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). # @return [::Object] # @!attribute [rw] scope # The OAuth scopes # @return [::Array<::String>] # @!attribute [rw] lib_name # The library name as recorded in instrumentation and logging # @return [::String] # @!attribute [rw] lib_version # The library version as recorded in instrumentation and logging # @return [::String] # @!attribute [rw] channel_args # Extra parameters passed to the gRPC channel. Note: this is ignored if a # `GRPC::Core::Channel` object is provided as the credential. # @return [::Hash] # @!attribute [rw] interceptors # An array of interceptors that are run before calls are executed. # @return [::Array<::GRPC::ClientInterceptor>] # @!attribute [rw] timeout # The call timeout in seconds. # @return [::Numeric] # @!attribute [rw] metadata # Additional gRPC headers to be sent with the call. # @return [::Hash{::Symbol=>::String}] # @!attribute [rw] retry_policy # The retry policy. The value is a hash with the following keys: # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. # * `:retry_codes` (*type:* `Array`) - The error codes that should # trigger a retry. # @return [::Hash] # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] # @!attribute [rw] universe_domain # The universe domain within which to make requests. This determines the # default endpoint URL. The default value of nil uses the environment # universe (usually the default "googleapis.com" universe). # @return [::String,nil] # @!attribute [rw] logger # A custom logger to use for request/response debug logging, or the value # `:default` (the default) to construct a default logger, or `nil` to # explicitly disable logging. # @return [::Logger,:default,nil] # class Configuration extend ::Gapic::Config # @private # The endpoint specific to the default "googleapis.com" universe. Deprecated. DEFAULT_ENDPOINT = "logging.googleapis.com" config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel allowed.any? { |klass| klass === value } end config_attr :scope, nil, ::String, ::Array, nil config_attr :lib_name, nil, ::String, nil config_attr :lib_version, nil, ::String, nil config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) config_attr :interceptors, nil, ::Array, nil config_attr :timeout, nil, ::Numeric, nil config_attr :metadata, nil, ::Hash, nil config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil config_attr :universe_domain, nil, ::String, nil config_attr :logger, :default, ::Logger, nil, :default # @private def initialize parent_config = nil @parent_config = parent_config unless parent_config.nil? yield self if block_given? end ## # Configurations for individual RPCs # @return [Rpcs] # def rpcs @rpcs ||= begin parent_rpcs = nil parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) Rpcs.new parent_rpcs end end ## # Configuration for the channel pool # @return [::Gapic::ServiceStub::ChannelPool::Configuration] # def channel_pool @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new end ## # Configuration RPC class for the MetricsService API. # # Includes fields providing the configuration for each RPC in this service. # Each configuration object is of type `Gapic::Config::Method` and includes # the following configuration fields: # # * `timeout` (*type:* `Numeric`) - The call timeout in seconds # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields # include the following keys: # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. # * `:retry_codes` (*type:* `Array`) - The error codes that should # trigger a retry. # class Rpcs ## # RPC-specific configuration for `list_log_metrics` # @return [::Gapic::Config::Method] # attr_reader :list_log_metrics ## # RPC-specific configuration for `get_log_metric` # @return [::Gapic::Config::Method] # attr_reader :get_log_metric ## # RPC-specific configuration for `create_log_metric` # @return [::Gapic::Config::Method] # attr_reader :create_log_metric ## # RPC-specific configuration for `update_log_metric` # @return [::Gapic::Config::Method] # attr_reader :update_log_metric ## # RPC-specific configuration for `delete_log_metric` # @return [::Gapic::Config::Method] # attr_reader :delete_log_metric # @private def initialize parent_rpcs = nil list_log_metrics_config = parent_rpcs.list_log_metrics if parent_rpcs.respond_to? :list_log_metrics @list_log_metrics = ::Gapic::Config::Method.new list_log_metrics_config get_log_metric_config = parent_rpcs.get_log_metric if parent_rpcs.respond_to? :get_log_metric @get_log_metric = ::Gapic::Config::Method.new get_log_metric_config create_log_metric_config = parent_rpcs.create_log_metric if parent_rpcs.respond_to? :create_log_metric @create_log_metric = ::Gapic::Config::Method.new create_log_metric_config update_log_metric_config = parent_rpcs.update_log_metric if parent_rpcs.respond_to? :update_log_metric @update_log_metric = ::Gapic::Config::Method.new update_log_metric_config delete_log_metric_config = parent_rpcs.delete_log_metric if parent_rpcs.respond_to? :delete_log_metric @delete_log_metric = ::Gapic::Config::Method.new delete_log_metric_config yield self if block_given? end end end end end end end end end google-cloud-logging-v2-1.5.1/lib/google/cloud/logging/v2/metrics_service/credentials.rb0000644000004100000410000000350215143461113031213 0ustar www-datawww-data# frozen_string_literal: true # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Auto-generated by gapic-generator-ruby. DO NOT EDIT! require "googleauth" module Google module Cloud module Logging module V2 module MetricsService # Credentials for the MetricsService API. class Credentials < ::Google::Auth::Credentials self.scope = [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/cloud-platform.read-only", "https://www.googleapis.com/auth/logging.admin", "https://www.googleapis.com/auth/logging.read", "https://www.googleapis.com/auth/logging.write" ] self.env_vars = [ "LOGGING_CREDENTIALS", "LOGGING_KEYFILE", "GOOGLE_CLOUD_CREDENTIALS", "GOOGLE_CLOUD_KEYFILE", "GCLOUD_KEYFILE", "LOGGING_CREDENTIALS_JSON", "LOGGING_KEYFILE_JSON", "GOOGLE_CLOUD_CREDENTIALS_JSON", "GOOGLE_CLOUD_KEYFILE_JSON", "GCLOUD_KEYFILE_JSON" ] self.paths = [ "~/.config/google_cloud/application_default_credentials.json" ] end end end end end end google-cloud-logging-v2-1.5.1/lib/google/cloud/logging/v2/logging_service/0000755000004100000410000000000015143461113026351 5ustar www-datawww-datagoogle-cloud-logging-v2-1.5.1/lib/google/cloud/logging/v2/logging_service/paths.rb0000644000004100000410000001202415143461113030014 0ustar www-datawww-data# frozen_string_literal: true # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Auto-generated by gapic-generator-ruby. DO NOT EDIT! module Google module Cloud module Logging module V2 module LoggingService # Path helper methods for the LoggingService API. module Paths ## # Create a fully-qualified BillingAccount resource string. # # The resource will be in the following format: # # `billingAccounts/{billing_account}` # # @param billing_account [String] # # @return [::String] def billing_account_path billing_account: "billingAccounts/#{billing_account}" end ## # Create a fully-qualified Folder resource string. # # The resource will be in the following format: # # `folders/{folder}` # # @param folder [String] # # @return [::String] def folder_path folder: "folders/#{folder}" end ## # Create a fully-qualified Log resource string. # # @overload log_path(project:, log:) # The resource will be in the following format: # # `projects/{project}/logs/{log}` # # @param project [String] # @param log [String] # # @overload log_path(organization:, log:) # The resource will be in the following format: # # `organizations/{organization}/logs/{log}` # # @param organization [String] # @param log [String] # # @overload log_path(folder:, log:) # The resource will be in the following format: # # `folders/{folder}/logs/{log}` # # @param folder [String] # @param log [String] # # @overload log_path(billing_account:, log:) # The resource will be in the following format: # # `billingAccounts/{billing_account}/logs/{log}` # # @param billing_account [String] # @param log [String] # # @return [::String] def log_path **args resources = { "log:project" => (proc do |project:, log:| raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" "projects/#{project}/logs/#{log}" end), "log:organization" => (proc do |organization:, log:| raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" "organizations/#{organization}/logs/#{log}" end), "folder:log" => (proc do |folder:, log:| raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" "folders/#{folder}/logs/#{log}" end), "billing_account:log" => (proc do |billing_account:, log:| raise ::ArgumentError, "billing_account cannot contain /" if billing_account.to_s.include? "/" "billingAccounts/#{billing_account}/logs/#{log}" end) } resource = resources[args.keys.sort.join(":")] raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? resource.call(**args) end ## # Create a fully-qualified Organization resource string. # # The resource will be in the following format: # # `organizations/{organization}` # # @param organization [String] # # @return [::String] def organization_path organization: "organizations/#{organization}" end ## # Create a fully-qualified Project resource string. # # The resource will be in the following format: # # `projects/{project}` # # @param project [String] # # @return [::String] def project_path project: "projects/#{project}" end extend self end end end end end end google-cloud-logging-v2-1.5.1/lib/google/cloud/logging/v2/logging_service/client.rb0000644000004100000410000016526515143461113030173 0ustar www-datawww-data# frozen_string_literal: true # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Auto-generated by gapic-generator-ruby. DO NOT EDIT! require "google/cloud/errors" require "google/logging/v2/logging_pb" module Google module Cloud module Logging module V2 module LoggingService ## # Client for the LoggingService service. # # Service for ingesting and querying logs. # class Client # @private API_VERSION = "" # @private DEFAULT_ENDPOINT_TEMPLATE = "logging.$UNIVERSE_DOMAIN$" include Paths # @private attr_reader :logging_service_stub ## # Configure the LoggingService Client class. # # See {::Google::Cloud::Logging::V2::LoggingService::Client::Configuration} # for a description of the configuration fields. # # @example # # # Modify the configuration for all LoggingService clients # ::Google::Cloud::Logging::V2::LoggingService::Client.configure do |config| # config.timeout = 10.0 # end # # @yield [config] Configure the Client client. # @yieldparam config [Client::Configuration] # # @return [Client::Configuration] # 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.delete_log.timeout = 60.0 default_config.rpcs.delete_log.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 13, 14] } default_config.rpcs.write_log_entries.timeout = 60.0 default_config.rpcs.write_log_entries.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 13, 14] } default_config.rpcs.list_log_entries.timeout = 60.0 default_config.rpcs.list_log_entries.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 13, 14] } default_config.rpcs.list_monitored_resource_descriptors.timeout = 60.0 default_config.rpcs.list_monitored_resource_descriptors.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 13, 14] } default_config.rpcs.list_logs.timeout = 60.0 default_config.rpcs.list_logs.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 13, 14] } default_config.rpcs.tail_log_entries.timeout = 3600.0 default_config.rpcs.tail_log_entries.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 ## # Configure the LoggingService Client instance. # # The configuration is set to the derived mode, meaning that values can be changed, # but structural changes (adding new fields, etc.) are not allowed. Structural changes # should be made on {Client.configure}. # # See {::Google::Cloud::Logging::V2::LoggingService::Client::Configuration} # for a description of the configuration fields. # # @yield [config] Configure the Client client. # @yieldparam config [Client::Configuration] # # @return [Client::Configuration] # def configure yield @config if block_given? @config end ## # The effective universe domain # # @return [String] # def universe_domain @logging_service_stub.universe_domain end ## # Create a new LoggingService client object. # # @example # # # Create a client using the default configuration # client = ::Google::Cloud::Logging::V2::LoggingService::Client.new # # # Create a client using a custom configuration # client = ::Google::Cloud::Logging::V2::LoggingService::Client.new do |config| # config.timeout = 10.0 # end # # @yield [config] Configure the LoggingService client. # @yieldparam config [Client::Configuration] # 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_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.nil? || (@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 @logging_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Logging::V2::LoggingServiceV2::Stub, credentials: credentials, endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, channel_args: @config.channel_args, interceptors: @config.interceptors, channel_pool_config: @config.channel_pool, logger: @config.logger ) @logging_service_stub.stub_logger&.info do |entry| entry.set_system_name entry.set_service entry.message = "Created client for #{entry.service}" entry.set_credentials_fields credentials entry.set "customEndpoint", @config.endpoint if @config.endpoint entry.set "defaultTimeout", @config.timeout if @config.timeout entry.set "quotaProject", @quota_project_id if @quota_project_id end end ## # The logger used for request/response debug logging. # # @return [Logger] # def logger @logging_service_stub.logger end # Service calls ## # Deletes all the log entries in a log for the _Default Log Bucket. The log # reappears if it receives new entries. Log entries written shortly before # the delete operation might not be deleted. Entries received after the # delete operation with a timestamp before the operation will be deleted. # # @overload delete_log(request, options = nil) # Pass arguments to `delete_log` via a request object, either of type # {::Google::Cloud::Logging::V2::DeleteLogRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Logging::V2::DeleteLogRequest, ::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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload delete_log(log_name: nil) # Pass arguments to `delete_log` 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). # # @param log_name [::String] # Required. The resource name of the log to delete: # # * `projects/[PROJECT_ID]/logs/[LOG_ID]` # * `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]` # * `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]` # * `folders/[FOLDER_ID]/logs/[LOG_ID]` # # `[LOG_ID]` must be URL-encoded. For example, # `"projects/my-project-id/logs/syslog"`, # `"organizations/123/logs/cloudaudit.googleapis.com%2Factivity"`. # # For more information about log names, see # {::Google::Cloud::Logging::V2::LogEntry LogEntry}. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Protobuf::Empty] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/logging/v2" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Logging::V2::LoggingService::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Logging::V2::DeleteLogRequest.new # # # Call the delete_log method. # result = client.delete_log request # # # The returned object is of type Google::Protobuf::Empty. # p result # def delete_log request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::DeleteLogRequest # 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 metadata = @config.rpcs.delete_log.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers metadata[:"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 metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.log_name header_params["log_name"] = request.log_name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.delete_log.timeout, metadata: metadata, retry_policy: @config.rpcs.delete_log.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @logging_service_stub.call_rpc :delete_log, request, options: options do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Writes log entries to Logging. This API method is the # only way to send log entries to Logging. This method # is used, directly or indirectly, by the Logging agent # (fluentd) and all logging libraries configured to use Logging. # A single request may contain log entries for a maximum of 1000 # different resources (projects, organizations, billing accounts or # folders) # # @overload write_log_entries(request, options = nil) # Pass arguments to `write_log_entries` via a request object, either of type # {::Google::Cloud::Logging::V2::WriteLogEntriesRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Logging::V2::WriteLogEntriesRequest, ::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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload write_log_entries(log_name: nil, resource: nil, labels: nil, entries: nil, partial_success: nil, dry_run: nil) # Pass arguments to `write_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). # # @param log_name [::String] # Optional. A default log resource name that is assigned to all log entries # in `entries` that do not specify a value for `log_name`: # # * `projects/[PROJECT_ID]/logs/[LOG_ID]` # * `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]` # * `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]` # * `folders/[FOLDER_ID]/logs/[LOG_ID]` # # `[LOG_ID]` must be URL-encoded. For example: # # "projects/my-project-id/logs/syslog" # "organizations/123/logs/cloudaudit.googleapis.com%2Factivity" # # The permission `logging.logEntries.create` is needed on each project, # organization, billing account, or folder that is receiving new log # entries, whether the resource is specified in `logName` or in an # individual log entry. # @param resource [::Google::Api::MonitoredResource, ::Hash] # Optional. A default monitored resource object that is assigned to all log # entries in `entries` that do not specify a value for `resource`. Example: # # { "type": "gce_instance", # "labels": { # "zone": "us-central1-a", "instance_id": "00000000000000000000" }} # # See {::Google::Cloud::Logging::V2::LogEntry LogEntry}. # @param labels [::Hash{::String => ::String}] # Optional. Default labels that are added to the `labels` field of all log # entries in `entries`. If a log entry already has a label with the same key # as a label in this parameter, then the log entry's label is not changed. # See {::Google::Cloud::Logging::V2::LogEntry LogEntry}. # @param entries [::Array<::Google::Cloud::Logging::V2::LogEntry, ::Hash>] # Required. The log entries to send to Logging. The order of log # entries in this list does not matter. Values supplied in this method's # `log_name`, `resource`, and `labels` fields are copied into those log # entries in this list that do not include values for their corresponding # fields. For more information, see the # {::Google::Cloud::Logging::V2::LogEntry LogEntry} type. # # If the `timestamp` or `insert_id` fields are missing in log entries, then # this method supplies the current time or a unique identifier, respectively. # The supplied values are chosen so that, among the log entries that did not # supply their own values, the entries earlier in the list will sort before # the entries later in the list. See the `entries.list` method. # # Log entries with timestamps that are more than the # [logs retention period](https://cloud.google.com/logging/quotas) in # the past or more than 24 hours in the future will not be available when # calling `entries.list`. However, those log entries can still be [exported # with # LogSinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs). # # To improve throughput and to avoid exceeding the # [quota limit](https://cloud.google.com/logging/quotas) for calls to # `entries.write`, you should try to include several log entries in this # list, rather than calling this method for each individual log entry. # @param partial_success [::Boolean] # Optional. Whether a batch's valid entries should be written even if some # other entry failed due to a permanent error such as INVALID_ARGUMENT or # PERMISSION_DENIED. If any entry failed, then the response status is the # response status of one of the failed entries. The response will include # error details in `WriteLogEntriesPartialErrors.log_entry_errors` keyed by # the entries' zero-based index in the `entries`. Failed requests for which # no entries are written will not include per-entry errors. # @param dry_run [::Boolean] # Optional. If true, the request should expect normal response, but the # entries won't be persisted nor exported. Useful for checking whether the # logging API endpoints are working properly before sending valuable data. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::Logging::V2::WriteLogEntriesResponse] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Cloud::Logging::V2::WriteLogEntriesResponse] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/logging/v2" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Logging::V2::LoggingService::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Logging::V2::WriteLogEntriesRequest.new # # # Call the write_log_entries method. # result = client.write_log_entries request # # # The returned object is of type Google::Cloud::Logging::V2::WriteLogEntriesResponse. # p result # def write_log_entries request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::WriteLogEntriesRequest # 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 metadata = @config.rpcs.write_log_entries.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers metadata[:"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 metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.write_log_entries.timeout, metadata: metadata, retry_policy: @config.rpcs.write_log_entries.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @logging_service_stub.call_rpc :write_log_entries, request, options: options do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Lists log entries. Use this method to retrieve log entries that originated # from a project/folder/organization/billing account. For ways to export log # entries, see [Exporting # Logs](https://cloud.google.com/logging/docs/export). # # @overload list_log_entries(request, options = nil) # Pass arguments to `list_log_entries` via a request object, either of type # {::Google::Cloud::Logging::V2::ListLogEntriesRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Logging::V2::ListLogEntriesRequest, ::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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload list_log_entries(resource_names: nil, filter: nil, order_by: nil, page_size: nil, page_token: nil) # Pass arguments to `list_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). # # @param resource_names [::Array<::String>] # Required. Names of one or more parent resources from which to # retrieve log entries: # # * `projects/[PROJECT_ID]` # * `organizations/[ORGANIZATION_ID]` # * `billingAccounts/[BILLING_ACCOUNT_ID]` # * `folders/[FOLDER_ID]` # # May alternatively be one or more views: # # * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` # * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` # * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` # * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` # # Projects listed in the `project_ids` field are added to this list. # A maximum of 100 resources may be specified in a single request. # @param filter [::String] # Optional. Only log entries that match the filter are returned. An empty # filter matches all log entries in the resources listed in `resource_names`. # Referencing a parent resource that is not listed in `resource_names` will # cause the filter to return no results. The maximum length of a filter is # 20,000 characters. # @param order_by [::String] # Optional. How the results should be sorted. Presently, the only permitted # values are `"timestamp asc"` (default) and `"timestamp desc"`. The first # option returns entries in order of increasing values of # `LogEntry.timestamp` (oldest first), and the second option returns entries # in order of decreasing timestamps (newest first). Entries with equal # timestamps are returned in order of their `insert_id` values. # @param page_size [::Integer] # Optional. The maximum number of results to return from this request. # Default is 50. If the value is negative or exceeds 1000, the request is # rejected. The presence of `next_page_token` in the response indicates that # more results might be available. # @param page_token [::String] # Optional. If present, then retrieve the next batch of results from the # preceding call to this method. `page_token` must be the value of # `next_page_token` from the previous response. The values of other method # parameters should be identical to those in the previous call. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Logging::V2::LogEntry>] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Gapic::PagedEnumerable<::Google::Cloud::Logging::V2::LogEntry>] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/logging/v2" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Logging::V2::LoggingService::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Logging::V2::ListLogEntriesRequest.new # # # Call the list_log_entries method. # result = client.list_log_entries 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::LogEntry. # p item # end # def list_log_entries request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::ListLogEntriesRequest # 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 metadata = @config.rpcs.list_log_entries.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers metadata[:"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 metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.list_log_entries.timeout, metadata: metadata, retry_policy: @config.rpcs.list_log_entries.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @logging_service_stub.call_rpc :list_log_entries, request, options: options do |response, operation| response = ::Gapic::PagedEnumerable.new @logging_service_stub, :list_log_entries, request, response, operation, options yield response, operation if block_given? throw :response, response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Lists the descriptors for monitored resource types used by Logging. # # @overload list_monitored_resource_descriptors(request, options = nil) # Pass arguments to `list_monitored_resource_descriptors` via a request object, either of type # {::Google::Cloud::Logging::V2::ListMonitoredResourceDescriptorsRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Logging::V2::ListMonitoredResourceDescriptorsRequest, ::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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload list_monitored_resource_descriptors(page_size: nil, page_token: nil) # Pass arguments to `list_monitored_resource_descriptors` 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). # # @param page_size [::Integer] # Optional. The maximum number of results to return from this request. # Non-positive values are ignored. The presence of `nextPageToken` in the # response indicates that more results might be available. # @param page_token [::String] # Optional. If present, then retrieve the next batch of results from the # preceding call to this method. `pageToken` must be the value of # `nextPageToken` from the previous response. The values of other method # parameters should be identical to those in the previous call. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Gapic::PagedEnumerable<::Google::Api::MonitoredResourceDescriptor>] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Gapic::PagedEnumerable<::Google::Api::MonitoredResourceDescriptor>] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/logging/v2" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Logging::V2::LoggingService::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Logging::V2::ListMonitoredResourceDescriptorsRequest.new # # # Call the list_monitored_resource_descriptors method. # result = client.list_monitored_resource_descriptors 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::Api::MonitoredResourceDescriptor. # p item # end # def list_monitored_resource_descriptors request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::ListMonitoredResourceDescriptorsRequest # 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 metadata = @config.rpcs.list_monitored_resource_descriptors.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers metadata[:"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 metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.list_monitored_resource_descriptors.timeout, metadata: metadata, retry_policy: @config.rpcs.list_monitored_resource_descriptors.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @logging_service_stub.call_rpc :list_monitored_resource_descriptors, request, options: options do |response, operation| response = ::Gapic::PagedEnumerable.new @logging_service_stub, :list_monitored_resource_descriptors, request, response, operation, options yield response, operation if block_given? throw :response, response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Lists the logs in projects, organizations, folders, or billing accounts. # Only logs that have entries are listed. # # @overload list_logs(request, options = nil) # Pass arguments to `list_logs` via a request object, either of type # {::Google::Cloud::Logging::V2::ListLogsRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Logging::V2::ListLogsRequest, ::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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload list_logs(parent: nil, resource_names: nil, page_size: nil, page_token: nil) # Pass arguments to `list_logs` 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). # # @param parent [::String] # Required. The resource name to list logs for: # # * `projects/[PROJECT_ID]` # * `organizations/[ORGANIZATION_ID]` # * `billingAccounts/[BILLING_ACCOUNT_ID]` # * `folders/[FOLDER_ID]` # @param resource_names [::Array<::String>] # Optional. List of resource names to list logs for: # # * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` # * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` # * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` # * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` # # To support legacy queries, it could also be: # # * `projects/[PROJECT_ID]` # * `organizations/[ORGANIZATION_ID]` # * `billingAccounts/[BILLING_ACCOUNT_ID]` # * `folders/[FOLDER_ID]` # # The resource name in the `parent` field is added to this list. # @param page_size [::Integer] # Optional. The maximum number of results to return from this request. # Non-positive values are ignored. The presence of `nextPageToken` in the # response indicates that more results might be available. # @param page_token [::String] # Optional. If present, then retrieve the next batch of results from the # preceding call to this method. `pageToken` must be the value of # `nextPageToken` from the previous response. The values of other method # parameters should be identical to those in the previous call. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::Logging::V2::ListLogsResponse] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Cloud::Logging::V2::ListLogsResponse] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/logging/v2" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Logging::V2::LoggingService::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Logging::V2::ListLogsRequest.new # # # Call the list_logs method. # result = client.list_logs request # # # The returned object is of type Google::Cloud::Logging::V2::ListLogsResponse. # p result # def list_logs request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::ListLogsRequest # 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 metadata = @config.rpcs.list_logs.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers metadata[:"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 metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"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("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.list_logs.timeout, metadata: metadata, retry_policy: @config.rpcs.list_logs.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @logging_service_stub.call_rpc :list_logs, request, options: options do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Streaming read of log entries as they are ingested. Until the stream is # terminated, it will continue reading logs. # # @param request [::Gapic::StreamInput, ::Enumerable<::Google::Cloud::Logging::V2::TailLogEntriesRequest, ::Hash>] # An enumerable of {::Google::Cloud::Logging::V2::TailLogEntriesRequest} instances. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Enumerable<::Google::Cloud::Logging::V2::TailLogEntriesResponse>] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Enumerable<::Google::Cloud::Logging::V2::TailLogEntriesResponse>] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/logging/v2" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Logging::V2::LoggingService::Client.new # # # Create an input stream. # input = Gapic::StreamInput.new # # # Call the tail_log_entries method to start streaming. # output = client.tail_log_entries input # # # Send requests on the stream. For each request object, set fields by # # passing keyword arguments. Be sure to close the stream when done. # input << Google::Cloud::Logging::V2::TailLogEntriesRequest.new # input << Google::Cloud::Logging::V2::TailLogEntriesRequest.new # input.close # # # The returned object is a streamed enumerable yielding elements of type # # ::Google::Cloud::Logging::V2::TailLogEntriesResponse # output.each do |current_response| # p current_response # end # def tail_log_entries request, options = nil unless request.is_a? ::Enumerable raise ::ArgumentError, "request must be an Enumerable" unless request.respond_to? :to_enum request = request.to_enum end request = request.lazy.map do |req| ::Gapic::Protobuf.coerce req, to: ::Google::Cloud::Logging::V2::TailLogEntriesRequest end # 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 metadata = @config.rpcs.tail_log_entries.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers metadata[:"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 metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.tail_log_entries.timeout, metadata: metadata, retry_policy: @config.rpcs.tail_log_entries.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @logging_service_stub.call_rpc :tail_log_entries, request, options: options do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Configuration class for the LoggingService API. # # This class represents the configuration for LoggingService, # providing control over timeouts, retry behavior, logging, transport # parameters, and other low-level controls. Certain parameters can also be # applied individually to specific RPCs. See # {::Google::Cloud::Logging::V2::LoggingService::Client::Configuration::Rpcs} # for a list of RPCs that can be configured independently. # # Configuration can be applied globally to all clients, or to a single client # on construction. # # @example # # # Modify the global config, setting the timeout for # # delete_log to 20 seconds, # # and all remaining timeouts to 10 seconds. # ::Google::Cloud::Logging::V2::LoggingService::Client.configure do |config| # config.timeout = 10.0 # config.rpcs.delete_log.timeout = 20.0 # end # # # Apply the above configuration only to a new client. # client = ::Google::Cloud::Logging::V2::LoggingService::Client.new do |config| # config.timeout = 10.0 # config.rpcs.delete_log.timeout = 20.0 # end # # @!attribute [rw] endpoint # A custom service endpoint, as a hostname or hostname:port. The default is # nil, indicating to use the default endpoint in the current universe domain. # @return [::String,nil] # @!attribute [rw] credentials # Credentials to send with calls. You may provide any of the following types: # * (`Google::Auth::Credentials`) A googleauth credentials object # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) # * (`Signet::OAuth2::Client`) A signet oauth2 client object # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) # * (`GRPC::Core::Channel`) a gRPC channel with included credentials # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object # * (`nil`) indicating no credentials # # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials # is deprecated. Providing an unvalidated credential configuration to # Google APIs can compromise the security of your systems and data. # # @example # # # The recommended way to provide credentials is to use the `make_creds` method # # on the appropriate credentials class for your environment. # # require "googleauth" # # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( # json_key_io: ::File.open("/path/to/keyfile.json") # ) # # client = ::Google::Cloud::Logging::V2::LoggingService::Client.new do |config| # config.credentials = credentials # end # # @note Warning: If you accept a credential configuration (JSON file or Hash) from an # external source for authentication to Google Cloud, you must validate it before # providing it to a Google API client library. Providing an unvalidated credential # configuration to Google APIs can compromise the security of your systems and data. # For more information, refer to [Validate credential configurations from external # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). # @return [::Object] # @!attribute [rw] scope # The OAuth scopes # @return [::Array<::String>] # @!attribute [rw] lib_name # The library name as recorded in instrumentation and logging # @return [::String] # @!attribute [rw] lib_version # The library version as recorded in instrumentation and logging # @return [::String] # @!attribute [rw] channel_args # Extra parameters passed to the gRPC channel. Note: this is ignored if a # `GRPC::Core::Channel` object is provided as the credential. # @return [::Hash] # @!attribute [rw] interceptors # An array of interceptors that are run before calls are executed. # @return [::Array<::GRPC::ClientInterceptor>] # @!attribute [rw] timeout # The call timeout in seconds. # @return [::Numeric] # @!attribute [rw] metadata # Additional gRPC headers to be sent with the call. # @return [::Hash{::Symbol=>::String}] # @!attribute [rw] retry_policy # The retry policy. The value is a hash with the following keys: # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. # * `:retry_codes` (*type:* `Array`) - The error codes that should # trigger a retry. # @return [::Hash] # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] # @!attribute [rw] universe_domain # The universe domain within which to make requests. This determines the # default endpoint URL. The default value of nil uses the environment # universe (usually the default "googleapis.com" universe). # @return [::String,nil] # @!attribute [rw] logger # A custom logger to use for request/response debug logging, or the value # `:default` (the default) to construct a default logger, or `nil` to # explicitly disable logging. # @return [::Logger,:default,nil] # class Configuration extend ::Gapic::Config # @private # The endpoint specific to the default "googleapis.com" universe. Deprecated. DEFAULT_ENDPOINT = "logging.googleapis.com" config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel allowed.any? { |klass| klass === value } end config_attr :scope, nil, ::String, ::Array, nil config_attr :lib_name, nil, ::String, nil config_attr :lib_version, nil, ::String, nil config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) config_attr :interceptors, nil, ::Array, nil config_attr :timeout, nil, ::Numeric, nil config_attr :metadata, nil, ::Hash, nil config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil config_attr :universe_domain, nil, ::String, nil config_attr :logger, :default, ::Logger, nil, :default # @private def initialize parent_config = nil @parent_config = parent_config unless parent_config.nil? yield self if block_given? end ## # Configurations for individual RPCs # @return [Rpcs] # def rpcs @rpcs ||= begin parent_rpcs = nil parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) Rpcs.new parent_rpcs end end ## # Configuration for the channel pool # @return [::Gapic::ServiceStub::ChannelPool::Configuration] # def channel_pool @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new end ## # Configuration RPC class for the LoggingService API. # # Includes fields providing the configuration for each RPC in this service. # Each configuration object is of type `Gapic::Config::Method` and includes # the following configuration fields: # # * `timeout` (*type:* `Numeric`) - The call timeout in seconds # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields # include the following keys: # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. # * `:retry_codes` (*type:* `Array`) - The error codes that should # trigger a retry. # class Rpcs ## # RPC-specific configuration for `delete_log` # @return [::Gapic::Config::Method] # attr_reader :delete_log ## # RPC-specific configuration for `write_log_entries` # @return [::Gapic::Config::Method] # attr_reader :write_log_entries ## # RPC-specific configuration for `list_log_entries` # @return [::Gapic::Config::Method] # attr_reader :list_log_entries ## # RPC-specific configuration for `list_monitored_resource_descriptors` # @return [::Gapic::Config::Method] # attr_reader :list_monitored_resource_descriptors ## # RPC-specific configuration for `list_logs` # @return [::Gapic::Config::Method] # attr_reader :list_logs ## # RPC-specific configuration for `tail_log_entries` # @return [::Gapic::Config::Method] # attr_reader :tail_log_entries # @private def initialize parent_rpcs = nil delete_log_config = parent_rpcs.delete_log if parent_rpcs.respond_to? :delete_log @delete_log = ::Gapic::Config::Method.new delete_log_config write_log_entries_config = parent_rpcs.write_log_entries if parent_rpcs.respond_to? :write_log_entries @write_log_entries = ::Gapic::Config::Method.new write_log_entries_config list_log_entries_config = parent_rpcs.list_log_entries if parent_rpcs.respond_to? :list_log_entries @list_log_entries = ::Gapic::Config::Method.new list_log_entries_config list_monitored_resource_descriptors_config = parent_rpcs.list_monitored_resource_descriptors if parent_rpcs.respond_to? :list_monitored_resource_descriptors @list_monitored_resource_descriptors = ::Gapic::Config::Method.new list_monitored_resource_descriptors_config list_logs_config = parent_rpcs.list_logs if parent_rpcs.respond_to? :list_logs @list_logs = ::Gapic::Config::Method.new list_logs_config tail_log_entries_config = parent_rpcs.tail_log_entries if parent_rpcs.respond_to? :tail_log_entries @tail_log_entries = ::Gapic::Config::Method.new tail_log_entries_config yield self if block_given? end end end end end end end end end google-cloud-logging-v2-1.5.1/lib/google/cloud/logging/v2/logging_service/credentials.rb0000644000004100000410000000350215143461113031173 0ustar www-datawww-data# frozen_string_literal: true # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Auto-generated by gapic-generator-ruby. DO NOT EDIT! require "googleauth" module Google module Cloud module Logging module V2 module LoggingService # Credentials for the LoggingService API. class Credentials < ::Google::Auth::Credentials self.scope = [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/cloud-platform.read-only", "https://www.googleapis.com/auth/logging.admin", "https://www.googleapis.com/auth/logging.read", "https://www.googleapis.com/auth/logging.write" ] self.env_vars = [ "LOGGING_CREDENTIALS", "LOGGING_KEYFILE", "GOOGLE_CLOUD_CREDENTIALS", "GOOGLE_CLOUD_KEYFILE", "GCLOUD_KEYFILE", "LOGGING_CREDENTIALS_JSON", "LOGGING_KEYFILE_JSON", "GOOGLE_CLOUD_CREDENTIALS_JSON", "GOOGLE_CLOUD_KEYFILE_JSON", "GCLOUD_KEYFILE_JSON" ] self.paths = [ "~/.config/google_cloud/application_default_credentials.json" ] end end end end end end google-cloud-logging-v2-1.5.1/lib/google/cloud/logging/v2/version.rb0000644000004100000410000000141615143461113025217 0ustar www-datawww-data# frozen_string_literal: true # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Auto-generated by gapic-generator-ruby. DO NOT EDIT! module Google module Cloud module Logging module V2 VERSION = "1.5.1" end end end end google-cloud-logging-v2-1.5.1/lib/google/cloud/logging/v2/logging_service.rb0000644000004100000410000000301615143461113026676 0ustar www-datawww-data# frozen_string_literal: true # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Auto-generated by gapic-generator-ruby. DO NOT EDIT! require "gapic/common" require "gapic/config" require "gapic/config/method" require "google/cloud/logging/v2/version" require "google/cloud/logging/v2/logging_service/credentials" require "google/cloud/logging/v2/logging_service/paths" require "google/cloud/logging/v2/logging_service/client" module Google module Cloud module Logging module V2 ## # Service for ingesting and querying logs. # # @example Load this service and instantiate a gRPC client # # require "google/cloud/logging/v2/logging_service" # client = ::Google::Cloud::Logging::V2::LoggingService::Client.new # module LoggingService end end end end end helper_path = ::File.join __dir__, "logging_service", "helpers.rb" require "google/cloud/logging/v2/logging_service/helpers" if ::File.file? helper_path google-cloud-logging-v2-1.5.1/lib/google/cloud/logging/v2/config_service.rb0000644000004100000410000000312215143461113026513 0ustar www-datawww-data# frozen_string_literal: true # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Auto-generated by gapic-generator-ruby. DO NOT EDIT! require "gapic/common" require "gapic/config" require "gapic/config/method" require "google/cloud/logging/v2/version" require "google/cloud/logging/v2/config_service/credentials" require "google/cloud/logging/v2/config_service/paths" require "google/cloud/logging/v2/config_service/operations" require "google/cloud/logging/v2/config_service/client" module Google module Cloud module Logging module V2 ## # Service for configuring sinks used to route log entries. # # @example Load this service and instantiate a gRPC client # # require "google/cloud/logging/v2/config_service" # client = ::Google::Cloud::Logging::V2::ConfigService::Client.new # module ConfigService end end end end end helper_path = ::File.join __dir__, "config_service", "helpers.rb" require "google/cloud/logging/v2/config_service/helpers" if ::File.file? helper_path google-cloud-logging-v2-1.5.1/lib/google/cloud/logging/v2/config_service/0000755000004100000410000000000015143461113026170 5ustar www-datawww-datagoogle-cloud-logging-v2-1.5.1/lib/google/cloud/logging/v2/config_service/operations.rb0000644000004100000410000012372515143461113030712 0ustar www-datawww-data# frozen_string_literal: true # Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Auto-generated by gapic-generator-ruby. DO NOT EDIT! require "gapic/operation" require "google/longrunning/operations_pb" module Google module Cloud module Logging module V2 module ConfigService # Service that implements Longrunning Operations API. class Operations # @private API_VERSION = "" # @private DEFAULT_ENDPOINT_TEMPLATE = "logging.$UNIVERSE_DOMAIN$" # @private attr_reader :operations_stub ## # Configuration for the ConfigService Operations API. # # @yield [config] Configure the Operations client. # @yieldparam config [Operations::Configuration] # # @return [Operations::Configuration] # def self.configure @configure ||= Operations::Configuration.new yield @configure if block_given? @configure end ## # Configure the ConfigService Operations 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 {Operations.configure}. # # @yield [config] Configure the Operations client. # @yieldparam config [Operations::Configuration] # # @return [Operations::Configuration] # def configure yield @config if block_given? @config end ## # The effective universe domain # # @return [String] # def universe_domain @operations_stub.universe_domain end ## # Create a new Operations client object. # # @yield [config] Configure the Client client. # @yieldparam config [Operations::Configuration] # 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/longrunning/operations_services_pb" # Create the configuration object @config = Configuration.new Operations.configure # Yield the configuration if needed yield @config if block_given? # Create credentials credentials = @config.credentials credentials ||= Credentials.default scope: @config.scope 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_stub = ::Gapic::ServiceStub.new( ::Google::Longrunning::Operations::Stub, credentials: credentials, endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, channel_args: @config.channel_args, interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) # Used by an LRO wrapper for some methods of this service @operations_client = self end # Service calls ## # Lists operations that match the specified filter in the request. If the # server doesn't support this method, it returns `UNIMPLEMENTED`. # # @overload list_operations(request, options = nil) # Pass arguments to `list_operations` via a request object, either of type # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. # # @param request [::Google::Longrunning::ListOperationsRequest, ::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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) # Pass arguments to `list_operations` 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). # # @param name [::String] # The name of the operation's parent resource. # @param filter [::String] # The standard list filter. # @param page_size [::Integer] # The standard list page size. # @param page_token [::String] # The standard list page token. # @param return_partial_success [::Boolean] # When set to `true`, operations that are reachable are returned as normal, # and those that are unreachable are returned in the # [ListOperationsResponse.unreachable] field. # # This can only be `true` when reading across collections e.g. when `parent` # is set to `"projects/example/locations/-"`. # # This field is not by default supported and will result in an # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in # service or product specific documentation. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/longrunning" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Longrunning::Operations::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Longrunning::ListOperationsRequest.new # # # Call the list_operations method. # result = client.list_operations 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::Longrunning::Operation. # p item # end # def list_operations request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest # 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 metadata = @config.rpcs.list_operations.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers metadata[:"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 metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"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("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.list_operations.timeout, metadata: metadata, retry_policy: @config.rpcs.list_operations.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation yield response, operation if block_given? throw :response, response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Gets the latest state of a long-running operation. Clients can use this # method to poll the operation result at intervals as recommended by the API # service. # # @overload get_operation(request, options = nil) # Pass arguments to `get_operation` via a request object, either of type # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. # # @param request [::Google::Longrunning::GetOperationRequest, ::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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload get_operation(name: nil) # Pass arguments to `get_operation` 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). # # @param name [::String] # The name of the operation resource. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Gapic::Operation] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/longrunning" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Longrunning::Operations::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Longrunning::GetOperationRequest.new # # # Call the get_operation method. # result = client.get_operation 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 # def get_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest # 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 metadata = @config.rpcs.get_operation.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers metadata[:"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 metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"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("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.get_operation.timeout, metadata: metadata, retry_policy: @config.rpcs.get_operation.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: options yield response, operation if block_given? throw :response, response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Deletes a long-running operation. This method indicates that the client is # no longer interested in the operation result. It does not cancel the # operation. If the server doesn't support this method, it returns # `google.rpc.Code.UNIMPLEMENTED`. # # @overload delete_operation(request, options = nil) # Pass arguments to `delete_operation` via a request object, either of type # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. # # @param request [::Google::Longrunning::DeleteOperationRequest, ::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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload delete_operation(name: nil) # Pass arguments to `delete_operation` 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). # # @param name [::String] # The name of the operation resource to be deleted. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Protobuf::Empty] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/longrunning" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Longrunning::Operations::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Longrunning::DeleteOperationRequest.new # # # Call the delete_operation method. # result = client.delete_operation request # # # The returned object is of type Google::Protobuf::Empty. # p result # def delete_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest # 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 metadata = @config.rpcs.delete_operation.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers metadata[:"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 metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"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("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, metadata: metadata, retry_policy: @config.rpcs.delete_operation.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Starts asynchronous cancellation on a long-running operation. The server # makes a best effort to cancel the operation, but success is not # guaranteed. If the server doesn't support this method, it returns # `google.rpc.Code.UNIMPLEMENTED`. Clients can use # Operations.GetOperation or # other methods to check whether the cancellation succeeded or whether the # operation completed despite cancellation. On successful cancellation, # the operation is not deleted; instead, it becomes an operation with # an {::Google::Longrunning::Operation#error Operation.error} value with a # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to # `Code.CANCELLED`. # # @overload cancel_operation(request, options = nil) # Pass arguments to `cancel_operation` via a request object, either of type # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. # # @param request [::Google::Longrunning::CancelOperationRequest, ::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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload cancel_operation(name: nil) # Pass arguments to `cancel_operation` 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). # # @param name [::String] # The name of the operation resource to be cancelled. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Protobuf::Empty] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/longrunning" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Longrunning::Operations::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Longrunning::CancelOperationRequest.new # # # Call the cancel_operation method. # result = client.cancel_operation request # # # The returned object is of type Google::Protobuf::Empty. # p result # def cancel_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest # 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 metadata = @config.rpcs.cancel_operation.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers metadata[:"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 metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"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("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, metadata: metadata, retry_policy: @config.rpcs.cancel_operation.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Waits until the specified long-running operation is done or reaches at most # a specified timeout, returning the latest state. If the operation is # already done, the latest state is immediately returned. If the timeout # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC # timeout is used. If the server does not support this method, it returns # `google.rpc.Code.UNIMPLEMENTED`. # Note that this method is on a best-effort basis. It may return the latest # state before the specified timeout (including immediately), meaning even an # immediate response is no guarantee that the operation is done. # # @overload wait_operation(request, options = nil) # Pass arguments to `wait_operation` via a request object, either of type # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. # # @param request [::Google::Longrunning::WaitOperationRequest, ::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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload wait_operation(name: nil, timeout: nil) # Pass arguments to `wait_operation` 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). # # @param name [::String] # The name of the operation resource to wait on. # @param timeout [::Google::Protobuf::Duration, ::Hash] # The maximum duration to wait before timing out. If left blank, the wait # will be at most the time permitted by the underlying HTTP/RPC protocol. # If RPC context deadline is also specified, the shorter one will be used. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Gapic::Operation] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/longrunning" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Longrunning::Operations::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Longrunning::WaitOperationRequest.new # # # Call the wait_operation method. # result = client.wait_operation 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 # def wait_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest # 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 metadata = @config.rpcs.wait_operation.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers metadata[:"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 metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, metadata: metadata, retry_policy: @config.rpcs.wait_operation.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: options yield response, operation if block_given? throw :response, response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Configuration class for the Operations API. # # This class represents the configuration for Operations, # providing control over timeouts, retry behavior, logging, transport # parameters, and other low-level controls. Certain parameters can also be # applied individually to specific RPCs. See # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} # for a list of RPCs that can be configured independently. # # Configuration can be applied globally to all clients, or to a single client # on construction. # # @example # # # Modify the global config, setting the timeout for # # list_operations to 20 seconds, # # and all remaining timeouts to 10 seconds. # ::Google::Longrunning::Operations::Client.configure do |config| # config.timeout = 10.0 # config.rpcs.list_operations.timeout = 20.0 # end # # # Apply the above configuration only to a new client. # client = ::Google::Longrunning::Operations::Client.new do |config| # config.timeout = 10.0 # config.rpcs.list_operations.timeout = 20.0 # end # # @!attribute [rw] endpoint # A custom service endpoint, as a hostname or hostname:port. The default is # nil, indicating to use the default endpoint in the current universe domain. # @return [::String,nil] # @!attribute [rw] credentials # Credentials to send with calls. You may provide any of the following types: # * (`Google::Auth::Credentials`) A googleauth credentials object # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) # * (`Signet::OAuth2::Client`) A signet oauth2 client object # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) # * (`GRPC::Core::Channel`) a gRPC channel with included credentials # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object # * (`nil`) indicating no credentials # # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials # is deprecated. Providing an unvalidated credential configuration to # Google APIs can compromise the security of your systems and data. # # @example # # # The recommended way to provide credentials is to use the `make_creds` method # # on the appropriate credentials class for your environment. # # require "googleauth" # # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( # json_key_io: ::File.open("/path/to/keyfile.json") # ) # # client = ::Google::Longrunning::Operations::Client.new do |config| # config.credentials = credentials # end # # @note Warning: If you accept a credential configuration (JSON file or Hash) from an # external source for authentication to Google Cloud, you must validate it before # providing it to a Google API client library. Providing an unvalidated credential # configuration to Google APIs can compromise the security of your systems and data. # For more information, refer to [Validate credential configurations from external # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). # @return [::Object] # @!attribute [rw] scope # The OAuth scopes # @return [::Array<::String>] # @!attribute [rw] lib_name # The library name as recorded in instrumentation and logging # @return [::String] # @!attribute [rw] lib_version # The library version as recorded in instrumentation and logging # @return [::String] # @!attribute [rw] channel_args # Extra parameters passed to the gRPC channel. Note: this is ignored if a # `GRPC::Core::Channel` object is provided as the credential. # @return [::Hash] # @!attribute [rw] interceptors # An array of interceptors that are run before calls are executed. # @return [::Array<::GRPC::ClientInterceptor>] # @!attribute [rw] timeout # The call timeout in seconds. # @return [::Numeric] # @!attribute [rw] metadata # Additional gRPC headers to be sent with the call. # @return [::Hash{::Symbol=>::String}] # @!attribute [rw] retry_policy # The retry policy. The value is a hash with the following keys: # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. # * `:retry_codes` (*type:* `Array`) - The error codes that should # trigger a retry. # @return [::Hash] # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] # @!attribute [rw] universe_domain # The universe domain within which to make requests. This determines the # default endpoint URL. The default value of nil uses the environment # universe (usually the default "googleapis.com" universe). # @return [::String,nil] # @!attribute [rw] logger # A custom logger to use for request/response debug logging, or the value # `:default` (the default) to construct a default logger, or `nil` to # explicitly disable logging. # @return [::Logger,:default,nil] # class Configuration extend ::Gapic::Config # @private # The endpoint specific to the default "googleapis.com" universe. Deprecated. DEFAULT_ENDPOINT = "logging.googleapis.com" config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel allowed.any? { |klass| klass === value } end config_attr :scope, nil, ::String, ::Array, nil config_attr :lib_name, nil, ::String, nil config_attr :lib_version, nil, ::String, nil config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) config_attr :interceptors, nil, ::Array, nil config_attr :timeout, nil, ::Numeric, nil config_attr :metadata, nil, ::Hash, nil config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil config_attr :universe_domain, nil, ::String, nil config_attr :logger, :default, ::Logger, nil, :default # @private def initialize parent_config = nil @parent_config = parent_config unless parent_config.nil? yield self if block_given? end ## # Configurations for individual RPCs # @return [Rpcs] # def rpcs @rpcs ||= begin parent_rpcs = nil parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) Rpcs.new parent_rpcs end end ## # Configuration for the channel pool # @return [::Gapic::ServiceStub::ChannelPool::Configuration] # def channel_pool @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new end ## # Configuration RPC class for the Operations API. # # Includes fields providing the configuration for each RPC in this service. # Each configuration object is of type `Gapic::Config::Method` and includes # the following configuration fields: # # * `timeout` (*type:* `Numeric`) - The call timeout in seconds # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields # include the following keys: # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. # * `:retry_codes` (*type:* `Array`) - The error codes that should # trigger a retry. # class Rpcs ## # RPC-specific configuration for `list_operations` # @return [::Gapic::Config::Method] # attr_reader :list_operations ## # RPC-specific configuration for `get_operation` # @return [::Gapic::Config::Method] # attr_reader :get_operation ## # RPC-specific configuration for `delete_operation` # @return [::Gapic::Config::Method] # attr_reader :delete_operation ## # RPC-specific configuration for `cancel_operation` # @return [::Gapic::Config::Method] # attr_reader :cancel_operation ## # RPC-specific configuration for `wait_operation` # @return [::Gapic::Config::Method] # attr_reader :wait_operation # @private def initialize parent_rpcs = nil list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations @list_operations = ::Gapic::Config::Method.new list_operations_config get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation @get_operation = ::Gapic::Config::Method.new get_operation_config delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation @delete_operation = ::Gapic::Config::Method.new delete_operation_config cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation @wait_operation = ::Gapic::Config::Method.new wait_operation_config yield self if block_given? end end end end end end end end end google-cloud-logging-v2-1.5.1/lib/google/cloud/logging/v2/config_service/paths.rb0000644000004100000410000006356515143461113027653 0ustar www-datawww-data# frozen_string_literal: true # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Auto-generated by gapic-generator-ruby. DO NOT EDIT! module Google module Cloud module Logging module V2 module ConfigService # Path helper methods for the ConfigService API. module Paths ## # Create a fully-qualified BillingAccount resource string. # # The resource will be in the following format: # # `billingAccounts/{billing_account}` # # @param billing_account [String] # # @return [::String] def billing_account_path billing_account: "billingAccounts/#{billing_account}" end ## # Create a fully-qualified BillingAccountLocation resource string. # # The resource will be in the following format: # # `billingAccounts/{billing_account}/locations/{location}` # # @param billing_account [String] # @param location [String] # # @return [::String] def billing_account_location_path billing_account:, location: raise ::ArgumentError, "billing_account cannot contain /" if billing_account.to_s.include? "/" "billingAccounts/#{billing_account}/locations/#{location}" end ## # Create a fully-qualified CmekSettings resource string. # # @overload cmek_settings_path(project:) # The resource will be in the following format: # # `projects/{project}/cmekSettings` # # @param project [String] # # @overload cmek_settings_path(organization:) # The resource will be in the following format: # # `organizations/{organization}/cmekSettings` # # @param organization [String] # # @overload cmek_settings_path(folder:) # The resource will be in the following format: # # `folders/{folder}/cmekSettings` # # @param folder [String] # # @overload cmek_settings_path(billing_account:) # The resource will be in the following format: # # `billingAccounts/{billing_account}/cmekSettings` # # @param billing_account [String] # # @return [::String] def cmek_settings_path **args resources = { "project" => (proc do |project:| "projects/#{project}/cmekSettings" end), "organization" => (proc do |organization:| "organizations/#{organization}/cmekSettings" end), "folder" => (proc do |folder:| "folders/#{folder}/cmekSettings" end), "billing_account" => (proc do |billing_account:| "billingAccounts/#{billing_account}/cmekSettings" end) } resource = resources[args.keys.sort.join(":")] raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? resource.call(**args) end ## # Create a fully-qualified Folder resource string. # # The resource will be in the following format: # # `folders/{folder}` # # @param folder [String] # # @return [::String] def folder_path folder: "folders/#{folder}" end ## # Create a fully-qualified FolderLocation resource string. # # The resource will be in the following format: # # `folders/{folder}/locations/{location}` # # @param folder [String] # @param location [String] # # @return [::String] def folder_location_path folder:, location: raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" "folders/#{folder}/locations/#{location}" end ## # Create a fully-qualified Link resource string. # # @overload link_path(project:, location:, bucket:, link:) # The resource will be in the following format: # # `projects/{project}/locations/{location}/buckets/{bucket}/links/{link}` # # @param project [String] # @param location [String] # @param bucket [String] # @param link [String] # # @overload link_path(organization:, location:, bucket:, link:) # The resource will be in the following format: # # `organizations/{organization}/locations/{location}/buckets/{bucket}/links/{link}` # # @param organization [String] # @param location [String] # @param bucket [String] # @param link [String] # # @overload link_path(folder:, location:, bucket:, link:) # The resource will be in the following format: # # `folders/{folder}/locations/{location}/buckets/{bucket}/links/{link}` # # @param folder [String] # @param location [String] # @param bucket [String] # @param link [String] # # @overload link_path(billing_account:, location:, bucket:, link:) # The resource will be in the following format: # # `billingAccounts/{billing_account}/locations/{location}/buckets/{bucket}/links/{link}` # # @param billing_account [String] # @param location [String] # @param bucket [String] # @param link [String] # # @return [::String] def link_path **args resources = { "bucket:link:location:project" => (proc do |project:, location:, bucket:, link:| raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" raise ::ArgumentError, "bucket cannot contain /" if bucket.to_s.include? "/" "projects/#{project}/locations/#{location}/buckets/#{bucket}/links/#{link}" end), "bucket:link:location:organization" => (proc do |organization:, location:, bucket:, link:| raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" raise ::ArgumentError, "bucket cannot contain /" if bucket.to_s.include? "/" "organizations/#{organization}/locations/#{location}/buckets/#{bucket}/links/#{link}" end), "bucket:folder:link:location" => (proc do |folder:, location:, bucket:, link:| raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" raise ::ArgumentError, "bucket cannot contain /" if bucket.to_s.include? "/" "folders/#{folder}/locations/#{location}/buckets/#{bucket}/links/#{link}" end), "billing_account:bucket:link:location" => (proc do |billing_account:, location:, bucket:, link:| raise ::ArgumentError, "billing_account cannot contain /" if billing_account.to_s.include? "/" raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" raise ::ArgumentError, "bucket cannot contain /" if bucket.to_s.include? "/" "billingAccounts/#{billing_account}/locations/#{location}/buckets/#{bucket}/links/#{link}" end) } resource = resources[args.keys.sort.join(":")] raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? resource.call(**args) end ## # Create a fully-qualified Location resource string. # # The resource will be in the following format: # # `projects/{project}/locations/{location}` # # @param project [String] # @param location [String] # # @return [::String] def location_path project:, location: raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" "projects/#{project}/locations/#{location}" end ## # Create a fully-qualified LogBucket resource string. # # @overload log_bucket_path(project:, location:, bucket:) # The resource will be in the following format: # # `projects/{project}/locations/{location}/buckets/{bucket}` # # @param project [String] # @param location [String] # @param bucket [String] # # @overload log_bucket_path(organization:, location:, bucket:) # The resource will be in the following format: # # `organizations/{organization}/locations/{location}/buckets/{bucket}` # # @param organization [String] # @param location [String] # @param bucket [String] # # @overload log_bucket_path(folder:, location:, bucket:) # The resource will be in the following format: # # `folders/{folder}/locations/{location}/buckets/{bucket}` # # @param folder [String] # @param location [String] # @param bucket [String] # # @overload log_bucket_path(billing_account:, location:, bucket:) # The resource will be in the following format: # # `billingAccounts/{billing_account}/locations/{location}/buckets/{bucket}` # # @param billing_account [String] # @param location [String] # @param bucket [String] # # @return [::String] def log_bucket_path **args resources = { "bucket:location:project" => (proc do |project:, location:, bucket:| raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" "projects/#{project}/locations/#{location}/buckets/#{bucket}" end), "bucket:location:organization" => (proc do |organization:, location:, bucket:| raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" "organizations/#{organization}/locations/#{location}/buckets/#{bucket}" end), "bucket:folder:location" => (proc do |folder:, location:, bucket:| raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" "folders/#{folder}/locations/#{location}/buckets/#{bucket}" end), "billing_account:bucket:location" => (proc do |billing_account:, location:, bucket:| raise ::ArgumentError, "billing_account cannot contain /" if billing_account.to_s.include? "/" raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" "billingAccounts/#{billing_account}/locations/#{location}/buckets/#{bucket}" end) } resource = resources[args.keys.sort.join(":")] raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? resource.call(**args) end ## # Create a fully-qualified LogExclusion resource string. # # @overload log_exclusion_path(project:, exclusion:) # The resource will be in the following format: # # `projects/{project}/exclusions/{exclusion}` # # @param project [String] # @param exclusion [String] # # @overload log_exclusion_path(organization:, exclusion:) # The resource will be in the following format: # # `organizations/{organization}/exclusions/{exclusion}` # # @param organization [String] # @param exclusion [String] # # @overload log_exclusion_path(folder:, exclusion:) # The resource will be in the following format: # # `folders/{folder}/exclusions/{exclusion}` # # @param folder [String] # @param exclusion [String] # # @overload log_exclusion_path(billing_account:, exclusion:) # The resource will be in the following format: # # `billingAccounts/{billing_account}/exclusions/{exclusion}` # # @param billing_account [String] # @param exclusion [String] # # @return [::String] def log_exclusion_path **args resources = { "exclusion:project" => (proc do |project:, exclusion:| raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" "projects/#{project}/exclusions/#{exclusion}" end), "exclusion:organization" => (proc do |organization:, exclusion:| raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" "organizations/#{organization}/exclusions/#{exclusion}" end), "exclusion:folder" => (proc do |folder:, exclusion:| raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" "folders/#{folder}/exclusions/#{exclusion}" end), "billing_account:exclusion" => (proc do |billing_account:, exclusion:| raise ::ArgumentError, "billing_account cannot contain /" if billing_account.to_s.include? "/" "billingAccounts/#{billing_account}/exclusions/#{exclusion}" end) } resource = resources[args.keys.sort.join(":")] raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? resource.call(**args) end ## # Create a fully-qualified LogSink resource string. # # @overload log_sink_path(project:, sink:) # The resource will be in the following format: # # `projects/{project}/sinks/{sink}` # # @param project [String] # @param sink [String] # # @overload log_sink_path(organization:, sink:) # The resource will be in the following format: # # `organizations/{organization}/sinks/{sink}` # # @param organization [String] # @param sink [String] # # @overload log_sink_path(folder:, sink:) # The resource will be in the following format: # # `folders/{folder}/sinks/{sink}` # # @param folder [String] # @param sink [String] # # @overload log_sink_path(billing_account:, sink:) # The resource will be in the following format: # # `billingAccounts/{billing_account}/sinks/{sink}` # # @param billing_account [String] # @param sink [String] # # @return [::String] def log_sink_path **args resources = { "project:sink" => (proc do |project:, sink:| raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" "projects/#{project}/sinks/#{sink}" end), "organization:sink" => (proc do |organization:, sink:| raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" "organizations/#{organization}/sinks/#{sink}" end), "folder:sink" => (proc do |folder:, sink:| raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" "folders/#{folder}/sinks/#{sink}" end), "billing_account:sink" => (proc do |billing_account:, sink:| raise ::ArgumentError, "billing_account cannot contain /" if billing_account.to_s.include? "/" "billingAccounts/#{billing_account}/sinks/#{sink}" end) } resource = resources[args.keys.sort.join(":")] raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? resource.call(**args) end ## # Create a fully-qualified LogView resource string. # # @overload log_view_path(project:, location:, bucket:, view:) # The resource will be in the following format: # # `projects/{project}/locations/{location}/buckets/{bucket}/views/{view}` # # @param project [String] # @param location [String] # @param bucket [String] # @param view [String] # # @overload log_view_path(organization:, location:, bucket:, view:) # The resource will be in the following format: # # `organizations/{organization}/locations/{location}/buckets/{bucket}/views/{view}` # # @param organization [String] # @param location [String] # @param bucket [String] # @param view [String] # # @overload log_view_path(folder:, location:, bucket:, view:) # The resource will be in the following format: # # `folders/{folder}/locations/{location}/buckets/{bucket}/views/{view}` # # @param folder [String] # @param location [String] # @param bucket [String] # @param view [String] # # @overload log_view_path(billing_account:, location:, bucket:, view:) # The resource will be in the following format: # # `billingAccounts/{billing_account}/locations/{location}/buckets/{bucket}/views/{view}` # # @param billing_account [String] # @param location [String] # @param bucket [String] # @param view [String] # # @return [::String] def log_view_path **args resources = { "bucket:location:project:view" => (proc do |project:, location:, bucket:, view:| raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" raise ::ArgumentError, "bucket cannot contain /" if bucket.to_s.include? "/" "projects/#{project}/locations/#{location}/buckets/#{bucket}/views/#{view}" end), "bucket:location:organization:view" => (proc do |organization:, location:, bucket:, view:| raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" raise ::ArgumentError, "bucket cannot contain /" if bucket.to_s.include? "/" "organizations/#{organization}/locations/#{location}/buckets/#{bucket}/views/#{view}" end), "bucket:folder:location:view" => (proc do |folder:, location:, bucket:, view:| raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" raise ::ArgumentError, "bucket cannot contain /" if bucket.to_s.include? "/" "folders/#{folder}/locations/#{location}/buckets/#{bucket}/views/#{view}" end), "billing_account:bucket:location:view" => (proc do |billing_account:, location:, bucket:, view:| raise ::ArgumentError, "billing_account cannot contain /" if billing_account.to_s.include? "/" raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" raise ::ArgumentError, "bucket cannot contain /" if bucket.to_s.include? "/" "billingAccounts/#{billing_account}/locations/#{location}/buckets/#{bucket}/views/#{view}" end) } resource = resources[args.keys.sort.join(":")] raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? resource.call(**args) end ## # Create a fully-qualified Organization resource string. # # The resource will be in the following format: # # `organizations/{organization}` # # @param organization [String] # # @return [::String] def organization_path organization: "organizations/#{organization}" end ## # Create a fully-qualified OrganizationLocation resource string. # # The resource will be in the following format: # # `organizations/{organization}/locations/{location}` # # @param organization [String] # @param location [String] # # @return [::String] def organization_location_path organization:, location: raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" "organizations/#{organization}/locations/#{location}" end ## # Create a fully-qualified Project resource string. # # The resource will be in the following format: # # `projects/{project}` # # @param project [String] # # @return [::String] def project_path project: "projects/#{project}" end ## # Create a fully-qualified Settings resource string. # # @overload settings_path(project:) # The resource will be in the following format: # # `projects/{project}/settings` # # @param project [String] # # @overload settings_path(organization:) # The resource will be in the following format: # # `organizations/{organization}/settings` # # @param organization [String] # # @overload settings_path(folder:) # The resource will be in the following format: # # `folders/{folder}/settings` # # @param folder [String] # # @overload settings_path(billing_account:) # The resource will be in the following format: # # `billingAccounts/{billing_account}/settings` # # @param billing_account [String] # # @return [::String] def settings_path **args resources = { "project" => (proc do |project:| "projects/#{project}/settings" end), "organization" => (proc do |organization:| "organizations/#{organization}/settings" end), "folder" => (proc do |folder:| "folders/#{folder}/settings" end), "billing_account" => (proc do |billing_account:| "billingAccounts/#{billing_account}/settings" end) } resource = resources[args.keys.sort.join(":")] raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? resource.call(**args) end extend self end end end end end end google-cloud-logging-v2-1.5.1/lib/google/cloud/logging/v2/config_service/client.rb0000644000004100000410000063451315143461113030007 0ustar www-datawww-data# frozen_string_literal: true # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Auto-generated by gapic-generator-ruby. DO NOT EDIT! require "google/cloud/errors" require "google/logging/v2/logging_config_pb" module Google module Cloud module Logging module V2 module ConfigService ## # Client for the ConfigService service. # # Service for configuring sinks used to route log entries. # class Client # @private API_VERSION = "" # @private DEFAULT_ENDPOINT_TEMPLATE = "logging.$UNIVERSE_DOMAIN$" include Paths # @private attr_reader :config_service_stub ## # Configure the ConfigService Client class. # # See {::Google::Cloud::Logging::V2::ConfigService::Client::Configuration} # for a description of the configuration fields. # # @example # # # Modify the configuration for all ConfigService clients # ::Google::Cloud::Logging::V2::ConfigService::Client.configure do |config| # config.timeout = 10.0 # end # # @yield [config] Configure the Client client. # @yieldparam config [Client::Configuration] # # @return [Client::Configuration] # 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 ## # Configure the ConfigService Client instance. # # The configuration is set to the derived mode, meaning that values can be changed, # but structural changes (adding new fields, etc.) are not allowed. Structural changes # should be made on {Client.configure}. # # See {::Google::Cloud::Logging::V2::ConfigService::Client::Configuration} # for a description of the configuration fields. # # @yield [config] Configure the Client client. # @yieldparam config [Client::Configuration] # # @return [Client::Configuration] # def configure yield @config if block_given? @config end ## # The effective universe domain # # @return [String] # def universe_domain @config_service_stub.universe_domain end ## # Create a new ConfigService client object. # # @example # # # Create a client using the default configuration # client = ::Google::Cloud::Logging::V2::ConfigService::Client.new # # # Create a client using a custom configuration # client = ::Google::Cloud::Logging::V2::ConfigService::Client.new do |config| # config.timeout = 10.0 # end # # @yield [config] Configure the ConfigService client. # @yieldparam config [Client::Configuration] # 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.nil? || (@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 config.universe_domain = @config.universe_domain end @config_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Logging::V2::ConfigServiceV2::Stub, credentials: credentials, endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, channel_args: @config.channel_args, interceptors: @config.interceptors, channel_pool_config: @config.channel_pool, logger: @config.logger ) @config_service_stub.stub_logger&.info do |entry| entry.set_system_name entry.set_service entry.message = "Created client for #{entry.service}" entry.set_credentials_fields credentials entry.set "customEndpoint", @config.endpoint if @config.endpoint entry.set "defaultTimeout", @config.timeout if @config.timeout entry.set "quotaProject", @quota_project_id if @quota_project_id end end ## # Get the associated client for long-running operations. # # @return [::Google::Cloud::Logging::V2::ConfigService::Operations] # attr_reader :operations_client ## # The logger used for request/response debug logging. # # @return [Logger] # def logger @config_service_stub.logger end # Service calls ## # Lists log buckets. # # @overload list_buckets(request, options = nil) # Pass arguments to `list_buckets` via a request object, either of type # {::Google::Cloud::Logging::V2::ListBucketsRequest} or an equivalent Hash. # # @param 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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload list_buckets(parent: nil, page_token: nil, page_size: nil) # 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). # # @param parent [::String] # Required. The parent resource whose buckets are to be listed: # # "projects/[PROJECT_ID]/locations/[LOCATION_ID]" # "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" # "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" # "folders/[FOLDER_ID]/locations/[LOCATION_ID]" # # Note: The locations portion of the resource must be specified, but # supplying the character `-` in place of [LOCATION_ID] will return all # buckets. # @param page_token [::String] # Optional. If present, then retrieve the next batch of results from the # preceding call to this method. `pageToken` must be the value of # `nextPageToken` from the previous response. The values of other method # parameters should be identical to those in the previous call. # @param page_size [::Integer] # Optional. The maximum number of results to return from this request. # Non-positive values are ignored. The presence of `nextPageToken` in the # response indicates that more results might be available. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Logging::V2::LogBucket>] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Gapic::PagedEnumerable<::Google::Cloud::Logging::V2::LogBucket>] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/logging/v2" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Logging::V2::ConfigService::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Logging::V2::ListBucketsRequest.new # # # Call the list_buckets method. # result = client.list_buckets request # # # The returned object is of type Gapic::PagedEnumerable. You can iterate # # over 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 # 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 metadata = @config.rpcs.list_buckets.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers metadata[:"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 metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"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("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.list_buckets.timeout, metadata: metadata, retry_policy: @config.rpcs.list_buckets.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, 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? throw :response, response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Gets a log bucket. # # @overload get_bucket(request, options = nil) # Pass arguments to `get_bucket` via a request object, either of type # {::Google::Cloud::Logging::V2::GetBucketRequest} or an equivalent Hash. # # @param 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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload get_bucket(name: nil) # 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). # # @param name [::String] # Required. The resource name of the bucket: # # "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" # "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" # "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" # "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" # # For example: # # `"projects/my-project/locations/global/buckets/my-bucket"` # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::Logging::V2::LogBucket] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Cloud::Logging::V2::LogBucket] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/logging/v2" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Logging::V2::ConfigService::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Logging::V2::GetBucketRequest.new # # # Call the get_bucket method. # result = client.get_bucket request # # # The returned object is of type Google::Cloud::Logging::V2::LogBucket. # p result # 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 metadata = @config.rpcs.get_bucket.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers metadata[:"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 metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"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("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.get_bucket.timeout, metadata: metadata, retry_policy: @config.rpcs.get_bucket.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @config_service_stub.call_rpc :get_bucket, request, options: options do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # 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. # # @overload create_bucket_async(request, options = nil) # Pass arguments to `create_bucket_async` via a request object, either of type # {::Google::Cloud::Logging::V2::CreateBucketRequest} or an equivalent Hash. # # @param 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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload create_bucket_async(parent: nil, bucket_id: nil, bucket: nil) # 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). # # @param parent [::String] # Required. The resource in which to create the log bucket: # # "projects/[PROJECT_ID]/locations/[LOCATION_ID]" # # For example: # # `"projects/my-project/locations/global"` # @param bucket_id [::String] # Required. A client-assigned identifier such as `"my-bucket"`. Identifiers # are limited to 100 characters and can include only letters, digits, # underscores, hyphens, and periods. # @param bucket [::Google::Cloud::Logging::V2::LogBucket, ::Hash] # Required. The new bucket. The region specified in the new bucket must be # compliant with any Location Restriction Org Policy. The name field in the # bucket is ignored. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Gapic::Operation] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/logging/v2" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Logging::V2::ConfigService::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Logging::V2::CreateBucketRequest.new # # # Call the create_bucket_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 # 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 metadata = @config.rpcs.create_bucket_async.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers metadata[:"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 metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"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("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.create_bucket_async.timeout, metadata: metadata, retry_policy: @config.rpcs.create_bucket_async.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, 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? throw :response, response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # 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. # # @overload update_bucket_async(request, options = nil) # Pass arguments to `update_bucket_async` via a request object, either of type # {::Google::Cloud::Logging::V2::UpdateBucketRequest} or an equivalent Hash. # # @param 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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload update_bucket_async(name: nil, bucket: nil, update_mask: nil) # 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). # # @param name [::String] # Required. The full resource name of the bucket to update. # # "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" # "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" # "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" # "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" # # For example: # # `"projects/my-project/locations/global/buckets/my-bucket"` # @param bucket [::Google::Cloud::Logging::V2::LogBucket, ::Hash] # Required. The updated bucket. # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] # Required. Field mask that specifies the fields in `bucket` that need an # update. A bucket field will be overwritten if, and only if, it is in the # update mask. `name` and output only fields cannot be updated. # # For a detailed `FieldMask` definition, see: # https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask # # For example: `updateMask=retention_days` # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Gapic::Operation] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/logging/v2" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Logging::V2::ConfigService::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Logging::V2::UpdateBucketRequest.new # # # Call the update_bucket_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 # 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 metadata = @config.rpcs.update_bucket_async.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers metadata[:"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 metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"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("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.update_bucket_async.timeout, metadata: metadata, retry_policy: @config.rpcs.update_bucket_async.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, 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? throw :response, response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # 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. # # @overload create_bucket(request, options = nil) # Pass arguments to `create_bucket` via a request object, either of type # {::Google::Cloud::Logging::V2::CreateBucketRequest} or an equivalent Hash. # # @param 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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload create_bucket(parent: nil, bucket_id: nil, bucket: nil) # 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). # # @param parent [::String] # Required. The resource in which to create the log bucket: # # "projects/[PROJECT_ID]/locations/[LOCATION_ID]" # # For example: # # `"projects/my-project/locations/global"` # @param bucket_id [::String] # Required. A client-assigned identifier such as `"my-bucket"`. Identifiers # are limited to 100 characters and can include only letters, digits, # underscores, hyphens, and periods. # @param bucket [::Google::Cloud::Logging::V2::LogBucket, ::Hash] # Required. The new bucket. The region specified in the new bucket must be # compliant with any Location Restriction Org Policy. The name field in the # bucket is ignored. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::Logging::V2::LogBucket] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Cloud::Logging::V2::LogBucket] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/logging/v2" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Logging::V2::ConfigService::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Logging::V2::CreateBucketRequest.new # # # Call the create_bucket method. # result = client.create_bucket request # # # The returned object is of type Google::Cloud::Logging::V2::LogBucket. # p result # 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 metadata = @config.rpcs.create_bucket.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers metadata[:"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 metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"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("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.create_bucket.timeout, metadata: metadata, retry_policy: @config.rpcs.create_bucket.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @config_service_stub.call_rpc :create_bucket, request, options: options do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # 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. # # @overload update_bucket(request, options = nil) # Pass arguments to `update_bucket` via a request object, either of type # {::Google::Cloud::Logging::V2::UpdateBucketRequest} or an equivalent Hash. # # @param 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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload update_bucket(name: nil, bucket: nil, update_mask: nil) # 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). # # @param name [::String] # Required. The full resource name of the bucket to update. # # "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" # "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" # "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" # "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" # # For example: # # `"projects/my-project/locations/global/buckets/my-bucket"` # @param bucket [::Google::Cloud::Logging::V2::LogBucket, ::Hash] # Required. The updated bucket. # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] # Required. Field mask that specifies the fields in `bucket` that need an # update. A bucket field will be overwritten if, and only if, it is in the # update mask. `name` and output only fields cannot be updated. # # For a detailed `FieldMask` definition, see: # https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask # # For example: `updateMask=retention_days` # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::Logging::V2::LogBucket] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Cloud::Logging::V2::LogBucket] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/logging/v2" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Logging::V2::ConfigService::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Logging::V2::UpdateBucketRequest.new # # # Call the update_bucket method. # result = client.update_bucket request # # # The returned object is of type Google::Cloud::Logging::V2::LogBucket. # p result # 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 metadata = @config.rpcs.update_bucket.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers metadata[:"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 metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"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("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.update_bucket.timeout, metadata: metadata, retry_policy: @config.rpcs.update_bucket.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @config_service_stub.call_rpc :update_bucket, request, options: options do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # 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. # # @overload delete_bucket(request, options = nil) # Pass arguments to `delete_bucket` via a request object, either of type # {::Google::Cloud::Logging::V2::DeleteBucketRequest} or an equivalent Hash. # # @param 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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload delete_bucket(name: nil) # 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). # # @param name [::String] # Required. The full resource name of the bucket to delete. # # "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" # "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" # "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" # "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" # # For example: # # `"projects/my-project/locations/global/buckets/my-bucket"` # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Protobuf::Empty] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/logging/v2" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Logging::V2::ConfigService::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Logging::V2::DeleteBucketRequest.new # # # Call the delete_bucket method. # result = client.delete_bucket request # # # The returned object is of type Google::Protobuf::Empty. # p result # 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 metadata = @config.rpcs.delete_bucket.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers metadata[:"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 metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"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("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.delete_bucket.timeout, metadata: metadata, retry_policy: @config.rpcs.delete_bucket.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @config_service_stub.call_rpc :delete_bucket, request, options: options do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Undeletes a log bucket. A bucket that has been deleted can be undeleted # within the grace period of 7 days. # # @overload undelete_bucket(request, options = nil) # Pass arguments to `undelete_bucket` via a request object, either of type # {::Google::Cloud::Logging::V2::UndeleteBucketRequest} or an equivalent Hash. # # @param 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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload undelete_bucket(name: nil) # 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). # # @param name [::String] # Required. The full resource name of the bucket to undelete. # # "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" # "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" # "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" # "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" # # For example: # # `"projects/my-project/locations/global/buckets/my-bucket"` # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Protobuf::Empty] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/logging/v2" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Logging::V2::ConfigService::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Logging::V2::UndeleteBucketRequest.new # # # Call the undelete_bucket method. # result = client.undelete_bucket request # # # The returned object is of type Google::Protobuf::Empty. # p result # 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 metadata = @config.rpcs.undelete_bucket.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers metadata[:"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 metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"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("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.undelete_bucket.timeout, metadata: metadata, retry_policy: @config.rpcs.undelete_bucket.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @config_service_stub.call_rpc :undelete_bucket, request, options: options do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Lists views on a log bucket. # # @overload list_views(request, options = nil) # Pass arguments to `list_views` via a request object, either of type # {::Google::Cloud::Logging::V2::ListViewsRequest} or an equivalent Hash. # # @param 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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload list_views(parent: nil, page_token: nil, page_size: nil) # 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). # # @param parent [::String] # Required. The bucket whose views are to be listed: # # "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" # @param page_token [::String] # Optional. If present, then retrieve the next batch of results from the # preceding call to this method. `pageToken` must be the value of # `nextPageToken` from the previous response. The values of other method # parameters should be identical to those in the previous call. # @param page_size [::Integer] # Optional. The maximum number of results to return from this request. # # Non-positive values are ignored. The presence of `nextPageToken` in the # response indicates that more results might be available. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Logging::V2::LogView>] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Gapic::PagedEnumerable<::Google::Cloud::Logging::V2::LogView>] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/logging/v2" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Logging::V2::ConfigService::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Logging::V2::ListViewsRequest.new # # # Call the list_views method. # result = client.list_views request # # # The returned object is of type Gapic::PagedEnumerable. You can iterate # # over 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 # 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 metadata = @config.rpcs.list_views.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers metadata[:"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 metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"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("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.list_views.timeout, metadata: metadata, retry_policy: @config.rpcs.list_views.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, 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? throw :response, response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Gets a view on a log bucket.. # # @overload get_view(request, options = nil) # Pass arguments to `get_view` via a request object, either of type # {::Google::Cloud::Logging::V2::GetViewRequest} or an equivalent Hash. # # @param 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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload get_view(name: nil) # 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). # # @param name [::String] # Required. The resource name of the policy: # # "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" # # For example: # # `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"` # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::Logging::V2::LogView] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Cloud::Logging::V2::LogView] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/logging/v2" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Logging::V2::ConfigService::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Logging::V2::GetViewRequest.new # # # Call the get_view method. # result = client.get_view request # # # The returned object is of type Google::Cloud::Logging::V2::LogView. # p result # 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 metadata = @config.rpcs.get_view.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers metadata[:"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 metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"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("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.get_view.timeout, metadata: metadata, retry_policy: @config.rpcs.get_view.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @config_service_stub.call_rpc :get_view, request, options: options do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Creates a view over log entries in a log bucket. A bucket may contain a # maximum of 30 views. # # @overload create_view(request, options = nil) # Pass arguments to `create_view` via a request object, either of type # {::Google::Cloud::Logging::V2::CreateViewRequest} or an equivalent Hash. # # @param 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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload create_view(parent: nil, view_id: nil, view: nil) # 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). # # @param parent [::String] # Required. The bucket in which to create the view # # `"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"` # # For example: # # `"projects/my-project/locations/global/buckets/my-bucket"` # @param view_id [::String] # 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. # @param view [::Google::Cloud::Logging::V2::LogView, ::Hash] # Required. The new view. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::Logging::V2::LogView] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Cloud::Logging::V2::LogView] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/logging/v2" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Logging::V2::ConfigService::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Logging::V2::CreateViewRequest.new # # # Call the create_view method. # result = client.create_view request # # # The returned object is of type Google::Cloud::Logging::V2::LogView. # p result # 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 metadata = @config.rpcs.create_view.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers metadata[:"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 metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"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("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.create_view.timeout, metadata: metadata, retry_policy: @config.rpcs.create_view.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @config_service_stub.call_rpc :create_view, request, options: options do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # 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. # # @overload update_view(request, options = nil) # Pass arguments to `update_view` via a request object, either of type # {::Google::Cloud::Logging::V2::UpdateViewRequest} or an equivalent Hash. # # @param 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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload update_view(name: nil, view: nil, update_mask: nil) # 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). # # @param name [::String] # Required. The full resource name of the view to update # # "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"` # @param view [::Google::Cloud::Logging::V2::LogView, ::Hash] # Required. The updated view. # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] # Optional. Field mask that specifies the fields in `view` that need # an update. A field will be overwritten if, and only if, it is # in the update mask. `name` and output only fields cannot be updated. # # For a detailed `FieldMask` definition, see # https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask # # For example: `updateMask=filter` # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::Logging::V2::LogView] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Cloud::Logging::V2::LogView] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/logging/v2" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Logging::V2::ConfigService::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Logging::V2::UpdateViewRequest.new # # # Call the update_view method. # result = client.update_view request # # # The returned object is of type Google::Cloud::Logging::V2::LogView. # p result # 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 metadata = @config.rpcs.update_view.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers metadata[:"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 metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"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("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.update_view.timeout, metadata: metadata, retry_policy: @config.rpcs.update_view.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @config_service_stub.call_rpc :update_view, request, options: options do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # 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. # # @overload delete_view(request, options = nil) # Pass arguments to `delete_view` via a request object, either of type # {::Google::Cloud::Logging::V2::DeleteViewRequest} or an equivalent Hash. # # @param 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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload delete_view(name: nil) # 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). # # @param name [::String] # Required. The full resource name of the view to delete: # # "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" # # For example: # # `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"` # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Protobuf::Empty] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/logging/v2" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Logging::V2::ConfigService::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Logging::V2::DeleteViewRequest.new # # # Call the delete_view method. # result = client.delete_view request # # # The returned object is of type Google::Protobuf::Empty. # p result # 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 metadata = @config.rpcs.delete_view.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers metadata[:"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 metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"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("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.delete_view.timeout, metadata: metadata, retry_policy: @config.rpcs.delete_view.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @config_service_stub.call_rpc :delete_view, request, options: options do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Lists sinks. # # @overload list_sinks(request, options = nil) # Pass arguments to `list_sinks` via a request object, either of type # {::Google::Cloud::Logging::V2::ListSinksRequest} or an equivalent Hash. # # @param 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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload list_sinks(parent: nil, page_token: nil, page_size: nil) # 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). # # @param parent [::String] # Required. The parent resource whose sinks are to be listed: # # "projects/[PROJECT_ID]" # "organizations/[ORGANIZATION_ID]" # "billingAccounts/[BILLING_ACCOUNT_ID]" # "folders/[FOLDER_ID]" # @param page_token [::String] # Optional. If present, then retrieve the next batch of results from the # preceding call to this method. `pageToken` must be the value of # `nextPageToken` from the previous response. The values of other method # parameters should be identical to those in the previous call. # @param page_size [::Integer] # Optional. The maximum number of results to return from this request. # Non-positive values are ignored. The presence of `nextPageToken` in the # response indicates that more results might be available. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Logging::V2::LogSink>] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Gapic::PagedEnumerable<::Google::Cloud::Logging::V2::LogSink>] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/logging/v2" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Logging::V2::ConfigService::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Logging::V2::ListSinksRequest.new # # # Call the list_sinks method. # result = client.list_sinks request # # # The returned object is of type Gapic::PagedEnumerable. You can iterate # # over 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 # 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 metadata = @config.rpcs.list_sinks.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers metadata[:"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 metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"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("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.list_sinks.timeout, metadata: metadata, retry_policy: @config.rpcs.list_sinks.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, 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? throw :response, response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Gets a sink. # # @overload get_sink(request, options = nil) # Pass arguments to `get_sink` via a request object, either of type # {::Google::Cloud::Logging::V2::GetSinkRequest} or an equivalent Hash. # # @param 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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload get_sink(sink_name: nil) # 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). # # @param sink_name [::String] # Required. The resource name of the sink: # # "projects/[PROJECT_ID]/sinks/[SINK_ID]" # "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" # "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" # "folders/[FOLDER_ID]/sinks/[SINK_ID]" # # For example: # # `"projects/my-project/sinks/my-sink"` # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::Logging::V2::LogSink] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Cloud::Logging::V2::LogSink] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/logging/v2" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Logging::V2::ConfigService::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Logging::V2::GetSinkRequest.new # # # Call the get_sink method. # result = client.get_sink request # # # The returned object is of type Google::Cloud::Logging::V2::LogSink. # p result # 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 metadata = @config.rpcs.get_sink.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers metadata[:"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 metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"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("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.get_sink.timeout, metadata: metadata, retry_policy: @config.rpcs.get_sink.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @config_service_stub.call_rpc :get_sink, request, options: options do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # 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. # # @overload create_sink(request, options = nil) # Pass arguments to `create_sink` via a request object, either of type # {::Google::Cloud::Logging::V2::CreateSinkRequest} or an equivalent Hash. # # @param 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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload create_sink(parent: nil, sink: nil, unique_writer_identity: nil) # 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). # # @param parent [::String] # Required. The resource in which to create the sink: # # "projects/[PROJECT_ID]" # "organizations/[ORGANIZATION_ID]" # "billingAccounts/[BILLING_ACCOUNT_ID]" # "folders/[FOLDER_ID]" # # For examples: # # `"projects/my-project"` # `"organizations/123456789"` # @param sink [::Google::Cloud::Logging::V2::LogSink, ::Hash] # Required. The new sink, whose `name` parameter is a sink identifier that # is not already in use. # @param unique_writer_identity [::Boolean] # Optional. Determines the kind of IAM identity returned as `writer_identity` # in the new sink. If this value is omitted or set to false, and if the # sink's parent is a project, then the value returned as `writer_identity` is # the same group or service account used by Cloud Logging before the addition # of writer identities to this API. The sink's destination must be in the # same project as the sink itself. # # If this field is set to true, or if the sink is owned by a non-project # resource such as an organization, then the value of `writer_identity` will # be a unique service account used only for exports from the new sink. For # more information, see `writer_identity` in # {::Google::Cloud::Logging::V2::LogSink LogSink}. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::Logging::V2::LogSink] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Cloud::Logging::V2::LogSink] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/logging/v2" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Logging::V2::ConfigService::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Logging::V2::CreateSinkRequest.new # # # Call the create_sink method. # result = client.create_sink request # # # The returned object is of type Google::Cloud::Logging::V2::LogSink. # p result # 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 metadata = @config.rpcs.create_sink.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers metadata[:"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 metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"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("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.create_sink.timeout, metadata: metadata, retry_policy: @config.rpcs.create_sink.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @config_service_stub.call_rpc :create_sink, request, options: options do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # 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. # # @overload update_sink(request, options = nil) # Pass arguments to `update_sink` via a request object, either of type # {::Google::Cloud::Logging::V2::UpdateSinkRequest} or an equivalent Hash. # # @param 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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload update_sink(sink_name: nil, sink: nil, unique_writer_identity: nil, update_mask: nil) # 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). # # @param sink_name [::String] # Required. The full resource name of the sink to update, including the # parent resource and the sink identifier: # # "projects/[PROJECT_ID]/sinks/[SINK_ID]" # "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" # "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" # "folders/[FOLDER_ID]/sinks/[SINK_ID]" # # For example: # # `"projects/my-project/sinks/my-sink"` # @param sink [::Google::Cloud::Logging::V2::LogSink, ::Hash] # Required. The updated sink, whose name is the same identifier that appears # as part of `sink_name`. # @param unique_writer_identity [::Boolean] # Optional. See {::Google::Cloud::Logging::V2::ConfigService::Client#create_sink sinks.create} # for a description of this field. When updating a sink, the effect of this # field on the value of `writer_identity` in the updated sink depends on both # the old and new values of this field: # # + If the old and new values of this field are both false or both true, # then there is no change to the sink's `writer_identity`. # + If the old value is false and the new value is true, then # `writer_identity` is changed to a unique service account. # + It is an error if the old value is true and the new value is # set to false or defaulted to false. # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] # Optional. Field mask that specifies the fields in `sink` that need # an update. A sink field will be overwritten if, and only if, it is # in the update mask. `name` and output only fields cannot be updated. # # An empty `updateMask` is temporarily treated as using the following mask # for backwards compatibility purposes: # # `destination,filter,includeChildren` # # At some point in the future, behavior will be removed and specifying an # empty `updateMask` will be an error. # # For a detailed `FieldMask` definition, see # https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask # # For example: `updateMask=filter` # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::Logging::V2::LogSink] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Cloud::Logging::V2::LogSink] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/logging/v2" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Logging::V2::ConfigService::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Logging::V2::UpdateSinkRequest.new # # # Call the update_sink method. # result = client.update_sink request # # # The returned object is of type Google::Cloud::Logging::V2::LogSink. # p result # 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 metadata = @config.rpcs.update_sink.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers metadata[:"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 metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"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("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.update_sink.timeout, metadata: metadata, retry_policy: @config.rpcs.update_sink.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @config_service_stub.call_rpc :update_sink, request, options: options do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Deletes a sink. If the sink has a unique `writer_identity`, then that # service account is also deleted. # # @overload delete_sink(request, options = nil) # Pass arguments to `delete_sink` via a request object, either of type # {::Google::Cloud::Logging::V2::DeleteSinkRequest} or an equivalent Hash. # # @param 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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload delete_sink(sink_name: nil) # 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). # # @param sink_name [::String] # Required. The full resource name of the sink to delete, including the # parent resource and the sink identifier: # # "projects/[PROJECT_ID]/sinks/[SINK_ID]" # "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" # "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" # "folders/[FOLDER_ID]/sinks/[SINK_ID]" # # For example: # # `"projects/my-project/sinks/my-sink"` # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Protobuf::Empty] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/logging/v2" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Logging::V2::ConfigService::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Logging::V2::DeleteSinkRequest.new # # # Call the delete_sink method. # result = client.delete_sink request # # # The returned object is of type Google::Protobuf::Empty. # p result # 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 metadata = @config.rpcs.delete_sink.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers metadata[:"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 metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"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("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.delete_sink.timeout, metadata: metadata, retry_policy: @config.rpcs.delete_sink.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @config_service_stub.call_rpc :delete_sink, request, options: options do |response, operation| yield response, operation if block_given? 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. # # @overload create_link(request, options = nil) # Pass arguments to `create_link` via a request object, either of type # {::Google::Cloud::Logging::V2::CreateLinkRequest} or an equivalent Hash. # # @param 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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload create_link(parent: nil, link: nil, link_id: nil) # 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). # # @param parent [::String] # 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]" # @param link [::Google::Cloud::Logging::V2::Link, ::Hash] # Required. The new link. # @param link_id [::String] # 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. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Gapic::Operation] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/logging/v2" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Logging::V2::ConfigService::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Logging::V2::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 # 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 metadata = @config.rpcs.create_link.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers metadata[:"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 metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"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("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.create_link.timeout, metadata: metadata, retry_policy: @config.rpcs.create_link.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, 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? throw :response, 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. # # @overload delete_link(request, options = nil) # Pass arguments to `delete_link` via a request object, either of type # {::Google::Cloud::Logging::V2::DeleteLinkRequest} or an equivalent Hash. # # @param 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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload delete_link(name: nil) # 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). # # @param name [::String] # 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]" # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Gapic::Operation] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/logging/v2" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Logging::V2::ConfigService::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Logging::V2::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 # 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 metadata = @config.rpcs.delete_link.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers metadata[:"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 metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"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("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.delete_link.timeout, metadata: metadata, retry_policy: @config.rpcs.delete_link.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, 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? throw :response, response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Lists links. # # @overload list_links(request, options = nil) # Pass arguments to `list_links` via a request object, either of type # {::Google::Cloud::Logging::V2::ListLinksRequest} or an equivalent Hash. # # @param 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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload list_links(parent: nil, page_token: nil, page_size: nil) # 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). # # @param parent [::String] # 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]/ # @param page_token [::String] # Optional. If present, then retrieve the next batch of results from the # preceding call to this method. `pageToken` must be the value of # `nextPageToken` from the previous response. # @param page_size [::Integer] # Optional. The maximum number of results to return from this request. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Logging::V2::Link>] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Gapic::PagedEnumerable<::Google::Cloud::Logging::V2::Link>] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/logging/v2" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Logging::V2::ConfigService::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Logging::V2::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 # 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 metadata = @config.rpcs.list_links.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers metadata[:"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 metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"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("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.list_links.timeout, metadata: metadata, retry_policy: @config.rpcs.list_links.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, 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? throw :response, response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Gets a link. # # @overload get_link(request, options = nil) # Pass arguments to `get_link` via a request object, either of type # {::Google::Cloud::Logging::V2::GetLinkRequest} or an equivalent Hash. # # @param 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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload get_link(name: nil) # 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). # # @param name [::String] # 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] # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::Logging::V2::Link] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Cloud::Logging::V2::Link] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/logging/v2" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Logging::V2::ConfigService::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Logging::V2::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 # 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 metadata = @config.rpcs.get_link.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers metadata[:"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 metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"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("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.get_link.timeout, metadata: metadata, retry_policy: @config.rpcs.get_link.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @config_service_stub.call_rpc :get_link, request, options: options do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Lists all the exclusions on the _Default sink in a parent resource. # # @overload list_exclusions(request, options = nil) # Pass arguments to `list_exclusions` via a request object, either of type # {::Google::Cloud::Logging::V2::ListExclusionsRequest} or an equivalent Hash. # # @param 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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload list_exclusions(parent: nil, page_token: nil, page_size: nil) # 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). # # @param parent [::String] # Required. The parent resource whose exclusions are to be listed. # # "projects/[PROJECT_ID]" # "organizations/[ORGANIZATION_ID]" # "billingAccounts/[BILLING_ACCOUNT_ID]" # "folders/[FOLDER_ID]" # @param page_token [::String] # Optional. If present, then retrieve the next batch of results from the # preceding call to this method. `pageToken` must be the value of # `nextPageToken` from the previous response. The values of other method # parameters should be identical to those in the previous call. # @param page_size [::Integer] # Optional. The maximum number of results to return from this request. # Non-positive values are ignored. The presence of `nextPageToken` in the # response indicates that more results might be available. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Logging::V2::LogExclusion>] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Gapic::PagedEnumerable<::Google::Cloud::Logging::V2::LogExclusion>] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/logging/v2" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Logging::V2::ConfigService::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Logging::V2::ListExclusionsRequest.new # # # Call the list_exclusions method. # result = client.list_exclusions request # # # The returned object is of type Gapic::PagedEnumerable. You can iterate # # over 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 # 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 metadata = @config.rpcs.list_exclusions.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers metadata[:"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 metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"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("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.list_exclusions.timeout, metadata: metadata, retry_policy: @config.rpcs.list_exclusions.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, 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? throw :response, response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Gets the description of an exclusion in the _Default sink. # # @overload get_exclusion(request, options = nil) # Pass arguments to `get_exclusion` via a request object, either of type # {::Google::Cloud::Logging::V2::GetExclusionRequest} or an equivalent Hash. # # @param 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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload get_exclusion(name: nil) # 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). # # @param name [::String] # Required. The resource name of an existing exclusion: # # "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" # "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" # "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" # "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" # # For example: # # `"projects/my-project/exclusions/my-exclusion"` # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::Logging::V2::LogExclusion] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Cloud::Logging::V2::LogExclusion] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/logging/v2" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Logging::V2::ConfigService::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Logging::V2::GetExclusionRequest.new # # # Call the get_exclusion method. # result = client.get_exclusion request # # # The returned object is of type Google::Cloud::Logging::V2::LogExclusion. # p result # 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 metadata = @config.rpcs.get_exclusion.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers metadata[:"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 metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"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("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.get_exclusion.timeout, metadata: metadata, retry_policy: @config.rpcs.get_exclusion.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @config_service_stub.call_rpc :get_exclusion, request, options: options do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # 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. # # @overload create_exclusion(request, options = nil) # Pass arguments to `create_exclusion` via a request object, either of type # {::Google::Cloud::Logging::V2::CreateExclusionRequest} or an equivalent Hash. # # @param 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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload create_exclusion(parent: nil, exclusion: nil) # 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). # # @param parent [::String] # Required. The parent resource in which to create the exclusion: # # "projects/[PROJECT_ID]" # "organizations/[ORGANIZATION_ID]" # "billingAccounts/[BILLING_ACCOUNT_ID]" # "folders/[FOLDER_ID]" # # For examples: # # `"projects/my-logging-project"` # `"organizations/123456789"` # @param exclusion [::Google::Cloud::Logging::V2::LogExclusion, ::Hash] # Required. The new exclusion, whose `name` parameter is an exclusion name # that is not already used in the parent resource. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::Logging::V2::LogExclusion] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Cloud::Logging::V2::LogExclusion] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/logging/v2" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Logging::V2::ConfigService::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Logging::V2::CreateExclusionRequest.new # # # Call the create_exclusion method. # result = client.create_exclusion request # # # The returned object is of type Google::Cloud::Logging::V2::LogExclusion. # p result # 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 metadata = @config.rpcs.create_exclusion.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers metadata[:"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 metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"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("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.create_exclusion.timeout, metadata: metadata, retry_policy: @config.rpcs.create_exclusion.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @config_service_stub.call_rpc :create_exclusion, request, options: options do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Changes one or more properties of an existing exclusion in the _Default # sink. # # @overload update_exclusion(request, options = nil) # Pass arguments to `update_exclusion` via a request object, either of type # {::Google::Cloud::Logging::V2::UpdateExclusionRequest} or an equivalent Hash. # # @param 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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload update_exclusion(name: nil, exclusion: nil, update_mask: nil) # 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). # # @param name [::String] # Required. The resource name of the exclusion to update: # # "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" # "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" # "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" # "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" # # For example: # # `"projects/my-project/exclusions/my-exclusion"` # @param exclusion [::Google::Cloud::Logging::V2::LogExclusion, ::Hash] # Required. New values for the existing exclusion. Only the fields specified # in `update_mask` are relevant. # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] # Required. A non-empty list of fields to change in the existing exclusion. # New values for the fields are taken from the corresponding fields in the # {::Google::Cloud::Logging::V2::LogExclusion 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"`. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::Logging::V2::LogExclusion] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Cloud::Logging::V2::LogExclusion] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/logging/v2" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Logging::V2::ConfigService::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Logging::V2::UpdateExclusionRequest.new # # # Call the update_exclusion method. # result = client.update_exclusion request # # # The returned object is of type Google::Cloud::Logging::V2::LogExclusion. # p result # 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 metadata = @config.rpcs.update_exclusion.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers metadata[:"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 metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"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("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.update_exclusion.timeout, metadata: metadata, retry_policy: @config.rpcs.update_exclusion.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @config_service_stub.call_rpc :update_exclusion, request, options: options do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Deletes an exclusion in the _Default sink. # # @overload delete_exclusion(request, options = nil) # Pass arguments to `delete_exclusion` via a request object, either of type # {::Google::Cloud::Logging::V2::DeleteExclusionRequest} or an equivalent Hash. # # @param 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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload delete_exclusion(name: nil) # 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). # # @param name [::String] # Required. The resource name of an existing exclusion to delete: # # "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" # "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" # "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" # "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" # # For example: # # `"projects/my-project/exclusions/my-exclusion"` # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Protobuf::Empty] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/logging/v2" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Logging::V2::ConfigService::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Logging::V2::DeleteExclusionRequest.new # # # Call the delete_exclusion method. # result = client.delete_exclusion request # # # The returned object is of type Google::Protobuf::Empty. # p result # 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 metadata = @config.rpcs.delete_exclusion.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers metadata[:"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 metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"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("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.delete_exclusion.timeout, metadata: metadata, retry_policy: @config.rpcs.delete_exclusion.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @config_service_stub.call_rpc :delete_exclusion, request, options: options do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # 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](https://cloud.google.com/logging/docs/routing/managed-encryption) # for more information. # # @overload get_cmek_settings(request, options = nil) # Pass arguments to `get_cmek_settings` via a request object, either of type # {::Google::Cloud::Logging::V2::GetCmekSettingsRequest} or an equivalent Hash. # # @param 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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload get_cmek_settings(name: nil) # 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). # # @param name [::String] # Required. The resource for which to retrieve CMEK settings. # # "projects/[PROJECT_ID]/cmekSettings" # "organizations/[ORGANIZATION_ID]/cmekSettings" # "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" # "folders/[FOLDER_ID]/cmekSettings" # # For example: # # `"organizations/12345/cmekSettings"` # # Note: CMEK for the Log Router can be configured for Google Cloud projects, # folders, organizations and billing accounts. Once configured for an # organization, it applies to all projects and folders in the Google Cloud # organization. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::Logging::V2::CmekSettings] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Cloud::Logging::V2::CmekSettings] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/logging/v2" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Logging::V2::ConfigService::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Logging::V2::GetCmekSettingsRequest.new # # # Call the get_cmek_settings method. # result = client.get_cmek_settings request # # # The returned object is of type Google::Cloud::Logging::V2::CmekSettings. # p result # 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 metadata = @config.rpcs.get_cmek_settings.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers metadata[:"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 metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"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("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.get_cmek_settings.timeout, metadata: metadata, retry_policy: @config.rpcs.get_cmek_settings.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, 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? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # 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. # # {::Google::Cloud::Logging::V2::ConfigService::Client#update_cmek_settings UpdateCmekSettings} # will fail if 1) `kms_key_name` is invalid, or 2) the associated service # account does not have the required # `roles/cloudkms.cryptoKeyEncrypterDecrypter` role assigned for the key, or # 3) access to the key is disabled. # # See [Enabling CMEK for Log # Router](https://cloud.google.com/logging/docs/routing/managed-encryption) # for more information. # # @overload update_cmek_settings(request, options = nil) # Pass arguments to `update_cmek_settings` via a request object, either of type # {::Google::Cloud::Logging::V2::UpdateCmekSettingsRequest} or an equivalent Hash. # # @param 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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload update_cmek_settings(name: nil, cmek_settings: nil, update_mask: nil) # 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). # # @param name [::String] # Required. The resource name for the CMEK settings to update. # # "projects/[PROJECT_ID]/cmekSettings" # "organizations/[ORGANIZATION_ID]/cmekSettings" # "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" # "folders/[FOLDER_ID]/cmekSettings" # # 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. # @param cmek_settings [::Google::Cloud::Logging::V2::CmekSettings, ::Hash] # Required. The CMEK settings to update. # # See [Enabling CMEK for Log # Router](https://cloud.google.com/logging/docs/routing/managed-encryption) # for more information. # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] # Optional. Field mask identifying which fields from `cmek_settings` should # be updated. A field will be overwritten if and only if it is in the update # mask. Output only fields cannot be updated. # # See {::Google::Protobuf::FieldMask FieldMask} for more information. # # For example: `"updateMask=kmsKeyName"` # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::Logging::V2::CmekSettings] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Cloud::Logging::V2::CmekSettings] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/logging/v2" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Logging::V2::ConfigService::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Logging::V2::UpdateCmekSettingsRequest.new # # # Call the update_cmek_settings method. # result = client.update_cmek_settings request # # # The returned object is of type Google::Cloud::Logging::V2::CmekSettings. # p result # 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 metadata = @config.rpcs.update_cmek_settings.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers metadata[:"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 metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"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("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.update_cmek_settings.timeout, metadata: metadata, retry_policy: @config.rpcs.update_cmek_settings.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, 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? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # 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](https://cloud.google.com/logging/docs/routing/managed-encryption) # for more information. # # @overload get_settings(request, options = nil) # Pass arguments to `get_settings` via a request object, either of type # {::Google::Cloud::Logging::V2::GetSettingsRequest} or an equivalent Hash. # # @param 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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload get_settings(name: nil) # 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). # # @param name [::String] # Required. The resource for which to retrieve settings. # # "projects/[PROJECT_ID]/settings" # "organizations/[ORGANIZATION_ID]/settings" # "billingAccounts/[BILLING_ACCOUNT_ID]/settings" # "folders/[FOLDER_ID]/settings" # # For example: # # `"organizations/12345/settings"` # # Note: Settings for the Log Router can be get for Google Cloud projects, # folders, organizations and billing accounts. Currently it can only be # configured for organizations. Once configured for an organization, it # applies to all projects and folders in the Google Cloud organization. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::Logging::V2::Settings] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Cloud::Logging::V2::Settings] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/logging/v2" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Logging::V2::ConfigService::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Logging::V2::GetSettingsRequest.new # # # Call the get_settings method. # result = client.get_settings request # # # The returned object is of type Google::Cloud::Logging::V2::Settings. # p result # 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 metadata = @config.rpcs.get_settings.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers metadata[:"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 metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"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("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.get_settings.timeout, metadata: metadata, retry_policy: @config.rpcs.get_settings.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @config_service_stub.call_rpc :get_settings, request, options: options do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # 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. # # {::Google::Cloud::Logging::V2::ConfigService::Client#update_settings 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](https://cloud.google.com/logging/docs/routing/managed-encryption) # for more information. # # @overload update_settings(request, options = nil) # Pass arguments to `update_settings` via a request object, either of type # {::Google::Cloud::Logging::V2::UpdateSettingsRequest} or an equivalent Hash. # # @param 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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload update_settings(name: nil, settings: nil, update_mask: nil) # 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). # # @param name [::String] # 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. # @param settings [::Google::Cloud::Logging::V2::Settings, ::Hash] # Required. The settings to update. # # See [Enabling CMEK for Log # Router](https://cloud.google.com/logging/docs/routing/managed-encryption) # for more information. # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] # 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 {::Google::Protobuf::FieldMask FieldMask} for more information. # # For example: `"updateMask=kmsKeyName"` # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::Logging::V2::Settings] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Cloud::Logging::V2::Settings] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/logging/v2" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Logging::V2::ConfigService::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Logging::V2::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 # 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 metadata = @config.rpcs.update_settings.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers metadata[:"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 metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"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("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.update_settings.timeout, metadata: metadata, retry_policy: @config.rpcs.update_settings.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @config_service_stub.call_rpc :update_settings, request, options: options do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Copies a set of log entries from a log bucket to a Cloud Storage bucket. # # @overload copy_log_entries(request, options = nil) # Pass arguments to `copy_log_entries` via a request object, either of type # {::Google::Cloud::Logging::V2::CopyLogEntriesRequest} or an equivalent Hash. # # @param 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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload copy_log_entries(name: nil, filter: nil, destination: nil) # 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). # # @param name [::String] # Required. Log bucket from which to copy log entries. # # For example: # # `"projects/my-project/locations/global/buckets/my-source-bucket"` # @param filter [::String] # Optional. A filter specifying which log entries to copy. The filter must be # no more than 20k characters. An empty filter matches all log entries. # @param destination [::String] # Required. Destination to which to copy log entries. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Gapic::Operation] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/logging/v2" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Logging::V2::ConfigService::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Logging::V2::CopyLogEntriesRequest.new # # # Call the copy_log_entries method. # result = client.copy_log_entries request # # # The returned object is of type Gapic::Operation. You can use 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 # 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 metadata = @config.rpcs.copy_log_entries.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers metadata[:"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 metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.copy_log_entries.timeout, metadata: metadata, retry_policy: @config.rpcs.copy_log_entries.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, 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? throw :response, response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Configuration class for the ConfigService API. # # This class represents the configuration for ConfigService, # providing control over timeouts, retry behavior, logging, transport # parameters, and other low-level controls. Certain parameters can also be # applied individually to specific RPCs. See # {::Google::Cloud::Logging::V2::ConfigService::Client::Configuration::Rpcs} # for a list of RPCs that can be configured independently. # # Configuration can be applied globally to all clients, or to a single client # on construction. # # @example # # # Modify the global config, setting the timeout for # # list_buckets to 20 seconds, # # and all remaining timeouts to 10 seconds. # ::Google::Cloud::Logging::V2::ConfigService::Client.configure do |config| # config.timeout = 10.0 # config.rpcs.list_buckets.timeout = 20.0 # end # # # Apply the above configuration only to a new client. # client = ::Google::Cloud::Logging::V2::ConfigService::Client.new do |config| # config.timeout = 10.0 # config.rpcs.list_buckets.timeout = 20.0 # end # # @!attribute [rw] endpoint # A custom service endpoint, as a hostname or hostname:port. The default is # nil, indicating to use the default endpoint in the current universe domain. # @return [::String,nil] # @!attribute [rw] credentials # Credentials to send with calls. You may provide any of the following types: # * (`Google::Auth::Credentials`) A googleauth credentials object # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) # * (`Signet::OAuth2::Client`) A signet oauth2 client object # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) # * (`GRPC::Core::Channel`) a gRPC channel with included credentials # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object # * (`nil`) indicating no credentials # # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials # is deprecated. Providing an unvalidated credential configuration to # Google APIs can compromise the security of your systems and data. # # @example # # # The recommended way to provide credentials is to use the `make_creds` method # # on the appropriate credentials class for your environment. # # require "googleauth" # # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( # json_key_io: ::File.open("/path/to/keyfile.json") # ) # # client = ::Google::Cloud::Logging::V2::ConfigService::Client.new do |config| # config.credentials = credentials # end # # @note Warning: If you accept a credential configuration (JSON file or Hash) from an # external source for authentication to Google Cloud, you must validate it before # providing it to a Google API client library. Providing an unvalidated credential # configuration to Google APIs can compromise the security of your systems and data. # For more information, refer to [Validate credential configurations from external # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). # @return [::Object] # @!attribute [rw] scope # The OAuth scopes # @return [::Array<::String>] # @!attribute [rw] lib_name # The library name as recorded in instrumentation and logging # @return [::String] # @!attribute [rw] lib_version # The library version as recorded in instrumentation and logging # @return [::String] # @!attribute [rw] channel_args # Extra parameters passed to the gRPC channel. Note: this is ignored if a # `GRPC::Core::Channel` object is provided as the credential. # @return [::Hash] # @!attribute [rw] interceptors # An array of interceptors that are run before calls are executed. # @return [::Array<::GRPC::ClientInterceptor>] # @!attribute [rw] timeout # The call timeout in seconds. # @return [::Numeric] # @!attribute [rw] metadata # Additional gRPC headers to be sent with the call. # @return [::Hash{::Symbol=>::String}] # @!attribute [rw] retry_policy # The retry policy. The value is a hash with the following keys: # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. # * `:retry_codes` (*type:* `Array`) - The error codes that should # trigger a retry. # @return [::Hash] # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] # @!attribute [rw] universe_domain # The universe domain within which to make requests. This determines the # default endpoint URL. The default value of nil uses the environment # universe (usually the default "googleapis.com" universe). # @return [::String,nil] # @!attribute [rw] logger # A custom logger to use for request/response debug logging, or the value # `:default` (the default) to construct a default logger, or `nil` to # explicitly disable logging. # @return [::Logger,:default,nil] # class Configuration extend ::Gapic::Config # @private # The endpoint specific to the default "googleapis.com" universe. Deprecated. DEFAULT_ENDPOINT = "logging.googleapis.com" config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel allowed.any? { |klass| klass === value } end config_attr :scope, nil, ::String, ::Array, nil config_attr :lib_name, nil, ::String, nil config_attr :lib_version, nil, ::String, nil config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) config_attr :interceptors, nil, ::Array, nil config_attr :timeout, nil, ::Numeric, nil config_attr :metadata, nil, ::Hash, nil config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil config_attr :universe_domain, nil, ::String, nil config_attr :logger, :default, ::Logger, nil, :default # @private def initialize parent_config = nil @parent_config = parent_config unless parent_config.nil? yield self if block_given? end ## # Configurations for individual RPCs # @return [Rpcs] # def rpcs @rpcs ||= begin parent_rpcs = nil parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) Rpcs.new parent_rpcs end end ## # Configuration for the channel pool # @return [::Gapic::ServiceStub::ChannelPool::Configuration] # def channel_pool @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new end ## # Configuration RPC class for the ConfigService API. # # Includes fields providing the configuration for each RPC in this service. # Each configuration object is of type `Gapic::Config::Method` and includes # the following configuration fields: # # * `timeout` (*type:* `Numeric`) - The call timeout in seconds # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields # include the following keys: # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. # * `:retry_codes` (*type:* `Array`) - The error codes that should # trigger a retry. # class Rpcs ## # RPC-specific configuration for `list_buckets` # @return [::Gapic::Config::Method] # attr_reader :list_buckets ## # RPC-specific configuration for `get_bucket` # @return [::Gapic::Config::Method] # attr_reader :get_bucket ## # RPC-specific configuration for `create_bucket_async` # @return [::Gapic::Config::Method] # attr_reader :create_bucket_async ## # RPC-specific configuration for `update_bucket_async` # @return [::Gapic::Config::Method] # attr_reader :update_bucket_async ## # RPC-specific configuration for `create_bucket` # @return [::Gapic::Config::Method] # attr_reader :create_bucket ## # RPC-specific configuration for `update_bucket` # @return [::Gapic::Config::Method] # attr_reader :update_bucket ## # RPC-specific configuration for `delete_bucket` # @return [::Gapic::Config::Method] # attr_reader :delete_bucket ## # RPC-specific configuration for `undelete_bucket` # @return [::Gapic::Config::Method] # attr_reader :undelete_bucket ## # RPC-specific configuration for `list_views` # @return [::Gapic::Config::Method] # attr_reader :list_views ## # RPC-specific configuration for `get_view` # @return [::Gapic::Config::Method] # attr_reader :get_view ## # RPC-specific configuration for `create_view` # @return [::Gapic::Config::Method] # attr_reader :create_view ## # RPC-specific configuration for `update_view` # @return [::Gapic::Config::Method] # attr_reader :update_view ## # RPC-specific configuration for `delete_view` # @return [::Gapic::Config::Method] # attr_reader :delete_view ## # RPC-specific configuration for `list_sinks` # @return [::Gapic::Config::Method] # attr_reader :list_sinks ## # RPC-specific configuration for `get_sink` # @return [::Gapic::Config::Method] # attr_reader :get_sink ## # RPC-specific configuration for `create_sink` # @return [::Gapic::Config::Method] # attr_reader :create_sink ## # RPC-specific configuration for `update_sink` # @return [::Gapic::Config::Method] # attr_reader :update_sink ## # RPC-specific configuration for `delete_sink` # @return [::Gapic::Config::Method] # attr_reader :delete_sink ## # RPC-specific configuration for `create_link` # @return [::Gapic::Config::Method] # attr_reader :create_link ## # RPC-specific configuration for `delete_link` # @return [::Gapic::Config::Method] # attr_reader :delete_link ## # RPC-specific configuration for `list_links` # @return [::Gapic::Config::Method] # attr_reader :list_links ## # RPC-specific configuration for `get_link` # @return [::Gapic::Config::Method] # attr_reader :get_link ## # RPC-specific configuration for `list_exclusions` # @return [::Gapic::Config::Method] # attr_reader :list_exclusions ## # RPC-specific configuration for `get_exclusion` # @return [::Gapic::Config::Method] # attr_reader :get_exclusion ## # RPC-specific configuration for `create_exclusion` # @return [::Gapic::Config::Method] # attr_reader :create_exclusion ## # RPC-specific configuration for `update_exclusion` # @return [::Gapic::Config::Method] # attr_reader :update_exclusion ## # RPC-specific configuration for `delete_exclusion` # @return [::Gapic::Config::Method] # attr_reader :delete_exclusion ## # RPC-specific configuration for `get_cmek_settings` # @return [::Gapic::Config::Method] # attr_reader :get_cmek_settings ## # RPC-specific configuration for `update_cmek_settings` # @return [::Gapic::Config::Method] # attr_reader :update_cmek_settings ## # RPC-specific configuration for `get_settings` # @return [::Gapic::Config::Method] # attr_reader :get_settings ## # RPC-specific configuration for `update_settings` # @return [::Gapic::Config::Method] # attr_reader :update_settings ## # RPC-specific configuration for `copy_log_entries` # @return [::Gapic::Config::Method] # attr_reader :copy_log_entries # @private def initialize parent_rpcs = nil list_buckets_config = parent_rpcs.list_buckets if parent_rpcs.respond_to? :list_buckets @list_buckets = ::Gapic::Config::Method.new list_buckets_config get_bucket_config = parent_rpcs.get_bucket if parent_rpcs.respond_to? :get_bucket @get_bucket = ::Gapic::Config::Method.new get_bucket_config create_bucket_async_config = parent_rpcs.create_bucket_async if parent_rpcs.respond_to? :create_bucket_async @create_bucket_async = ::Gapic::Config::Method.new create_bucket_async_config update_bucket_async_config = parent_rpcs.update_bucket_async if parent_rpcs.respond_to? :update_bucket_async @update_bucket_async = ::Gapic::Config::Method.new update_bucket_async_config create_bucket_config = parent_rpcs.create_bucket if parent_rpcs.respond_to? :create_bucket @create_bucket = ::Gapic::Config::Method.new create_bucket_config update_bucket_config = parent_rpcs.update_bucket if parent_rpcs.respond_to? :update_bucket @update_bucket = ::Gapic::Config::Method.new update_bucket_config delete_bucket_config = parent_rpcs.delete_bucket if parent_rpcs.respond_to? :delete_bucket @delete_bucket = ::Gapic::Config::Method.new delete_bucket_config undelete_bucket_config = parent_rpcs.undelete_bucket if parent_rpcs.respond_to? :undelete_bucket @undelete_bucket = ::Gapic::Config::Method.new undelete_bucket_config list_views_config = parent_rpcs.list_views if parent_rpcs.respond_to? :list_views @list_views = ::Gapic::Config::Method.new list_views_config get_view_config = parent_rpcs.get_view if parent_rpcs.respond_to? :get_view @get_view = ::Gapic::Config::Method.new get_view_config create_view_config = parent_rpcs.create_view if parent_rpcs.respond_to? :create_view @create_view = ::Gapic::Config::Method.new create_view_config update_view_config = parent_rpcs.update_view if parent_rpcs.respond_to? :update_view @update_view = ::Gapic::Config::Method.new update_view_config delete_view_config = parent_rpcs.delete_view if parent_rpcs.respond_to? :delete_view @delete_view = ::Gapic::Config::Method.new delete_view_config list_sinks_config = parent_rpcs.list_sinks if parent_rpcs.respond_to? :list_sinks @list_sinks = ::Gapic::Config::Method.new list_sinks_config get_sink_config = parent_rpcs.get_sink if parent_rpcs.respond_to? :get_sink @get_sink = ::Gapic::Config::Method.new get_sink_config create_sink_config = parent_rpcs.create_sink if parent_rpcs.respond_to? :create_sink @create_sink = ::Gapic::Config::Method.new create_sink_config update_sink_config = parent_rpcs.update_sink if parent_rpcs.respond_to? :update_sink @update_sink = ::Gapic::Config::Method.new update_sink_config delete_sink_config = parent_rpcs.delete_sink if parent_rpcs.respond_to? :delete_sink @delete_sink = ::Gapic::Config::Method.new delete_sink_config create_link_config = parent_rpcs.create_link if parent_rpcs.respond_to? :create_link @create_link = ::Gapic::Config::Method.new create_link_config delete_link_config = parent_rpcs.delete_link if parent_rpcs.respond_to? :delete_link @delete_link = ::Gapic::Config::Method.new delete_link_config list_links_config = parent_rpcs.list_links if parent_rpcs.respond_to? :list_links @list_links = ::Gapic::Config::Method.new list_links_config get_link_config = parent_rpcs.get_link if parent_rpcs.respond_to? :get_link @get_link = ::Gapic::Config::Method.new get_link_config list_exclusions_config = parent_rpcs.list_exclusions if parent_rpcs.respond_to? :list_exclusions @list_exclusions = ::Gapic::Config::Method.new list_exclusions_config get_exclusion_config = parent_rpcs.get_exclusion if parent_rpcs.respond_to? :get_exclusion @get_exclusion = ::Gapic::Config::Method.new get_exclusion_config create_exclusion_config = parent_rpcs.create_exclusion if parent_rpcs.respond_to? :create_exclusion @create_exclusion = ::Gapic::Config::Method.new create_exclusion_config update_exclusion_config = parent_rpcs.update_exclusion if parent_rpcs.respond_to? :update_exclusion @update_exclusion = ::Gapic::Config::Method.new update_exclusion_config delete_exclusion_config = parent_rpcs.delete_exclusion if parent_rpcs.respond_to? :delete_exclusion @delete_exclusion = ::Gapic::Config::Method.new delete_exclusion_config get_cmek_settings_config = parent_rpcs.get_cmek_settings if parent_rpcs.respond_to? :get_cmek_settings @get_cmek_settings = ::Gapic::Config::Method.new get_cmek_settings_config update_cmek_settings_config = parent_rpcs.update_cmek_settings if parent_rpcs.respond_to? :update_cmek_settings @update_cmek_settings = ::Gapic::Config::Method.new update_cmek_settings_config get_settings_config = parent_rpcs.get_settings if parent_rpcs.respond_to? :get_settings @get_settings = ::Gapic::Config::Method.new get_settings_config update_settings_config = parent_rpcs.update_settings if parent_rpcs.respond_to? :update_settings @update_settings = ::Gapic::Config::Method.new update_settings_config copy_log_entries_config = parent_rpcs.copy_log_entries if parent_rpcs.respond_to? :copy_log_entries @copy_log_entries = ::Gapic::Config::Method.new copy_log_entries_config yield self if block_given? end end end end end end end end end google-cloud-logging-v2-1.5.1/lib/google/cloud/logging/v2/config_service/credentials.rb0000644000004100000410000000340115143461113031010 0ustar www-datawww-data# frozen_string_literal: true # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Auto-generated by gapic-generator-ruby. DO NOT EDIT! require "googleauth" module Google module Cloud module Logging module V2 module ConfigService # Credentials for the ConfigService API. class Credentials < ::Google::Auth::Credentials self.scope = [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/cloud-platform.read-only", "https://www.googleapis.com/auth/logging.admin", "https://www.googleapis.com/auth/logging.read" ] self.env_vars = [ "LOGGING_CREDENTIALS", "LOGGING_KEYFILE", "GOOGLE_CLOUD_CREDENTIALS", "GOOGLE_CLOUD_KEYFILE", "GCLOUD_KEYFILE", "LOGGING_CREDENTIALS_JSON", "LOGGING_KEYFILE_JSON", "GOOGLE_CLOUD_CREDENTIALS_JSON", "GOOGLE_CLOUD_KEYFILE_JSON", "GCLOUD_KEYFILE_JSON" ] self.paths = [ "~/.config/google_cloud/application_default_credentials.json" ] end end end end end end google-cloud-logging-v2-1.5.1/lib/google/cloud/logging/v2/metrics_service.rb0000644000004100000410000000302115143461113026712 0ustar www-datawww-data# frozen_string_literal: true # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Auto-generated by gapic-generator-ruby. DO NOT EDIT! require "gapic/common" require "gapic/config" require "gapic/config/method" require "google/cloud/logging/v2/version" require "google/cloud/logging/v2/metrics_service/credentials" require "google/cloud/logging/v2/metrics_service/paths" require "google/cloud/logging/v2/metrics_service/client" module Google module Cloud module Logging module V2 ## # Service for configuring logs-based metrics. # # @example Load this service and instantiate a gRPC client # # require "google/cloud/logging/v2/metrics_service" # client = ::Google::Cloud::Logging::V2::MetricsService::Client.new # module MetricsService end end end end end helper_path = ::File.join __dir__, "metrics_service", "helpers.rb" require "google/cloud/logging/v2/metrics_service/helpers" if ::File.file? helper_path google-cloud-logging-v2-1.5.1/lib/google/cloud/logging/v2.rb0000644000004100000410000000251015143461113023526 0ustar www-datawww-data# frozen_string_literal: true # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Auto-generated by gapic-generator-ruby. DO NOT EDIT! require "google/cloud/logging/v2/logging_service" require "google/cloud/logging/v2/config_service" require "google/cloud/logging/v2/metrics_service" require "google/cloud/logging/v2/version" module Google module Cloud module Logging ## # API client module. # # @example Load this package, including all its services, and instantiate a gRPC client # # require "google/cloud/logging/v2" # client = ::Google::Cloud::Logging::V2::LoggingService::Client.new # module V2 end end end end helper_path = ::File.join __dir__, "v2", "_helpers.rb" require "google/cloud/logging/v2/_helpers" if ::File.file? helper_path google-cloud-logging-v2-1.5.1/lib/google/logging/0000755000004100000410000000000015143461113021546 5ustar www-datawww-datagoogle-cloud-logging-v2-1.5.1/lib/google/logging/v2/0000755000004100000410000000000015143461113022075 5ustar www-datawww-datagoogle-cloud-logging-v2-1.5.1/lib/google/logging/v2/log_entry_pb.rb0000644000004100000410000001225515143461113025112 0ustar www-datawww-data# frozen_string_literal: true # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/logging/v2/log_entry.proto require 'google/protobuf' require 'google/api/field_behavior_pb' require 'google/api/monitored_resource_pb' require 'google/api/resource_pb' require 'google/logging/type/http_request_pb' require 'google/logging/type/log_severity_pb' require 'google/protobuf/any_pb' require 'google/protobuf/struct_pb' require 'google/protobuf/timestamp_pb' descriptor_data = "\n!google/logging/v2/log_entry.proto\x12\x11google.logging.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a#google/api/monitored_resource.proto\x1a\x19google/api/resource.proto\x1a&google/logging/type/http_request.proto\x1a&google/logging/type/log_severity.proto\x1a\x19google/protobuf/any.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x83\x08\n\x08LogEntry\x12\x15\n\x08log_name\x18\x0c \x01(\tB\x03\xe0\x41\x02\x12\x34\n\x08resource\x18\x08 \x01(\x0b\x32\x1d.google.api.MonitoredResourceB\x03\xe0\x41\x02\x12-\n\rproto_payload\x18\x02 \x01(\x0b\x32\x14.google.protobuf.AnyH\x00\x12\x16\n\x0ctext_payload\x18\x03 \x01(\tH\x00\x12/\n\x0cjson_payload\x18\x06 \x01(\x0b\x32\x17.google.protobuf.StructH\x00\x12\x32\n\ttimestamp\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\x12:\n\x11receive_timestamp\x18\x18 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x37\n\x08severity\x18\n \x01(\x0e\x32 .google.logging.type.LogSeverityB\x03\xe0\x41\x01\x12\x16\n\tinsert_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12;\n\x0chttp_request\x18\x07 \x01(\x0b\x32 .google.logging.type.HttpRequestB\x03\xe0\x41\x01\x12<\n\x06labels\x18\x0b \x03(\x0b\x32\'.google.logging.v2.LogEntry.LabelsEntryB\x03\xe0\x41\x01\x12<\n\toperation\x18\x0f \x01(\x0b\x32$.google.logging.v2.LogEntryOperationB\x03\xe0\x41\x01\x12\x12\n\x05trace\x18\x16 \x01(\tB\x03\xe0\x41\x01\x12\x14\n\x07span_id\x18\x1b \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rtrace_sampled\x18\x1e \x01(\x08\x42\x03\xe0\x41\x01\x12G\n\x0fsource_location\x18\x17 \x01(\x0b\x32).google.logging.v2.LogEntrySourceLocationB\x03\xe0\x41\x01\x12/\n\x05split\x18# \x01(\x0b\x32\x1b.google.logging.v2.LogSplitB\x03\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\xbd\x01\xea\x41\xb9\x01\n\x1alogging.googleapis.com/Log\x12\x1dprojects/{project}/logs/{log}\x12\'organizations/{organization}/logs/{log}\x12\x1b\x66olders/{folder}/logs/{log}\x12,billingAccounts/{billing_account}/logs/{log}\x1a\x08log_nameB\t\n\x07payload\"b\n\x11LogEntryOperation\x12\x0f\n\x02id\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08producer\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05\x66irst\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\x12\x11\n\x04last\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"U\n\x16LogEntrySourceLocation\x12\x11\n\x04\x66ile\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x11\n\x04line\x18\x02 \x01(\x03\x42\x03\xe0\x41\x01\x12\x15\n\x08\x66unction\x18\x03 \x01(\tB\x03\xe0\x41\x01\"<\n\x08LogSplit\x12\x0b\n\x03uid\x18\x01 \x01(\t\x12\r\n\x05index\x18\x02 \x01(\x05\x12\x14\n\x0ctotal_splits\x18\x03 \x01(\x05\x42\xb3\x01\n\x15\x63om.google.logging.v2B\rLogEntryProtoP\x01Z5cloud.google.com/go/logging/apiv2/loggingpb;loggingpb\xf8\x01\x01\xaa\x02\x17Google.Cloud.Logging.V2\xca\x02\x17Google\\Cloud\\Logging\\V2\xea\x02\x1aGoogle::Cloud::Logging::V2b\x06proto3" pool = Google::Protobuf::DescriptorPool.generated_pool begin pool.add_serialized_file(descriptor_data) rescue TypeError # Compatibility code: will be removed in the next major version. require 'google/protobuf/descriptor_pb' parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) parsed.clear_dependency serialized = parsed.class.encode(parsed) file = pool.add_serialized_file(serialized) warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" imports = [ ["google.api.MonitoredResource", "google/api/monitored_resource.proto"], ["google.protobuf.Any", "google/protobuf/any.proto"], ["google.protobuf.Struct", "google/protobuf/struct.proto"], ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], ["google.logging.type.HttpRequest", "google/logging/type/http_request.proto"], ] imports.each do |type_name, expected_filename| import_file = pool.lookup(type_name).file_descriptor if import_file.name != expected_filename warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" end end warn "Each proto file must use a consistent fully-qualified name." warn "This will become an error in the next major version." end module Google module Cloud module Logging module V2 LogEntry = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.LogEntry").msgclass LogEntryOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.LogEntryOperation").msgclass LogEntrySourceLocation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.LogEntrySourceLocation").msgclass LogSplit = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.LogSplit").msgclass end end end end google-cloud-logging-v2-1.5.1/lib/google/logging/v2/logging_services_pb.rb0000644000004100000410000000700215143461113026433 0ustar www-datawww-data# Generated by the protocol buffer compiler. DO NOT EDIT! # Source: google/logging/v2/logging.proto for package 'Google.Cloud.Logging.V2' # Original file comments: # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # require 'grpc' require 'google/logging/v2/logging_pb' module Google module Cloud module Logging module V2 module LoggingServiceV2 # Service for ingesting and querying logs. class Service include ::GRPC::GenericService self.marshal_class_method = :encode self.unmarshal_class_method = :decode self.service_name = 'google.logging.v2.LoggingServiceV2' # Deletes all the log entries in a log for the _Default Log Bucket. The log # reappears if it receives new entries. Log entries written shortly before # the delete operation might not be deleted. Entries received after the # delete operation with a timestamp before the operation will be deleted. rpc :DeleteLog, ::Google::Cloud::Logging::V2::DeleteLogRequest, ::Google::Protobuf::Empty # Writes log entries to Logging. This API method is the # only way to send log entries to Logging. This method # is used, directly or indirectly, by the Logging agent # (fluentd) and all logging libraries configured to use Logging. # A single request may contain log entries for a maximum of 1000 # different resources (projects, organizations, billing accounts or # folders) rpc :WriteLogEntries, ::Google::Cloud::Logging::V2::WriteLogEntriesRequest, ::Google::Cloud::Logging::V2::WriteLogEntriesResponse # Lists log entries. Use this method to retrieve log entries that originated # from a project/folder/organization/billing account. For ways to export log # entries, see [Exporting # Logs](https://cloud.google.com/logging/docs/export). rpc :ListLogEntries, ::Google::Cloud::Logging::V2::ListLogEntriesRequest, ::Google::Cloud::Logging::V2::ListLogEntriesResponse # Lists the descriptors for monitored resource types used by Logging. rpc :ListMonitoredResourceDescriptors, ::Google::Cloud::Logging::V2::ListMonitoredResourceDescriptorsRequest, ::Google::Cloud::Logging::V2::ListMonitoredResourceDescriptorsResponse # Lists the logs in projects, organizations, folders, or billing accounts. # Only logs that have entries are listed. rpc :ListLogs, ::Google::Cloud::Logging::V2::ListLogsRequest, ::Google::Cloud::Logging::V2::ListLogsResponse # Streaming read of log entries as they are ingested. Until the stream is # terminated, it will continue reading logs. rpc :TailLogEntries, stream(::Google::Cloud::Logging::V2::TailLogEntriesRequest), stream(::Google::Cloud::Logging::V2::TailLogEntriesResponse) end Stub = Service.rpc_stub_class end end end end end google-cloud-logging-v2-1.5.1/lib/google/logging/v2/logging_metrics_pb.rb0000644000004100000410000001602215143461113026260 0ustar www-datawww-data# frozen_string_literal: true # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/logging/v2/logging_metrics.proto require 'google/protobuf' require 'google/api/annotations_pb' require 'google/api/client_pb' require 'google/api/distribution_pb' require 'google/api/field_behavior_pb' require 'google/api/metric_pb' require 'google/api/resource_pb' require 'google/protobuf/empty_pb' require 'google/protobuf/timestamp_pb' descriptor_data = "\n\'google/logging/v2/logging_metrics.proto\x12\x11google.logging.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1dgoogle/api/distribution.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x17google/api/metric.proto\x1a\x19google/api/resource.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xbd\x05\n\tLogMetric\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0b\x64\x65scription\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0b\x62ucket_name\x18\r \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08\x64isabled\x18\x0c \x01(\x08\x42\x03\xe0\x41\x01\x12<\n\x11metric_descriptor\x18\x05 \x01(\x0b\x32\x1c.google.api.MetricDescriptorB\x03\xe0\x41\x01\x12\x1c\n\x0fvalue_extractor\x18\x06 \x01(\tB\x03\xe0\x41\x01\x12P\n\x10label_extractors\x18\x07 \x03(\x0b\x32\x31.google.logging.v2.LogMetric.LabelExtractorsEntryB\x03\xe0\x41\x01\x12\x43\n\x0e\x62ucket_options\x18\x08 \x01(\x0b\x32&.google.api.Distribution.BucketOptionsB\x03\xe0\x41\x01\x12\x34\n\x0b\x63reate_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12<\n\x07version\x18\x04 \x01(\x0e\x32\'.google.logging.v2.LogMetric.ApiVersionB\x02\x18\x01\x1a\x36\n\x14LabelExtractorsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x1c\n\nApiVersion\x12\x06\n\x02V2\x10\x00\x12\x06\n\x02V1\x10\x01:J\xea\x41G\n logging.googleapis.com/LogMetric\x12#projects/{project}/metrics/{metric}\"\x8d\x01\n\x15ListLogMetricsRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12\x17\n\npage_token\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\tpage_size\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\"`\n\x16ListLogMetricsResponse\x12-\n\x07metrics\x18\x01 \x03(\x0b\x32\x1c.google.logging.v2.LogMetric\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"T\n\x13GetLogMetricRequest\x12=\n\x0bmetric_name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n logging.googleapis.com/LogMetric\"\x85\x01\n\x16\x43reateLogMetricRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\x12 logging.googleapis.com/LogMetric\x12\x31\n\x06metric\x18\x02 \x01(\x0b\x32\x1c.google.logging.v2.LogMetricB\x03\xe0\x41\x02\"\x8a\x01\n\x16UpdateLogMetricRequest\x12=\n\x0bmetric_name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n logging.googleapis.com/LogMetric\x12\x31\n\x06metric\x18\x02 \x01(\x0b\x32\x1c.google.logging.v2.LogMetricB\x03\xe0\x41\x02\"W\n\x16\x44\x65leteLogMetricRequest\x12=\n\x0bmetric_name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n logging.googleapis.com/LogMetric2\xae\x08\n\x10MetricsServiceV2\x12\x97\x01\n\x0eListLogMetrics\x12(.google.logging.v2.ListLogMetricsRequest\x1a).google.logging.v2.ListLogMetricsResponse\"0\xda\x41\x06parent\x82\xd3\xe4\x93\x02!\x12\x1f/v2/{parent=projects/*}/metrics\x12\x92\x01\n\x0cGetLogMetric\x12&.google.logging.v2.GetLogMetricRequest\x1a\x1c.google.logging.v2.LogMetric\"<\xda\x41\x0bmetric_name\x82\xd3\xe4\x93\x02(\x12&/v2/{metric_name=projects/*/metrics/*}\x12\x9b\x01\n\x0f\x43reateLogMetric\x12).google.logging.v2.CreateLogMetricRequest\x1a\x1c.google.logging.v2.LogMetric\"?\xda\x41\rparent,metric\x82\xd3\xe4\x93\x02)\"\x1f/v2/{parent=projects/*}/metrics:\x06metric\x12\xa7\x01\n\x0fUpdateLogMetric\x12).google.logging.v2.UpdateLogMetricRequest\x1a\x1c.google.logging.v2.LogMetric\"K\xda\x41\x12metric_name,metric\x82\xd3\xe4\x93\x02\x30\x1a&/v2/{metric_name=projects/*/metrics/*}:\x06metric\x12\x92\x01\n\x0f\x44\x65leteLogMetric\x12).google.logging.v2.DeleteLogMetricRequest\x1a\x16.google.protobuf.Empty\"<\xda\x41\x0bmetric_name\x82\xd3\xe4\x93\x02(*&/v2/{metric_name=projects/*/metrics/*}\x1a\x8d\x02\xca\x41\x16logging.googleapis.com\xd2\x41\xf0\x01https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-only,https://www.googleapis.com/auth/logging.admin,https://www.googleapis.com/auth/logging.read,https://www.googleapis.com/auth/logging.writeB\xb9\x01\n\x15\x63om.google.logging.v2B\x13LoggingMetricsProtoP\x01Z5cloud.google.com/go/logging/apiv2/loggingpb;loggingpb\xf8\x01\x01\xaa\x02\x17Google.Cloud.Logging.V2\xca\x02\x17Google\\Cloud\\Logging\\V2\xea\x02\x1aGoogle::Cloud::Logging::V2b\x06proto3" pool = Google::Protobuf::DescriptorPool.generated_pool begin pool.add_serialized_file(descriptor_data) rescue TypeError # Compatibility code: will be removed in the next major version. require 'google/protobuf/descriptor_pb' parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) parsed.clear_dependency serialized = parsed.class.encode(parsed) file = pool.add_serialized_file(serialized) warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" imports = [ ["google.api.MetricDescriptor", "google/api/metric.proto"], ["google.api.Distribution.BucketOptions", "google/api/distribution.proto"], ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], ] imports.each do |type_name, expected_filename| import_file = pool.lookup(type_name).file_descriptor if import_file.name != expected_filename warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" end end warn "Each proto file must use a consistent fully-qualified name." warn "This will become an error in the next major version." end module Google module Cloud module Logging module V2 LogMetric = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.LogMetric").msgclass LogMetric::ApiVersion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.LogMetric.ApiVersion").enummodule ListLogMetricsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.ListLogMetricsRequest").msgclass ListLogMetricsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.ListLogMetricsResponse").msgclass GetLogMetricRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.GetLogMetricRequest").msgclass CreateLogMetricRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.CreateLogMetricRequest").msgclass UpdateLogMetricRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.UpdateLogMetricRequest").msgclass DeleteLogMetricRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.DeleteLogMetricRequest").msgclass end end end end google-cloud-logging-v2-1.5.1/lib/google/logging/v2/logging_pb.rb0000644000004100000410000002340315143461113024533 0ustar www-datawww-data# frozen_string_literal: true # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/logging/v2/logging.proto require 'google/protobuf' require 'google/api/annotations_pb' require 'google/api/client_pb' require 'google/api/field_behavior_pb' require 'google/api/monitored_resource_pb' require 'google/api/resource_pb' require 'google/logging/v2/log_entry_pb' require 'google/protobuf/duration_pb' require 'google/protobuf/empty_pb' require 'google/rpc/status_pb' descriptor_data = "\n\x1fgoogle/logging/v2/logging.proto\x12\x11google.logging.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a#google/api/monitored_resource.proto\x1a\x19google/api/resource.proto\x1a!google/logging/v2/log_entry.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x17google/rpc/status.proto\"H\n\x10\x44\x65leteLogRequest\x12\x34\n\x08log_name\x18\x01 \x01(\tB\"\xe0\x41\x02\xfa\x41\x1c\n\x1alogging.googleapis.com/Log\"\xe6\x02\n\x16WriteLogEntriesRequest\x12\x34\n\x08log_name\x18\x01 \x01(\tB\"\xe0\x41\x01\xfa\x41\x1c\n\x1alogging.googleapis.com/Log\x12\x34\n\x08resource\x18\x02 \x01(\x0b\x32\x1d.google.api.MonitoredResourceB\x03\xe0\x41\x01\x12J\n\x06labels\x18\x03 \x03(\x0b\x32\x35.google.logging.v2.WriteLogEntriesRequest.LabelsEntryB\x03\xe0\x41\x01\x12\x31\n\x07\x65ntries\x18\x04 \x03(\x0b\x32\x1b.google.logging.v2.LogEntryB\x03\xe0\x41\x02\x12\x1c\n\x0fpartial_success\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\x12\x14\n\x07\x64ry_run\x18\x06 \x01(\x08\x42\x03\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x19\n\x17WriteLogEntriesResponse\"\xc8\x01\n\x1cWriteLogEntriesPartialErrors\x12]\n\x10log_entry_errors\x18\x01 \x03(\x0b\x32\x43.google.logging.v2.WriteLogEntriesPartialErrors.LogEntryErrorsEntry\x1aI\n\x13LogEntryErrorsEntry\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12!\n\x05value\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status:\x02\x38\x01\"\xb0\x01\n\x15ListLogEntriesRequest\x12:\n\x0eresource_names\x18\x08 \x03(\tB\"\xe0\x41\x02\xfa\x41\x1c\x12\x1alogging.googleapis.com/Log\x12\x13\n\x06\x66ilter\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08order_by\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\tpage_size\x18\x04 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x05 \x01(\tB\x03\xe0\x41\x01\"_\n\x16ListLogEntriesResponse\x12,\n\x07\x65ntries\x18\x01 \x03(\x0b\x32\x1b.google.logging.v2.LogEntry\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"Z\n\'ListMonitoredResourceDescriptorsRequest\x12\x16\n\tpage_size\x18\x01 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\x8a\x01\n(ListMonitoredResourceDescriptorsResponse\x12\x45\n\x14resource_descriptors\x18\x01 \x03(\x0b\x32\'.google.api.MonitoredResourceDescriptor\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xb2\x01\n\x0fListLogsRequest\x12\x32\n\x06parent\x18\x01 \x01(\tB\"\xe0\x41\x02\xfa\x41\x1c\x12\x1alogging.googleapis.com/Log\x12:\n\x0eresource_names\x18\x08 \x03(\tB\"\xe0\x41\x01\xfa\x41\x1c\x12\x1alogging.googleapis.com/Log\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\">\n\x10ListLogsResponse\x12\x11\n\tlog_names\x18\x03 \x03(\t\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x80\x01\n\x15TailLogEntriesRequest\x12\x1b\n\x0eresource_names\x18\x01 \x03(\tB\x03\xe0\x41\x02\x12\x13\n\x06\x66ilter\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x35\n\rbuffer_window\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\"\xdf\x02\n\x16TailLogEntriesResponse\x12,\n\x07\x65ntries\x18\x01 \x03(\x0b\x32\x1b.google.logging.v2.LogEntry\x12S\n\x10suppression_info\x18\x02 \x03(\x0b\x32\x39.google.logging.v2.TailLogEntriesResponse.SuppressionInfo\x1a\xc1\x01\n\x0fSuppressionInfo\x12P\n\x06reason\x18\x01 \x01(\x0e\x32@.google.logging.v2.TailLogEntriesResponse.SuppressionInfo.Reason\x12\x18\n\x10suppressed_count\x18\x02 \x01(\x05\"B\n\x06Reason\x12\x16\n\x12REASON_UNSPECIFIED\x10\x00\x12\x0e\n\nRATE_LIMIT\x10\x01\x12\x10\n\x0cNOT_CONSUMED\x10\x02\x32\xe9\r\n\x10LoggingServiceV2\x12\x93\x02\n\tDeleteLog\x12#.google.logging.v2.DeleteLogRequest\x1a\x16.google.protobuf.Empty\"\xc8\x01\xda\x41\x08log_name\x82\xd3\xe4\x93\x02\xb6\x01* /v2/{log_name=projects/*/logs/*}Z\x1b*\x19/v2/{log_name=*/*/logs/*}Z\'*%/v2/{log_name=organizations/*/logs/*}Z!*\x1f/v2/{log_name=folders/*/logs/*}Z)*\'/v2/{log_name=billingAccounts/*/logs/*}\x12\xa9\x01\n\x0fWriteLogEntries\x12).google.logging.v2.WriteLogEntriesRequest\x1a*.google.logging.v2.WriteLogEntriesResponse\"?\xda\x41 log_name,resource,labels,entries\x82\xd3\xe4\x93\x02\x16\"\x11/v2/entries:write:\x01*\x12\xa3\x01\n\x0eListLogEntries\x12(.google.logging.v2.ListLogEntriesRequest\x1a).google.logging.v2.ListLogEntriesResponse\"<\xda\x41\x1eresource_names,filter,order_by\x82\xd3\xe4\x93\x02\x15\"\x10/v2/entries:list:\x01*\x12\xc5\x01\n ListMonitoredResourceDescriptors\x12:.google.logging.v2.ListMonitoredResourceDescriptorsRequest\x1a;.google.logging.v2.ListMonitoredResourceDescriptorsResponse\"(\x82\xd3\xe4\x93\x02\"\x12 /v2/monitoredResourceDescriptors\x12\x8b\x04\n\x08ListLogs\x12\".google.logging.v2.ListLogsRequest\x1a#.google.logging.v2.ListLogsResponse\"\xb5\x03\xda\x41\x06parent\x82\xd3\xe4\x93\x02\xa5\x03\x12\x15/v2/{parent=*/*}/logsZ\x1e\x12\x1c/v2/{parent=projects/*}/logsZ#\x12!/v2/{parent=organizations/*}/logsZ\x1d\x12\x1b/v2/{parent=folders/*}/logsZ%\x12#/v2/{parent=billingAccounts/*}/logsZ<\x12:/v2/{parent=projects/*/locations/*/buckets/*/views/*}/logsZA\x12?/v2/{parent=organizations/*/locations/*/buckets/*/views/*}/logsZ;\x12\x39/v2/{parent=folders/*/locations/*/buckets/*/views/*}/logsZC\x12\x41/v2/{parent=billingAccounts/*/locations/*/buckets/*/views/*}/logs\x12\x86\x01\n\x0eTailLogEntries\x12(.google.logging.v2.TailLogEntriesRequest\x1a).google.logging.v2.TailLogEntriesResponse\"\x1b\x82\xd3\xe4\x93\x02\x15\"\x10/v2/entries:tail:\x01*(\x01\x30\x01\x1a\x8d\x02\xca\x41\x16logging.googleapis.com\xd2\x41\xf0\x01https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-only,https://www.googleapis.com/auth/logging.admin,https://www.googleapis.com/auth/logging.read,https://www.googleapis.com/auth/logging.writeB\xb2\x01\n\x15\x63om.google.logging.v2B\x0cLoggingProtoP\x01Z5cloud.google.com/go/logging/apiv2/loggingpb;loggingpb\xf8\x01\x01\xaa\x02\x17Google.Cloud.Logging.V2\xca\x02\x17Google\\Cloud\\Logging\\V2\xea\x02\x1aGoogle::Cloud::Logging::V2b\x06proto3" pool = Google::Protobuf::DescriptorPool.generated_pool begin pool.add_serialized_file(descriptor_data) rescue TypeError # Compatibility code: will be removed in the next major version. require 'google/protobuf/descriptor_pb' parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) parsed.clear_dependency serialized = parsed.class.encode(parsed) file = pool.add_serialized_file(serialized) warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" imports = [ ["google.api.MonitoredResource", "google/api/monitored_resource.proto"], ["google.logging.v2.LogEntry", "google/logging/v2/log_entry.proto"], ["google.rpc.Status", "google/rpc/status.proto"], ["google.protobuf.Duration", "google/protobuf/duration.proto"], ] imports.each do |type_name, expected_filename| import_file = pool.lookup(type_name).file_descriptor if import_file.name != expected_filename warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" end end warn "Each proto file must use a consistent fully-qualified name." warn "This will become an error in the next major version." end module Google module Cloud module Logging module V2 DeleteLogRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.DeleteLogRequest").msgclass WriteLogEntriesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.WriteLogEntriesRequest").msgclass WriteLogEntriesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.WriteLogEntriesResponse").msgclass WriteLogEntriesPartialErrors = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.WriteLogEntriesPartialErrors").msgclass ListLogEntriesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.ListLogEntriesRequest").msgclass ListLogEntriesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.ListLogEntriesResponse").msgclass ListMonitoredResourceDescriptorsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.ListMonitoredResourceDescriptorsRequest").msgclass ListMonitoredResourceDescriptorsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.ListMonitoredResourceDescriptorsResponse").msgclass ListLogsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.ListLogsRequest").msgclass ListLogsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.ListLogsResponse").msgclass TailLogEntriesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.TailLogEntriesRequest").msgclass TailLogEntriesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.TailLogEntriesResponse").msgclass TailLogEntriesResponse::SuppressionInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.TailLogEntriesResponse.SuppressionInfo").msgclass TailLogEntriesResponse::SuppressionInfo::Reason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.TailLogEntriesResponse.SuppressionInfo.Reason").enummodule end end end end google-cloud-logging-v2-1.5.1/lib/google/logging/v2/logging_metrics_services_pb.rb0000644000004100000410000000414415143461113030165 0ustar www-datawww-data# Generated by the protocol buffer compiler. DO NOT EDIT! # Source: google/logging/v2/logging_metrics.proto for package 'Google.Cloud.Logging.V2' # Original file comments: # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # require 'grpc' require 'google/logging/v2/logging_metrics_pb' module Google module Cloud module Logging module V2 module MetricsServiceV2 # Service for configuring logs-based metrics. class Service include ::GRPC::GenericService self.marshal_class_method = :encode self.unmarshal_class_method = :decode self.service_name = 'google.logging.v2.MetricsServiceV2' # Lists logs-based metrics. rpc :ListLogMetrics, ::Google::Cloud::Logging::V2::ListLogMetricsRequest, ::Google::Cloud::Logging::V2::ListLogMetricsResponse # Gets a logs-based metric. rpc :GetLogMetric, ::Google::Cloud::Logging::V2::GetLogMetricRequest, ::Google::Cloud::Logging::V2::LogMetric # Creates a logs-based metric. rpc :CreateLogMetric, ::Google::Cloud::Logging::V2::CreateLogMetricRequest, ::Google::Cloud::Logging::V2::LogMetric # Creates or updates a logs-based metric. rpc :UpdateLogMetric, ::Google::Cloud::Logging::V2::UpdateLogMetricRequest, ::Google::Cloud::Logging::V2::LogMetric # Deletes a logs-based metric. rpc :DeleteLogMetric, ::Google::Cloud::Logging::V2::DeleteLogMetricRequest, ::Google::Protobuf::Empty end Stub = Service.rpc_stub_class end end end end end google-cloud-logging-v2-1.5.1/lib/google/logging/v2/logging_config_pb.rb0000644000004100000410000011417315143461113026065 0ustar www-datawww-data# frozen_string_literal: true # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/logging/v2/logging_config.proto require 'google/protobuf' require 'google/api/annotations_pb' require 'google/api/client_pb' require 'google/api/field_behavior_pb' require 'google/api/resource_pb' require 'google/longrunning/operations_pb' require 'google/protobuf/empty_pb' require 'google/protobuf/field_mask_pb' require 'google/protobuf/timestamp_pb' descriptor_data = "\n&google/logging/v2/logging_config.proto\x12\x11google.logging.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x8d\x01\n\x0bIndexConfig\x12\x17\n\nfield_path\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12/\n\x04type\x18\x02 \x01(\x0e\x32\x1c.google.logging.v2.IndexTypeB\x03\xe0\x41\x02\x12\x34\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\"\xd5\x05\n\tLogBucket\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x16\n\x0eretention_days\x18\x0b \x01(\x05\x12\x0e\n\x06locked\x18\t \x01(\x08\x12?\n\x0flifecycle_state\x18\x0c \x01(\x0e\x32!.google.logging.v2.LifecycleStateB\x03\xe0\x41\x03\x12\x19\n\x11\x61nalytics_enabled\x18\x0e \x01(\x08\x12\x19\n\x11restricted_fields\x18\x0f \x03(\t\x12\x35\n\rindex_configs\x18\x11 \x03(\x0b\x32\x1e.google.logging.v2.IndexConfig\x12\x36\n\rcmek_settings\x18\x13 \x01(\x0b\x32\x1f.google.logging.v2.CmekSettings:\xa5\x02\xea\x41\xa1\x02\n logging.googleapis.com/LogBucket\x12\x38projects/{project}/locations/{location}/buckets/{bucket}\x12\x42organizations/{organization}/locations/{location}/buckets/{bucket}\x12\x36\x66olders/{folder}/locations/{location}/buckets/{bucket}\x12GbillingAccounts/{billing_account}/locations/{location}/buckets/{bucket}\"\x82\x04\n\x07LogView\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x0e\n\x06\x66ilter\x18\x07 \x01(\t:\xd7\x02\xea\x41\xd3\x02\n\x1elogging.googleapis.com/LogView\x12\x45projects/{project}/locations/{location}/buckets/{bucket}/views/{view}\x12Oorganizations/{organization}/locations/{location}/buckets/{bucket}/views/{view}\x12\x43\x66olders/{folder}/locations/{location}/buckets/{bucket}/views/{view}\x12TbillingAccounts/{billing_account}/locations/{location}/buckets/{bucket}/views/{view}\"\x85\x06\n\x07LogSink\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1e\n\x0b\x64\x65stination\x18\x03 \x01(\tB\t\xe0\x41\x02\xfa\x41\x03\n\x01*\x12\x13\n\x06\x66ilter\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0b\x64\x65scription\x18\x12 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08\x64isabled\x18\x13 \x01(\x08\x42\x03\xe0\x41\x01\x12\x38\n\nexclusions\x18\x10 \x03(\x0b\x32\x1f.google.logging.v2.LogExclusionB\x03\xe0\x41\x01\x12K\n\x15output_version_format\x18\x06 \x01(\x0e\x32(.google.logging.v2.LogSink.VersionFormatB\x02\x18\x01\x12\x1c\n\x0fwriter_identity\x18\x08 \x01(\tB\x03\xe0\x41\x03\x12\x1d\n\x10include_children\x18\t \x01(\x08\x42\x03\xe0\x41\x01\x12\x43\n\x10\x62igquery_options\x18\x0c \x01(\x0b\x32\".google.logging.v2.BigQueryOptionsB\x03\xe0\x41\x01H\x00\x12\x34\n\x0b\x63reate_time\x18\r \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x0e \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\"?\n\rVersionFormat\x12\x1e\n\x1aVERSION_FORMAT_UNSPECIFIED\x10\x00\x12\x06\n\x02V2\x10\x01\x12\x06\n\x02V1\x10\x02:\xbf\x01\xea\x41\xbb\x01\n\x1elogging.googleapis.com/LogSink\x12\x1fprojects/{project}/sinks/{sink}\x12)organizations/{organization}/sinks/{sink}\x12\x1d\x66olders/{folder}/sinks/{sink}\x12.billingAccounts/{billing_account}/sinks/{sink}B\t\n\x07options\"*\n\x0f\x42igQueryDataset\x12\x17\n\ndataset_id\x18\x01 \x01(\tB\x03\xe0\x41\x03\"\xb5\x04\n\x04Link\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x34\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12?\n\x0flifecycle_state\x18\x04 \x01(\x0e\x32!.google.logging.v2.LifecycleStateB\x03\xe0\x41\x03\x12<\n\x10\x62igquery_dataset\x18\x05 \x01(\x0b\x32\".google.logging.v2.BigQueryDataset:\xd4\x02\xea\x41\xd0\x02\n\x1blogging.googleapis.com/Link\x12\x45projects/{project}/locations/{location}/buckets/{bucket}/links/{link}\x12Oorganizations/{organization}/locations/{location}/buckets/{bucket}/links/{link}\x12\x43\x66olders/{folder}/locations/{location}/buckets/{bucket}/links/{link}\x12TbillingAccounts/{billing_account}/locations/{location}/buckets/{bucket}/links/{link}\"g\n\x0f\x42igQueryOptions\x12#\n\x16use_partitioned_tables\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x12/\n\"uses_timestamp_column_partitioning\x18\x03 \x01(\x08\x42\x03\xe0\x41\x03\"\x7f\n\x12ListBucketsRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\x12 logging.googleapis.com/LogBucket\x12\x17\n\npage_token\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\tpage_size\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\"]\n\x13ListBucketsResponse\x12-\n\x07\x62uckets\x18\x01 \x03(\x0b\x32\x1c.google.logging.v2.LogBucket\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x9a\x01\n\x13\x43reateBucketRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\x12 logging.googleapis.com/LogBucket\x12\x16\n\tbucket_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x31\n\x06\x62ucket\x18\x03 \x01(\x0b\x32\x1c.google.logging.v2.LogBucketB\x03\xe0\x41\x02\"\xb6\x01\n\x13UpdateBucketRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n logging.googleapis.com/LogBucket\x12\x31\n\x06\x62ucket\x18\x02 \x01(\x0b\x32\x1c.google.logging.v2.LogBucketB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"J\n\x10GetBucketRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n logging.googleapis.com/LogBucket\"M\n\x13\x44\x65leteBucketRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n logging.googleapis.com/LogBucket\"O\n\x15UndeleteBucketRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n logging.googleapis.com/LogBucket\"X\n\x10ListViewsRequest\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x17\n\npage_token\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\tpage_size\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\"W\n\x11ListViewsResponse\x12)\n\x05views\x18\x01 \x03(\x0b\x32\x1a.google.logging.v2.LogView\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"m\n\x11\x43reateViewRequest\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x14\n\x07view_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12-\n\x04view\x18\x03 \x01(\x0b\x32\x1a.google.logging.v2.LogViewB\x03\xe0\x41\x02\"\x8b\x01\n\x11UpdateViewRequest\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12-\n\x04view\x18\x02 \x01(\x0b\x32\x1a.google.logging.v2.LogViewB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"F\n\x0eGetViewRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1elogging.googleapis.com/LogView\"I\n\x11\x44\x65leteViewRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1elogging.googleapis.com/LogView\"{\n\x10ListSinksRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1elogging.googleapis.com/LogSink\x12\x17\n\npage_token\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\tpage_size\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\"W\n\x11ListSinksResponse\x12)\n\x05sinks\x18\x01 \x03(\x0b\x32\x1a.google.logging.v2.LogSink\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"K\n\x0eGetSinkRequest\x12\x39\n\tsink_name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1elogging.googleapis.com/LogSink\"\x9f\x01\n\x11\x43reateSinkRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1elogging.googleapis.com/LogSink\x12-\n\x04sink\x18\x02 \x01(\x0b\x32\x1a.google.logging.v2.LogSinkB\x03\xe0\x41\x02\x12#\n\x16unique_writer_identity\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\"\xd8\x01\n\x11UpdateSinkRequest\x12\x39\n\tsink_name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1elogging.googleapis.com/LogSink\x12-\n\x04sink\x18\x02 \x01(\x0b\x32\x1a.google.logging.v2.LogSinkB\x03\xe0\x41\x02\x12#\n\x16unique_writer_identity\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\x12\x34\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"N\n\x11\x44\x65leteSinkRequest\x12\x39\n\tsink_name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1elogging.googleapis.com/LogSink\"\x8a\x01\n\x11\x43reateLinkRequest\x12\x33\n\x06parent\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\x12\x1blogging.googleapis.com/Link\x12*\n\x04link\x18\x02 \x01(\x0b\x32\x17.google.logging.v2.LinkB\x03\xe0\x41\x02\x12\x14\n\x07link_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\"F\n\x11\x44\x65leteLinkRequest\x12\x31\n\x04name\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1blogging.googleapis.com/Link\"x\n\x10ListLinksRequest\x12\x33\n\x06parent\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\x12\x1blogging.googleapis.com/Link\x12\x17\n\npage_token\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\tpage_size\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\"T\n\x11ListLinksResponse\x12&\n\x05links\x18\x01 \x03(\x0b\x32\x17.google.logging.v2.Link\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"C\n\x0eGetLinkRequest\x12\x31\n\x04name\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1blogging.googleapis.com/Link\"\xc2\x03\n\x0cLogExclusion\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0b\x64\x65scription\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x15\n\x08\x64isabled\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\x12\x34\n\x0b\x63reate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03:\xec\x01\xea\x41\xe8\x01\n#logging.googleapis.com/LogExclusion\x12)projects/{project}/exclusions/{exclusion}\x12\x33organizations/{organization}/exclusions/{exclusion}\x12\'folders/{folder}/exclusions/{exclusion}\x12\x38\x62illingAccounts/{billing_account}/exclusions/{exclusion}\"\x85\x01\n\x15ListExclusionsRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#logging.googleapis.com/LogExclusion\x12\x17\n\npage_token\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\tpage_size\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\"f\n\x16ListExclusionsResponse\x12\x33\n\nexclusions\x18\x01 \x03(\x0b\x32\x1f.google.logging.v2.LogExclusion\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"P\n\x13GetExclusionRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#logging.googleapis.com/LogExclusion\"\x8e\x01\n\x16\x43reateExclusionRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#logging.googleapis.com/LogExclusion\x12\x37\n\texclusion\x18\x02 \x01(\x0b\x32\x1f.google.logging.v2.LogExclusionB\x03\xe0\x41\x02\"\xc2\x01\n\x16UpdateExclusionRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#logging.googleapis.com/LogExclusion\x12\x37\n\texclusion\x18\x02 \x01(\x0b\x32\x1f.google.logging.v2.LogExclusionB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"S\n\x16\x44\x65leteExclusionRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#logging.googleapis.com/LogExclusion\"S\n\x16GetCmekSettingsRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#logging.googleapis.com/CmekSettings\"\xa1\x01\n\x19UpdateCmekSettingsRequest\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12;\n\rcmek_settings\x18\x02 \x01(\x0b\x32\x1f.google.logging.v2.CmekSettingsB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"\xbd\x02\n\x0c\x43mekSettings\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x0ckms_key_name\x18\x02 \x01(\t\x12\x1c\n\x14kms_key_version_name\x18\x04 \x01(\t\x12\x1f\n\x12service_account_id\x18\x03 \x01(\tB\x03\xe0\x41\x03:\xc4\x01\xea\x41\xc0\x01\n#logging.googleapis.com/CmekSettings\x12\x1fprojects/{project}/cmekSettings\x12)organizations/{organization}/cmekSettings\x12\x1d\x66olders/{folder}/cmekSettings\x12.billingAccounts/{billing_account}/cmekSettings\"K\n\x12GetSettingsRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1flogging.googleapis.com/Settings\"\x94\x01\n\x15UpdateSettingsRequest\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x32\n\x08settings\x18\x02 \x01(\x0b\x32\x1b.google.logging.v2.SettingsB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"\xd2\x02\n\x08Settings\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0ckms_key_name\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12#\n\x16kms_service_account_id\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x1d\n\x10storage_location\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12!\n\x14\x64isable_default_sink\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01:\xb0\x01\xea\x41\xac\x01\n\x1flogging.googleapis.com/Settings\x12\x1bprojects/{project}/settings\x12%organizations/{organization}/settings\x12\x19\x66olders/{folder}/settings\x12*billingAccounts/{billing_account}/settings\"Y\n\x15\x43opyLogEntriesRequest\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06\x66ilter\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0b\x64\x65stination\x18\x04 \x01(\tB\x03\xe0\x41\x02\"\xae\x02\n\x16\x43opyLogEntriesMetadata\x12.\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x30\n\x05state\x18\x03 \x01(\x0e\x32!.google.logging.v2.OperationState\x12\x1e\n\x16\x63\x61ncellation_requested\x18\x04 \x01(\x08\x12\x39\n\x07request\x18\x05 \x01(\x0b\x32(.google.logging.v2.CopyLogEntriesRequest\x12\x10\n\x08progress\x18\x06 \x01(\x05\x12\x17\n\x0fwriter_identity\x18\x07 \x01(\t\":\n\x16\x43opyLogEntriesResponse\x12 \n\x18log_entries_copied_count\x18\x01 \x01(\x03\"\xbd\x02\n\x0e\x42ucketMetadata\x12.\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x30\n\x05state\x18\x03 \x01(\x0e\x32!.google.logging.v2.OperationState\x12G\n\x15\x63reate_bucket_request\x18\x04 \x01(\x0b\x32&.google.logging.v2.CreateBucketRequestH\x00\x12G\n\x15update_bucket_request\x18\x05 \x01(\x0b\x32&.google.logging.v2.UpdateBucketRequestH\x00\x42\t\n\x07request\"\xb3\x02\n\x0cLinkMetadata\x12.\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x30\n\x05state\x18\x03 \x01(\x0e\x32!.google.logging.v2.OperationState\x12\x43\n\x13\x63reate_link_request\x18\x04 \x01(\x0b\x32$.google.logging.v2.CreateLinkRequestH\x00\x12\x43\n\x13\x64\x65lete_link_request\x18\x05 \x01(\x0b\x32$.google.logging.v2.DeleteLinkRequestH\x00\x42\t\n\x07request\"1\n\x10LocationMetadata\x12\x1d\n\x15log_analytics_enabled\x18\x01 \x01(\x08*\xf4\x01\n\x0eOperationState\x12\x1f\n\x1bOPERATION_STATE_UNSPECIFIED\x10\x00\x12\x1d\n\x19OPERATION_STATE_SCHEDULED\x10\x01\x12+\n\'OPERATION_STATE_WAITING_FOR_PERMISSIONS\x10\x02\x12\x1b\n\x17OPERATION_STATE_RUNNING\x10\x03\x12\x1d\n\x19OPERATION_STATE_SUCCEEDED\x10\x04\x12\x1a\n\x16OPERATION_STATE_FAILED\x10\x05\x12\x1d\n\x19OPERATION_STATE_CANCELLED\x10\x06*{\n\x0eLifecycleState\x12\x1f\n\x1bLIFECYCLE_STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x14\n\x10\x44\x45LETE_REQUESTED\x10\x02\x12\x0c\n\x08UPDATING\x10\x03\x12\x0c\n\x08\x43REATING\x10\x04\x12\n\n\x06\x46\x41ILED\x10\x05*V\n\tIndexType\x12\x1a\n\x16INDEX_TYPE_UNSPECIFIED\x10\x00\x12\x15\n\x11INDEX_TYPE_STRING\x10\x01\x12\x16\n\x12INDEX_TYPE_INTEGER\x10\x02\x32\x9fY\n\x0f\x43onfigServiceV2\x12\xdc\x02\n\x0bListBuckets\x12%.google.logging.v2.ListBucketsRequest\x1a&.google.logging.v2.ListBucketsResponse\"\xfd\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\xed\x01\x12$/v2/{parent=*/*/locations/*}/bucketsZ-\x12+/v2/{parent=projects/*/locations/*}/bucketsZ2\x12\x30/v2/{parent=organizations/*/locations/*}/bucketsZ,\x12*/v2/{parent=folders/*/locations/*}/bucketsZ4\x12\x32/v2/{parent=billingAccounts/*/locations/*}/buckets\x12\xc5\x02\n\tGetBucket\x12#.google.logging.v2.GetBucketRequest\x1a\x1c.google.logging.v2.LogBucket\"\xf4\x01\x82\xd3\xe4\x93\x02\xed\x01\x12$/v2/{name=*/*/locations/*/buckets/*}Z-\x12+/v2/{name=projects/*/locations/*/buckets/*}Z2\x12\x30/v2/{name=organizations/*/locations/*/buckets/*}Z,\x12*/v2/{name=folders/*/locations/*/buckets/*}Z4\x12\x32/v2/{name=billingAccounts/*/locations/*/buckets/*}\x12\xd3\x03\n\x11\x43reateBucketAsync\x12&.google.logging.v2.CreateBucketRequest\x1a\x1d.google.longrunning.Operation\"\xf6\x02\xca\x41\x1b\n\tLogBucket\x12\x0e\x42ucketMetadata\x82\xd3\xe4\x93\x02\xd1\x02\"0/v2/{parent=*/*/locations/*}/buckets:createAsync:\x06\x62ucketZA\"7/v2/{parent=projects/*/locations/*}/buckets:createAsync:\x06\x62ucketZF\"/v2/{parent=billingAccounts/*/locations/*}/buckets:createAsync:\x06\x62ucket\x12\xd3\x03\n\x11UpdateBucketAsync\x12&.google.logging.v2.UpdateBucketRequest\x1a\x1d.google.longrunning.Operation\"\xf6\x02\xca\x41\x1b\n\tLogBucket\x12\x0e\x42ucketMetadata\x82\xd3\xe4\x93\x02\xd1\x02\"0/v2/{name=*/*/locations/*/buckets/*}:updateAsync:\x06\x62ucketZA\"7/v2/{name=projects/*/locations/*/buckets/*}:updateAsync:\x06\x62ucketZF\"/v2/{name=billingAccounts/*/locations/*/buckets/*}:updateAsync:\x06\x62ucket\x12\xf3\x02\n\x0c\x43reateBucket\x12&.google.logging.v2.CreateBucketRequest\x1a\x1c.google.logging.v2.LogBucket\"\x9c\x02\x82\xd3\xe4\x93\x02\x95\x02\"$/v2/{parent=*/*/locations/*}/buckets:\x06\x62ucketZ5\"+/v2/{parent=projects/*/locations/*}/buckets:\x06\x62ucketZ:\"0/v2/{parent=organizations/*/locations/*}/buckets:\x06\x62ucketZ4\"*/v2/{parent=folders/*/locations/*}/buckets:\x06\x62ucketZ<\"2/v2/{parent=billingAccounts/*/locations/*}/buckets:\x06\x62ucket\x12\xf3\x02\n\x0cUpdateBucket\x12&.google.logging.v2.UpdateBucketRequest\x1a\x1c.google.logging.v2.LogBucket\"\x9c\x02\x82\xd3\xe4\x93\x02\x95\x02\x32$/v2/{name=*/*/locations/*/buckets/*}:\x06\x62ucketZ52+/v2/{name=projects/*/locations/*/buckets/*}:\x06\x62ucketZ:20/v2/{name=organizations/*/locations/*/buckets/*}:\x06\x62ucketZ42*/v2/{name=folders/*/locations/*/buckets/*}:\x06\x62ucketZ<22/v2/{name=billingAccounts/*/locations/*/buckets/*}:\x06\x62ucket\x12\xc5\x02\n\x0c\x44\x65leteBucket\x12&.google.logging.v2.DeleteBucketRequest\x1a\x16.google.protobuf.Empty\"\xf4\x01\x82\xd3\xe4\x93\x02\xed\x01*$/v2/{name=*/*/locations/*/buckets/*}Z-*+/v2/{name=projects/*/locations/*/buckets/*}Z2*0/v2/{name=organizations/*/locations/*/buckets/*}Z,**/v2/{name=folders/*/locations/*/buckets/*}Z4*2/v2/{name=billingAccounts/*/locations/*/buckets/*}\x12\x85\x03\n\x0eUndeleteBucket\x12(.google.logging.v2.UndeleteBucketRequest\x1a\x16.google.protobuf.Empty\"\xb0\x02\x82\xd3\xe4\x93\x02\xa9\x02\"-/v2/{name=*/*/locations/*/buckets/*}:undelete:\x01*Z9\"4/v2/{name=projects/*/locations/*/buckets/*}:undelete:\x01*Z>\"9/v2/{name=organizations/*/locations/*/buckets/*}:undelete:\x01*Z8\"3/v2/{name=folders/*/locations/*/buckets/*}:undelete:\x01*Z@\";/v2/{name=billingAccounts/*/locations/*/buckets/*}:undelete:\x01*\x12\xfe\x02\n\tListViews\x12#.google.logging.v2.ListViewsRequest\x1a$.google.logging.v2.ListViewsResponse\"\xa5\x02\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x95\x02\x12,/v2/{parent=*/*/locations/*/buckets/*}/viewsZ5\x12\x33/v2/{parent=projects/*/locations/*/buckets/*}/viewsZ:\x12\x38/v2/{parent=organizations/*/locations/*/buckets/*}/viewsZ4\x12\x32/v2/{parent=folders/*/locations/*/buckets/*}/viewsZ<\x12:/v2/{parent=billingAccounts/*/locations/*/buckets/*}/views\x12\xe7\x02\n\x07GetView\x12!.google.logging.v2.GetViewRequest\x1a\x1a.google.logging.v2.LogView\"\x9c\x02\x82\xd3\xe4\x93\x02\x95\x02\x12,/v2/{name=*/*/locations/*/buckets/*/views/*}Z5\x12\x33/v2/{name=projects/*/locations/*/buckets/*/views/*}Z:\x12\x38/v2/{name=organizations/*/locations/*/buckets/*/views/*}Z4\x12\x32/v2/{name=folders/*/locations/*/buckets/*/views/*}Z<\x12:/v2/{name=billingAccounts/*/locations/*/buckets/*/views/*}\x12\x8b\x03\n\nCreateView\x12$.google.logging.v2.CreateViewRequest\x1a\x1a.google.logging.v2.LogView\"\xba\x02\x82\xd3\xe4\x93\x02\xb3\x02\",/v2/{parent=*/*/locations/*/buckets/*}/views:\x04viewZ;\"3/v2/{parent=projects/*/locations/*/buckets/*}/views:\x04viewZ@\"8/v2/{parent=organizations/*/locations/*/buckets/*}/views:\x04viewZ:\"2/v2/{parent=folders/*/locations/*/buckets/*}/views:\x04viewZB\":/v2/{parent=billingAccounts/*/locations/*/buckets/*}/views:\x04view\x12\x8b\x03\n\nUpdateView\x12$.google.logging.v2.UpdateViewRequest\x1a\x1a.google.logging.v2.LogView\"\xba\x02\x82\xd3\xe4\x93\x02\xb3\x02\x32,/v2/{name=*/*/locations/*/buckets/*/views/*}:\x04viewZ;23/v2/{name=projects/*/locations/*/buckets/*/views/*}:\x04viewZ@28/v2/{name=organizations/*/locations/*/buckets/*/views/*}:\x04viewZ:22/v2/{name=folders/*/locations/*/buckets/*/views/*}:\x04viewZB2:/v2/{name=billingAccounts/*/locations/*/buckets/*/views/*}:\x04view\x12\xe9\x02\n\nDeleteView\x12$.google.logging.v2.DeleteViewRequest\x1a\x16.google.protobuf.Empty\"\x9c\x02\x82\xd3\xe4\x93\x02\x95\x02*,/v2/{name=*/*/locations/*/buckets/*/views/*}Z5*3/v2/{name=projects/*/locations/*/buckets/*/views/*}Z:*8/v2/{name=organizations/*/locations/*/buckets/*/views/*}Z4*2/v2/{name=folders/*/locations/*/buckets/*/views/*}Z<*:/v2/{name=billingAccounts/*/locations/*/buckets/*/views/*}\x12\x90\x02\n\tListSinks\x12#.google.logging.v2.ListSinksRequest\x1a$.google.logging.v2.ListSinksResponse\"\xb7\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\xa7\x01\x12\x16/v2/{parent=*/*}/sinksZ\x1f\x12\x1d/v2/{parent=projects/*}/sinksZ$\x12\"/v2/{parent=organizations/*}/sinksZ\x1e\x12\x1c/v2/{parent=folders/*}/sinksZ&\x12$/v2/{parent=billingAccounts/*}/sinks\x12\x9e\x02\n\x07GetSink\x12!.google.logging.v2.GetSinkRequest\x1a\x1a.google.logging.v2.LogSink\"\xd3\x01\xda\x41\tsink_name\x82\xd3\xe4\x93\x02\xc0\x01\x12\x1b/v2/{sink_name=*/*/sinks/*}Z$\x12\"/v2/{sink_name=projects/*/sinks/*}Z)\x12\'/v2/{sink_name=organizations/*/sinks/*}Z#\x12!/v2/{sink_name=folders/*/sinks/*}Z+\x12)/v2/{sink_name=billingAccounts/*/sinks/*}\x12\xab\x02\n\nCreateSink\x12$.google.logging.v2.CreateSinkRequest\x1a\x1a.google.logging.v2.LogSink\"\xda\x01\xda\x41\x0bparent,sink\x82\xd3\xe4\x93\x02\xc5\x01\"\x16/v2/{parent=*/*}/sinks:\x04sinkZ%\"\x1d/v2/{parent=projects/*}/sinks:\x04sinkZ*\"\"/v2/{parent=organizations/*}/sinks:\x04sinkZ$\"\x1c/v2/{parent=folders/*}/sinks:\x04sinkZ,\"$/v2/{parent=billingAccounts/*}/sinks:\x04sink\x12\x9f\x04\n\nUpdateSink\x12$.google.logging.v2.UpdateSinkRequest\x1a\x1a.google.logging.v2.LogSink\"\xce\x03\xda\x41\x1asink_name,sink,update_mask\xda\x41\x0esink_name,sink\x82\xd3\xe4\x93\x02\x99\x03\x1a\x1b/v2/{sink_name=*/*/sinks/*}:\x04sinkZ*\x1a\"/v2/{sink_name=projects/*/sinks/*}:\x04sinkZ/\x1a\'/v2/{sink_name=organizations/*/sinks/*}:\x04sinkZ)\x1a!/v2/{sink_name=folders/*/sinks/*}:\x04sinkZ1\x1a)/v2/{sink_name=billingAccounts/*/sinks/*}:\x04sinkZ*2\"/v2/{sink_name=projects/*/sinks/*}:\x04sinkZ/2\'/v2/{sink_name=organizations/*/sinks/*}:\x04sinkZ)2!/v2/{sink_name=folders/*/sinks/*}:\x04sinkZ12)/v2/{sink_name=billingAccounts/*/sinks/*}:\x04sink\x12\xa0\x02\n\nDeleteSink\x12$.google.logging.v2.DeleteSinkRequest\x1a\x16.google.protobuf.Empty\"\xd3\x01\xda\x41\tsink_name\x82\xd3\xe4\x93\x02\xc0\x01*\x1b/v2/{sink_name=*/*/sinks/*}Z$*\"/v2/{sink_name=projects/*/sinks/*}Z)*\'/v2/{sink_name=organizations/*/sinks/*}Z#*!/v2/{sink_name=folders/*/sinks/*}Z+*)/v2/{sink_name=billingAccounts/*/sinks/*}\x12\xbb\x03\n\nCreateLink\x12$.google.logging.v2.CreateLinkRequest\x1a\x1d.google.longrunning.Operation\"\xe7\x02\xca\x41\x14\n\x04Link\x12\x0cLinkMetadata\xda\x41\x13parent,link,link_id\x82\xd3\xe4\x93\x02\xb3\x02\",/v2/{parent=*/*/locations/*/buckets/*}/links:\x04linkZ;\"3/v2/{parent=projects/*/locations/*/buckets/*}/links:\x04linkZ@\"8/v2/{parent=organizations/*/locations/*/buckets/*}/links:\x04linkZ:\"2/v2/{parent=folders/*/locations/*/buckets/*}/links:\x04linkZB\":/v2/{parent=billingAccounts/*/locations/*/buckets/*}/links:\x04link\x12\x9f\x03\n\nDeleteLink\x12$.google.logging.v2.DeleteLinkRequest\x1a\x1d.google.longrunning.Operation\"\xcb\x02\xca\x41%\n\x15google.protobuf.Empty\x12\x0cLinkMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x95\x02*,/v2/{name=*/*/locations/*/buckets/*/links/*}Z5*3/v2/{name=projects/*/locations/*/buckets/*/links/*}Z:*8/v2/{name=organizations/*/locations/*/buckets/*/links/*}Z4*2/v2/{name=folders/*/locations/*/buckets/*/links/*}Z<*:/v2/{name=billingAccounts/*/locations/*/buckets/*/links/*}\x12\xfe\x02\n\tListLinks\x12#.google.logging.v2.ListLinksRequest\x1a$.google.logging.v2.ListLinksResponse\"\xa5\x02\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x95\x02\x12,/v2/{parent=*/*/locations/*/buckets/*}/linksZ5\x12\x33/v2/{parent=projects/*/locations/*/buckets/*}/linksZ:\x12\x38/v2/{parent=organizations/*/locations/*/buckets/*}/linksZ4\x12\x32/v2/{parent=folders/*/locations/*/buckets/*}/linksZ<\x12:/v2/{parent=billingAccounts/*/locations/*/buckets/*}/links\x12\xeb\x02\n\x07GetLink\x12!.google.logging.v2.GetLinkRequest\x1a\x17.google.logging.v2.Link\"\xa3\x02\xda\x41\x04name\x82\xd3\xe4\x93\x02\x95\x02\x12,/v2/{name=*/*/locations/*/buckets/*/links/*}Z5\x12\x33/v2/{name=projects/*/locations/*/buckets/*/links/*}Z:\x12\x38/v2/{name=organizations/*/locations/*/buckets/*/links/*}Z4\x12\x32/v2/{name=folders/*/locations/*/buckets/*/links/*}Z<\x12:/v2/{name=billingAccounts/*/locations/*/buckets/*/links/*}\x12\xb8\x02\n\x0eListExclusions\x12(.google.logging.v2.ListExclusionsRequest\x1a).google.logging.v2.ListExclusionsResponse\"\xd0\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\xc0\x01\x12\x1b/v2/{parent=*/*}/exclusionsZ$\x12\"/v2/{parent=projects/*}/exclusionsZ)\x12\'/v2/{parent=organizations/*}/exclusionsZ#\x12!/v2/{parent=folders/*}/exclusionsZ+\x12)/v2/{parent=billingAccounts/*}/exclusions\x12\xa8\x02\n\x0cGetExclusion\x12&.google.logging.v2.GetExclusionRequest\x1a\x1f.google.logging.v2.LogExclusion\"\xce\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\xc0\x01\x12\x1b/v2/{name=*/*/exclusions/*}Z$\x12\"/v2/{name=projects/*/exclusions/*}Z)\x12\'/v2/{name=organizations/*/exclusions/*}Z#\x12!/v2/{name=folders/*/exclusions/*}Z+\x12)/v2/{name=billingAccounts/*/exclusions/*}\x12\xf1\x02\n\x0f\x43reateExclusion\x12).google.logging.v2.CreateExclusionRequest\x1a\x1f.google.logging.v2.LogExclusion\"\x91\x02\xda\x41\x10parent,exclusion\x82\xd3\xe4\x93\x02\xf7\x01\"\x1b/v2/{parent=*/*}/exclusions:\texclusionZ/\"\"/v2/{parent=projects/*}/exclusions:\texclusionZ4\"\'/v2/{parent=organizations/*}/exclusions:\texclusionZ.\"!/v2/{parent=folders/*}/exclusions:\texclusionZ6\")/v2/{parent=billingAccounts/*}/exclusions:\texclusion\x12\xfb\x02\n\x0fUpdateExclusion\x12).google.logging.v2.UpdateExclusionRequest\x1a\x1f.google.logging.v2.LogExclusion\"\x9b\x02\xda\x41\x1aname,exclusion,update_mask\x82\xd3\xe4\x93\x02\xf7\x01\x32\x1b/v2/{name=*/*/exclusions/*}:\texclusionZ/2\"/v2/{name=projects/*/exclusions/*}:\texclusionZ42\'/v2/{name=organizations/*/exclusions/*}:\texclusionZ.2!/v2/{name=folders/*/exclusions/*}:\texclusionZ62)/v2/{name=billingAccounts/*/exclusions/*}:\texclusion\x12\xa5\x02\n\x0f\x44\x65leteExclusion\x12).google.logging.v2.DeleteExclusionRequest\x1a\x16.google.protobuf.Empty\"\xce\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\xc0\x01*\x1b/v2/{name=*/*/exclusions/*}Z$*\"/v2/{name=projects/*/exclusions/*}Z)*\'/v2/{name=organizations/*/exclusions/*}Z#*!/v2/{name=folders/*/exclusions/*}Z+*)/v2/{name=billingAccounts/*/exclusions/*}\x12\xa7\x02\n\x0fGetCmekSettings\x12).google.logging.v2.GetCmekSettingsRequest\x1a\x1f.google.logging.v2.CmekSettings\"\xc7\x01\x82\xd3\xe4\x93\x02\xc0\x01\x12\x1b/v2/{name=*/*}/cmekSettingsZ$\x12\"/v2/{name=projects/*}/cmekSettingsZ)\x12\'/v2/{name=organizations/*}/cmekSettingsZ#\x12!/v2/{name=folders/*}/cmekSettingsZ+\x12)/v2/{name=billingAccounts/*}/cmekSettings\x12\xd1\x01\n\x12UpdateCmekSettings\x12,.google.logging.v2.UpdateCmekSettingsRequest\x1a\x1f.google.logging.v2.CmekSettings\"l\x82\xd3\xe4\x93\x02\x66\x32\x1b/v2/{name=*/*}/cmekSettings:\rcmek_settingsZ82\'/v2/{name=organizations/*}/cmekSettings:\rcmek_settings\x12\x8e\x02\n\x0bGetSettings\x12%.google.logging.v2.GetSettingsRequest\x1a\x1b.google.logging.v2.Settings\"\xba\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\xac\x01\x12\x17/v2/{name=*/*}/settingsZ \x12\x1e/v2/{name=projects/*}/settingsZ%\x12#/v2/{name=organizations/*}/settingsZ\x1f\x12\x1d/v2/{name=folders/*}/settingsZ\'\x12%/v2/{name=billingAccounts/*}/settings\x12\xf6\x01\n\x0eUpdateSettings\x12(.google.logging.v2.UpdateSettingsRequest\x1a\x1b.google.logging.v2.Settings\"\x9c\x01\xda\x41\x14settings,update_mask\x82\xd3\xe4\x93\x02\x7f\x32\x17/v2/{name=*/*}/settings:\x08settingsZ/2#/v2/{name=organizations/*}/settings:\x08settingsZ)2\x1d/v2/{name=folders/*}/settings:\x08settings\x12\xa9\x01\n\x0e\x43opyLogEntries\x12(.google.logging.v2.CopyLogEntriesRequest\x1a\x1d.google.longrunning.Operation\"N\xca\x41\x30\n\x16\x43opyLogEntriesResponse\x12\x16\x43opyLogEntriesMetadata\x82\xd3\xe4\x93\x02\x15\"\x10/v2/entries:copy:\x01*\x1a\xdf\x01\xca\x41\x16logging.googleapis.com\xd2\x41\xc2\x01https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-only,https://www.googleapis.com/auth/logging.admin,https://www.googleapis.com/auth/logging.readB\xd6\x03\n\x15\x63om.google.logging.v2B\x12LoggingConfigProtoP\x01Z5cloud.google.com/go/logging/apiv2/loggingpb;loggingpb\xf8\x01\x01\xaa\x02\x17Google.Cloud.Logging.V2\xca\x02\x17Google\\Cloud\\Logging\\V2\xea\x02\x1aGoogle::Cloud::Logging::V2\xea\x41`\n+logging.googleapis.com/OrganizationLocation\x12\x31organizations/{organization}/locations/{location}\xea\x41N\n%logging.googleapis.com/FolderLocation\x12%folders/{folder}/locations/{location}\xea\x41g\n-logging.googleapis.com/BillingAccountLocation\x12\x36\x62illingAccounts/{billing_account}/locations/{location}b\x06proto3" pool = Google::Protobuf::DescriptorPool.generated_pool begin pool.add_serialized_file(descriptor_data) rescue TypeError # Compatibility code: will be removed in the next major version. require 'google/protobuf/descriptor_pb' parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) parsed.clear_dependency serialized = parsed.class.encode(parsed) file = pool.add_serialized_file(serialized) warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" imports = [ ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], ] imports.each do |type_name, expected_filename| import_file = pool.lookup(type_name).file_descriptor if import_file.name != expected_filename warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" end end warn "Each proto file must use a consistent fully-qualified name." warn "This will become an error in the next major version." end module Google module Cloud module Logging module V2 IndexConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.IndexConfig").msgclass LogBucket = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.LogBucket").msgclass LogView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.LogView").msgclass LogSink = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.LogSink").msgclass LogSink::VersionFormat = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.LogSink.VersionFormat").enummodule BigQueryDataset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.BigQueryDataset").msgclass Link = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.Link").msgclass BigQueryOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.BigQueryOptions").msgclass ListBucketsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.ListBucketsRequest").msgclass ListBucketsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.ListBucketsResponse").msgclass CreateBucketRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.CreateBucketRequest").msgclass UpdateBucketRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.UpdateBucketRequest").msgclass GetBucketRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.GetBucketRequest").msgclass DeleteBucketRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.DeleteBucketRequest").msgclass UndeleteBucketRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.UndeleteBucketRequest").msgclass ListViewsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.ListViewsRequest").msgclass ListViewsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.ListViewsResponse").msgclass CreateViewRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.CreateViewRequest").msgclass UpdateViewRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.UpdateViewRequest").msgclass GetViewRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.GetViewRequest").msgclass DeleteViewRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.DeleteViewRequest").msgclass ListSinksRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.ListSinksRequest").msgclass ListSinksResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.ListSinksResponse").msgclass GetSinkRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.GetSinkRequest").msgclass CreateSinkRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.CreateSinkRequest").msgclass UpdateSinkRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.UpdateSinkRequest").msgclass DeleteSinkRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.DeleteSinkRequest").msgclass CreateLinkRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.CreateLinkRequest").msgclass DeleteLinkRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.DeleteLinkRequest").msgclass ListLinksRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.ListLinksRequest").msgclass ListLinksResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.ListLinksResponse").msgclass GetLinkRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.GetLinkRequest").msgclass LogExclusion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.LogExclusion").msgclass ListExclusionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.ListExclusionsRequest").msgclass ListExclusionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.ListExclusionsResponse").msgclass GetExclusionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.GetExclusionRequest").msgclass CreateExclusionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.CreateExclusionRequest").msgclass UpdateExclusionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.UpdateExclusionRequest").msgclass DeleteExclusionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.DeleteExclusionRequest").msgclass GetCmekSettingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.GetCmekSettingsRequest").msgclass UpdateCmekSettingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.UpdateCmekSettingsRequest").msgclass CmekSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.CmekSettings").msgclass GetSettingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.GetSettingsRequest").msgclass UpdateSettingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.UpdateSettingsRequest").msgclass Settings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.Settings").msgclass CopyLogEntriesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.CopyLogEntriesRequest").msgclass CopyLogEntriesMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.CopyLogEntriesMetadata").msgclass CopyLogEntriesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.CopyLogEntriesResponse").msgclass BucketMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.BucketMetadata").msgclass LinkMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.LinkMetadata").msgclass LocationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.LocationMetadata").msgclass OperationState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.OperationState").enummodule LifecycleState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.LifecycleState").enummodule IndexType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.IndexType").enummodule end end end end google-cloud-logging-v2-1.5.1/lib/google/logging/v2/logging_config_services_pb.rb0000644000004100000410000002763115143461113027772 0ustar www-datawww-data# Generated by the protocol buffer compiler. DO NOT EDIT! # Source: google/logging/v2/logging_config.proto for package 'Google.Cloud.Logging.V2' # Original file comments: # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # require 'grpc' require 'google/logging/v2/logging_config_pb' module Google module Cloud module Logging module V2 module ConfigServiceV2 # Service for configuring sinks used to route log entries. class Service include ::GRPC::GenericService self.marshal_class_method = :encode self.unmarshal_class_method = :decode self.service_name = 'google.logging.v2.ConfigServiceV2' # Lists log buckets. rpc :ListBuckets, ::Google::Cloud::Logging::V2::ListBucketsRequest, ::Google::Cloud::Logging::V2::ListBucketsResponse # Gets a log bucket. rpc :GetBucket, ::Google::Cloud::Logging::V2::GetBucketRequest, ::Google::Cloud::Logging::V2::LogBucket # 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. rpc :CreateBucketAsync, ::Google::Cloud::Logging::V2::CreateBucketRequest, ::Google::Longrunning::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. rpc :UpdateBucketAsync, ::Google::Cloud::Logging::V2::UpdateBucketRequest, ::Google::Longrunning::Operation # 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. rpc :CreateBucket, ::Google::Cloud::Logging::V2::CreateBucketRequest, ::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. rpc :UpdateBucket, ::Google::Cloud::Logging::V2::UpdateBucketRequest, ::Google::Cloud::Logging::V2::LogBucket # 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. rpc :DeleteBucket, ::Google::Cloud::Logging::V2::DeleteBucketRequest, ::Google::Protobuf::Empty # Undeletes a log bucket. A bucket that has been deleted can be undeleted # within the grace period of 7 days. rpc :UndeleteBucket, ::Google::Cloud::Logging::V2::UndeleteBucketRequest, ::Google::Protobuf::Empty # Lists views on a log bucket. rpc :ListViews, ::Google::Cloud::Logging::V2::ListViewsRequest, ::Google::Cloud::Logging::V2::ListViewsResponse # Gets a view on a log bucket.. rpc :GetView, ::Google::Cloud::Logging::V2::GetViewRequest, ::Google::Cloud::Logging::V2::LogView # Creates a view over log entries in a log bucket. A bucket may contain a # maximum of 30 views. rpc :CreateView, ::Google::Cloud::Logging::V2::CreateViewRequest, ::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. rpc :UpdateView, ::Google::Cloud::Logging::V2::UpdateViewRequest, ::Google::Cloud::Logging::V2::LogView # 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. rpc :DeleteView, ::Google::Cloud::Logging::V2::DeleteViewRequest, ::Google::Protobuf::Empty # Lists sinks. rpc :ListSinks, ::Google::Cloud::Logging::V2::ListSinksRequest, ::Google::Cloud::Logging::V2::ListSinksResponse # Gets a sink. rpc :GetSink, ::Google::Cloud::Logging::V2::GetSinkRequest, ::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. rpc :CreateSink, ::Google::Cloud::Logging::V2::CreateSinkRequest, ::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. rpc :UpdateSink, ::Google::Cloud::Logging::V2::UpdateSinkRequest, ::Google::Cloud::Logging::V2::LogSink # Deletes a sink. If the sink has a unique `writer_identity`, then that # service account is also deleted. rpc :DeleteSink, ::Google::Cloud::Logging::V2::DeleteSinkRequest, ::Google::Protobuf::Empty # 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. rpc :CreateLink, ::Google::Cloud::Logging::V2::CreateLinkRequest, ::Google::Longrunning::Operation # Deletes a link. This will also delete the corresponding BigQuery linked # dataset. rpc :DeleteLink, ::Google::Cloud::Logging::V2::DeleteLinkRequest, ::Google::Longrunning::Operation # Lists links. rpc :ListLinks, ::Google::Cloud::Logging::V2::ListLinksRequest, ::Google::Cloud::Logging::V2::ListLinksResponse # Gets a link. rpc :GetLink, ::Google::Cloud::Logging::V2::GetLinkRequest, ::Google::Cloud::Logging::V2::Link # Lists all the exclusions on the _Default sink in a parent resource. rpc :ListExclusions, ::Google::Cloud::Logging::V2::ListExclusionsRequest, ::Google::Cloud::Logging::V2::ListExclusionsResponse # Gets the description of an exclusion in the _Default sink. rpc :GetExclusion, ::Google::Cloud::Logging::V2::GetExclusionRequest, ::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. rpc :CreateExclusion, ::Google::Cloud::Logging::V2::CreateExclusionRequest, ::Google::Cloud::Logging::V2::LogExclusion # Changes one or more properties of an existing exclusion in the _Default # sink. rpc :UpdateExclusion, ::Google::Cloud::Logging::V2::UpdateExclusionRequest, ::Google::Cloud::Logging::V2::LogExclusion # Deletes an exclusion in the _Default sink. rpc :DeleteExclusion, ::Google::Cloud::Logging::V2::DeleteExclusionRequest, ::Google::Protobuf::Empty # 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](https://cloud.google.com/logging/docs/routing/managed-encryption) # for more information. rpc :GetCmekSettings, ::Google::Cloud::Logging::V2::GetCmekSettingsRequest, ::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][google.logging.v2.ConfigServiceV2.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](https://cloud.google.com/logging/docs/routing/managed-encryption) # for more information. rpc :UpdateCmekSettings, ::Google::Cloud::Logging::V2::UpdateCmekSettingsRequest, ::Google::Cloud::Logging::V2::CmekSettings # 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](https://cloud.google.com/logging/docs/routing/managed-encryption) # for more information. rpc :GetSettings, ::Google::Cloud::Logging::V2::GetSettingsRequest, ::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][google.logging.v2.ConfigServiceV2.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](https://cloud.google.com/logging/docs/routing/managed-encryption) # for more information. rpc :UpdateSettings, ::Google::Cloud::Logging::V2::UpdateSettingsRequest, ::Google::Cloud::Logging::V2::Settings # Copies a set of log entries from a log bucket to a Cloud Storage bucket. rpc :CopyLogEntries, ::Google::Cloud::Logging::V2::CopyLogEntriesRequest, ::Google::Longrunning::Operation end Stub = Service.rpc_stub_class end end end end end google-cloud-logging-v2-1.5.1/lib/google-cloud-logging-v2.rb0000644000004100000410000000150615143461113023524 0ustar www-datawww-data# frozen_string_literal: true # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Auto-generated by gapic-generator-ruby. DO NOT EDIT! # This gem does not autoload during Bundler.require. To load this gem, # issue explicit require statements for the packages desired, e.g.: # require "google/cloud/logging/v2" google-cloud-logging-v2-1.5.1/.yardopts0000644000004100000410000000027215143461113017745 0ustar www-datawww-data--no-private --title="Cloud Logging V2 API" --exclude _pb\.rb$ --markup markdown --markup-provider redcarpet ./lib/**/*.rb ./proto_docs/**/*.rb - README.md LICENSE.md AUTHENTICATION.md google-cloud-logging-v2-1.5.1/LICENSE.md0000644000004100000410000002636015143461113017511 0ustar www-datawww-data Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. google-cloud-logging-v2-1.5.1/README.md0000644000004100000410000001555015143461113017363 0ustar www-datawww-data# Ruby Client for the Cloud Logging V2 API Writes log entries and manages your Cloud Logging configuration. The Cloud Logging API lets you programmatically read and write log entries, set up exclusions, create logs-based metrics, and manage export sinks. https://github.com/googleapis/google-cloud-ruby This gem is a _versioned_ client. It provides basic client classes for a specific version of the Cloud Logging V2 API. Most users should consider using the main client gem, [google-cloud-logging](https://rubygems.org/gems/google-cloud-logging). See the section below titled *Which client should I use?* for more information. ## Installation ``` $ gem install google-cloud-logging-v2 ``` ## Before You Begin In order to use this library, you first need to go through the following steps: 1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project) 1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project) 1. [Enable the API.](https://console.cloud.google.com/apis/library/logging.googleapis.com) 1. {file:AUTHENTICATION.md Set up authentication.} ## Quick Start ```ruby require "google/cloud/logging/v2" client = ::Google::Cloud::Logging::V2::LoggingService::Client.new request = ::Google::Cloud::Logging::V2::DeleteLogRequest.new # (request fields as keyword arguments...) response = client.delete_log request ``` View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-logging-v2/latest) for class and method documentation. See also the [Product Documentation](https://cloud.google.com/logging) for general usage information. ## Debug Logging This library comes with opt-in Debug Logging that can help you troubleshoot your application's integration with the API. When logging is activated, key events such as requests and responses, along with data payloads and metadata such as headers and client configuration, are logged to the standard error stream. **WARNING:** Client Library Debug Logging includes your data payloads in plaintext, which could include sensitive data such as PII for yourself or your customers, private keys, or other security data that could be compromising if leaked. Always practice good data hygiene with your application logs, and follow the principle of least access. Google also recommends that Client Library Debug Logging be enabled only temporarily during active debugging, and not used permanently in production. To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` to the value `all`. Alternatively, you can set the value to a comma-delimited list of client library gem names. This will select the default logging behavior, which writes logs to the standard error stream. On a local workstation, this may result in logs appearing on the console. When running on a Google Cloud hosting service such as [Google Cloud Run](https://cloud.google.com/run), this generally results in logs appearing alongside your application logs in the [Google Cloud Logging](https://cloud.google.com/logging/) service. You can customize logging by modifying the `logger` configuration when constructing a client object. For example: ```ruby require "google/cloud/logging/v2" require "logger" client = ::Google::Cloud::Logging::V2::LoggingService::Client.new do |config| config.logger = Logger.new "my-app.log" end ``` ## Google Cloud Samples To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). ## Supported Ruby Versions This library is supported on Ruby 3.0+. Google provides official support for Ruby versions that are actively supported by Ruby Core—that is, Ruby versions that are either in normal maintenance or in security maintenance, and not end of life. Older versions of Ruby _may_ still work, but are unsupported and not recommended. See https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby support schedule. ## Which client should I use? Most modern Ruby client libraries for Google APIs come in two flavors: the main client library with a name such as `google-cloud-logging`, and lower-level _versioned_ client libraries with names such as `google-cloud-logging-v2`. _In most cases, you should install the main client._ ### What's the difference between the main client and a versioned client? A _versioned client_ provides a basic set of data types and client classes for a _single version_ of a specific service. (That is, for a service with multiple versions, there might be a separate versioned client for each service version.) Most versioned clients are written and maintained by a code generator. The _main client_ is designed to provide you with the _recommended_ client interfaces for the service. There will be only one main client for any given service, even a service with multiple versions. The main client includes factory methods for constructing the client objects we recommend for most users. In some cases, those will be classes provided by an underlying versioned client; in other cases, they will be handwritten higher-level client objects with additional capabilities, convenience methods, or best practices built in. Generally, the main client will default to a recommended service version, although in some cases you can override this if you need to talk to a specific service version. ### Why would I want to use the main client? We recommend that most users install the main client gem for a service. You can identify this gem as the one _without_ a version in its name, e.g. `google-cloud-logging`. The main client is recommended because it will embody the best practices for accessing the service, and may also provide more convenient interfaces or tighter integration into frameworks and third-party libraries. In addition, the documentation and samples published by Google will generally demonstrate use of the main client. ### Why would I want to use a versioned client? You can use a versioned client if you are content with a possibly lower-level class interface, you explicitly want to avoid features provided by the main client, or you want to access a specific service version not be covered by the main client. You can identify versioned client gems because the service version is part of the name, e.g. `google-cloud-logging-v2`. ### What about the google-apis- clients? Client library gems with names that begin with `google-apis-` are based on an older code generation technology. They talk to a REST/JSON backend (whereas most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may not offer the same performance, features, and ease of use provided by more modern clients. The `google-apis-` clients have wide coverage across Google services, so you might need to use one if there is no modern client available for the service. However, if a modern client is available, we generally recommend it over the older `google-apis-` clients. google-cloud-logging-v2-1.5.1/proto_docs/0000755000004100000410000000000015143461113020251 5ustar www-datawww-datagoogle-cloud-logging-v2-1.5.1/proto_docs/google/0000755000004100000410000000000015143461113021525 5ustar www-datawww-datagoogle-cloud-logging-v2-1.5.1/proto_docs/google/logging/0000755000004100000410000000000015143461113023153 5ustar www-datawww-datagoogle-cloud-logging-v2-1.5.1/proto_docs/google/logging/v2/0000755000004100000410000000000015143461113023502 5ustar www-datawww-datagoogle-cloud-logging-v2-1.5.1/proto_docs/google/logging/v2/logging.rb0000644000004100000410000005164715143461113025472 0ustar www-datawww-data# frozen_string_literal: true # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Auto-generated by gapic-generator-ruby. DO NOT EDIT! module Google module Cloud module Logging module V2 # The parameters to DeleteLog. # @!attribute [rw] log_name # @return [::String] # Required. The resource name of the log to delete: # # * `projects/[PROJECT_ID]/logs/[LOG_ID]` # * `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]` # * `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]` # * `folders/[FOLDER_ID]/logs/[LOG_ID]` # # `[LOG_ID]` must be URL-encoded. For example, # `"projects/my-project-id/logs/syslog"`, # `"organizations/123/logs/cloudaudit.googleapis.com%2Factivity"`. # # For more information about log names, see # {::Google::Cloud::Logging::V2::LogEntry LogEntry}. class DeleteLogRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # The parameters to WriteLogEntries. # @!attribute [rw] log_name # @return [::String] # Optional. A default log resource name that is assigned to all log entries # in `entries` that do not specify a value for `log_name`: # # * `projects/[PROJECT_ID]/logs/[LOG_ID]` # * `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]` # * `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]` # * `folders/[FOLDER_ID]/logs/[LOG_ID]` # # `[LOG_ID]` must be URL-encoded. For example: # # "projects/my-project-id/logs/syslog" # "organizations/123/logs/cloudaudit.googleapis.com%2Factivity" # # The permission `logging.logEntries.create` is needed on each project, # organization, billing account, or folder that is receiving new log # entries, whether the resource is specified in `logName` or in an # individual log entry. # @!attribute [rw] resource # @return [::Google::Api::MonitoredResource] # Optional. A default monitored resource object that is assigned to all log # entries in `entries` that do not specify a value for `resource`. Example: # # { "type": "gce_instance", # "labels": { # "zone": "us-central1-a", "instance_id": "00000000000000000000" }} # # See {::Google::Cloud::Logging::V2::LogEntry LogEntry}. # @!attribute [rw] labels # @return [::Google::Protobuf::Map{::String => ::String}] # Optional. Default labels that are added to the `labels` field of all log # entries in `entries`. If a log entry already has a label with the same key # as a label in this parameter, then the log entry's label is not changed. # See {::Google::Cloud::Logging::V2::LogEntry LogEntry}. # @!attribute [rw] entries # @return [::Array<::Google::Cloud::Logging::V2::LogEntry>] # Required. The log entries to send to Logging. The order of log # entries in this list does not matter. Values supplied in this method's # `log_name`, `resource`, and `labels` fields are copied into those log # entries in this list that do not include values for their corresponding # fields. For more information, see the # {::Google::Cloud::Logging::V2::LogEntry LogEntry} type. # # If the `timestamp` or `insert_id` fields are missing in log entries, then # this method supplies the current time or a unique identifier, respectively. # The supplied values are chosen so that, among the log entries that did not # supply their own values, the entries earlier in the list will sort before # the entries later in the list. See the `entries.list` method. # # Log entries with timestamps that are more than the # [logs retention period](https://cloud.google.com/logging/quotas) in # the past or more than 24 hours in the future will not be available when # calling `entries.list`. However, those log entries can still be [exported # with # LogSinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs). # # To improve throughput and to avoid exceeding the # [quota limit](https://cloud.google.com/logging/quotas) for calls to # `entries.write`, you should try to include several log entries in this # list, rather than calling this method for each individual log entry. # @!attribute [rw] partial_success # @return [::Boolean] # Optional. Whether a batch's valid entries should be written even if some # other entry failed due to a permanent error such as INVALID_ARGUMENT or # PERMISSION_DENIED. If any entry failed, then the response status is the # response status of one of the failed entries. The response will include # error details in `WriteLogEntriesPartialErrors.log_entry_errors` keyed by # the entries' zero-based index in the `entries`. Failed requests for which # no entries are written will not include per-entry errors. # @!attribute [rw] dry_run # @return [::Boolean] # Optional. If true, the request should expect normal response, but the # entries won't be persisted nor exported. Useful for checking whether the # logging API endpoints are working properly before sending valuable data. class WriteLogEntriesRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # @!attribute [rw] key # @return [::String] # @!attribute [rw] value # @return [::String] class LabelsEntry include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end end # Result returned from WriteLogEntries. class WriteLogEntriesResponse include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # Error details for WriteLogEntries with partial success. # @!attribute [rw] log_entry_errors # @return [::Google::Protobuf::Map{::Integer => ::Google::Rpc::Status}] # When `WriteLogEntriesRequest.partial_success` is true, records the error # status for entries that were not written due to a permanent error, keyed # by the entry's zero-based index in `WriteLogEntriesRequest.entries`. # # Failed requests for which no entries are written will not include # per-entry errors. class WriteLogEntriesPartialErrors include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # @!attribute [rw] key # @return [::Integer] # @!attribute [rw] value # @return [::Google::Rpc::Status] class LogEntryErrorsEntry include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end end # The parameters to `ListLogEntries`. # @!attribute [rw] resource_names # @return [::Array<::String>] # Required. Names of one or more parent resources from which to # retrieve log entries: # # * `projects/[PROJECT_ID]` # * `organizations/[ORGANIZATION_ID]` # * `billingAccounts/[BILLING_ACCOUNT_ID]` # * `folders/[FOLDER_ID]` # # May alternatively be one or more views: # # * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` # * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` # * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` # * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` # # Projects listed in the `project_ids` field are added to this list. # A maximum of 100 resources may be specified in a single request. # @!attribute [rw] filter # @return [::String] # Optional. Only log entries that match the filter are returned. An empty # filter matches all log entries in the resources listed in `resource_names`. # Referencing a parent resource that is not listed in `resource_names` will # cause the filter to return no results. The maximum length of a filter is # 20,000 characters. # @!attribute [rw] order_by # @return [::String] # Optional. How the results should be sorted. Presently, the only permitted # values are `"timestamp asc"` (default) and `"timestamp desc"`. The first # option returns entries in order of increasing values of # `LogEntry.timestamp` (oldest first), and the second option returns entries # in order of decreasing timestamps (newest first). Entries with equal # timestamps are returned in order of their `insert_id` values. # @!attribute [rw] page_size # @return [::Integer] # Optional. The maximum number of results to return from this request. # Default is 50. If the value is negative or exceeds 1000, the request is # rejected. The presence of `next_page_token` in the response indicates that # more results might be available. # @!attribute [rw] page_token # @return [::String] # Optional. If present, then retrieve the next batch of results from the # preceding call to this method. `page_token` must be the value of # `next_page_token` from the previous response. The values of other method # parameters should be identical to those in the previous call. class ListLogEntriesRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # Result returned from `ListLogEntries`. # @!attribute [rw] entries # @return [::Array<::Google::Cloud::Logging::V2::LogEntry>] # A list of log entries. If `entries` is empty, `nextPageToken` may still be # returned, indicating that more entries may exist. See `nextPageToken` for # more information. # @!attribute [rw] next_page_token # @return [::String] # If there might be more results than those appearing in this response, then # `nextPageToken` is included. To get the next set of results, call this # method again using the value of `nextPageToken` as `pageToken`. # # If a value for `next_page_token` appears and the `entries` field is empty, # it means that the search found no log entries so far but it did not have # time to search all the possible log entries. Retry the method with this # value for `page_token` to continue the search. Alternatively, consider # speeding up the search by changing your filter to specify a single log name # or resource type, or to narrow the time range of the search. class ListLogEntriesResponse include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # The parameters to ListMonitoredResourceDescriptors # @!attribute [rw] page_size # @return [::Integer] # Optional. The maximum number of results to return from this request. # Non-positive values are ignored. The presence of `nextPageToken` in the # response indicates that more results might be available. # @!attribute [rw] page_token # @return [::String] # Optional. If present, then retrieve the next batch of results from the # preceding call to this method. `pageToken` must be the value of # `nextPageToken` from the previous response. The values of other method # parameters should be identical to those in the previous call. class ListMonitoredResourceDescriptorsRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # Result returned from ListMonitoredResourceDescriptors. # @!attribute [rw] resource_descriptors # @return [::Array<::Google::Api::MonitoredResourceDescriptor>] # A list of resource descriptors. # @!attribute [rw] next_page_token # @return [::String] # If there might be more results than those appearing in this response, then # `nextPageToken` is included. To get the next set of results, call this # method again using the value of `nextPageToken` as `pageToken`. class ListMonitoredResourceDescriptorsResponse include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # The parameters to ListLogs. # @!attribute [rw] parent # @return [::String] # Required. The resource name to list logs for: # # * `projects/[PROJECT_ID]` # * `organizations/[ORGANIZATION_ID]` # * `billingAccounts/[BILLING_ACCOUNT_ID]` # * `folders/[FOLDER_ID]` # @!attribute [rw] resource_names # @return [::Array<::String>] # Optional. List of resource names to list logs for: # # * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` # * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` # * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` # * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` # # To support legacy queries, it could also be: # # * `projects/[PROJECT_ID]` # * `organizations/[ORGANIZATION_ID]` # * `billingAccounts/[BILLING_ACCOUNT_ID]` # * `folders/[FOLDER_ID]` # # The resource name in the `parent` field is added to this list. # @!attribute [rw] page_size # @return [::Integer] # Optional. The maximum number of results to return from this request. # Non-positive values are ignored. The presence of `nextPageToken` in the # response indicates that more results might be available. # @!attribute [rw] page_token # @return [::String] # Optional. If present, then retrieve the next batch of results from the # preceding call to this method. `pageToken` must be the value of # `nextPageToken` from the previous response. The values of other method # parameters should be identical to those in the previous call. class ListLogsRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # Result returned from ListLogs. # @!attribute [rw] log_names # @return [::Array<::String>] # A list of log names. For example, # `"projects/my-project/logs/syslog"` or # `"organizations/123/logs/cloudresourcemanager.googleapis.com%2Factivity"`. # @!attribute [rw] next_page_token # @return [::String] # If there might be more results than those appearing in this response, then # `nextPageToken` is included. To get the next set of results, call this # method again using the value of `nextPageToken` as `pageToken`. class ListLogsResponse include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # The parameters to `TailLogEntries`. # @!attribute [rw] resource_names # @return [::Array<::String>] # Required. Name of a parent resource from which to retrieve log entries: # # * `projects/[PROJECT_ID]` # * `organizations/[ORGANIZATION_ID]` # * `billingAccounts/[BILLING_ACCOUNT_ID]` # * `folders/[FOLDER_ID]` # # May alternatively be one or more views: # # * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` # * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` # * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` # * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` # @!attribute [rw] filter # @return [::String] # Optional. Only log entries that match the filter are returned. An empty # filter matches all log entries in the resources listed in `resource_names`. # Referencing a parent resource that is not listed in `resource_names` will # cause the filter to return no results. The maximum length of a filter is # 20,000 characters. # @!attribute [rw] buffer_window # @return [::Google::Protobuf::Duration] # Optional. The amount of time to buffer log entries at the server before # being returned to prevent out of order results due to late arriving log # entries. Valid values are between 0-60000 milliseconds. Defaults to 2000 # milliseconds. class TailLogEntriesRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # Result returned from `TailLogEntries`. # @!attribute [rw] entries # @return [::Array<::Google::Cloud::Logging::V2::LogEntry>] # A list of log entries. Each response in the stream will order entries with # increasing values of `LogEntry.timestamp`. Ordering is not guaranteed # between separate responses. # @!attribute [rw] suppression_info # @return [::Array<::Google::Cloud::Logging::V2::TailLogEntriesResponse::SuppressionInfo>] # If entries that otherwise would have been included in the session were not # sent back to the client, counts of relevant entries omitted from the # session with the reason that they were not included. There will be at most # one of each reason per response. The counts represent the number of # suppressed entries since the last streamed response. class TailLogEntriesResponse include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # Information about entries that were omitted from the session. # @!attribute [rw] reason # @return [::Google::Cloud::Logging::V2::TailLogEntriesResponse::SuppressionInfo::Reason] # The reason that entries were omitted from the session. # @!attribute [rw] suppressed_count # @return [::Integer] # A lower bound on the count of entries omitted due to `reason`. class SuppressionInfo include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # An indicator of why entries were omitted. module Reason # Unexpected default. REASON_UNSPECIFIED = 0 # Indicates suppression occurred due to relevant entries being # received in excess of rate limits. For quotas and limits, see # [Logging API quotas and # limits](https://cloud.google.com/logging/quotas#api-limits). RATE_LIMIT = 1 # Indicates suppression occurred due to the client not consuming # responses quickly enough. NOT_CONSUMED = 2 end end end end end end end google-cloud-logging-v2-1.5.1/proto_docs/google/logging/v2/log_entry.rb0000644000004100000410000003537315143461113026044 0ustar www-datawww-data# frozen_string_literal: true # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Auto-generated by gapic-generator-ruby. DO NOT EDIT! module Google module Cloud module Logging module V2 # An individual entry in a log. # @!attribute [rw] log_name # @return [::String] # Required. The resource name of the log to which this log entry belongs: # # "projects/[PROJECT_ID]/logs/[LOG_ID]" # "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" # "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" # "folders/[FOLDER_ID]/logs/[LOG_ID]" # # A project number may be used in place of PROJECT_ID. The project number is # translated to its corresponding PROJECT_ID internally and the `log_name` # field will contain PROJECT_ID in queries and exports. # # `[LOG_ID]` must be URL-encoded within `log_name`. Example: # `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`. # # `[LOG_ID]` must be less than 512 characters long and can only include the # following characters: upper and lower case alphanumeric characters, # forward-slash, underscore, hyphen, and period. # # For backward compatibility, if `log_name` begins with a forward-slash, such # as `/projects/...`, then the log entry is ingested as usual, but the # forward-slash is removed. Listing the log entry will not show the leading # slash and filtering for a log name with a leading slash will never return # any results. # @!attribute [rw] resource # @return [::Google::Api::MonitoredResource] # Required. The monitored resource that produced this log entry. # # Example: a log entry that reports a database error would be associated with # the monitored resource designating the particular database that reported # the error. # @!attribute [rw] proto_payload # @return [::Google::Protobuf::Any] # The log entry payload, represented as a protocol buffer. Some Google # Cloud Platform services use this field for their log entry payloads. # # The following protocol buffer types are supported; user-defined types # are not supported: # # "type.googleapis.com/google.cloud.audit.AuditLog" # "type.googleapis.com/google.appengine.logging.v1.RequestLog" # # Note: The following fields are mutually exclusive: `proto_payload`, `text_payload`, `json_payload`. If a field in that set is populated, all other fields in the set will automatically be cleared. # @!attribute [rw] text_payload # @return [::String] # The log entry payload, represented as a Unicode string (UTF-8). # # Note: The following fields are mutually exclusive: `text_payload`, `proto_payload`, `json_payload`. If a field in that set is populated, all other fields in the set will automatically be cleared. # @!attribute [rw] json_payload # @return [::Google::Protobuf::Struct] # The log entry payload, represented as a structure that is # expressed as a JSON object. # # Note: The following fields are mutually exclusive: `json_payload`, `proto_payload`, `text_payload`. If a field in that set is populated, all other fields in the set will automatically be cleared. # @!attribute [rw] timestamp # @return [::Google::Protobuf::Timestamp] # Optional. The time the event described by the log entry occurred. This time # is used to compute the log entry's age and to enforce the logs retention # period. If this field is omitted in a new log entry, then Logging assigns # it the current time. Timestamps have nanosecond accuracy, but trailing # zeros in the fractional seconds might be omitted when the timestamp is # displayed. # # Incoming log entries must have timestamps that don't exceed the # [logs retention # period](https://cloud.google.com/logging/quotas#logs_retention_periods) in # the past, and that don't exceed 24 hours in the future. Log entries outside # those time boundaries aren't ingested by Logging. # @!attribute [r] receive_timestamp # @return [::Google::Protobuf::Timestamp] # Output only. The time the log entry was received by Logging. # @!attribute [rw] severity # @return [::Google::Cloud::Logging::Type::LogSeverity] # Optional. The severity of the log entry. The default value is # `LogSeverity.DEFAULT`. # @!attribute [rw] insert_id # @return [::String] # Optional. A unique identifier for the log entry. If you provide a value, # then Logging considers other log entries in the same project, with the same # `timestamp`, and with the same `insert_id` to be duplicates which are # removed in a single query result. However, there are no guarantees of # de-duplication in the export of logs. # # If the `insert_id` is omitted when writing a log entry, the Logging API # assigns its own unique identifier in this field. # # In queries, the `insert_id` is also used to order log entries that have # the same `log_name` and `timestamp` values. # @!attribute [rw] http_request # @return [::Google::Cloud::Logging::Type::HttpRequest] # Optional. Information about the HTTP request associated with this log # entry, if applicable. # @!attribute [rw] labels # @return [::Google::Protobuf::Map{::String => ::String}] # Optional. A map of key, value pairs that provides additional information # about the log entry. The labels can be user-defined or system-defined. # # User-defined labels are arbitrary key, value pairs that you can use to # classify logs. # # System-defined labels are defined by GCP services for platform logs. # They have two components - a service namespace component and the # attribute name. For example: `compute.googleapis.com/resource_name`. # # Cloud Logging truncates label keys that exceed 512 B and label # values that exceed 64 KB upon their associated log entry being # written. The truncation is indicated by an ellipsis at the # end of the character string. # @!attribute [rw] operation # @return [::Google::Cloud::Logging::V2::LogEntryOperation] # Optional. Information about an operation associated with the log entry, if # applicable. # @!attribute [rw] trace # @return [::String] # Optional. The REST resource name of the trace being written to # [Cloud Trace](https://cloud.google.com/trace) in # association with this log entry. For example, if your trace data is stored # in the Cloud project "my-trace-project" and if the service that is creating # the log entry receives a trace header that includes the trace ID "12345", # then the service should use "projects/my-tracing-project/traces/12345". # # The `trace` field provides the link between logs and traces. By using # this field, you can navigate from a log entry to a trace. # @!attribute [rw] span_id # @return [::String] # Optional. The ID of the [Cloud Trace](https://cloud.google.com/trace) span # associated with the current operation in which the log is being written. # For example, if a span has the REST resource name of # "projects/some-project/traces/some-trace/spans/some-span-id", then the # `span_id` field is "some-span-id". # # A # [Span](https://cloud.google.com/trace/docs/reference/v2/rest/v2/projects.traces/batchWrite#Span) # represents a single operation within a trace. Whereas a trace may involve # multiple different microservices running on multiple different machines, # a span generally corresponds to a single logical operation being performed # in a single instance of a microservice on one specific machine. Spans # are the nodes within the tree that is a trace. # # Applications that are [instrumented for # tracing](https://cloud.google.com/trace/docs/setup) will generally assign a # new, unique span ID on each incoming request. It is also common to create # and record additional spans corresponding to internal processing elements # as well as issuing requests to dependencies. # # The span ID is expected to be a 16-character, hexadecimal encoding of an # 8-byte array and should not be zero. It should be unique within the trace # and should, ideally, be generated in a manner that is uniformly random. # # Example values: # # - `000000000000004a` # - `7a2190356c3fc94b` # - `0000f00300090021` # - `d39223e101960076` # @!attribute [rw] trace_sampled # @return [::Boolean] # Optional. The sampling decision of the trace associated with the log entry. # # True means that the trace resource name in the `trace` field was sampled # for storage in a trace backend. False means that the trace was not sampled # for storage when this log entry was written, or the sampling decision was # unknown at the time. A non-sampled `trace` value is still useful as a # request correlation identifier. The default is False. # @!attribute [rw] source_location # @return [::Google::Cloud::Logging::V2::LogEntrySourceLocation] # Optional. Source code location information associated with the log entry, # if any. # @!attribute [rw] split # @return [::Google::Cloud::Logging::V2::LogSplit] # Optional. Information indicating this LogEntry is part of a sequence of # multiple log entries split from a single LogEntry. class LogEntry include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # @!attribute [rw] key # @return [::String] # @!attribute [rw] value # @return [::String] class LabelsEntry include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end end # Additional information about a potentially long-running operation with which # a log entry is associated. # @!attribute [rw] id # @return [::String] # Optional. An arbitrary operation identifier. Log entries with the same # identifier are assumed to be part of the same operation. # @!attribute [rw] producer # @return [::String] # Optional. An arbitrary producer identifier. The combination of `id` and # `producer` must be globally unique. Examples for `producer`: # `"MyDivision.MyBigCompany.com"`, `"github.com/MyProject/MyApplication"`. # @!attribute [rw] first # @return [::Boolean] # Optional. Set this to True if this is the first log entry in the operation. # @!attribute [rw] last # @return [::Boolean] # Optional. Set this to True if this is the last log entry in the operation. class LogEntryOperation include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # Additional information about the source code location that produced the log # entry. # @!attribute [rw] file # @return [::String] # Optional. Source file name. Depending on the runtime environment, this # might be a simple name or a fully-qualified name. # @!attribute [rw] line # @return [::Integer] # Optional. Line within the source file. 1-based; 0 indicates no line number # available. # @!attribute [rw] function # @return [::String] # Optional. Human-readable name of the function or method being invoked, with # optional context such as the class or package name. This information may be # used in contexts such as the logs viewer, where a file and line number are # less meaningful. The format can vary by language. For example: # `qual.if.ied.Class.method` (Java), `dir/package.func` (Go), `function` # (Python). class LogEntrySourceLocation include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # Additional information used to correlate multiple log entries. Used when a # single LogEntry would exceed the Google Cloud Logging size limit and is # split across multiple log entries. # @!attribute [rw] uid # @return [::String] # A globally unique identifier for all log entries in a sequence of split log # entries. All log entries with the same |LogSplit.uid| are assumed to be # part of the same sequence of split log entries. # @!attribute [rw] index # @return [::Integer] # The index of this LogEntry in the sequence of split log entries. Log # entries are given |index| values 0, 1, ..., n-1 for a sequence of n log # entries. # @!attribute [rw] total_splits # @return [::Integer] # The total number of log entries that the original LogEntry was split into. class LogSplit include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end end end end end google-cloud-logging-v2-1.5.1/proto_docs/google/logging/v2/logging_config.rb0000644000004100000410000021641415143461113027012 0ustar www-datawww-data# frozen_string_literal: true # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Auto-generated by gapic-generator-ruby. DO NOT EDIT! module Google module Cloud module Logging module V2 # Configuration for an indexed field. # @!attribute [rw] field_path # @return [::String] # Required. The LogEntry field path to index. # # Note that some paths are automatically indexed, and other paths are not # eligible for indexing. See [indexing documentation]( # https://cloud.google.com/logging/docs/view/advanced-queries#indexed-fields) # for details. # # For example: `jsonPayload.request.status` # @!attribute [rw] type # @return [::Google::Cloud::Logging::V2::IndexType] # Required. The type of data in this index. # @!attribute [r] create_time # @return [::Google::Protobuf::Timestamp] # Output only. The timestamp when the index was last modified. # # This is used to return the timestamp, and will be ignored if supplied # during update. class IndexConfig include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # Describes a repository in which log entries are stored. # @!attribute [r] name # @return [::String] # Output only. The resource name of the bucket. # # For example: # # `projects/my-project/locations/global/buckets/my-bucket` # # For a list of supported locations, see [Supported # Regions](https://cloud.google.com/logging/docs/region-support) # # For the location of `global` it is unspecified where log entries are # actually stored. # # After a bucket has been created, the location cannot be changed. # @!attribute [rw] description # @return [::String] # Describes this bucket. # @!attribute [r] create_time # @return [::Google::Protobuf::Timestamp] # Output only. The creation timestamp of the bucket. This is not set for any # of the default buckets. # @!attribute [r] update_time # @return [::Google::Protobuf::Timestamp] # Output only. The last update timestamp of the bucket. # @!attribute [rw] retention_days # @return [::Integer] # Logs will be retained by default for this amount of time, after which they # will automatically be deleted. The minimum retention period is 1 day. If # this value is set to zero at bucket creation time, the default time of 30 # days will be used. # @!attribute [rw] locked # @return [::Boolean] # Whether the bucket is locked. # # The retention period on a locked bucket cannot be changed. Locked buckets # may only be deleted if they are empty. # @!attribute [r] lifecycle_state # @return [::Google::Cloud::Logging::V2::LifecycleState] # Output only. The bucket lifecycle state. # @!attribute [rw] analytics_enabled # @return [::Boolean] # Whether log analytics is enabled for this bucket. # # Once enabled, log analytics features cannot be disabled. # @!attribute [rw] restricted_fields # @return [::Array<::String>] # Log entry field paths that are denied access in this bucket. # # The following fields and their children are eligible: `textPayload`, # `jsonPayload`, `protoPayload`, `httpRequest`, `labels`, `sourceLocation`. # # Restricting a repeated field will restrict all values. Adding a parent will # block all child fields. (e.g. `foo.bar` will block `foo.bar.baz`) # @!attribute [rw] index_configs # @return [::Array<::Google::Cloud::Logging::V2::IndexConfig>] # A list of indexed fields and related configuration data. # @!attribute [rw] cmek_settings # @return [::Google::Cloud::Logging::V2::CmekSettings] # The CMEK settings of the log bucket. If present, new log entries written to # this log bucket are encrypted using the CMEK key provided in this # configuration. If a log bucket has CMEK settings, the CMEK settings cannot # be disabled later by updating the log bucket. Changing the KMS key is # allowed. class LogBucket include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # Describes a view over log entries in a bucket. # @!attribute [rw] name # @return [::String] # The resource name of the view. # # For example: # # `projects/my-project/locations/global/buckets/my-bucket/views/my-view` # @!attribute [rw] description # @return [::String] # Describes this view. # @!attribute [r] create_time # @return [::Google::Protobuf::Timestamp] # Output only. The creation timestamp of the view. # @!attribute [r] update_time # @return [::Google::Protobuf::Timestamp] # Output only. The last update timestamp of the view. # @!attribute [rw] filter # @return [::String] # Filter that restricts which log entries in a bucket are visible in this # view. # # Filters are restricted to be a logical AND of ==/!= of any of the # following: # # - originating project/folder/organization/billing account. # - resource type # - log id # # For example: # # SOURCE("projects/myproject") AND resource.type = "gce_instance" # AND LOG_ID("stdout") class LogView include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # Describes a sink used to export log entries to one of the following # destinations in any project: a Cloud Storage bucket, a BigQuery dataset, a # Pub/Sub topic or a Cloud Logging log bucket. A logs filter controls which log # entries are exported. The sink must be created within a project, # organization, billing account, or folder. # @!attribute [rw] name # @return [::String] # Required. The client-assigned sink identifier, unique within the project. # # For example: `"my-syslog-errors-to-pubsub"`. Sink identifiers are limited # to 100 characters and can include only the following characters: upper and # lower-case alphanumeric characters, underscores, hyphens, and periods. # First character has to be alphanumeric. # @!attribute [rw] destination # @return [::String] # Required. The export destination: # # "storage.googleapis.com/[GCS_BUCKET]" # "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]" # "pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]" # # The sink's `writer_identity`, set when the sink is created, must have # permission to write to the destination or else the log entries are not # exported. For more information, see # [Exporting Logs with # Sinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs). # @!attribute [rw] filter # @return [::String] # Optional. An [advanced logs # filter](https://cloud.google.com/logging/docs/view/advanced-queries). The # only exported log entries are those that are in the resource owning the # sink and that match the filter. # # For example: # # `logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR` # @!attribute [rw] description # @return [::String] # Optional. A description of this sink. # # The maximum length of the description is 8000 characters. # @!attribute [rw] disabled # @return [::Boolean] # Optional. If set to true, then this sink is disabled and it does not export # any log entries. # @!attribute [rw] exclusions # @return [::Array<::Google::Cloud::Logging::V2::LogExclusion>] # Optional. Log entries that match any of these exclusion filters will not be # exported. # # If a log entry is matched by both `filter` and one of `exclusion_filters` # it will not be exported. # @!attribute [rw] output_version_format # @deprecated This field is deprecated and may be removed in the next major version update. # @return [::Google::Cloud::Logging::V2::LogSink::VersionFormat] # Deprecated. This field is unused. # @!attribute [r] writer_identity # @return [::String] # Output only. An IAM identity—a service account or group—under # which Cloud Logging writes the exported log entries to the sink's # destination. This field is either set by specifying # `custom_writer_identity` or set automatically by # {::Google::Cloud::Logging::V2::ConfigService::Client#create_sink sinks.create} and # {::Google::Cloud::Logging::V2::ConfigService::Client#update_sink sinks.update} based on the # value of `unique_writer_identity` in those methods. # # Until you grant this identity write-access to the destination, log entry # exports from this sink will fail. For more information, see [Granting # Access for a # Resource](https://cloud.google.com/iam/docs/granting-roles-to-service-accounts#granting_access_to_a_service_account_for_a_resource). # Consult the destination service's documentation to determine the # appropriate IAM roles to assign to the identity. # # Sinks that have a destination that is a log bucket in the same project as # the sink cannot have a writer_identity and no additional permissions are # required. # @!attribute [rw] include_children # @return [::Boolean] # Optional. This field applies only to sinks owned by organizations and # folders. If the field is false, the default, only the logs owned by the # sink's parent resource are available for export. If the field is true, then # log entries from all the projects, folders, and billing accounts contained # in the sink's parent resource are also available for export. Whether a # particular log entry from the children is exported depends on the sink's # filter expression. # # For example, if this field is true, then the filter # `resource.type=gce_instance` would export all Compute Engine VM instance # log entries from all projects in the sink's parent. # # To only export entries from certain child projects, filter on the project # part of the log name: # # logName:("projects/test-project1/" OR "projects/test-project2/") AND # resource.type=gce_instance # @!attribute [rw] bigquery_options # @return [::Google::Cloud::Logging::V2::BigQueryOptions] # Optional. Options that affect sinks exporting data to BigQuery. # @!attribute [r] create_time # @return [::Google::Protobuf::Timestamp] # Output only. The creation timestamp of the sink. # # This field may not be present for older sinks. # @!attribute [r] update_time # @return [::Google::Protobuf::Timestamp] # Output only. The last update timestamp of the sink. # # This field may not be present for older sinks. class LogSink include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # Deprecated. This is unused. module VersionFormat # An unspecified format version that will default to V2. VERSION_FORMAT_UNSPECIFIED = 0 # `LogEntry` version 2 format. V2 = 1 # `LogEntry` version 1 format. V1 = 2 end end # Describes a BigQuery dataset that was created by a link. # @!attribute [r] dataset_id # @return [::String] # Output only. The full resource name of the BigQuery dataset. The DATASET_ID # will match the ID of the link, so the link must match the naming # restrictions of BigQuery datasets (alphanumeric characters and underscores # only). # # The dataset will have a resource path of # "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET_ID]" class BigQueryDataset include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # Describes a link connected to an analytics enabled bucket. # @!attribute [rw] name # @return [::String] # The resource name of the link. The name can have up to 100 characters. # A valid link id (at the end of the link name) must only have alphanumeric # characters and underscores within it. # # "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]" # # For example: # # `projects/my-project/locations/global/buckets/my-bucket/links/my_link # @!attribute [rw] description # @return [::String] # Describes this link. # # The maximum length of the description is 8000 characters. # @!attribute [r] create_time # @return [::Google::Protobuf::Timestamp] # Output only. The creation timestamp of the link. # @!attribute [r] lifecycle_state # @return [::Google::Cloud::Logging::V2::LifecycleState] # Output only. The resource lifecycle state. # @!attribute [rw] bigquery_dataset # @return [::Google::Cloud::Logging::V2::BigQueryDataset] # The information of a BigQuery Dataset. When a link is created, a BigQuery # dataset is created along with it, in the same project as the LogBucket it's # linked to. This dataset will also have BigQuery Views corresponding to the # LogViews in the bucket. class Link include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # Options that change functionality of a sink exporting data to BigQuery. # @!attribute [rw] use_partitioned_tables # @return [::Boolean] # Optional. Whether to use [BigQuery's partition # tables](https://cloud.google.com/bigquery/docs/partitioned-tables). By # default, Cloud Logging creates dated tables based on the log entries' # timestamps, e.g. syslog_20170523. With partitioned tables the date suffix # is no longer present and [special query # syntax](https://cloud.google.com/bigquery/docs/querying-partitioned-tables) # has to be used instead. In both cases, tables are sharded based on UTC # timezone. # @!attribute [r] uses_timestamp_column_partitioning # @return [::Boolean] # Output only. True if new timestamp column based partitioning is in use, # false if legacy ingestion-time partitioning is in use. # # All new sinks will have this field set true and will use timestamp column # based partitioning. If use_partitioned_tables is false, this value has no # meaning and will be false. Legacy sinks using partitioned tables will have # this field set to false. class BigQueryOptions include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # The parameters to `ListBuckets`. # @!attribute [rw] parent # @return [::String] # Required. The parent resource whose buckets are to be listed: # # "projects/[PROJECT_ID]/locations/[LOCATION_ID]" # "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" # "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" # "folders/[FOLDER_ID]/locations/[LOCATION_ID]" # # Note: The locations portion of the resource must be specified, but # supplying the character `-` in place of [LOCATION_ID] will return all # buckets. # @!attribute [rw] page_token # @return [::String] # Optional. If present, then retrieve the next batch of results from the # preceding call to this method. `pageToken` must be the value of # `nextPageToken` from the previous response. The values of other method # parameters should be identical to those in the previous call. # @!attribute [rw] page_size # @return [::Integer] # Optional. The maximum number of results to return from this request. # Non-positive values are ignored. The presence of `nextPageToken` in the # response indicates that more results might be available. class ListBucketsRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # The response from ListBuckets. # @!attribute [rw] buckets # @return [::Array<::Google::Cloud::Logging::V2::LogBucket>] # A list of buckets. # @!attribute [rw] next_page_token # @return [::String] # If there might be more results than appear in this response, then # `nextPageToken` is included. To get the next set of results, call the same # method again using the value of `nextPageToken` as `pageToken`. class ListBucketsResponse include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # The parameters to `CreateBucket`. # @!attribute [rw] parent # @return [::String] # Required. The resource in which to create the log bucket: # # "projects/[PROJECT_ID]/locations/[LOCATION_ID]" # # For example: # # `"projects/my-project/locations/global"` # @!attribute [rw] bucket_id # @return [::String] # Required. A client-assigned identifier such as `"my-bucket"`. Identifiers # are limited to 100 characters and can include only letters, digits, # underscores, hyphens, and periods. # @!attribute [rw] bucket # @return [::Google::Cloud::Logging::V2::LogBucket] # 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. class CreateBucketRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # The parameters to `UpdateBucket`. # @!attribute [rw] name # @return [::String] # Required. The full resource name of the bucket to update. # # "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" # "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" # "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" # "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" # # For example: # # `"projects/my-project/locations/global/buckets/my-bucket"` # @!attribute [rw] bucket # @return [::Google::Cloud::Logging::V2::LogBucket] # Required. The updated bucket. # @!attribute [rw] update_mask # @return [::Google::Protobuf::FieldMask] # 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` class UpdateBucketRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # The parameters to `GetBucket`. # @!attribute [rw] name # @return [::String] # Required. The resource name of the bucket: # # "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" # "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" # "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" # "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" # # For example: # # `"projects/my-project/locations/global/buckets/my-bucket"` class GetBucketRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # The parameters to `DeleteBucket`. # @!attribute [rw] name # @return [::String] # Required. The full resource name of the bucket to delete. # # "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" # "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" # "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" # "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" # # For example: # # `"projects/my-project/locations/global/buckets/my-bucket"` class DeleteBucketRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # The parameters to `UndeleteBucket`. # @!attribute [rw] name # @return [::String] # Required. The full resource name of the bucket to undelete. # # "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" # "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" # "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" # "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" # # For example: # # `"projects/my-project/locations/global/buckets/my-bucket"` class UndeleteBucketRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # The parameters to `ListViews`. # @!attribute [rw] parent # @return [::String] # Required. The bucket whose views are to be listed: # # "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" # @!attribute [rw] page_token # @return [::String] # Optional. If present, then retrieve the next batch of results from the # preceding call to this method. `pageToken` must be the value of # `nextPageToken` from the previous response. The values of other method # parameters should be identical to those in the previous call. # @!attribute [rw] page_size # @return [::Integer] # Optional. The maximum number of results to return from this request. # # Non-positive values are ignored. The presence of `nextPageToken` in the # response indicates that more results might be available. class ListViewsRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # The response from ListViews. # @!attribute [rw] views # @return [::Array<::Google::Cloud::Logging::V2::LogView>] # A list of views. # @!attribute [rw] next_page_token # @return [::String] # If there might be more results than appear in this response, then # `nextPageToken` is included. To get the next set of results, call the same # method again using the value of `nextPageToken` as `pageToken`. class ListViewsResponse include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # The parameters to `CreateView`. # @!attribute [rw] parent # @return [::String] # Required. The bucket in which to create the view # # `"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"` # # For example: # # `"projects/my-project/locations/global/buckets/my-bucket"` # @!attribute [rw] view_id # @return [::String] # 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. # @!attribute [rw] view # @return [::Google::Cloud::Logging::V2::LogView] # Required. The new view. class CreateViewRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # The parameters to `UpdateView`. # @!attribute [rw] name # @return [::String] # Required. The full resource name of the view to update # # "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"` # @!attribute [rw] view # @return [::Google::Cloud::Logging::V2::LogView] # Required. The updated view. # @!attribute [rw] update_mask # @return [::Google::Protobuf::FieldMask] # Optional. Field mask that specifies the fields in `view` that need # an update. A field will be overwritten if, and only if, it is # in the update mask. `name` and output only fields cannot be updated. # # For a detailed `FieldMask` definition, see # https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask # # For example: `updateMask=filter` class UpdateViewRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # The parameters to `GetView`. # @!attribute [rw] name # @return [::String] # Required. The resource name of the policy: # # "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" # # For example: # # `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"` class GetViewRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # The parameters to `DeleteView`. # @!attribute [rw] name # @return [::String] # Required. The full resource name of the view to delete: # # "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" # # For example: # # `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"` class DeleteViewRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # The parameters to `ListSinks`. # @!attribute [rw] parent # @return [::String] # Required. The parent resource whose sinks are to be listed: # # "projects/[PROJECT_ID]" # "organizations/[ORGANIZATION_ID]" # "billingAccounts/[BILLING_ACCOUNT_ID]" # "folders/[FOLDER_ID]" # @!attribute [rw] page_token # @return [::String] # Optional. If present, then retrieve the next batch of results from the # preceding call to this method. `pageToken` must be the value of # `nextPageToken` from the previous response. The values of other method # parameters should be identical to those in the previous call. # @!attribute [rw] page_size # @return [::Integer] # Optional. The maximum number of results to return from this request. # Non-positive values are ignored. The presence of `nextPageToken` in the # response indicates that more results might be available. class ListSinksRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # Result returned from `ListSinks`. # @!attribute [rw] sinks # @return [::Array<::Google::Cloud::Logging::V2::LogSink>] # A list of sinks. # @!attribute [rw] next_page_token # @return [::String] # If there might be more results than appear in this response, then # `nextPageToken` is included. To get the next set of results, call the same # method again using the value of `nextPageToken` as `pageToken`. class ListSinksResponse include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # The parameters to `GetSink`. # @!attribute [rw] sink_name # @return [::String] # Required. The resource name of the sink: # # "projects/[PROJECT_ID]/sinks/[SINK_ID]" # "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" # "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" # "folders/[FOLDER_ID]/sinks/[SINK_ID]" # # For example: # # `"projects/my-project/sinks/my-sink"` class GetSinkRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # The parameters to `CreateSink`. # @!attribute [rw] parent # @return [::String] # Required. The resource in which to create the sink: # # "projects/[PROJECT_ID]" # "organizations/[ORGANIZATION_ID]" # "billingAccounts/[BILLING_ACCOUNT_ID]" # "folders/[FOLDER_ID]" # # For examples: # # `"projects/my-project"` # `"organizations/123456789"` # @!attribute [rw] sink # @return [::Google::Cloud::Logging::V2::LogSink] # Required. The new sink, whose `name` parameter is a sink identifier that # is not already in use. # @!attribute [rw] unique_writer_identity # @return [::Boolean] # Optional. Determines the kind of IAM identity returned as `writer_identity` # in the new sink. If this value is omitted or set to false, and if the # sink's parent is a project, then the value returned as `writer_identity` is # the same group or service account used by Cloud Logging before the addition # of writer identities to this API. The sink's destination must be in the # same project as the sink itself. # # If this field is set to true, or if the sink is owned by a non-project # resource such as an organization, then the value of `writer_identity` will # be a unique service account used only for exports from the new sink. For # more information, see `writer_identity` in # {::Google::Cloud::Logging::V2::LogSink LogSink}. class CreateSinkRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # The parameters to `UpdateSink`. # @!attribute [rw] sink_name # @return [::String] # Required. The full resource name of the sink to update, including the # parent resource and the sink identifier: # # "projects/[PROJECT_ID]/sinks/[SINK_ID]" # "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" # "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" # "folders/[FOLDER_ID]/sinks/[SINK_ID]" # # For example: # # `"projects/my-project/sinks/my-sink"` # @!attribute [rw] sink # @return [::Google::Cloud::Logging::V2::LogSink] # Required. The updated sink, whose name is the same identifier that appears # as part of `sink_name`. # @!attribute [rw] unique_writer_identity # @return [::Boolean] # Optional. See {::Google::Cloud::Logging::V2::ConfigService::Client#create_sink sinks.create} # for a description of this field. When updating a sink, the effect of this # field on the value of `writer_identity` in the updated sink depends on both # the old and new values of this field: # # + If the old and new values of this field are both false or both true, # then there is no change to the sink's `writer_identity`. # + If the old value is false and the new value is true, then # `writer_identity` is changed to a unique service account. # + It is an error if the old value is true and the new value is # set to false or defaulted to false. # @!attribute [rw] update_mask # @return [::Google::Protobuf::FieldMask] # 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` class UpdateSinkRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # The parameters to `DeleteSink`. # @!attribute [rw] sink_name # @return [::String] # Required. The full resource name of the sink to delete, including the # parent resource and the sink identifier: # # "projects/[PROJECT_ID]/sinks/[SINK_ID]" # "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" # "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" # "folders/[FOLDER_ID]/sinks/[SINK_ID]" # # For example: # # `"projects/my-project/sinks/my-sink"` class DeleteSinkRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # The parameters to CreateLink. # @!attribute [rw] parent # @return [::String] # 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]" # @!attribute [rw] link # @return [::Google::Cloud::Logging::V2::Link] # Required. The new link. # @!attribute [rw] link_id # @return [::String] # 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. class CreateLinkRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # The parameters to DeleteLink. # @!attribute [rw] name # @return [::String] # 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]" class DeleteLinkRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # The parameters to ListLinks. # @!attribute [rw] parent # @return [::String] # 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]/ # @!attribute [rw] page_token # @return [::String] # Optional. If present, then retrieve the next batch of results from the # preceding call to this method. `pageToken` must be the value of # `nextPageToken` from the previous response. # @!attribute [rw] page_size # @return [::Integer] # Optional. The maximum number of results to return from this request. class ListLinksRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # The response from ListLinks. # @!attribute [rw] links # @return [::Array<::Google::Cloud::Logging::V2::Link>] # A list of links. # @!attribute [rw] next_page_token # @return [::String] # If there might be more results than those appearing in this response, then # `nextPageToken` is included. To get the next set of results, call the same # method again using the value of `nextPageToken` as `pageToken`. class ListLinksResponse include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # The parameters to GetLink. # @!attribute [rw] name # @return [::String] # 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] class GetLinkRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # Specifies a set of log entries that are filtered out by a sink. If # your Google Cloud resource receives a large volume of log entries, you can # use exclusions to reduce your chargeable logs. Note that exclusions on # organization-level and folder-level sinks don't apply to child resources. # Note also that you cannot modify the _Required sink or exclude logs from it. # @!attribute [rw] name # @return [::String] # Required. A client-assigned identifier, such as # `"load-balancer-exclusion"`. Identifiers are limited to 100 characters and # can include only letters, digits, underscores, hyphens, and periods. First # character has to be alphanumeric. # @!attribute [rw] description # @return [::String] # Optional. A description of this exclusion. # @!attribute [rw] filter # @return [::String] # Required. An [advanced logs # filter](https://cloud.google.com/logging/docs/view/advanced-queries) that # matches the log entries to be excluded. By using the [sample # function](https://cloud.google.com/logging/docs/view/advanced-queries#sample), # you can exclude less than 100% of the matching log entries. # # For example, the following query matches 99% of low-severity log entries # from Google Cloud Storage buckets: # # `resource.type=gcs_bucket severity] # A list of exclusions. # @!attribute [rw] next_page_token # @return [::String] # If there might be more results than appear in this response, then # `nextPageToken` is included. To get the next set of results, call the same # method again using the value of `nextPageToken` as `pageToken`. class ListExclusionsResponse include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # The parameters to `GetExclusion`. # @!attribute [rw] name # @return [::String] # Required. The resource name of an existing exclusion: # # "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" # "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" # "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" # "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" # # For example: # # `"projects/my-project/exclusions/my-exclusion"` class GetExclusionRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # The parameters to `CreateExclusion`. # @!attribute [rw] parent # @return [::String] # Required. The parent resource in which to create the exclusion: # # "projects/[PROJECT_ID]" # "organizations/[ORGANIZATION_ID]" # "billingAccounts/[BILLING_ACCOUNT_ID]" # "folders/[FOLDER_ID]" # # For examples: # # `"projects/my-logging-project"` # `"organizations/123456789"` # @!attribute [rw] exclusion # @return [::Google::Cloud::Logging::V2::LogExclusion] # Required. The new exclusion, whose `name` parameter is an exclusion name # that is not already used in the parent resource. class CreateExclusionRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # The parameters to `UpdateExclusion`. # @!attribute [rw] name # @return [::String] # Required. The resource name of the exclusion to update: # # "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" # "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" # "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" # "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" # # For example: # # `"projects/my-project/exclusions/my-exclusion"` # @!attribute [rw] exclusion # @return [::Google::Cloud::Logging::V2::LogExclusion] # Required. New values for the existing exclusion. Only the fields specified # in `update_mask` are relevant. # @!attribute [rw] update_mask # @return [::Google::Protobuf::FieldMask] # 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 # {::Google::Cloud::Logging::V2::LogExclusion 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"`. class UpdateExclusionRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # The parameters to `DeleteExclusion`. # @!attribute [rw] name # @return [::String] # Required. The resource name of an existing exclusion to delete: # # "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" # "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" # "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" # "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" # # For example: # # `"projects/my-project/exclusions/my-exclusion"` class DeleteExclusionRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # The parameters to # {::Google::Cloud::Logging::V2::ConfigService::Client#get_cmek_settings GetCmekSettings}. # # See [Enabling CMEK for Log # Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for # more information. # @!attribute [rw] name # @return [::String] # Required. The resource for which to retrieve CMEK settings. # # "projects/[PROJECT_ID]/cmekSettings" # "organizations/[ORGANIZATION_ID]/cmekSettings" # "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" # "folders/[FOLDER_ID]/cmekSettings" # # For example: # # `"organizations/12345/cmekSettings"` # # Note: CMEK for the Log Router can be configured for Google Cloud projects, # folders, organizations and billing accounts. Once configured for an # organization, it applies to all projects and folders in the Google Cloud # organization. class GetCmekSettingsRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # The parameters to # {::Google::Cloud::Logging::V2::ConfigService::Client#update_cmek_settings UpdateCmekSettings}. # # See [Enabling CMEK for Log # Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for # more information. # @!attribute [rw] name # @return [::String] # Required. The resource name for the CMEK settings to update. # # "projects/[PROJECT_ID]/cmekSettings" # "organizations/[ORGANIZATION_ID]/cmekSettings" # "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" # "folders/[FOLDER_ID]/cmekSettings" # # 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. # @!attribute [rw] cmek_settings # @return [::Google::Cloud::Logging::V2::CmekSettings] # Required. The CMEK settings to update. # # See [Enabling CMEK for Log # Router](https://cloud.google.com/logging/docs/routing/managed-encryption) # for more information. # @!attribute [rw] update_mask # @return [::Google::Protobuf::FieldMask] # 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 {::Google::Protobuf::FieldMask FieldMask} for more information. # # For example: `"updateMask=kmsKeyName"` class UpdateCmekSettingsRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # Describes the customer-managed encryption key (CMEK) settings associated with # a project, folder, organization, billing account, or flexible 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. # # See [Enabling CMEK for Log # Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for # more information. # @!attribute [r] name # @return [::String] # Output only. The resource name of the CMEK settings. # @!attribute [rw] kms_key_name # @return [::String] # The resource name for the configured Cloud KMS key. # # KMS key name format: # # "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]" # # For example: # # `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key"` # # # # To enable CMEK for the Log Router, set this field to a valid # `kms_key_name` for which the associated service account has the required # cloudkms.cryptoKeyEncrypterDecrypter roles assigned for the key. # # The Cloud KMS key used by the Log Router can be updated by changing the # `kms_key_name` to a new valid key name or disabled by setting the key name # to an empty string. Encryption operations that are in progress will be # completed with the key that was in use when they started. Decryption # operations will be completed using the key that was used at the time of # encryption unless access to that key has been revoked. # # To disable CMEK for the Log Router, set this field to an empty string. # # See [Enabling CMEK for Log # Router](https://cloud.google.com/logging/docs/routing/managed-encryption) # for more information. # @!attribute [rw] kms_key_version_name # @return [::String] # The CryptoKeyVersion resource name for the configured Cloud KMS key. # # KMS key name format: # # "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]/cryptoKeyVersions/[VERSION]" # # For example: # # `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key/cryptoKeyVersions/1"` # # This is a read-only field used to convey the specific configured # CryptoKeyVersion of `kms_key` that has been configured. It will be # populated in cases where the CMEK settings are bound to a single key # version. # # If this field is populated, the `kms_key` is tied to a specific # CryptoKeyVersion. # @!attribute [r] service_account_id # @return [::String] # Output only. The service account that will be used by the Log Router to # access your Cloud KMS key. # # Before enabling CMEK for Log Router, you must first assign the # cloudkms.cryptoKeyEncrypterDecrypter role to the service account that # the Log Router will use to access your Cloud KMS key. Use # {::Google::Cloud::Logging::V2::ConfigService::Client#get_cmek_settings GetCmekSettings} to # obtain the service account ID. # # See [Enabling CMEK for Log # Router](https://cloud.google.com/logging/docs/routing/managed-encryption) # for more information. class CmekSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # The parameters to # {::Google::Cloud::Logging::V2::ConfigService::Client#get_settings GetSettings}. # # See [Enabling CMEK for Log # Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for # more information. # @!attribute [rw] name # @return [::String] # Required. The resource for which to retrieve settings. # # "projects/[PROJECT_ID]/settings" # "organizations/[ORGANIZATION_ID]/settings" # "billingAccounts/[BILLING_ACCOUNT_ID]/settings" # "folders/[FOLDER_ID]/settings" # # For example: # # `"organizations/12345/settings"` # # Note: Settings for the Log Router can be get for Google Cloud projects, # folders, organizations and billing accounts. Currently it can only be # configured for organizations. Once configured for an organization, it # applies to all projects and folders in the Google Cloud organization. class GetSettingsRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # The parameters to # {::Google::Cloud::Logging::V2::ConfigService::Client#update_settings UpdateSettings}. # # See [Enabling CMEK for Log # Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for # more information. # @!attribute [rw] name # @return [::String] # 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. # @!attribute [rw] settings # @return [::Google::Cloud::Logging::V2::Settings] # Required. The settings to update. # # See [Enabling CMEK for Log # Router](https://cloud.google.com/logging/docs/routing/managed-encryption) # for more information. # @!attribute [rw] update_mask # @return [::Google::Protobuf::FieldMask] # 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 {::Google::Protobuf::FieldMask FieldMask} for more information. # # For example: `"updateMask=kmsKeyName"` class UpdateSettingsRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # Describes the settings associated with a project, folder, organization, # billing account, or flexible resource. # @!attribute [r] name # @return [::String] # Output only. The resource name of the settings. # @!attribute [rw] kms_key_name # @return [::String] # Optional. The resource name for the configured Cloud KMS key. # # KMS key name format: # # "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]" # # For example: # # `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key"` # # # # To enable CMEK for the Log Router, set this field to a valid # `kms_key_name` for which the associated service account has the required # `roles/cloudkms.cryptoKeyEncrypterDecrypter` role assigned for the key. # # The Cloud KMS key used by the Log Router can be updated by changing the # `kms_key_name` to a new valid key name. Encryption operations that are in # progress will be completed with the key that was in use when they started. # Decryption operations will be completed using the key that was used at the # time of encryption unless access to that key has been revoked. # # To disable CMEK for the Log Router, set this field to an empty string. # # See [Enabling CMEK for Log # Router](https://cloud.google.com/logging/docs/routing/managed-encryption) # for more information. # @!attribute [r] kms_service_account_id # @return [::String] # Output only. The service account that will be used by the Log Router to # access your Cloud KMS key. # # Before enabling CMEK for Log Router, you must first assign the role # `roles/cloudkms.cryptoKeyEncrypterDecrypter` to the service account that # the Log Router will use to access your Cloud KMS key. Use # {::Google::Cloud::Logging::V2::ConfigService::Client#get_settings GetSettings} to # obtain the service account ID. # # See [Enabling CMEK for Log # Router](https://cloud.google.com/logging/docs/routing/managed-encryption) # for more information. # @!attribute [rw] storage_location # @return [::String] # Optional. The Cloud region that will be used for _Default and _Required log # buckets for newly created projects and folders. For example `europe-west1`. # This setting does not affect the location of custom log buckets. # @!attribute [rw] disable_default_sink # @return [::Boolean] # Optional. If set to true, the _Default sink in newly created projects and # folders will created in a disabled state. This can be used to automatically # disable log ingestion if there is already an aggregated sink configured in # the hierarchy. The _Default sink can be re-enabled manually if needed. class Settings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # The parameters to CopyLogEntries. # @!attribute [rw] name # @return [::String] # Required. Log bucket from which to copy log entries. # # For example: # # `"projects/my-project/locations/global/buckets/my-source-bucket"` # @!attribute [rw] filter # @return [::String] # Optional. A filter specifying which log entries to copy. The filter must be # no more than 20k characters. An empty filter matches all log entries. # @!attribute [rw] destination # @return [::String] # Required. Destination to which to copy log entries. class CopyLogEntriesRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # Metadata for CopyLogEntries long running operations. # @!attribute [rw] start_time # @return [::Google::Protobuf::Timestamp] # The create time of an operation. # @!attribute [rw] end_time # @return [::Google::Protobuf::Timestamp] # The end time of an operation. # @!attribute [rw] state # @return [::Google::Cloud::Logging::V2::OperationState] # State of an operation. # @!attribute [rw] cancellation_requested # @return [::Boolean] # Identifies whether the user has requested cancellation of the operation. # @!attribute [rw] request # @return [::Google::Cloud::Logging::V2::CopyLogEntriesRequest] # CopyLogEntries RPC request. # @!attribute [rw] progress # @return [::Integer] # Estimated progress of the operation (0 - 100%). # @!attribute [rw] writer_identity # @return [::String] # The IAM identity of a service account that must be granted access to the # destination. # # If the service account is not granted permission to the destination within # an hour, the operation will be cancelled. # # For example: `"serviceAccount:foo@bar.com"` class CopyLogEntriesMetadata include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # Response type for CopyLogEntries long running operations. # @!attribute [rw] log_entries_copied_count # @return [::Integer] # Number of log entries copied. class CopyLogEntriesResponse include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # Metadata for LongRunningUpdateBucket Operations. # @!attribute [rw] start_time # @return [::Google::Protobuf::Timestamp] # The create time of an operation. # @!attribute [rw] end_time # @return [::Google::Protobuf::Timestamp] # The end time of an operation. # @!attribute [rw] state # @return [::Google::Cloud::Logging::V2::OperationState] # State of an operation. # @!attribute [rw] create_bucket_request # @return [::Google::Cloud::Logging::V2::CreateBucketRequest] # LongRunningCreateBucket RPC request. # # Note: The following fields are mutually exclusive: `create_bucket_request`, `update_bucket_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. # @!attribute [rw] update_bucket_request # @return [::Google::Cloud::Logging::V2::UpdateBucketRequest] # LongRunningUpdateBucket RPC request. # # Note: The following fields are mutually exclusive: `update_bucket_request`, `create_bucket_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. class BucketMetadata include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # Metadata for long running Link operations. # @!attribute [rw] start_time # @return [::Google::Protobuf::Timestamp] # The start time of an operation. # @!attribute [rw] end_time # @return [::Google::Protobuf::Timestamp] # The end time of an operation. # @!attribute [rw] state # @return [::Google::Cloud::Logging::V2::OperationState] # State of an operation. # @!attribute [rw] create_link_request # @return [::Google::Cloud::Logging::V2::CreateLinkRequest] # CreateLink RPC request. # # Note: The following fields are mutually exclusive: `create_link_request`, `delete_link_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. # @!attribute [rw] delete_link_request # @return [::Google::Cloud::Logging::V2::DeleteLinkRequest] # DeleteLink RPC request. # # Note: The following fields are mutually exclusive: `delete_link_request`, `create_link_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. class LinkMetadata include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # Cloud Logging specific location metadata. # @!attribute [rw] log_analytics_enabled # @return [::Boolean] # Indicates whether or not Log Analytics features are supported in the given # location. class LocationMetadata include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # List of different operation states. # High level state of the operation. This is used to report the job's # current state to the user. Once a long running operation is created, # the current state of the operation can be queried even before the # operation is finished and the final result is available. module OperationState # Should not be used. OPERATION_STATE_UNSPECIFIED = 0 # The operation is scheduled. OPERATION_STATE_SCHEDULED = 1 # Waiting for necessary permissions. OPERATION_STATE_WAITING_FOR_PERMISSIONS = 2 # The operation is running. OPERATION_STATE_RUNNING = 3 # The operation was completed successfully. OPERATION_STATE_SUCCEEDED = 4 # The operation failed. OPERATION_STATE_FAILED = 5 # The operation was cancelled by the user. OPERATION_STATE_CANCELLED = 6 end # LogBucket lifecycle states. module LifecycleState # Unspecified state. This is only used/useful for distinguishing unset # values. LIFECYCLE_STATE_UNSPECIFIED = 0 # The normal and active state. ACTIVE = 1 # The resource has been marked for deletion by the user. For some resources # (e.g. buckets), this can be reversed by an un-delete operation. DELETE_REQUESTED = 2 # The resource has been marked for an update by the user. It will remain in # this state until the update is complete. UPDATING = 3 # The resource has been marked for creation by the user. It will remain in # this state until the creation is complete. CREATING = 4 # The resource is in an INTERNAL error state. FAILED = 5 end # IndexType is used for custom indexing. It describes the type of an indexed # field. module IndexType # The index's type is unspecified. INDEX_TYPE_UNSPECIFIED = 0 # The index is a string-type index. INDEX_TYPE_STRING = 1 # The index is a integer-type index. INDEX_TYPE_INTEGER = 2 end end end end end google-cloud-logging-v2-1.5.1/proto_docs/google/logging/v2/logging_metrics.rb0000644000004100000410000003150215143461113027204 0ustar www-datawww-data# frozen_string_literal: true # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Auto-generated by gapic-generator-ruby. DO NOT EDIT! module Google module Cloud module Logging module V2 # Describes a logs-based metric. The value of the metric is the number of log # entries that match a logs filter in a given time interval. # # Logs-based metrics can also be used to extract values from logs and create a # distribution of the values. The distribution records the statistics of the # extracted values along with an optional histogram of the values as specified # by the bucket options. # @!attribute [rw] name # @return [::String] # Required. The client-assigned metric identifier. # Examples: `"error_count"`, `"nginx/requests"`. # # Metric identifiers are limited to 100 characters and can include only the # following characters: `A-Z`, `a-z`, `0-9`, and the special characters # `_-.,+!*',()%/`. The forward-slash character (`/`) denotes a hierarchy of # name pieces, and it cannot be the first character of the name. # # This field is the `[METRIC_ID]` part of a metric resource name in the # format "projects/[PROJECT_ID]/metrics/[METRIC_ID]". Example: If the # resource name of a metric is # `"projects/my-project/metrics/nginx%2Frequests"`, this field's value is # `"nginx/requests"`. # @!attribute [rw] description # @return [::String] # Optional. A description of this metric, which is used in documentation. # The maximum length of the description is 8000 characters. # @!attribute [rw] filter # @return [::String] # Required. An [advanced logs # filter](https://cloud.google.com/logging/docs/view/advanced_filters) which # is used to match log entries. Example: # # "resource.type=gae_app AND severity>=ERROR" # # The maximum length of the filter is 20000 characters. # @!attribute [rw] bucket_name # @return [::String] # Optional. The resource name of the Log Bucket that owns the Log Metric. # Only Log Buckets in projects are supported. The bucket has to be in the # same project as the metric. # # For example: # # `projects/my-project/locations/global/buckets/my-bucket` # # If empty, then the Log Metric is considered a non-Bucket Log Metric. # @!attribute [rw] disabled # @return [::Boolean] # Optional. If set to True, then this metric is disabled and it does not # generate any points. # @!attribute [rw] metric_descriptor # @return [::Google::Api::MetricDescriptor] # Optional. The metric descriptor associated with the logs-based metric. # If unspecified, it uses a default metric descriptor with a DELTA metric # kind, INT64 value type, with no labels and a unit of "1". Such a metric # counts the number of log entries matching the `filter` expression. # # The `name`, `type`, and `description` fields in the `metric_descriptor` # are output only, and is constructed using the `name` and `description` # field in the LogMetric. # # To create a logs-based metric that records a distribution of log values, a # DELTA metric kind with a DISTRIBUTION value type must be used along with # a `value_extractor` expression in the LogMetric. # # Each label in the metric descriptor must have a matching label # name as the key and an extractor expression as the value in the # `label_extractors` map. # # The `metric_kind` and `value_type` fields in the `metric_descriptor` cannot # be updated once initially configured. New labels can be added in the # `metric_descriptor`, but existing labels cannot be modified except for # their description. # @!attribute [rw] value_extractor # @return [::String] # Optional. A `value_extractor` is required when using a distribution # logs-based metric to extract the values to record from a log entry. # Two functions are supported for value extraction: `EXTRACT(field)` or # `REGEXP_EXTRACT(field, regex)`. The arguments are: # # 1. field: The name of the log entry field from which the value is to be # extracted. # 2. regex: A regular expression using the Google RE2 syntax # (https://github.com/google/re2/wiki/Syntax) with a single capture # group to extract data from the specified log entry field. The value # of the field is converted to a string before applying the regex. # It is an error to specify a regex that does not include exactly one # capture group. # # The result of the extraction must be convertible to a double type, as the # distribution always records double values. If either the extraction or # the conversion to double fails, then those values are not recorded in the # distribution. # # Example: `REGEXP_EXTRACT(jsonPayload.request, ".*quantity=(\d+).*")` # @!attribute [rw] label_extractors # @return [::Google::Protobuf::Map{::String => ::String}] # Optional. A map from a label key string to an extractor expression which is # used to extract data from a log entry field and assign as the label value. # Each label key specified in the LabelDescriptor must have an associated # extractor expression in this map. The syntax of the extractor expression # is the same as for the `value_extractor` field. # # The extracted value is converted to the type defined in the label # descriptor. If either the extraction or the type conversion fails, # the label will have a default value. The default value for a string # label is an empty string, for an integer label its 0, and for a boolean # label its `false`. # # Note that there are upper bounds on the maximum number of labels and the # number of active time series that are allowed in a project. # @!attribute [rw] bucket_options # @return [::Google::Api::Distribution::BucketOptions] # Optional. The `bucket_options` are required when the logs-based metric is # using a DISTRIBUTION value type and it describes the bucket boundaries # used to create a histogram of the extracted values. # @!attribute [r] create_time # @return [::Google::Protobuf::Timestamp] # Output only. The creation timestamp of the metric. # # This field may not be present for older metrics. # @!attribute [r] update_time # @return [::Google::Protobuf::Timestamp] # Output only. The last update timestamp of the metric. # # This field may not be present for older metrics. # @!attribute [rw] version # @deprecated This field is deprecated and may be removed in the next major version update. # @return [::Google::Cloud::Logging::V2::LogMetric::ApiVersion] # Deprecated. The API version that created or updated this metric. # The v2 format is used by default and cannot be changed. class LogMetric include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # @!attribute [rw] key # @return [::String] # @!attribute [rw] value # @return [::String] class LabelExtractorsEntry include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # Logging API version. module ApiVersion # Logging API v2. V2 = 0 # Logging API v1. V1 = 1 end end # The parameters to ListLogMetrics. # @!attribute [rw] parent # @return [::String] # Required. The name of the project containing the metrics: # # "projects/[PROJECT_ID]" # @!attribute [rw] page_token # @return [::String] # Optional. If present, then retrieve the next batch of results from the # preceding call to this method. `pageToken` must be the value of # `nextPageToken` from the previous response. The values of other method # parameters should be identical to those in the previous call. # @!attribute [rw] page_size # @return [::Integer] # Optional. The maximum number of results to return from this request. # Non-positive values are ignored. The presence of `nextPageToken` in the # response indicates that more results might be available. class ListLogMetricsRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # Result returned from ListLogMetrics. # @!attribute [rw] metrics # @return [::Array<::Google::Cloud::Logging::V2::LogMetric>] # A list of logs-based metrics. # @!attribute [rw] next_page_token # @return [::String] # If there might be more results than appear in this response, then # `nextPageToken` is included. To get the next set of results, call this # method again using the value of `nextPageToken` as `pageToken`. class ListLogMetricsResponse include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # The parameters to GetLogMetric. # @!attribute [rw] metric_name # @return [::String] # Required. The resource name of the desired metric: # # "projects/[PROJECT_ID]/metrics/[METRIC_ID]" class GetLogMetricRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # The parameters to CreateLogMetric. # @!attribute [rw] parent # @return [::String] # Required. The resource name of the project in which to create the metric: # # "projects/[PROJECT_ID]" # # The new metric must be provided in the request. # @!attribute [rw] metric # @return [::Google::Cloud::Logging::V2::LogMetric] # Required. The new logs-based metric, which must not have an identifier that # already exists. class CreateLogMetricRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # The parameters to UpdateLogMetric. # @!attribute [rw] metric_name # @return [::String] # Required. The resource name of the metric to update: # # "projects/[PROJECT_ID]/metrics/[METRIC_ID]" # # The updated metric must be provided in the request and it's # `name` field must be the same as `[METRIC_ID]` If the metric # does not exist in `[PROJECT_ID]`, then a new metric is created. # @!attribute [rw] metric # @return [::Google::Cloud::Logging::V2::LogMetric] # Required. The updated metric. class UpdateLogMetricRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # The parameters to DeleteLogMetric. # @!attribute [rw] metric_name # @return [::String] # Required. The resource name of the metric to delete: # # "projects/[PROJECT_ID]/metrics/[METRIC_ID]" class DeleteLogMetricRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end end end end end google-cloud-logging-v2-1.5.1/proto_docs/google/logging/type/0000755000004100000410000000000015143461113024134 5ustar www-datawww-datagoogle-cloud-logging-v2-1.5.1/proto_docs/google/logging/type/log_severity.rb0000644000004100000410000000472515143461113027204 0ustar www-datawww-data# frozen_string_literal: true # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Auto-generated by gapic-generator-ruby. DO NOT EDIT! module Google module Cloud module Logging module Type # The severity of the event described in a log entry, expressed as one of the # standard severity levels listed below. For your reference, the levels are # assigned the listed numeric values. The effect of using numeric values other # than those listed is undefined. # # You can filter for log entries by severity. For example, the following # filter expression will match log entries with severities `INFO`, `NOTICE`, # and `WARNING`: # # severity > DEBUG AND severity <= WARNING # # If you are writing log entries, you should map other severity encodings to # one of these standard levels. For example, you might map all of Java's FINE, # FINER, and FINEST levels to `LogSeverity.DEBUG`. You can preserve the # original severity level in the log entry payload if you wish. module LogSeverity # (0) The log entry has no assigned severity level. DEFAULT = 0 # (100) Debug or trace information. DEBUG = 100 # (200) Routine information, such as ongoing status or performance. INFO = 200 # (300) Normal but significant events, such as start up, shut down, or # a configuration change. NOTICE = 300 # (400) Warning events might cause problems. WARNING = 400 # (500) Error events are likely to cause problems. ERROR = 500 # (600) Critical events cause more severe problems or outages. CRITICAL = 600 # (700) A person must take an action immediately. ALERT = 700 # (800) One or more systems are unusable. EMERGENCY = 800 end end end end end google-cloud-logging-v2-1.5.1/proto_docs/google/logging/type/http_request.rb0000644000004100000410000001046415143461113027215 0ustar www-datawww-data# frozen_string_literal: true # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Auto-generated by gapic-generator-ruby. DO NOT EDIT! module Google module Cloud module Logging module Type # A common proto for logging HTTP requests. Only contains semantics # defined by the HTTP specification. Product-specific logging # information MUST be defined in a separate message. # @!attribute [rw] request_method # @return [::String] # The request method. Examples: `"GET"`, `"HEAD"`, `"PUT"`, `"POST"`. # @!attribute [rw] request_url # @return [::String] # The scheme (http, https), the host name, the path and the query # portion of the URL that was requested. # Example: `"http://example.com/some/info?color=red"`. # @!attribute [rw] request_size # @return [::Integer] # The size of the HTTP request message in bytes, including the request # headers and the request body. # @!attribute [rw] status # @return [::Integer] # The response code indicating the status of response. # Examples: 200, 404. # @!attribute [rw] response_size # @return [::Integer] # The size of the HTTP response message sent back to the client, in bytes, # including the response headers and the response body. # @!attribute [rw] user_agent # @return [::String] # The user agent sent by the client. Example: # `"Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET # CLR 1.0.3705)"`. # @!attribute [rw] remote_ip # @return [::String] # The IP address (IPv4 or IPv6) of the client that issued the HTTP # request. This field can include port information. Examples: # `"192.168.1.1"`, `"10.0.0.1:80"`, `"FE80::0202:B3FF:FE1E:8329"`. # @!attribute [rw] server_ip # @return [::String] # The IP address (IPv4 or IPv6) of the origin server that the request was # sent to. This field can include port information. Examples: # `"192.168.1.1"`, `"10.0.0.1:80"`, `"FE80::0202:B3FF:FE1E:8329"`. # @!attribute [rw] referer # @return [::String] # The referer URL of the request, as defined in # [HTTP/1.1 Header Field # Definitions](https://datatracker.ietf.org/doc/html/rfc2616#section-14.36). # @!attribute [rw] latency # @return [::Google::Protobuf::Duration] # The request processing latency on the server, from the time the request was # received until the response was sent. # @!attribute [rw] cache_lookup # @return [::Boolean] # Whether or not a cache lookup was attempted. # @!attribute [rw] cache_hit # @return [::Boolean] # Whether or not an entity was served from cache # (with or without validation). # @!attribute [rw] cache_validated_with_origin_server # @return [::Boolean] # Whether or not the response was validated with the origin server before # being served from cache. This field is only meaningful if `cache_hit` is # True. # @!attribute [rw] cache_fill_bytes # @return [::Integer] # The number of HTTP response bytes inserted into cache. Set only when a # cache fill was attempted. # @!attribute [rw] protocol # @return [::String] # Protocol used for the request. Examples: "HTTP/1.1", "HTTP/2", "websocket" class HttpRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end end end end end google-cloud-logging-v2-1.5.1/proto_docs/google/rpc/0000755000004100000410000000000015143461113022311 5ustar www-datawww-datagoogle-cloud-logging-v2-1.5.1/proto_docs/google/rpc/status.rb0000644000004100000410000000370415143461113024165 0ustar www-datawww-data# frozen_string_literal: true # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Auto-generated by gapic-generator-ruby. DO NOT EDIT! module Google module Rpc # The `Status` type defines a logical error model that is suitable for # different programming environments, including REST APIs and RPC APIs. It is # used by [gRPC](https://github.com/grpc). Each `Status` message contains # three pieces of data: error code, error message, and error details. # # You can find out more about this error model and how to work with it in the # [API Design Guide](https://cloud.google.com/apis/design/errors). # @!attribute [rw] code # @return [::Integer] # The status code, which should be an enum value of # [google.rpc.Code][google.rpc.Code]. # @!attribute [rw] message # @return [::String] # A developer-facing error message, which should be in English. Any # user-facing error message should be localized and sent in the # {::Google::Rpc::Status#details google.rpc.Status.details} field, or localized # by the client. # @!attribute [rw] details # @return [::Array<::Google::Protobuf::Any>] # A list of messages that carry the error details. There is a common set of # message types for APIs to use. class Status include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end end end google-cloud-logging-v2-1.5.1/proto_docs/google/longrunning/0000755000004100000410000000000015143461113024065 5ustar www-datawww-datagoogle-cloud-logging-v2-1.5.1/proto_docs/google/longrunning/operations.rb0000644000004100000410000001762215143461113026605 0ustar www-datawww-data# frozen_string_literal: true # Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Auto-generated by gapic-generator-ruby. DO NOT EDIT! module Google module Longrunning # This resource represents a long-running operation that is the result of a # network API call. # @!attribute [rw] name # @return [::String] # The server-assigned name, which is only unique within the same service that # originally returns it. If you use the default HTTP mapping, the # `name` should be a resource name ending with `operations/{unique_id}`. # @!attribute [rw] metadata # @return [::Google::Protobuf::Any] # Service-specific metadata associated with the operation. It typically # contains progress information and common metadata such as create time. # Some services might not provide such metadata. Any method that returns a # long-running operation should document the metadata type, if any. # @!attribute [rw] done # @return [::Boolean] # If the value is `false`, it means the operation is still in progress. # If `true`, the operation is completed, and either `error` or `response` is # available. # @!attribute [rw] error # @return [::Google::Rpc::Status] # The error result of the operation in case of failure or cancellation. # # Note: The following fields are mutually exclusive: `error`, `response`. If a field in that set is populated, all other fields in the set will automatically be cleared. # @!attribute [rw] response # @return [::Google::Protobuf::Any] # The normal, successful response of the operation. If the original # method returns no data on success, such as `Delete`, the response is # `google.protobuf.Empty`. If the original method is standard # `Get`/`Create`/`Update`, the response should be the resource. For other # methods, the response should have the type `XxxResponse`, where `Xxx` # is the original method name. For example, if the original method name # is `TakeSnapshot()`, the inferred response type is # `TakeSnapshotResponse`. # # Note: The following fields are mutually exclusive: `response`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. class Operation include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # The request message for # Operations.GetOperation. # @!attribute [rw] name # @return [::String] # The name of the operation resource. class GetOperationRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # The request message for # Operations.ListOperations. # @!attribute [rw] name # @return [::String] # The name of the operation's parent resource. # @!attribute [rw] filter # @return [::String] # The standard list filter. # @!attribute [rw] page_size # @return [::Integer] # The standard list page size. # @!attribute [rw] page_token # @return [::String] # The standard list page token. # @!attribute [rw] return_partial_success # @return [::Boolean] # When set to `true`, operations that are reachable are returned as normal, # and those that are unreachable are returned in the # [ListOperationsResponse.unreachable] field. # # This can only be `true` when reading across collections e.g. when `parent` # is set to `"projects/example/locations/-"`. # # This field is not by default supported and will result in an # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in # service or product specific documentation. class ListOperationsRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # The response message for # Operations.ListOperations. # @!attribute [rw] operations # @return [::Array<::Google::Longrunning::Operation>] # A list of operations that matches the specified filter in the request. # @!attribute [rw] next_page_token # @return [::String] # The standard List next-page token. # @!attribute [rw] unreachable # @return [::Array<::String>] # Unordered list. Unreachable resources. Populated when the request sets # `ListOperationsRequest.return_partial_success` and reads across # collections e.g. when attempting to list all resources across all supported # locations. class ListOperationsResponse include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # The request message for # Operations.CancelOperation. # @!attribute [rw] name # @return [::String] # The name of the operation resource to be cancelled. class CancelOperationRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # The request message for # Operations.DeleteOperation. # @!attribute [rw] name # @return [::String] # The name of the operation resource to be deleted. class DeleteOperationRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # The request message for # Operations.WaitOperation. # @!attribute [rw] name # @return [::String] # The name of the operation resource to wait on. # @!attribute [rw] timeout # @return [::Google::Protobuf::Duration] # The maximum duration to wait before timing out. If left blank, the wait # will be at most the time permitted by the underlying HTTP/RPC protocol. # If RPC context deadline is also specified, the shorter one will be used. class WaitOperationRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # A message representing the message types used by a long-running operation. # # Example: # # rpc Export(ExportRequest) returns (google.longrunning.Operation) { # option (google.longrunning.operation_info) = { # response_type: "ExportResponse" # metadata_type: "ExportMetadata" # }; # } # @!attribute [rw] response_type # @return [::String] # Required. The message name of the primary return type for this # long-running operation. # This type will be used to deserialize the LRO's response. # # If the response is in a different package from the rpc, a fully-qualified # message name must be used (e.g. `google.protobuf.Struct`). # # Note: Altering this value constitutes a breaking change. # @!attribute [rw] metadata_type # @return [::String] # Required. The message name of the metadata type for this long-running # operation. # # If the response is in a different package from the rpc, a fully-qualified # message name must be used (e.g. `google.protobuf.Struct`). # # Note: Altering this value constitutes a breaking change. class OperationInfo include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end end end google-cloud-logging-v2-1.5.1/proto_docs/google/protobuf/0000755000004100000410000000000015143461113023365 5ustar www-datawww-datagoogle-cloud-logging-v2-1.5.1/proto_docs/google/protobuf/duration.rb0000644000004100000410000000757715143461113025557 0ustar www-datawww-data# frozen_string_literal: true # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Auto-generated by gapic-generator-ruby. DO NOT EDIT! module Google module Protobuf # A Duration represents a signed, fixed-length span of time represented # as a count of seconds and fractions of seconds at nanosecond # resolution. It is independent of any calendar and concepts like "day" # or "month". It is related to Timestamp in that the difference between # two Timestamp values is a Duration and it can be added or subtracted # from a Timestamp. Range is approximately +-10,000 years. # # # Examples # # Example 1: Compute Duration from two Timestamps in pseudo code. # # Timestamp start = ...; # Timestamp end = ...; # Duration duration = ...; # # duration.seconds = end.seconds - start.seconds; # duration.nanos = end.nanos - start.nanos; # # if (duration.seconds < 0 && duration.nanos > 0) { # duration.seconds += 1; # duration.nanos -= 1000000000; # } else if (duration.seconds > 0 && duration.nanos < 0) { # duration.seconds -= 1; # duration.nanos += 1000000000; # } # # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. # # Timestamp start = ...; # Duration duration = ...; # Timestamp end = ...; # # end.seconds = start.seconds + duration.seconds; # end.nanos = start.nanos + duration.nanos; # # if (end.nanos < 0) { # end.seconds -= 1; # end.nanos += 1000000000; # } else if (end.nanos >= 1000000000) { # end.seconds += 1; # end.nanos -= 1000000000; # } # # Example 3: Compute Duration from datetime.timedelta in Python. # # td = datetime.timedelta(days=3, minutes=10) # duration = Duration() # duration.FromTimedelta(td) # # # JSON Mapping # # In JSON format, the Duration type is encoded as a string rather than an # object, where the string ends in the suffix "s" (indicating seconds) and # is preceded by the number of seconds, with nanoseconds expressed as # fractional seconds. For example, 3 seconds with 0 nanoseconds should be # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 # microsecond should be expressed in JSON format as "3.000001s". # @!attribute [rw] seconds # @return [::Integer] # Signed seconds of the span of time. Must be from -315,576,000,000 # to +315,576,000,000 inclusive. Note: these bounds are computed from: # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years # @!attribute [rw] nanos # @return [::Integer] # Signed fractions of a second at nanosecond resolution of the span # of time. Durations less than one second are represented with a 0 # `seconds` field and a positive or negative `nanos` field. For durations # of one second or more, a non-zero value for the `nanos` field must be # of the same sign as the `seconds` field. Must be from -999,999,999 # to +999,999,999 inclusive. class Duration include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end end end google-cloud-logging-v2-1.5.1/proto_docs/google/protobuf/field_mask.rb0000644000004100000410000001666515143461113026026 0ustar www-datawww-data# frozen_string_literal: true # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Auto-generated by gapic-generator-ruby. DO NOT EDIT! module Google module Protobuf # `FieldMask` represents a set of symbolic field paths, for example: # # paths: "f.a" # paths: "f.b.d" # # Here `f` represents a field in some root message, `a` and `b` # fields in the message found in `f`, and `d` a field found in the # message in `f.b`. # # Field masks are used to specify a subset of fields that should be # returned by a get operation or modified by an update operation. # Field masks also have a custom JSON encoding (see below). # # # Field Masks in Projections # # When used in the context of a projection, a response message or # sub-message is filtered by the API to only contain those fields as # specified in the mask. For example, if the mask in the previous # example is applied to a response message as follows: # # f { # a : 22 # b { # d : 1 # x : 2 # } # y : 13 # } # z: 8 # # The result will not contain specific values for fields x,y and z # (their value will be set to the default, and omitted in proto text # output): # # # f { # a : 22 # b { # d : 1 # } # } # # A repeated field is not allowed except at the last position of a # paths string. # # If a FieldMask object is not present in a get operation, the # operation applies to all fields (as if a FieldMask of all fields # had been specified). # # Note that a field mask does not necessarily apply to the # top-level response message. In case of a REST get operation, the # field mask applies directly to the response, but in case of a REST # list operation, the mask instead applies to each individual message # in the returned resource list. In case of a REST custom method, # other definitions may be used. Where the mask applies will be # clearly documented together with its declaration in the API. In # any case, the effect on the returned resource/resources is required # behavior for APIs. # # # Field Masks in Update Operations # # A field mask in update operations specifies which fields of the # targeted resource are going to be updated. The API is required # to only change the values of the fields as specified in the mask # and leave the others untouched. If a resource is passed in to # describe the updated values, the API ignores the values of all # fields not covered by the mask. # # If a repeated field is specified for an update operation, new values will # be appended to the existing repeated field in the target resource. Note that # a repeated field is only allowed in the last position of a `paths` string. # # If a sub-message is specified in the last position of the field mask for an # update operation, then new value will be merged into the existing sub-message # in the target resource. # # For example, given the target message: # # f { # b { # d: 1 # x: 2 # } # c: [1] # } # # And an update message: # # f { # b { # d: 10 # } # c: [2] # } # # then if the field mask is: # # paths: ["f.b", "f.c"] # # then the result will be: # # f { # b { # d: 10 # x: 2 # } # c: [1, 2] # } # # An implementation may provide options to override this default behavior for # repeated and message fields. # # In order to reset a field's value to the default, the field must # be in the mask and set to the default value in the provided resource. # Hence, in order to reset all fields of a resource, provide a default # instance of the resource and set all fields in the mask, or do # not provide a mask as described below. # # If a field mask is not present on update, the operation applies to # all fields (as if a field mask of all fields has been specified). # Note that in the presence of schema evolution, this may mean that # fields the client does not know and has therefore not filled into # the request will be reset to their default. If this is unwanted # behavior, a specific service may require a client to always specify # a field mask, producing an error if not. # # As with get operations, the location of the resource which # describes the updated values in the request message depends on the # operation kind. In any case, the effect of the field mask is # required to be honored by the API. # # ## Considerations for HTTP REST # # The HTTP kind of an update operation which uses a field mask must # be set to PATCH instead of PUT in order to satisfy HTTP semantics # (PUT must only be used for full updates). # # # JSON Encoding of Field Masks # # In JSON, a field mask is encoded as a single string where paths are # separated by a comma. Fields name in each path are converted # to/from lower-camel naming conventions. # # As an example, consider the following message declarations: # # message Profile { # User user = 1; # Photo photo = 2; # } # message User { # string display_name = 1; # string address = 2; # } # # In proto a field mask for `Profile` may look as such: # # mask { # paths: "user.display_name" # paths: "photo" # } # # In JSON, the same mask is represented as below: # # { # mask: "user.displayName,photo" # } # # # Field Masks and Oneof Fields # # Field masks treat fields in oneofs just as regular fields. Consider the # following message: # # message SampleMessage { # oneof test_oneof { # string name = 4; # SubMessage sub_message = 9; # } # } # # The field mask can be: # # mask { # paths: "name" # } # # Or: # # mask { # paths: "sub_message" # } # # Note that oneof type names ("test_oneof" in this case) cannot be used in # paths. # # ## Field Mask Verification # # The implementation of any API method which has a FieldMask type field in the # request should verify the included field paths, and return an # `INVALID_ARGUMENT` error if any path is unmappable. # @!attribute [rw] paths # @return [::Array<::String>] # The set of field mask paths. class FieldMask include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end end end google-cloud-logging-v2-1.5.1/proto_docs/google/protobuf/empty.rb0000644000004100000410000000222415143461113025050 0ustar www-datawww-data# frozen_string_literal: true # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Auto-generated by gapic-generator-ruby. DO NOT EDIT! module Google module Protobuf # A generic empty message that you can re-use to avoid defining duplicated # empty messages in your APIs. A typical example is to use it as the request # or the response type of an API method. For instance: # # service Foo { # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); # } class Empty include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end end end google-cloud-logging-v2-1.5.1/proto_docs/google/protobuf/struct.rb0000644000004100000410000001166115143461113025243 0ustar www-datawww-data# frozen_string_literal: true # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Auto-generated by gapic-generator-ruby. DO NOT EDIT! module Google module Protobuf # `Struct` represents a structured data value, consisting of fields # which map to dynamically typed values. In some languages, `Struct` # might be supported by a native representation. For example, in # scripting languages like JS a struct is represented as an # object. The details of that representation are described together # with the proto support for the language. # # The JSON representation for `Struct` is JSON object. # @!attribute [rw] fields # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}] # Unordered map of dynamically typed values. class Struct include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # @!attribute [rw] key # @return [::String] # @!attribute [rw] value # @return [::Google::Protobuf::Value] class FieldsEntry include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end end # `Value` represents a dynamically typed value which can be either # null, a number, a string, a boolean, a recursive struct value, or a # list of values. A producer of value is expected to set one of these # variants. Absence of any variant indicates an error. # # The JSON representation for `Value` is JSON value. # @!attribute [rw] null_value # @return [::Google::Protobuf::NullValue] # Represents a null value. # # Note: The following fields are mutually exclusive: `null_value`, `number_value`, `string_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. # @!attribute [rw] number_value # @return [::Float] # Represents a double value. # # Note: The following fields are mutually exclusive: `number_value`, `null_value`, `string_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. # @!attribute [rw] string_value # @return [::String] # Represents a string value. # # Note: The following fields are mutually exclusive: `string_value`, `null_value`, `number_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. # @!attribute [rw] bool_value # @return [::Boolean] # Represents a boolean value. # # Note: The following fields are mutually exclusive: `bool_value`, `null_value`, `number_value`, `string_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. # @!attribute [rw] struct_value # @return [::Google::Protobuf::Struct] # Represents a structured value. # # Note: The following fields are mutually exclusive: `struct_value`, `null_value`, `number_value`, `string_value`, `bool_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. # @!attribute [rw] list_value # @return [::Google::Protobuf::ListValue] # Represents a repeated `Value`. # # Note: The following fields are mutually exclusive: `list_value`, `null_value`, `number_value`, `string_value`, `bool_value`, `struct_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. class Value include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # `ListValue` is a wrapper around a repeated field of values. # # The JSON representation for `ListValue` is JSON array. # @!attribute [rw] values # @return [::Array<::Google::Protobuf::Value>] # Repeated field of dynamically typed values. class ListValue include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # `NullValue` is a singleton enumeration to represent the null value for the # `Value` type union. # # The JSON representation for `NullValue` is JSON `null`. module NullValue # Null value. NULL_VALUE = 0 end end end google-cloud-logging-v2-1.5.1/proto_docs/google/protobuf/timestamp.rb0000644000004100000410000001277715143461113025733 0ustar www-datawww-data# frozen_string_literal: true # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Auto-generated by gapic-generator-ruby. DO NOT EDIT! module Google module Protobuf # A Timestamp represents a point in time independent of any time zone or local # calendar, encoded as a count of seconds and fractions of seconds at # nanosecond resolution. The count is relative to an epoch at UTC midnight on # January 1, 1970, in the proleptic Gregorian calendar which extends the # Gregorian calendar backwards to year one. # # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap # second table is needed for interpretation, using a [24-hour linear # smear](https://developers.google.com/time/smear). # # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By # restricting to that range, we ensure that we can convert to and from [RFC # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # # # Examples # # Example 1: Compute Timestamp from POSIX `time()`. # # Timestamp timestamp; # timestamp.set_seconds(time(NULL)); # timestamp.set_nanos(0); # # Example 2: Compute Timestamp from POSIX `gettimeofday()`. # # struct timeval tv; # gettimeofday(&tv, NULL); # # Timestamp timestamp; # timestamp.set_seconds(tv.tv_sec); # timestamp.set_nanos(tv.tv_usec * 1000); # # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. # # FILETIME ft; # GetSystemTimeAsFileTime(&ft); # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; # # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. # Timestamp timestamp; # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); # # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. # # long millis = System.currentTimeMillis(); # # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) # .setNanos((int) ((millis % 1000) * 1000000)).build(); # # Example 5: Compute Timestamp from Java `Instant.now()`. # # Instant now = Instant.now(); # # Timestamp timestamp = # Timestamp.newBuilder().setSeconds(now.getEpochSecond()) # .setNanos(now.getNano()).build(); # # Example 6: Compute Timestamp from current time in Python. # # timestamp = Timestamp() # timestamp.GetCurrentTime() # # # JSON Mapping # # In JSON format, the Timestamp type is encoded as a string in the # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z" # where \\{year} is always expressed using four digits while \\{month}, \\{day}, # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone # is required. A proto3 JSON serializer should always use UTC (as indicated by # "Z") when printing the Timestamp type and a proto3 JSON parser should be # able to accept both UTC and other timezones (as indicated by an offset). # # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past # 01:30 UTC on January 15, 2017. # # In JavaScript, one can convert a Date object to this format using the # standard # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) # method. In Python, a standard `datetime.datetime` object can be converted # to this format using # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use # the Joda Time's [`ISODateTimeFormat.dateTime()`]( # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() # ) to obtain a formatter capable of generating timestamps in this format. # @!attribute [rw] seconds # @return [::Integer] # Represents seconds of UTC time since Unix epoch # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to # 9999-12-31T23:59:59Z inclusive. # @!attribute [rw] nanos # @return [::Integer] # Non-negative fractions of a second at nanosecond resolution. Negative # second values with fractions must still have non-negative nanos values # that count forward in time. Must be from 0 to 999,999,999 # inclusive. class Timestamp include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end end end google-cloud-logging-v2-1.5.1/proto_docs/google/protobuf/any.rb0000644000004100000410000001246415143461113024510 0ustar www-datawww-data# frozen_string_literal: true # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Auto-generated by gapic-generator-ruby. DO NOT EDIT! module Google module Protobuf # `Any` contains an arbitrary serialized protocol buffer message along with a # URL that describes the type of the serialized message. # # Protobuf library provides support to pack/unpack Any values in the form # of utility functions or additional generated methods of the Any type. # # Example 1: Pack and unpack a message in C++. # # Foo foo = ...; # Any any; # any.PackFrom(foo); # ... # if (any.UnpackTo(&foo)) { # ... # } # # Example 2: Pack and unpack a message in Java. # # Foo foo = ...; # Any any = Any.pack(foo); # ... # if (any.is(Foo.class)) { # foo = any.unpack(Foo.class); # } # // or ... # if (any.isSameTypeAs(Foo.getDefaultInstance())) { # foo = any.unpack(Foo.getDefaultInstance()); # } # # Example 3: Pack and unpack a message in Python. # # foo = Foo(...) # any = Any() # any.Pack(foo) # ... # if any.Is(Foo.DESCRIPTOR): # any.Unpack(foo) # ... # # Example 4: Pack and unpack a message in Go # # foo := &pb.Foo{...} # any, err := anypb.New(foo) # if err != nil { # ... # } # ... # foo := &pb.Foo{} # if err := any.UnmarshalTo(foo); err != nil { # ... # } # # The pack methods provided by protobuf library will by default use # 'type.googleapis.com/full.type.name' as the type URL and the unpack # methods only use the fully qualified type name after the last '/' # in the type URL, for example "foo.bar.com/x/y.z" will yield type # name "y.z". # # JSON # ==== # The JSON representation of an `Any` value uses the regular # representation of the deserialized, embedded message, with an # additional field `@type` which contains the type URL. Example: # # package google.profile; # message Person { # string first_name = 1; # string last_name = 2; # } # # { # "@type": "type.googleapis.com/google.profile.Person", # "firstName": , # "lastName": # } # # If the embedded message type is well-known and has a custom JSON # representation, that representation will be embedded adding a field # `value` which holds the custom JSON in addition to the `@type` # field. Example (for message [google.protobuf.Duration][]): # # { # "@type": "type.googleapis.com/google.protobuf.Duration", # "value": "1.212s" # } # @!attribute [rw] type_url # @return [::String] # A URL/resource name that uniquely identifies the type of the serialized # protocol buffer message. This string must contain at least # one "/" character. The last segment of the URL's path must represent # the fully qualified name of the type (as in # `path/google.protobuf.Duration`). The name should be in a canonical form # (e.g., leading "." is not accepted). # # In practice, teams usually precompile into the binary all types that they # expect it to use in the context of Any. However, for URLs which use the # scheme `http`, `https`, or no scheme, one can optionally set up a type # server that maps type URLs to message definitions as follows: # # * If no scheme is provided, `https` is assumed. # * An HTTP GET on the URL must yield a [google.protobuf.Type][] # value in binary format, or produce an error. # * Applications are allowed to cache lookup results based on the # URL, or have them precompiled into a binary to avoid any # lookup. Therefore, binary compatibility needs to be preserved # on changes to types. (Use versioned type names to manage # breaking changes.) # # Note: this functionality is not currently available in the official # protobuf release, and it is not used for type URLs beginning with # type.googleapis.com. As of May 2023, there are no widely used type server # implementations and no plans to implement one. # # Schemes other than `http`, `https` (or the empty scheme) might be # used with implementation specific semantics. # @!attribute [rw] value # @return [::String] # Must be a valid serialized protocol buffer of the above specified type. class Any include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end end end google-cloud-logging-v2-1.5.1/proto_docs/google/api/0000755000004100000410000000000015143461113022276 5ustar www-datawww-datagoogle-cloud-logging-v2-1.5.1/proto_docs/google/api/monitored_resource.rb0000644000004100000410000001604515143461113026540 0ustar www-datawww-data# frozen_string_literal: true # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Auto-generated by gapic-generator-ruby. DO NOT EDIT! module Google module Api # An object that describes the schema of a # {::Google::Api::MonitoredResource MonitoredResource} object using a type name # and a set of labels. For example, the monitored resource descriptor for # Google Compute Engine VM instances has a type of # `"gce_instance"` and specifies the use of the labels `"instance_id"` and # `"zone"` to identify particular VM instances. # # Different APIs can support different monitored resource types. APIs generally # provide a `list` method that returns the monitored resource descriptors used # by the API. # @!attribute [rw] name # @return [::String] # Optional. The resource name of the monitored resource descriptor: # `"projects/{project_id}/monitoredResourceDescriptors/{type}"` where # \\{type} is the value of the `type` field in this object and # \\{project_id} is a project ID that provides API-specific context for # accessing the type. APIs that do not use project information can use the # resource name format `"monitoredResourceDescriptors/{type}"`. # @!attribute [rw] type # @return [::String] # Required. The monitored resource type. For example, the type # `"cloudsql_database"` represents databases in Google Cloud SQL. # For a list of types, see [Monitored resource # types](https://cloud.google.com/monitoring/api/resources) # and [Logging resource # types](https://cloud.google.com/logging/docs/api/v2/resource-list). # @!attribute [rw] display_name # @return [::String] # Optional. A concise name for the monitored resource type that might be # displayed in user interfaces. It should be a Title Cased Noun Phrase, # without any article or other determiners. For example, # `"Google Cloud SQL Database"`. # @!attribute [rw] description # @return [::String] # Optional. A detailed description of the monitored resource type that might # be used in documentation. # @!attribute [rw] labels # @return [::Array<::Google::Api::LabelDescriptor>] # Required. A set of labels used to describe instances of this monitored # resource type. For example, an individual Google Cloud SQL database is # identified by values for the labels `"database_id"` and `"zone"`. # @!attribute [rw] launch_stage # @return [::Google::Api::LaunchStage] # Optional. The launch stage of the monitored resource definition. class MonitoredResourceDescriptor include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # An object representing a resource that can be used for monitoring, logging, # billing, or other purposes. Examples include virtual machine instances, # databases, and storage devices such as disks. The `type` field identifies a # {::Google::Api::MonitoredResourceDescriptor MonitoredResourceDescriptor} object # that describes the resource's schema. Information in the `labels` field # identifies the actual resource and its attributes according to the schema. # For example, a particular Compute Engine VM instance could be represented by # the following object, because the # {::Google::Api::MonitoredResourceDescriptor MonitoredResourceDescriptor} for # `"gce_instance"` has labels # `"project_id"`, `"instance_id"` and `"zone"`: # # { "type": "gce_instance", # "labels": { "project_id": "my-project", # "instance_id": "12345678901234", # "zone": "us-central1-a" }} # @!attribute [rw] type # @return [::String] # Required. The monitored resource type. This field must match # the `type` field of a # {::Google::Api::MonitoredResourceDescriptor MonitoredResourceDescriptor} # object. For example, the type of a Compute Engine VM instance is # `gce_instance`. Some descriptors include the service name in the type; for # example, the type of a Datastream stream is # `datastream.googleapis.com/Stream`. # @!attribute [rw] labels # @return [::Google::Protobuf::Map{::String => ::String}] # Required. Values for all of the labels listed in the associated monitored # resource descriptor. For example, Compute Engine VM instances use the # labels `"project_id"`, `"instance_id"`, and `"zone"`. class MonitoredResource include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # @!attribute [rw] key # @return [::String] # @!attribute [rw] value # @return [::String] class LabelsEntry include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end end # Auxiliary metadata for a {::Google::Api::MonitoredResource MonitoredResource} # object. {::Google::Api::MonitoredResource MonitoredResource} objects contain the # minimum set of information to uniquely identify a monitored resource # instance. There is some other useful auxiliary metadata. Monitoring and # Logging use an ingestion pipeline to extract metadata for cloud resources of # all types, and store the metadata in this message. # @!attribute [rw] system_labels # @return [::Google::Protobuf::Struct] # Output only. Values for predefined system metadata labels. # System labels are a kind of metadata extracted by Google, including # "machine_image", "vpc", "subnet_id", # "security_group", "name", etc. # System label values can be only strings, Boolean values, or a list of # strings. For example: # # { "name": "my-test-instance", # "security_group": ["a", "b", "c"], # "spot_instance": false } # @!attribute [rw] user_labels # @return [::Google::Protobuf::Map{::String => ::String}] # Output only. A map of user-defined metadata labels. class MonitoredResourceMetadata include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # @!attribute [rw] key # @return [::String] # @!attribute [rw] value # @return [::String] class UserLabelsEntry include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end end end end google-cloud-logging-v2-1.5.1/proto_docs/google/api/resource.rb0000644000004100000410000002233515143461113024457 0ustar www-datawww-data# frozen_string_literal: true # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Auto-generated by gapic-generator-ruby. DO NOT EDIT! module Google module Api # A simple descriptor of a resource type. # # ResourceDescriptor annotates a resource message (either by means of a # protobuf annotation or use in the service config), and associates the # resource's schema, the resource type, and the pattern of the resource name. # # Example: # # message Topic { # // Indicates this message defines a resource schema. # // Declares the resource type in the format of {service}/{kind}. # // For Kubernetes resources, the format is {api group}/{kind}. # option (google.api.resource) = { # type: "pubsub.googleapis.com/Topic" # pattern: "projects/{project}/topics/{topic}" # }; # } # # The ResourceDescriptor Yaml config will look like: # # resources: # - type: "pubsub.googleapis.com/Topic" # pattern: "projects/{project}/topics/{topic}" # # Sometimes, resources have multiple patterns, typically because they can # live under multiple parents. # # Example: # # message LogEntry { # option (google.api.resource) = { # type: "logging.googleapis.com/LogEntry" # pattern: "projects/{project}/logs/{log}" # pattern: "folders/{folder}/logs/{log}" # pattern: "organizations/{organization}/logs/{log}" # pattern: "billingAccounts/{billing_account}/logs/{log}" # }; # } # # The ResourceDescriptor Yaml config will look like: # # resources: # - type: 'logging.googleapis.com/LogEntry' # pattern: "projects/{project}/logs/{log}" # pattern: "folders/{folder}/logs/{log}" # pattern: "organizations/{organization}/logs/{log}" # pattern: "billingAccounts/{billing_account}/logs/{log}" # @!attribute [rw] type # @return [::String] # The resource type. It must be in the format of # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be # singular and must not include version numbers. # # Example: `storage.googleapis.com/Bucket` # # The value of the resource_type_kind must follow the regular expression # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and # should use PascalCase (UpperCamelCase). The maximum number of # characters allowed for the `resource_type_kind` is 100. # @!attribute [rw] pattern # @return [::Array<::String>] # Optional. The relative resource name pattern associated with this resource # type. The DNS prefix of the full resource name shouldn't be specified here. # # The path pattern must follow the syntax, which aligns with HTTP binding # syntax: # # Template = Segment { "/" Segment } ; # Segment = LITERAL | Variable ; # Variable = "{" LITERAL "}" ; # # Examples: # # - "projects/\\{project}/topics/\\{topic}" # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" # # The components in braces correspond to the IDs for each resource in the # hierarchy. It is expected that, if multiple patterns are provided, # the same component name (e.g. "project") refers to IDs of the same # type of resource. # @!attribute [rw] name_field # @return [::String] # Optional. The field on the resource that designates the resource name # field. If omitted, this is assumed to be "name". # @!attribute [rw] history # @return [::Google::Api::ResourceDescriptor::History] # Optional. The historical or future-looking state of the resource pattern. # # Example: # # // The InspectTemplate message originally only supported resource # // names with organization, and project was added later. # message InspectTemplate { # option (google.api.resource) = { # type: "dlp.googleapis.com/InspectTemplate" # pattern: # "organizations/{organization}/inspectTemplates/{inspect_template}" # pattern: "projects/{project}/inspectTemplates/{inspect_template}" # history: ORIGINALLY_SINGLE_PATTERN # }; # } # @!attribute [rw] plural # @return [::String] # The plural name used in the resource name and permission names, such as # 'projects' for the resource name of 'projects/\\{project}' and the permission # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception # to this is for Nested Collections that have stuttering names, as defined # in [AIP-122](https://google.aip.dev/122#nested-collections), where the # collection ID in the resource name pattern does not necessarily directly # match the `plural` value. # # It is the same concept of the `plural` field in k8s CRD spec # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ # # Note: The plural form is required even for singleton resources. See # https://aip.dev/156 # @!attribute [rw] singular # @return [::String] # The same concept of the `singular` field in k8s CRD spec # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ # Such as "project" for the `resourcemanager.googleapis.com/Project` type. # @!attribute [rw] style # @return [::Array<::Google::Api::ResourceDescriptor::Style>] # Style flag(s) for this resource. # These indicate that a resource is expected to conform to a given # style. See the specific style flags for additional information. class ResourceDescriptor include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # A description of the historical or future-looking state of the # resource pattern. module History # The "unset" value. HISTORY_UNSPECIFIED = 0 # The resource originally had one pattern and launched as such, and # additional patterns were added later. ORIGINALLY_SINGLE_PATTERN = 1 # The resource has one pattern, but the API owner expects to add more # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents # that from being necessary once there are multiple patterns.) FUTURE_MULTI_PATTERN = 2 end # A flag representing a specific style that a resource claims to conform to. module Style # The unspecified value. Do not use. STYLE_UNSPECIFIED = 0 # This resource is intended to be "declarative-friendly". # # Declarative-friendly resources must be more strictly consistent, and # setting this to true communicates to tools that this resource should # adhere to declarative-friendly expectations. # # Note: This is used by the API linter (linter.aip.dev) to enable # additional checks. DECLARATIVE_FRIENDLY = 1 end end # Defines a proto annotation that describes a string field that refers to # an API resource. # @!attribute [rw] type # @return [::String] # The resource type that the annotated field references. # # Example: # # message Subscription { # string topic = 2 [(google.api.resource_reference) = { # type: "pubsub.googleapis.com/Topic" # }]; # } # # Occasionally, a field may reference an arbitrary resource. In this case, # APIs use the special value * in their resource reference. # # Example: # # message GetIamPolicyRequest { # string resource = 2 [(google.api.resource_reference) = { # type: "*" # }]; # } # @!attribute [rw] child_type # @return [::String] # The resource type of a child collection that the annotated field # references. This is useful for annotating the `parent` field that # doesn't have a fixed resource type. # # Example: # # message ListLogEntriesRequest { # string parent = 1 [(google.api.resource_reference) = { # child_type: "logging.googleapis.com/LogEntry" # }; # } class ResourceReference include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end end end google-cloud-logging-v2-1.5.1/proto_docs/google/api/field_behavior.rb0000644000004100000410000000704515143461113025573 0ustar www-datawww-data# frozen_string_literal: true # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Auto-generated by gapic-generator-ruby. DO NOT EDIT! module Google module Api # An indicator of the behavior of a given field (for example, that a field # is required in requests, or given as output but ignored as input). # This **does not** change the behavior in protocol buffers itself; it only # denotes the behavior and may affect how API tooling handles the field. # # Note: This enum **may** receive new values in the future. module FieldBehavior # Conventional default for enums. Do not use this. FIELD_BEHAVIOR_UNSPECIFIED = 0 # Specifically denotes a field as optional. # While all fields in protocol buffers are optional, this may be specified # for emphasis if appropriate. OPTIONAL = 1 # Denotes a field as required. # This indicates that the field **must** be provided as part of the request, # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). REQUIRED = 2 # Denotes a field as output only. # This indicates that the field is provided in responses, but including the # field in a request does nothing (the server *must* ignore it and # *must not* throw an error as a result of the field's presence). OUTPUT_ONLY = 3 # Denotes a field as input only. # This indicates that the field is provided in requests, and the # corresponding field is not included in output. INPUT_ONLY = 4 # Denotes a field as immutable. # This indicates that the field may be set once in a request to create a # resource, but may not be changed thereafter. IMMUTABLE = 5 # Denotes that a (repeated) field is an unordered list. # This indicates that the service may provide the elements of the list # in any arbitrary order, rather than the order the user originally # provided. Additionally, the list's order may or may not be stable. UNORDERED_LIST = 6 # Denotes that this field returns a non-empty default value if not set. # This indicates that if the user provides the empty value in a request, # a non-empty value will be returned. The user will not be aware of what # non-empty value to expect. NON_EMPTY_DEFAULT = 7 # Denotes that the field in a resource (a message annotated with # google.api.resource) is used in the resource name to uniquely identify the # resource. For AIP-compliant APIs, this should only be applied to the # `name` field on the resource. # # This behavior should not be applied to references to other resources within # the message. # # The identifier field of resources often have different field behavior # depending on the request it is embedded in (e.g. for Create methods name # is optional and unused, while for Update methods it is required). Instead # of method-specific annotations, only `IDENTIFIER` is required. IDENTIFIER = 8 end end end google-cloud-logging-v2-1.5.1/proto_docs/google/api/distribution.rb0000644000004100000410000002604015143461113025344 0ustar www-datawww-data# frozen_string_literal: true # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Auto-generated by gapic-generator-ruby. DO NOT EDIT! module Google module Api # `Distribution` contains summary statistics for a population of values. It # optionally contains a histogram representing the distribution of those values # across a set of buckets. # # The summary statistics are the count, mean, sum of the squared deviation from # the mean, the minimum, and the maximum of the set of population of values. # The histogram is based on a sequence of buckets and gives a count of values # that fall into each bucket. The boundaries of the buckets are given either # explicitly or by formulas for buckets of fixed or exponentially increasing # widths. # # Although it is not forbidden, it is generally a bad idea to include # non-finite values (infinities or NaNs) in the population of values, as this # will render the `mean` and `sum_of_squared_deviation` fields meaningless. # @!attribute [rw] count # @return [::Integer] # The number of values in the population. Must be non-negative. This value # must equal the sum of the values in `bucket_counts` if a histogram is # provided. # @!attribute [rw] mean # @return [::Float] # The arithmetic mean of the values in the population. If `count` is zero # then this field must be zero. # @!attribute [rw] sum_of_squared_deviation # @return [::Float] # The sum of squared deviations from the mean of the values in the # population. For values x_i this is: # # Sum[i=1..n]((x_i - mean)^2) # # Knuth, "The Art of Computer Programming", Vol. 2, page 232, 3rd edition # describes Welford's method for accumulating this sum in one pass. # # If `count` is zero then this field must be zero. # @!attribute [rw] range # @return [::Google::Api::Distribution::Range] # If specified, contains the range of the population values. The field # must not be present if the `count` is zero. # @!attribute [rw] bucket_options # @return [::Google::Api::Distribution::BucketOptions] # Defines the histogram bucket boundaries. If the distribution does not # contain a histogram, then omit this field. # @!attribute [rw] bucket_counts # @return [::Array<::Integer>] # The number of values in each bucket of the histogram, as described in # `bucket_options`. If the distribution does not have a histogram, then omit # this field. If there is a histogram, then the sum of the values in # `bucket_counts` must equal the value in the `count` field of the # distribution. # # If present, `bucket_counts` should contain N values, where N is the number # of buckets specified in `bucket_options`. If you supply fewer than N # values, the remaining values are assumed to be 0. # # The order of the values in `bucket_counts` follows the bucket numbering # schemes described for the three bucket types. The first value must be the # count for the underflow bucket (number 0). The next N-2 values are the # counts for the finite buckets (number 1 through N-2). The N'th value in # `bucket_counts` is the count for the overflow bucket (number N-1). # @!attribute [rw] exemplars # @return [::Array<::Google::Api::Distribution::Exemplar>] # Must be in increasing order of `value` field. class Distribution include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # The range of the population values. # @!attribute [rw] min # @return [::Float] # The minimum of the population values. # @!attribute [rw] max # @return [::Float] # The maximum of the population values. class Range include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # `BucketOptions` describes the bucket boundaries used to create a histogram # for the distribution. The buckets can be in a linear sequence, an # exponential sequence, or each bucket can be specified explicitly. # `BucketOptions` does not include the number of values in each bucket. # # A bucket has an inclusive lower bound and exclusive upper bound for the # values that are counted for that bucket. The upper bound of a bucket must # be strictly greater than the lower bound. The sequence of N buckets for a # distribution consists of an underflow bucket (number 0), zero or more # finite buckets (number 1 through N - 2) and an overflow bucket (number N - # 1). The buckets are contiguous: the lower bound of bucket i (i > 0) is the # same as the upper bound of bucket i - 1. The buckets span the whole range # of finite values: lower bound of the underflow bucket is -infinity and the # upper bound of the overflow bucket is +infinity. The finite buckets are # so-called because both bounds are finite. # @!attribute [rw] linear_buckets # @return [::Google::Api::Distribution::BucketOptions::Linear] # The linear bucket. # # Note: The following fields are mutually exclusive: `linear_buckets`, `exponential_buckets`, `explicit_buckets`. If a field in that set is populated, all other fields in the set will automatically be cleared. # @!attribute [rw] exponential_buckets # @return [::Google::Api::Distribution::BucketOptions::Exponential] # The exponential buckets. # # Note: The following fields are mutually exclusive: `exponential_buckets`, `linear_buckets`, `explicit_buckets`. If a field in that set is populated, all other fields in the set will automatically be cleared. # @!attribute [rw] explicit_buckets # @return [::Google::Api::Distribution::BucketOptions::Explicit] # The explicit buckets. # # Note: The following fields are mutually exclusive: `explicit_buckets`, `linear_buckets`, `exponential_buckets`. If a field in that set is populated, all other fields in the set will automatically be cleared. class BucketOptions include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # Specifies a linear sequence of buckets that all have the same width # (except overflow and underflow). Each bucket represents a constant # absolute uncertainty on the specific value in the bucket. # # There are `num_finite_buckets + 2` (= N) buckets. Bucket `i` has the # following boundaries: # # Upper bound (0 <= i < N-1): offset + (width * i). # # Lower bound (1 <= i < N): offset + (width * (i - 1)). # @!attribute [rw] num_finite_buckets # @return [::Integer] # Must be greater than 0. # @!attribute [rw] width # @return [::Float] # Must be greater than 0. # @!attribute [rw] offset # @return [::Float] # Lower bound of the first bucket. class Linear include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # Specifies an exponential sequence of buckets that have a width that is # proportional to the value of the lower bound. Each bucket represents a # constant relative uncertainty on a specific value in the bucket. # # There are `num_finite_buckets + 2` (= N) buckets. Bucket `i` has the # following boundaries: # # Upper bound (0 <= i < N-1): scale * (growth_factor ^ i). # # Lower bound (1 <= i < N): scale * (growth_factor ^ (i - 1)). # @!attribute [rw] num_finite_buckets # @return [::Integer] # Must be greater than 0. # @!attribute [rw] growth_factor # @return [::Float] # Must be greater than 1. # @!attribute [rw] scale # @return [::Float] # Must be greater than 0. class Exponential include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # Specifies a set of buckets with arbitrary widths. # # There are `size(bounds) + 1` (= N) buckets. Bucket `i` has the following # boundaries: # # Upper bound (0 <= i < N-1): bounds[i] # Lower bound (1 <= i < N); bounds[i - 1] # # The `bounds` field must contain at least one element. If `bounds` has # only one element, then there are no finite buckets, and that single # element is the common boundary of the overflow and underflow buckets. # @!attribute [rw] bounds # @return [::Array<::Float>] # The values must be monotonically increasing. class Explicit include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end end # Exemplars are example points that may be used to annotate aggregated # distribution values. They are metadata that gives information about a # particular value added to a Distribution bucket, such as a trace ID that # was active when a value was added. They may contain further information, # such as a example values and timestamps, origin, etc. # @!attribute [rw] value # @return [::Float] # Value of the exemplar point. This value determines to which bucket the # exemplar belongs. # @!attribute [rw] timestamp # @return [::Google::Protobuf::Timestamp] # The observation (sampling) time of the above value. # @!attribute [rw] attachments # @return [::Array<::Google::Protobuf::Any>] # Contextual information about the example value. Examples are: # # Trace: type.googleapis.com/google.monitoring.v3.SpanContext # # Literal string: type.googleapis.com/google.protobuf.StringValue # # Labels dropped during aggregation: # type.googleapis.com/google.monitoring.v3.DroppedLabels # # There may be only a single attachment of any given message type in a # single exemplar, and this is enforced by the system. class Exemplar include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end end end end google-cloud-logging-v2-1.5.1/proto_docs/google/api/launch_stage.rb0000644000004100000410000000575415143461113025273 0ustar www-datawww-data# frozen_string_literal: true # Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Auto-generated by gapic-generator-ruby. DO NOT EDIT! module Google module Api # The launch stage as defined by [Google Cloud Platform # Launch Stages](https://cloud.google.com/terms/launch-stages). module LaunchStage # Do not use this default value. LAUNCH_STAGE_UNSPECIFIED = 0 # The feature is not yet implemented. Users can not use it. UNIMPLEMENTED = 6 # Prelaunch features are hidden from users and are only visible internally. PRELAUNCH = 7 # Early Access features are limited to a closed group of testers. To use # these features, you must sign up in advance and sign a Trusted Tester # agreement (which includes confidentiality provisions). These features may # be unstable, changed in backward-incompatible ways, and are not # guaranteed to be released. EARLY_ACCESS = 1 # Alpha is a limited availability test for releases before they are cleared # for widespread use. By Alpha, all significant design issues are resolved # and we are in the process of verifying functionality. Alpha customers # need to apply for access, agree to applicable terms, and have their # projects allowlisted. Alpha releases don't have to be feature complete, # no SLAs are provided, and there are no technical support obligations, but # they will be far enough along that customers can actually use them in # test environments or for limited-use tests -- just like they would in # normal production cases. ALPHA = 2 # Beta is the point at which we are ready to open a release for any # customer to use. There are no SLA or technical support obligations in a # Beta release. Products will be complete from a feature perspective, but # may have some open outstanding issues. Beta releases are suitable for # limited production use cases. BETA = 3 # GA features are open to all developers and are considered stable and # fully qualified for production use. GA = 4 # Deprecated features are scheduled to be shut down and removed. For more # information, see the "Deprecation Policy" section of our [Terms of # Service](https://cloud.google.com/terms/) # and the [Google Cloud Platform Subject to the Deprecation # Policy](https://cloud.google.com/terms/deprecation) documentation. DEPRECATED = 5 end end end google-cloud-logging-v2-1.5.1/proto_docs/google/api/label.rb0000644000004100000410000000272515143461113023710 0ustar www-datawww-data# frozen_string_literal: true # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Auto-generated by gapic-generator-ruby. DO NOT EDIT! module Google module Api # A description of a label. # @!attribute [rw] key # @return [::String] # The label key. # @!attribute [rw] value_type # @return [::Google::Api::LabelDescriptor::ValueType] # The type of data that can be assigned to the label. # @!attribute [rw] description # @return [::String] # A human-readable description for the label. class LabelDescriptor include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # Value types that can be used as label values. module ValueType # A variable-length string. This is the default. STRING = 0 # Boolean; true or false. BOOL = 1 # A 64-bit signed integer. INT64 = 2 end end end end google-cloud-logging-v2-1.5.1/proto_docs/google/api/client.rb0000644000004100000410000004673715143461113024122 0ustar www-datawww-data# frozen_string_literal: true # Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Auto-generated by gapic-generator-ruby. DO NOT EDIT! module Google module Api # Required information for every language. # @!attribute [rw] reference_docs_uri # @deprecated This field is deprecated and may be removed in the next major version update. # @return [::String] # Link to automatically generated reference documentation. Example: # https://cloud.google.com/nodejs/docs/reference/asset/latest # @!attribute [rw] destinations # @return [::Array<::Google::Api::ClientLibraryDestination>] # The destination where API teams want this client library to be published. # @!attribute [rw] selective_gapic_generation # @return [::Google::Api::SelectiveGapicGeneration] # Configuration for which RPCs should be generated in the GAPIC client. class CommonLanguageSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # Details about how and where to publish client libraries. # @!attribute [rw] version # @return [::String] # Version of the API to apply these settings to. This is the full protobuf # package for the API, ending in the version element. # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". # @!attribute [rw] launch_stage # @return [::Google::Api::LaunchStage] # Launch stage of this version of the API. # @!attribute [rw] rest_numeric_enums # @return [::Boolean] # When using transport=rest, the client request will encode enums as # numbers rather than strings. # @!attribute [rw] java_settings # @return [::Google::Api::JavaSettings] # Settings for legacy Java features, supported in the Service YAML. # @!attribute [rw] cpp_settings # @return [::Google::Api::CppSettings] # Settings for C++ client libraries. # @!attribute [rw] php_settings # @return [::Google::Api::PhpSettings] # Settings for PHP client libraries. # @!attribute [rw] python_settings # @return [::Google::Api::PythonSettings] # Settings for Python client libraries. # @!attribute [rw] node_settings # @return [::Google::Api::NodeSettings] # Settings for Node client libraries. # @!attribute [rw] dotnet_settings # @return [::Google::Api::DotnetSettings] # Settings for .NET client libraries. # @!attribute [rw] ruby_settings # @return [::Google::Api::RubySettings] # Settings for Ruby client libraries. # @!attribute [rw] go_settings # @return [::Google::Api::GoSettings] # Settings for Go client libraries. class ClientLibrarySettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # This message configures the settings for publishing [Google Cloud Client # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) # generated from the service config. # @!attribute [rw] method_settings # @return [::Array<::Google::Api::MethodSettings>] # A list of API method settings, e.g. the behavior for methods that use the # long-running operation pattern. # @!attribute [rw] new_issue_uri # @return [::String] # Link to a *public* URI where users can report issues. Example: # https://issuetracker.google.com/issues/new?component=190865&template=1161103 # @!attribute [rw] documentation_uri # @return [::String] # Link to product home page. Example: # https://cloud.google.com/asset-inventory/docs/overview # @!attribute [rw] api_short_name # @return [::String] # Used as a tracking tag when collecting data about the APIs developer # relations artifacts like docs, packages delivered to package managers, # etc. Example: "speech". # @!attribute [rw] github_label # @return [::String] # GitHub label to apply to issues and pull requests opened for this API. # @!attribute [rw] codeowner_github_teams # @return [::Array<::String>] # GitHub teams to be added to CODEOWNERS in the directory in GitHub # containing source code for the client libraries for this API. # @!attribute [rw] doc_tag_prefix # @return [::String] # A prefix used in sample code when demarking regions to be included in # documentation. # @!attribute [rw] organization # @return [::Google::Api::ClientLibraryOrganization] # For whom the client library is being published. # @!attribute [rw] library_settings # @return [::Array<::Google::Api::ClientLibrarySettings>] # Client library settings. If the same version string appears multiple # times in this list, then the last one wins. Settings from earlier # settings with the same version string are discarded. # @!attribute [rw] proto_reference_documentation_uri # @return [::String] # Optional link to proto reference documentation. Example: # https://cloud.google.com/pubsub/lite/docs/reference/rpc # @!attribute [rw] rest_reference_documentation_uri # @return [::String] # Optional link to REST reference documentation. Example: # https://cloud.google.com/pubsub/lite/docs/reference/rest class Publishing include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # Settings for Java client libraries. # @!attribute [rw] library_package # @return [::String] # The package name to use in Java. Clobbers the java_package option # set in the protobuf. This should be used **only** by APIs # who have already set the language_settings.java.package_name" field # in gapic.yaml. API teams should use the protobuf java_package option # where possible. # # Example of a YAML configuration:: # # publishing: # java_settings: # library_package: com.google.cloud.pubsub.v1 # @!attribute [rw] service_class_names # @return [::Google::Protobuf::Map{::String => ::String}] # Configure the Java class name to use instead of the service's for its # corresponding generated GAPIC client. Keys are fully-qualified # service names as they appear in the protobuf (including the full # the language_settings.java.interface_names" field in gapic.yaml. API # teams should otherwise use the service name as it appears in the # protobuf. # # Example of a YAML configuration:: # # publishing: # java_settings: # service_class_names: # - google.pubsub.v1.Publisher: TopicAdmin # - google.pubsub.v1.Subscriber: SubscriptionAdmin # @!attribute [rw] common # @return [::Google::Api::CommonLanguageSettings] # Some settings. class JavaSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # @!attribute [rw] key # @return [::String] # @!attribute [rw] value # @return [::String] class ServiceClassNamesEntry include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end end # Settings for C++ client libraries. # @!attribute [rw] common # @return [::Google::Api::CommonLanguageSettings] # Some settings. class CppSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # Settings for Php client libraries. # @!attribute [rw] common # @return [::Google::Api::CommonLanguageSettings] # Some settings. class PhpSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # Settings for Python client libraries. # @!attribute [rw] common # @return [::Google::Api::CommonLanguageSettings] # Some settings. # @!attribute [rw] experimental_features # @return [::Google::Api::PythonSettings::ExperimentalFeatures] # Experimental features to be included during client library generation. class PythonSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # Experimental features to be included during client library generation. # These fields will be deprecated once the feature graduates and is enabled # by default. # @!attribute [rw] rest_async_io_enabled # @return [::Boolean] # Enables generation of asynchronous REST clients if `rest` transport is # enabled. By default, asynchronous REST clients will not be generated. # This feature will be enabled by default 1 month after launching the # feature in preview packages. # @!attribute [rw] protobuf_pythonic_types_enabled # @return [::Boolean] # Enables generation of protobuf code using new types that are more # Pythonic which are included in `protobuf>=5.29.x`. This feature will be # enabled by default 1 month after launching the feature in preview # packages. # @!attribute [rw] unversioned_package_disabled # @return [::Boolean] # Disables generation of an unversioned Python package for this client # library. This means that the module names will need to be versioned in # import statements. For example `import google.cloud.library_v2` instead # of `import google.cloud.library`. class ExperimentalFeatures include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end end # Settings for Node client libraries. # @!attribute [rw] common # @return [::Google::Api::CommonLanguageSettings] # Some settings. class NodeSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # Settings for Dotnet client libraries. # @!attribute [rw] common # @return [::Google::Api::CommonLanguageSettings] # Some settings. # @!attribute [rw] renamed_services # @return [::Google::Protobuf::Map{::String => ::String}] # Map from original service names to renamed versions. # This is used when the default generated types # would cause a naming conflict. (Neither name is # fully-qualified.) # Example: Subscriber to SubscriberServiceApi. # @!attribute [rw] renamed_resources # @return [::Google::Protobuf::Map{::String => ::String}] # Map from full resource types to the effective short name # for the resource. This is used when otherwise resource # named from different services would cause naming collisions. # Example entry: # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" # @!attribute [rw] ignored_resources # @return [::Array<::String>] # List of full resource types to ignore during generation. # This is typically used for API-specific Location resources, # which should be handled by the generator as if they were actually # the common Location resources. # Example entry: "documentai.googleapis.com/Location" # @!attribute [rw] forced_namespace_aliases # @return [::Array<::String>] # Namespaces which must be aliased in snippets due to # a known (but non-generator-predictable) naming collision # @!attribute [rw] handwritten_signatures # @return [::Array<::String>] # Method signatures (in the form "service.method(signature)") # which are provided separately, so shouldn't be generated. # Snippets *calling* these methods are still generated, however. class DotnetSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # @!attribute [rw] key # @return [::String] # @!attribute [rw] value # @return [::String] class RenamedServicesEntry include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # @!attribute [rw] key # @return [::String] # @!attribute [rw] value # @return [::String] class RenamedResourcesEntry include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end end # Settings for Ruby client libraries. # @!attribute [rw] common # @return [::Google::Api::CommonLanguageSettings] # Some settings. class RubySettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # Settings for Go client libraries. # @!attribute [rw] common # @return [::Google::Api::CommonLanguageSettings] # Some settings. # @!attribute [rw] renamed_services # @return [::Google::Protobuf::Map{::String => ::String}] # Map of service names to renamed services. Keys are the package relative # service names and values are the name to be used for the service client # and call options. # # publishing: # go_settings: # renamed_services: # Publisher: TopicAdmin class GoSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # @!attribute [rw] key # @return [::String] # @!attribute [rw] value # @return [::String] class RenamedServicesEntry include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end end # Describes the generator configuration for a method. # @!attribute [rw] selector # @return [::String] # The fully qualified name of the method, for which the options below apply. # This is used to find the method to apply the options. # # Example: # # publishing: # method_settings: # - selector: google.storage.control.v2.StorageControl.CreateFolder # # method settings for CreateFolder... # @!attribute [rw] long_running # @return [::Google::Api::MethodSettings::LongRunning] # Describes settings to use for long-running operations when generating # API methods for RPCs. Complements RPCs that use the annotations in # google/longrunning/operations.proto. # # Example of a YAML configuration:: # # publishing: # method_settings: # - selector: google.cloud.speech.v2.Speech.BatchRecognize # long_running: # initial_poll_delay: 60s # 1 minute # poll_delay_multiplier: 1.5 # max_poll_delay: 360s # 6 minutes # total_poll_timeout: 54000s # 90 minutes # @!attribute [rw] auto_populated_fields # @return [::Array<::String>] # List of top-level fields of the request message, that should be # automatically populated by the client libraries based on their # (google.api.field_info).format. Currently supported format: UUID4. # # Example of a YAML configuration: # # publishing: # method_settings: # - selector: google.example.v1.ExampleService.CreateExample # auto_populated_fields: # - request_id class MethodSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # Describes settings to use when generating API methods that use the # long-running operation pattern. # All default values below are from those used in the client library # generators (e.g. # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). # @!attribute [rw] initial_poll_delay # @return [::Google::Protobuf::Duration] # Initial delay after which the first poll request will be made. # Default value: 5 seconds. # @!attribute [rw] poll_delay_multiplier # @return [::Float] # Multiplier to gradually increase delay between subsequent polls until it # reaches max_poll_delay. # Default value: 1.5. # @!attribute [rw] max_poll_delay # @return [::Google::Protobuf::Duration] # Maximum time between two subsequent poll requests. # Default value: 45 seconds. # @!attribute [rw] total_poll_timeout # @return [::Google::Protobuf::Duration] # Total polling timeout. # Default value: 5 minutes. class LongRunning include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end end # This message is used to configure the generation of a subset of the RPCs in # a service for client libraries. # @!attribute [rw] methods # @return [::Array<::String>] # An allowlist of the fully qualified names of RPCs that should be included # on public client surfaces. # @!attribute [rw] generate_omitted_as_internal # @return [::Boolean] # Setting this to true indicates to the client generators that methods # that would be excluded from the generation should instead be generated # in a way that indicates these methods should not be consumed by # end users. How this is expressed is up to individual language # implementations to decide. Some examples may be: added annotations, # obfuscated identifiers, or other language idiomatic patterns. class SelectiveGapicGeneration include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # The organization for which the client libraries are being published. # Affects the url where generated docs are published, etc. module ClientLibraryOrganization # Not useful. CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 # Google Cloud Platform Org. CLOUD = 1 # Ads (Advertising) Org. ADS = 2 # Photos Org. PHOTOS = 3 # Street View Org. STREET_VIEW = 4 # Shopping Org. SHOPPING = 5 # Geo Org. GEO = 6 # Generative AI - https://developers.generativeai.google GENERATIVE_AI = 7 end # To where should client libraries be published? module ClientLibraryDestination # Client libraries will neither be generated nor published to package # managers. CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 # Generate the client library in a repo under github.com/googleapis, # but don't publish it to package managers. GITHUB = 10 # Publish the library to package managers like nuget.org and npmjs.com. PACKAGE_MANAGER = 20 end end end google-cloud-logging-v2-1.5.1/proto_docs/google/api/metric.rb0000644000004100000410000003166015143461113024114 0ustar www-datawww-data# frozen_string_literal: true # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Auto-generated by gapic-generator-ruby. DO NOT EDIT! module Google module Api # Defines a metric type and its schema. Once a metric descriptor is created, # deleting or altering it stops data collection and makes the metric type's # existing data unusable. # @!attribute [rw] name # @return [::String] # The resource name of the metric descriptor. # @!attribute [rw] type # @return [::String] # The metric type, including its DNS name prefix. The type is not # URL-encoded. All user-defined metric types have the DNS name # `custom.googleapis.com` or `external.googleapis.com`. Metric types should # use a natural hierarchical grouping. For example: # # "custom.googleapis.com/invoice/paid/amount" # "external.googleapis.com/prometheus/up" # "appengine.googleapis.com/http/server/response_latencies" # @!attribute [rw] labels # @return [::Array<::Google::Api::LabelDescriptor>] # The set of labels that can be used to describe a specific # instance of this metric type. For example, the # `appengine.googleapis.com/http/server/response_latencies` metric # type has a label for the HTTP response code, `response_code`, so # you can look at latencies for successful responses or just # for responses that failed. # @!attribute [rw] metric_kind # @return [::Google::Api::MetricDescriptor::MetricKind] # Whether the metric records instantaneous values, changes to a value, etc. # Some combinations of `metric_kind` and `value_type` might not be supported. # @!attribute [rw] value_type # @return [::Google::Api::MetricDescriptor::ValueType] # Whether the measurement is an integer, a floating-point number, etc. # Some combinations of `metric_kind` and `value_type` might not be supported. # @!attribute [rw] unit # @return [::String] # The units in which the metric value is reported. It is only applicable # if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The `unit` # defines the representation of the stored metric values. # # Different systems might scale the values to be more easily displayed (so a # value of `0.02kBy` _might_ be displayed as `20By`, and a value of # `3523kBy` _might_ be displayed as `3.5MBy`). However, if the `unit` is # `kBy`, then the value of the metric is always in thousands of bytes, no # matter how it might be displayed. # # If you want a custom metric to record the exact number of CPU-seconds used # by a job, you can create an `INT64 CUMULATIVE` metric whose `unit` is # `s{CPU}` (or equivalently `1s{CPU}` or just `s`). If the job uses 12,005 # CPU-seconds, then the value is written as `12005`. # # Alternatively, if you want a custom metric to record data in a more # granular way, you can create a `DOUBLE CUMULATIVE` metric whose `unit` is # `ks{CPU}`, and then write the value `12.005` (which is `12005/1000`), # or use `Kis{CPU}` and write `11.723` (which is `12005/1024`). # # The supported units are a subset of [The Unified Code for Units of # Measure](https://unitsofmeasure.org/ucum.html) standard: # # **Basic units (UNIT)** # # * `bit` bit # * `By` byte # * `s` second # * `min` minute # * `h` hour # * `d` day # * `1` dimensionless # # **Prefixes (PREFIX)** # # * `k` kilo (10^3) # * `M` mega (10^6) # * `G` giga (10^9) # * `T` tera (10^12) # * `P` peta (10^15) # * `E` exa (10^18) # * `Z` zetta (10^21) # * `Y` yotta (10^24) # # * `m` milli (10^-3) # * `u` micro (10^-6) # * `n` nano (10^-9) # * `p` pico (10^-12) # * `f` femto (10^-15) # * `a` atto (10^-18) # * `z` zepto (10^-21) # * `y` yocto (10^-24) # # * `Ki` kibi (2^10) # * `Mi` mebi (2^20) # * `Gi` gibi (2^30) # * `Ti` tebi (2^40) # * `Pi` pebi (2^50) # # **Grammar** # # The grammar also includes these connectors: # # * `/` division or ratio (as an infix operator). For examples, # `kBy/{email}` or `MiBy/10ms` (although you should almost never # have `/s` in a metric `unit`; rates should always be computed at # query time from the underlying cumulative or delta value). # * `.` multiplication or composition (as an infix operator). For # examples, `GBy.d` or `k{watt}.h`. # # The grammar for a unit is as follows: # # Expression = Component { "." Component } { "/" Component } ; # # Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ] # | Annotation # | "1" # ; # # Annotation = "{" NAME "}" ; # # Notes: # # * `Annotation` is just a comment if it follows a `UNIT`. If the annotation # is used alone, then the unit is equivalent to `1`. For examples, # `{request}/s == 1/s`, `By{transmitted}/s == By/s`. # * `NAME` is a sequence of non-blank printable ASCII characters not # containing `{` or `}`. # * `1` represents a unitary [dimensionless # unit](https://en.wikipedia.org/wiki/Dimensionless_quantity) of 1, such # as in `1/s`. It is typically used when none of the basic units are # appropriate. For example, "new users per day" can be represented as # `1/d` or `{new-users}/d` (and a metric value `5` would mean "5 new # users). Alternatively, "thousands of page views per day" would be # represented as `1000/d` or `k1/d` or `k{page_views}/d` (and a metric # value of `5.3` would mean "5300 page views per day"). # * `%` represents dimensionless value of 1/100, and annotates values giving # a percentage (so the metric values are typically in the range of 0..100, # and a metric value `3` means "3 percent"). # * `10^2.%` indicates a metric contains a ratio, typically in the range # 0..1, that will be multiplied by 100 and displayed as a percentage # (so a metric value `0.03` means "3 percent"). # @!attribute [rw] description # @return [::String] # A detailed description of the metric, which can be used in documentation. # @!attribute [rw] display_name # @return [::String] # A concise name for the metric, which can be displayed in user interfaces. # Use sentence case without an ending period, for example "Request count". # This field is optional but it is recommended to be set for any metrics # associated with user-visible concepts, such as Quota. # @!attribute [rw] metadata # @return [::Google::Api::MetricDescriptor::MetricDescriptorMetadata] # Optional. Metadata which can be used to guide usage of the metric. # @!attribute [rw] launch_stage # @return [::Google::Api::LaunchStage] # Optional. The launch stage of the metric definition. # @!attribute [rw] monitored_resource_types # @return [::Array<::String>] # Read-only. If present, then a [time # series][google.monitoring.v3.TimeSeries], which is identified partially by # a metric type and a # {::Google::Api::MonitoredResourceDescriptor MonitoredResourceDescriptor}, that # is associated with this metric type can only be associated with one of the # monitored resource types listed here. class MetricDescriptor include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # Additional annotations that can be used to guide the usage of a metric. # @!attribute [rw] launch_stage # @deprecated This field is deprecated and may be removed in the next major version update. # @return [::Google::Api::LaunchStage] # Deprecated. Must use the # {::Google::Api::MetricDescriptor#launch_stage MetricDescriptor.launch_stage} # instead. # @!attribute [rw] sample_period # @return [::Google::Protobuf::Duration] # The sampling period of metric data points. For metrics which are written # periodically, consecutive data points are stored at this time interval, # excluding data loss due to errors. Metrics with a higher granularity have # a smaller sampling period. # @!attribute [rw] ingest_delay # @return [::Google::Protobuf::Duration] # The delay of data points caused by ingestion. Data points older than this # age are guaranteed to be ingested and available to be read, excluding # data loss due to errors. # @!attribute [rw] time_series_resource_hierarchy_level # @return [::Array<::Google::Api::MetricDescriptor::MetricDescriptorMetadata::TimeSeriesResourceHierarchyLevel>] # The scope of the timeseries data of the metric. class MetricDescriptorMetadata include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # The resource hierarchy level of the timeseries data of a metric. module TimeSeriesResourceHierarchyLevel # Do not use this default value. TIME_SERIES_RESOURCE_HIERARCHY_LEVEL_UNSPECIFIED = 0 # Scopes a metric to a project. PROJECT = 1 # Scopes a metric to an organization. ORGANIZATION = 2 # Scopes a metric to a folder. FOLDER = 3 end end # The kind of measurement. It describes how the data is reported. # For information on setting the start time and end time based on # the MetricKind, see [TimeInterval][google.monitoring.v3.TimeInterval]. module MetricKind # Do not use this default value. METRIC_KIND_UNSPECIFIED = 0 # An instantaneous measurement of a value. GAUGE = 1 # The change in a value during a time interval. DELTA = 2 # A value accumulated over a time interval. Cumulative # measurements in a time series should have the same start time # and increasing end times, until an event resets the cumulative # value to zero and sets a new start time for the following # points. CUMULATIVE = 3 end # The value type of a metric. module ValueType # Do not use this default value. VALUE_TYPE_UNSPECIFIED = 0 # The value is a boolean. # This value type can be used only if the metric kind is `GAUGE`. BOOL = 1 # The value is a signed 64-bit integer. INT64 = 2 # The value is a double precision floating point number. DOUBLE = 3 # The value is a text string. # This value type can be used only if the metric kind is `GAUGE`. STRING = 4 # The value is a {::Google::Api::Distribution `Distribution`}. DISTRIBUTION = 5 # The value is money. MONEY = 6 end end # A specific metric, identified by specifying values for all of the # labels of a {::Google::Api::MetricDescriptor `MetricDescriptor`}. # @!attribute [rw] type # @return [::String] # An existing metric type, see # {::Google::Api::MetricDescriptor google.api.MetricDescriptor}. For example, # `custom.googleapis.com/invoice/paid/amount`. # @!attribute [rw] labels # @return [::Google::Protobuf::Map{::String => ::String}] # The set of label values that uniquely identify this metric. All # labels listed in the `MetricDescriptor` must be assigned values. class Metric include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # @!attribute [rw] key # @return [::String] # @!attribute [rw] value # @return [::String] class LabelsEntry include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end end end end google-cloud-logging-v2-1.5.1/proto_docs/README.md0000644000004100000410000000027115143461113021530 0ustar www-datawww-data# Cloud Logging V2 Protocol Buffer Documentation These files are for the YARD documentation of the generated protobuf files. They are not intended to be required or loaded at runtime.