Class: Google::Cloud::Logging::V2::ConfigService::Client
- Inherits:
-
Object
- Object
- Google::Cloud::Logging::V2::ConfigService::Client
- Includes:
- Paths
- Defined in:
- lib/google/cloud/logging/v2/config_service/client.rb
Overview
Client for the ConfigService service.
Service for configuring sinks used to route log entries.
Defined Under Namespace
Classes: Configuration
Instance Attribute Summary collapse
-
#operations_client ⇒ ::Google::Cloud::Logging::V2::ConfigService::Operations
readonly
Get the associated client for long-running operations.
Class Method Summary collapse
-
.configure {|config| ... } ⇒ Client::Configuration
Configure the ConfigService Client class.
Instance Method Summary collapse
-
#configure {|config| ... } ⇒ Client::Configuration
Configure the ConfigService Client instance.
-
#copy_log_entries(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::Operation
Copies a set of log entries from a log bucket to a Cloud Storage bucket.
-
#create_bucket(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Logging::V2::LogBucket
Creates a log bucket that can be used to store log entries.
-
#create_exclusion(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Logging::V2::LogExclusion
Creates a new exclusion in the _Default sink in a specified parent resource.
-
#create_sink(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Logging::V2::LogSink
Creates a sink that exports specified log entries to a destination.
-
#create_view(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Logging::V2::LogView
Creates a view over log entries in a log bucket.
-
#delete_bucket(request, options = nil) {|response, operation| ... } ⇒ ::Google::Protobuf::Empty
Deletes a log bucket.
-
#delete_exclusion(request, options = nil) {|response, operation| ... } ⇒ ::Google::Protobuf::Empty
Deletes an exclusion in the _Default sink.
-
#delete_sink(request, options = nil) {|response, operation| ... } ⇒ ::Google::Protobuf::Empty
Deletes a sink.
-
#delete_view(request, options = nil) {|response, operation| ... } ⇒ ::Google::Protobuf::Empty
Deletes a view on a log bucket.
-
#get_bucket(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Logging::V2::LogBucket
Gets a log bucket.
-
#get_cmek_settings(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Logging::V2::CmekSettings
Gets the Logging CMEK settings for the given resource.
-
#get_exclusion(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Logging::V2::LogExclusion
Gets the description of an exclusion in the _Default sink.
-
#get_settings(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Logging::V2::Settings
Gets the Log Router settings for the given resource.
-
#get_sink(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Logging::V2::LogSink
Gets a sink.
-
#get_view(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Logging::V2::LogView
Gets a view on a log bucket..
-
#initialize {|config| ... } ⇒ Client
constructor
Create a new ConfigService client object.
-
#list_buckets(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Logging::V2::LogBucket>
Lists log buckets.
-
#list_exclusions(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Logging::V2::LogExclusion>
Lists all the exclusions on the _Default sink in a parent resource.
-
#list_sinks(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Logging::V2::LogSink>
Lists sinks.
-
#list_views(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Logging::V2::LogView>
Lists views on a log bucket.
-
#undelete_bucket(request, options = nil) {|response, operation| ... } ⇒ ::Google::Protobuf::Empty
Undeletes a log bucket.
-
#update_bucket(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Logging::V2::LogBucket
Updates a log bucket.
-
#update_cmek_settings(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Logging::V2::CmekSettings
Updates the Log Router CMEK settings for the given resource.
-
#update_exclusion(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Logging::V2::LogExclusion
Changes one or more properties of an existing exclusion in the _Default sink.
-
#update_settings(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Logging::V2::Settings
Updates the Log Router settings for the given resource.
-
#update_sink(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Logging::V2::LogSink
Updates a sink.
-
#update_view(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Logging::V2::LogView
Updates a view on a log bucket.
Methods included from Paths
#billing_account_location_path, #billing_account_path, #cmek_settings_path, #folder_location_path, #folder_path, #location_path, #log_bucket_path, #log_exclusion_path, #log_sink_path, #log_view_path, #organization_location_path, #organization_path, #project_path, #settings_path
Constructor Details
#initialize {|config| ... } ⇒ Client
Create a new ConfigService client object.
150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 |
# File 'lib/google/cloud/logging/v2/config_service/client.rb', line 150 def initialize # These require statements are intentionally placed here to initialize # the gRPC module only when it's required. # See https://github.com/googleapis/toolkit/issues/446 require "gapic/grpc" require "google/logging/v2/logging_config_services_pb" # Create the configuration object @config = Configuration.new Client.configure # Yield the configuration if needed yield @config if block_given? # Create credentials credentials = @config.credentials # Use self-signed JWT if the endpoint is unchanged from default, # but only if the default endpoint does not have a region prefix. enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint && !@config.endpoint.split(".").first.include?("-") credentials ||= Credentials.default scope: @config.scope, enable_self_signed_jwt: enable_self_signed_jwt if credentials.is_a?(::String) || credentials.is_a?(::Hash) credentials = Credentials.new credentials, scope: @config.scope end @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id @operations_client = Operations.new do |config| config.credentials = credentials config.quota_project = @quota_project_id config.endpoint = @config.endpoint end @config_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Logging::V2::ConfigServiceV2::Stub, credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, interceptors: @config.interceptors ) end |
Instance Attribute Details
#operations_client ⇒ ::Google::Cloud::Logging::V2::ConfigService::Operations (readonly)
Get the associated client for long-running operations.
197 198 199 |
# File 'lib/google/cloud/logging/v2/config_service/client.rb', line 197 def operations_client @operations_client end |
Class Method Details
.configure {|config| ... } ⇒ Client::Configuration
Configure the ConfigService Client class.
See Configuration for a description of the configuration fields.
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
# File 'lib/google/cloud/logging/v2/config_service/client.rb', line 56 def self.configure @configure ||= begin namespace = ["Google", "Cloud", "Logging", "V2"] parent_config = while namespace.any? parent_name = namespace.join "::" parent_const = const_get parent_name break parent_const.configure if parent_const.respond_to? :configure namespace.pop end default_config = Client::Configuration.new parent_config default_config.rpcs.list_sinks.timeout = 60.0 default_config.rpcs.list_sinks.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 13, 14] } default_config.rpcs.get_sink.timeout = 60.0 default_config.rpcs.get_sink.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 13, 14] } default_config.rpcs.create_sink.timeout = 120.0 default_config.rpcs.update_sink.timeout = 60.0 default_config.rpcs.update_sink.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 13, 14] } default_config.rpcs.delete_sink.timeout = 60.0 default_config.rpcs.delete_sink.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 13, 14] } default_config.rpcs.list_exclusions.timeout = 60.0 default_config.rpcs.list_exclusions.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 13, 14] } default_config.rpcs.get_exclusion.timeout = 60.0 default_config.rpcs.get_exclusion.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 13, 14] } default_config.rpcs.create_exclusion.timeout = 120.0 default_config.rpcs.update_exclusion.timeout = 120.0 default_config.rpcs.delete_exclusion.timeout = 60.0 default_config.rpcs.delete_exclusion.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 13, 14] } default_config end yield @configure if block_given? @configure end |
Instance Method Details
#configure {|config| ... } ⇒ Client::Configuration
Configure the ConfigService Client instance.
The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on configure.
See Configuration for a description of the configuration fields.
129 130 131 132 |
# File 'lib/google/cloud/logging/v2/config_service/client.rb', line 129 def configure yield @config if block_given? @config end |
#copy_log_entries(request, options = nil) ⇒ ::Gapic::Operation #copy_log_entries(name: nil, filter: nil, destination: nil) ⇒ ::Gapic::Operation
Copies a set of log entries from a log bucket to a Cloud Storage bucket.
2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 |
# File 'lib/google/cloud/logging/v2/config_service/client.rb', line 2869 def copy_log_entries request, = 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 = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.copy_log_entries..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Logging::V2::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.copy_log_entries.timeout, metadata: , retry_policy: @config.rpcs.copy_log_entries.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @config_service_stub.call_rpc :copy_log_entries, request, options: do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#create_bucket(request, options = nil) ⇒ ::Google::Cloud::Logging::V2::LogBucket #create_bucket(parent: nil, bucket_id: nil, bucket: nil) ⇒ ::Google::Cloud::Logging::V2::LogBucket
Creates a log bucket that can be used to store log entries. After a bucket has been created, the bucket's location cannot be changed.
464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 |
# File 'lib/google/cloud/logging/v2/config_service/client.rb', line 464 def create_bucket request, = 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 = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.create_bucket..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Logging::V2::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.create_bucket.timeout, metadata: , retry_policy: @config.rpcs.create_bucket.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @config_service_stub.call_rpc :create_bucket, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#create_exclusion(request, options = nil) ⇒ ::Google::Cloud::Logging::V2::LogExclusion #create_exclusion(parent: nil, exclusion: nil) ⇒ ::Google::Cloud::Logging::V2::LogExclusion
Creates a new exclusion in the _Default sink in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource.
2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 |
# File 'lib/google/cloud/logging/v2/config_service/client.rb', line 2102 def create_exclusion request, = 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 = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.create_exclusion..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Logging::V2::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.create_exclusion.timeout, metadata: , retry_policy: @config.rpcs.create_exclusion.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @config_service_stub.call_rpc :create_exclusion, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#create_sink(request, options = nil) ⇒ ::Google::Cloud::Logging::V2::LogSink #create_sink(parent: nil, sink: nil, unique_writer_identity: nil) ⇒ ::Google::Cloud::Logging::V2::LogSink
Creates a sink that exports specified log entries to a destination. The
export of newly-ingested log entries begins immediately, unless the sink's
writer_identity
is not permitted to write to the destination. A sink can
export log entries only from the resource owning the sink.
1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 |
# File 'lib/google/cloud/logging/v2/config_service/client.rb', line 1575 def create_sink request, = 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 = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.create_sink..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Logging::V2::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.create_sink.timeout, metadata: , retry_policy: @config.rpcs.create_sink.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @config_service_stub.call_rpc :create_sink, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#create_view(request, options = nil) ⇒ ::Google::Cloud::Logging::V2::LogView #create_view(parent: nil, view_id: nil, view: nil) ⇒ ::Google::Cloud::Logging::V2::LogView
Creates a view over log entries in a log bucket. A bucket may contain a maximum of 30 views.
1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 |
# File 'lib/google/cloud/logging/v2/config_service/client.rb', line 1062 def create_view request, = 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 = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.create_view..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Logging::V2::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.create_view.timeout, metadata: , retry_policy: @config.rpcs.create_view.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @config_service_stub.call_rpc :create_view, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#delete_bucket(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_bucket(name: nil) ⇒ ::Google::Protobuf::Empty
Deletes a log bucket.
Changes the bucket's lifecycle_state
to the DELETE_REQUESTED
state.
After 7 days, the bucket will be purged and all log entries in the bucket
will be permanently deleted.
676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 |
# File 'lib/google/cloud/logging/v2/config_service/client.rb', line 676 def delete_bucket request, = 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 = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.delete_bucket..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Logging::V2::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.delete_bucket.timeout, metadata: , retry_policy: @config.rpcs.delete_bucket.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @config_service_stub.call_rpc :delete_bucket, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#delete_exclusion(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_exclusion(name: nil) ⇒ ::Google::Protobuf::Empty
Deletes an exclusion in the _Default sink.
2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 |
# File 'lib/google/cloud/logging/v2/config_service/client.rb', line 2302 def delete_exclusion request, = 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 = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.delete_exclusion..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Logging::V2::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.delete_exclusion.timeout, metadata: , retry_policy: @config.rpcs.delete_exclusion.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @config_service_stub.call_rpc :delete_exclusion, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#delete_sink(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_sink(sink_name: nil) ⇒ ::Google::Protobuf::Empty
Deletes a sink. If the sink has a unique writer_identity
, then that
service account is also deleted.
1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 |
# File 'lib/google/cloud/logging/v2/config_service/client.rb', line 1802 def delete_sink request, = 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 = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.delete_sink..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Logging::V2::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.sink_name header_params["sink_name"] = request.sink_name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.delete_sink.timeout, metadata: , retry_policy: @config.rpcs.delete_sink.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @config_service_stub.call_rpc :delete_sink, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#delete_view(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_view(name: nil) ⇒ ::Google::Protobuf::Empty
Deletes a view on a log bucket.
If an UNAVAILABLE
error is returned, this indicates that system is not in
a state where it can delete the view. If this occurs, please try again in a
few minutes.
1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 |
# File 'lib/google/cloud/logging/v2/config_service/client.rb', line 1262 def delete_view request, = 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 = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.delete_view..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Logging::V2::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.delete_view.timeout, metadata: , retry_policy: @config.rpcs.delete_view.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @config_service_stub.call_rpc :delete_view, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#get_bucket(request, options = nil) ⇒ ::Google::Cloud::Logging::V2::LogBucket #get_bucket(name: nil) ⇒ ::Google::Cloud::Logging::V2::LogBucket
Gets a log bucket.
364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 |
# File 'lib/google/cloud/logging/v2/config_service/client.rb', line 364 def get_bucket request, = 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 = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.get_bucket..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Logging::V2::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.get_bucket.timeout, metadata: , retry_policy: @config.rpcs.get_bucket.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @config_service_stub.call_rpc :get_bucket, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#get_cmek_settings(request, options = nil) ⇒ ::Google::Cloud::Logging::V2::CmekSettings #get_cmek_settings(name: nil) ⇒ ::Google::Cloud::Logging::V2::CmekSettings
Gets the Logging CMEK settings for the given resource.
Note: CMEK for the Log Router can be configured for Google Cloud projects, folders, organizations and billing accounts. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.
See Enabling CMEK for Log Router for more information.
2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 |
# File 'lib/google/cloud/logging/v2/config_service/client.rb', line 2410 def get_cmek_settings request, = 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 = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.get_cmek_settings..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Logging::V2::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.get_cmek_settings.timeout, metadata: , retry_policy: @config.rpcs.get_cmek_settings.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @config_service_stub.call_rpc :get_cmek_settings, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#get_exclusion(request, options = nil) ⇒ ::Google::Cloud::Logging::V2::LogExclusion #get_exclusion(name: nil) ⇒ ::Google::Cloud::Logging::V2::LogExclusion
Gets the description of an exclusion in the _Default sink.
2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 |
# File 'lib/google/cloud/logging/v2/config_service/client.rb', line 2002 def get_exclusion request, = 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 = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.get_exclusion..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Logging::V2::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.get_exclusion.timeout, metadata: , retry_policy: @config.rpcs.get_exclusion.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @config_service_stub.call_rpc :get_exclusion, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#get_settings(request, options = nil) ⇒ ::Google::Cloud::Logging::V2::Settings #get_settings(name: nil) ⇒ ::Google::Cloud::Logging::V2::Settings
Gets the Log Router settings for the given resource.
Note: Settings for the Log Router can be get for Google Cloud projects, folders, organizations and billing accounts. Currently it can only be configured for organizations. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.
See Enabling CMEK for Log Router for more information.
2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 |
# File 'lib/google/cloud/logging/v2/config_service/client.rb', line 2644 def get_settings request, = 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 = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.get_settings..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Logging::V2::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.get_settings.timeout, metadata: , retry_policy: @config.rpcs.get_settings.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @config_service_stub.call_rpc :get_settings, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#get_sink(request, options = nil) ⇒ ::Google::Cloud::Logging::V2::LogSink #get_sink(sink_name: nil) ⇒ ::Google::Cloud::Logging::V2::LogSink
Gets a sink.
1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 |
# File 'lib/google/cloud/logging/v2/config_service/client.rb', line 1462 def get_sink request, = 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 = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.get_sink..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Logging::V2::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.sink_name header_params["sink_name"] = request.sink_name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.get_sink.timeout, metadata: , retry_policy: @config.rpcs.get_sink.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @config_service_stub.call_rpc :get_sink, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#get_view(request, options = nil) ⇒ ::Google::Cloud::Logging::V2::LogView #get_view(name: nil) ⇒ ::Google::Cloud::Logging::V2::LogView
Gets a view on a log bucket..
966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 |
# File 'lib/google/cloud/logging/v2/config_service/client.rb', line 966 def get_view request, = 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 = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.get_view..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Logging::V2::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.get_view.timeout, metadata: , retry_policy: @config.rpcs.get_view.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @config_service_stub.call_rpc :get_view, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#list_buckets(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Logging::V2::LogBucket> #list_buckets(parent: nil, page_token: nil, page_size: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Logging::V2::LogBucket>
Lists log buckets.
269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 |
# File 'lib/google/cloud/logging/v2/config_service/client.rb', line 269 def list_buckets request, = 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 = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.list_buckets..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Logging::V2::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.list_buckets.timeout, metadata: , retry_policy: @config.rpcs.list_buckets.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @config_service_stub.call_rpc :list_buckets, request, options: do |response, operation| response = ::Gapic::PagedEnumerable.new @config_service_stub, :list_buckets, request, response, operation, yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#list_exclusions(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Logging::V2::LogExclusion> #list_exclusions(parent: nil, page_token: nil, page_size: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Logging::V2::LogExclusion>
Lists all the exclusions on the _Default sink in a parent resource.
1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 |
# File 'lib/google/cloud/logging/v2/config_service/client.rb', line 1907 def list_exclusions request, = 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 = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.list_exclusions..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Logging::V2::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.list_exclusions.timeout, metadata: , retry_policy: @config.rpcs.list_exclusions.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @config_service_stub.call_rpc :list_exclusions, request, options: do |response, operation| response = ::Gapic::PagedEnumerable.new @config_service_stub, :list_exclusions, request, response, operation, yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#list_sinks(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Logging::V2::LogSink> #list_sinks(parent: nil, page_token: nil, page_size: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Logging::V2::LogSink>
Lists sinks.
1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 |
# File 'lib/google/cloud/logging/v2/config_service/client.rb', line 1367 def list_sinks request, = 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 = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.list_sinks..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Logging::V2::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.list_sinks.timeout, metadata: , retry_policy: @config.rpcs.list_sinks.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @config_service_stub.call_rpc :list_sinks, request, options: do |response, operation| response = ::Gapic::PagedEnumerable.new @config_service_stub, :list_sinks, request, response, operation, yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#list_views(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Logging::V2::LogView> #list_views(parent: nil, page_token: nil, page_size: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Logging::V2::LogView>
Lists views on a log bucket.
874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 |
# File 'lib/google/cloud/logging/v2/config_service/client.rb', line 874 def list_views request, = 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 = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.list_views..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Logging::V2::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.list_views.timeout, metadata: , retry_policy: @config.rpcs.list_views.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @config_service_stub.call_rpc :list_views, request, options: do |response, operation| response = ::Gapic::PagedEnumerable.new @config_service_stub, :list_views, request, response, operation, yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#undelete_bucket(request, options = nil) ⇒ ::Google::Protobuf::Empty #undelete_bucket(name: nil) ⇒ ::Google::Protobuf::Empty
Undeletes a log bucket. A bucket that has been deleted can be undeleted within the grace period of 7 days.
771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 |
# File 'lib/google/cloud/logging/v2/config_service/client.rb', line 771 def undelete_bucket request, = 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 = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.undelete_bucket..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Logging::V2::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.undelete_bucket.timeout, metadata: , retry_policy: @config.rpcs.undelete_bucket.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @config_service_stub.call_rpc :undelete_bucket, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#update_bucket(request, options = nil) ⇒ ::Google::Cloud::Logging::V2::LogBucket #update_bucket(name: nil, bucket: nil, update_mask: nil) ⇒ ::Google::Cloud::Logging::V2::LogBucket
Updates a log bucket. This method replaces the following fields in the
existing bucket with values from the new bucket: retention_period
If the retention period is decreased and the bucket is locked,
FAILED_PRECONDITION
will be returned.
If the bucket has a lifecycle_state
of DELETE_REQUESTED
, then
FAILED_PRECONDITION
will be returned.
After a bucket has been created, the bucket's location cannot be changed.
578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 |
# File 'lib/google/cloud/logging/v2/config_service/client.rb', line 578 def update_bucket request, = 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 = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.update_bucket..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Logging::V2::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.update_bucket.timeout, metadata: , retry_policy: @config.rpcs.update_bucket.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @config_service_stub.call_rpc :update_bucket, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#update_cmek_settings(request, options = nil) ⇒ ::Google::Cloud::Logging::V2::CmekSettings #update_cmek_settings(name: nil, cmek_settings: nil, update_mask: nil) ⇒ ::Google::Cloud::Logging::V2::CmekSettings
Updates the Log Router CMEK settings for the given resource.
Note: CMEK for the Log Router can currently only be configured for Google Cloud organizations. Once configured, it applies to all projects and folders in the Google Cloud organization.
UpdateCmekSettings
will fail if 1) kms_key_name
is invalid, or 2) the associated service
account does not have the required
roles/cloudkms.cryptoKeyEncrypterDecrypter
role assigned for the key, or
3) access to the key is disabled.
See Enabling CMEK for Log Router for more information.
2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 |
# File 'lib/google/cloud/logging/v2/config_service/client.rb', line 2536 def update_cmek_settings request, = 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 = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.update_cmek_settings..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Logging::V2::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.update_cmek_settings.timeout, metadata: , retry_policy: @config.rpcs.update_cmek_settings.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @config_service_stub.call_rpc :update_cmek_settings, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#update_exclusion(request, options = nil) ⇒ ::Google::Cloud::Logging::V2::LogExclusion #update_exclusion(name: nil, exclusion: nil, update_mask: nil) ⇒ ::Google::Cloud::Logging::V2::LogExclusion
Changes one or more properties of an existing exclusion in the _Default sink.
2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 |
# File 'lib/google/cloud/logging/v2/config_service/client.rb', line 2208 def update_exclusion request, = 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 = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.update_exclusion..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Logging::V2::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.update_exclusion.timeout, metadata: , retry_policy: @config.rpcs.update_exclusion.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @config_service_stub.call_rpc :update_exclusion, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#update_settings(request, options = nil) ⇒ ::Google::Cloud::Logging::V2::Settings #update_settings(name: nil, settings: nil, update_mask: nil) ⇒ ::Google::Cloud::Logging::V2::Settings
Updates the Log Router settings for the given resource.
Note: Settings for the Log Router can currently only be configured for Google Cloud organizations. Once configured, it applies to all projects and folders in the Google Cloud organization.
UpdateSettings
will fail if 1) kms_key_name
is invalid, or 2) the associated service
account does not have the required
roles/cloudkms.cryptoKeyEncrypterDecrypter
role assigned for the key, or
3) access to the key is disabled. 4) location_id
is not supported by
Logging. 5) location_id
violate OrgPolicy.
See Enabling CMEK for Log Router for more information.
2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 |
# File 'lib/google/cloud/logging/v2/config_service/client.rb', line 2768 def update_settings request, = 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 = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.update_settings..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Logging::V2::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.update_settings.timeout, metadata: , retry_policy: @config.rpcs.update_settings.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @config_service_stub.call_rpc :update_settings, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#update_sink(request, options = nil) ⇒ ::Google::Cloud::Logging::V2::LogSink #update_sink(sink_name: nil, sink: nil, unique_writer_identity: nil, update_mask: nil) ⇒ ::Google::Cloud::Logging::V2::LogSink
Updates a sink. This method replaces the following fields in the existing
sink with values from the new sink: destination
, and filter
.
The updated sink might also have a new writer_identity
; see the
unique_writer_identity
field.
1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 |
# File 'lib/google/cloud/logging/v2/config_service/client.rb', line 1706 def update_sink request, = 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 = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.update_sink..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Logging::V2::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.sink_name header_params["sink_name"] = request.sink_name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.update_sink.timeout, metadata: , retry_policy: @config.rpcs.update_sink.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @config_service_stub.call_rpc :update_sink, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#update_view(request, options = nil) ⇒ ::Google::Cloud::Logging::V2::LogView #update_view(name: nil, view: nil, update_mask: nil) ⇒ ::Google::Cloud::Logging::V2::LogView
Updates a view on a log bucket. This method replaces the following fields
in the existing view with values from the new view: filter
.
If an UNAVAILABLE
error is returned, this indicates that system is not in
a state where it can update the view. If this occurs, please try again in a
few minutes.
1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 |
# File 'lib/google/cloud/logging/v2/config_service/client.rb', line 1168 def update_view request, = 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 = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.update_view..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Logging::V2::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.update_view.timeout, metadata: , retry_policy: @config.rpcs.update_view.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @config_service_stub.call_rpc :update_view, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |