google-cloud-monitoring-v3 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.yardopts +12 -0
- data/AUTHENTICATION.md +169 -0
- data/LICENSE.md +203 -0
- data/README.md +71 -0
- data/lib/google-cloud-monitoring-v3.rb +21 -0
- data/lib/google/cloud/monitoring/v3.rb +40 -0
- data/lib/google/cloud/monitoring/v3/alert_policy_service.rb +57 -0
- data/lib/google/cloud/monitoring/v3/alert_policy_service/client.rb +772 -0
- data/lib/google/cloud/monitoring/v3/alert_policy_service/credentials.rb +53 -0
- data/lib/google/cloud/monitoring/v3/alert_policy_service/paths.rb +185 -0
- data/lib/google/cloud/monitoring/v3/group_service.rb +60 -0
- data/lib/google/cloud/monitoring/v3/group_service/client.rb +862 -0
- data/lib/google/cloud/monitoring/v3/group_service/credentials.rb +53 -0
- data/lib/google/cloud/monitoring/v3/group_service/paths.rb +127 -0
- data/lib/google/cloud/monitoring/v3/metric_service.rb +50 -0
- data/lib/google/cloud/monitoring/v3/metric_service/client.rb +1040 -0
- data/lib/google/cloud/monitoring/v3/metric_service/credentials.rb +54 -0
- data/lib/google/cloud/monitoring/v3/metric_service/paths.rb +179 -0
- data/lib/google/cloud/monitoring/v3/notification_channel_service.rb +50 -0
- data/lib/google/cloud/monitoring/v3/notification_channel_service/client.rb +1213 -0
- data/lib/google/cloud/monitoring/v3/notification_channel_service/credentials.rb +53 -0
- data/lib/google/cloud/monitoring/v3/notification_channel_service/paths.rb +179 -0
- data/lib/google/cloud/monitoring/v3/service_monitoring_service.rb +52 -0
- data/lib/google/cloud/monitoring/v3/service_monitoring_service/client.rb +1168 -0
- data/lib/google/cloud/monitoring/v3/service_monitoring_service/credentials.rb +53 -0
- data/lib/google/cloud/monitoring/v3/service_monitoring_service/paths.rb +185 -0
- data/lib/google/cloud/monitoring/v3/uptime_check_service.rb +56 -0
- data/lib/google/cloud/monitoring/v3/uptime_check_service/client.rb +822 -0
- data/lib/google/cloud/monitoring/v3/uptime_check_service/credentials.rb +53 -0
- data/lib/google/cloud/monitoring/v3/uptime_check_service/paths.rb +127 -0
- data/lib/google/cloud/monitoring/v3/version.rb +28 -0
- data/lib/google/monitoring/v3/alert_pb.rb +84 -0
- data/lib/google/monitoring/v3/alert_service_pb.rb +56 -0
- data/lib/google/monitoring/v3/alert_service_services_pb.rb +64 -0
- data/lib/google/monitoring/v3/common_pb.rb +98 -0
- data/lib/google/monitoring/v3/dropped_labels_pb.rb +22 -0
- data/lib/google/monitoring/v3/group_pb.rb +27 -0
- data/lib/google/monitoring/v3/group_service_pb.rb +76 -0
- data/lib/google/monitoring/v3/group_service_services_pb.rb +67 -0
- data/lib/google/monitoring/v3/metric_pb.rb +85 -0
- data/lib/google/monitoring/v3/metric_service_pb.rb +133 -0
- data/lib/google/monitoring/v3/metric_service_services_pb.rb +67 -0
- data/lib/google/monitoring/v3/mutation_record_pb.rb +24 -0
- data/lib/google/monitoring/v3/notification_pb.rb +50 -0
- data/lib/google/monitoring/v3/notification_service_pb.rb +93 -0
- data/lib/google/monitoring/v3/notification_service_services_pb.rb +95 -0
- data/lib/google/monitoring/v3/service_pb.rb +152 -0
- data/lib/google/monitoring/v3/service_service_pb.rb +89 -0
- data/lib/google/monitoring/v3/service_service_services_pb.rb +66 -0
- data/lib/google/monitoring/v3/span_context_pb.rb +22 -0
- data/lib/google/monitoring/v3/uptime_pb.rb +126 -0
- data/lib/google/monitoring/v3/uptime_service_pb.rb +66 -0
- data/lib/google/monitoring/v3/uptime_service_services_pb.rb +68 -0
- data/proto_docs/README.md +4 -0
- data/proto_docs/google/api/distribution.rb +225 -0
- data/proto_docs/google/api/field_behavior.rb +59 -0
- data/proto_docs/google/api/label.rb +49 -0
- data/proto_docs/google/api/launch_stage.rb +65 -0
- data/proto_docs/google/api/metric.rb +203 -0
- data/proto_docs/google/api/monitored_resource.rb +137 -0
- data/proto_docs/google/api/resource.rb +247 -0
- data/proto_docs/google/monitoring/v3/alert.rb +359 -0
- data/proto_docs/google/monitoring/v3/alert_service.rb +162 -0
- data/proto_docs/google/monitoring/v3/common.rb +464 -0
- data/proto_docs/google/monitoring/v3/dropped_labels.rb +58 -0
- data/proto_docs/google/monitoring/v3/group.rb +84 -0
- data/proto_docs/google/monitoring/v3/group_service.rb +197 -0
- data/proto_docs/google/monitoring/v3/metric.rb +249 -0
- data/proto_docs/google/monitoring/v3/metric_service.rb +366 -0
- data/proto_docs/google/monitoring/v3/mutation_record.rb +38 -0
- data/proto_docs/google/monitoring/v3/notification.rb +186 -0
- data/proto_docs/google/monitoring/v3/notification_service.rb +266 -0
- data/proto_docs/google/monitoring/v3/service.rb +424 -0
- data/proto_docs/google/monitoring/v3/service_service.rb +239 -0
- data/proto_docs/google/monitoring/v3/span_context.rb +49 -0
- data/proto_docs/google/monitoring/v3/uptime.rb +403 -0
- data/proto_docs/google/monitoring/v3/uptime_service.rb +166 -0
- data/proto_docs/google/protobuf/any.rb +138 -0
- data/proto_docs/google/protobuf/duration.rb +98 -0
- data/proto_docs/google/protobuf/empty.rb +36 -0
- data/proto_docs/google/protobuf/field_mask.rb +229 -0
- data/proto_docs/google/protobuf/struct.rb +96 -0
- data/proto_docs/google/protobuf/timestamp.rb +120 -0
- data/proto_docs/google/protobuf/wrappers.rb +121 -0
- data/proto_docs/google/rpc/status.rb +46 -0
- data/proto_docs/google/type/calendar_period.rb +55 -0
- metadata +269 -0
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2020 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
# This gem does not autoload during Bundler.require. To load this gem,
|
20
|
+
# issue explicit require statements for the packages desired, e.g.:
|
21
|
+
# require "google/cloud/monitoring/v3"
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2020 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
require "google/cloud/monitoring/v3/alert_policy_service"
|
20
|
+
require "google/cloud/monitoring/v3/group_service"
|
21
|
+
require "google/cloud/monitoring/v3/metric_service"
|
22
|
+
require "google/cloud/monitoring/v3/notification_channel_service"
|
23
|
+
require "google/cloud/monitoring/v3/service_monitoring_service"
|
24
|
+
require "google/cloud/monitoring/v3/uptime_check_service"
|
25
|
+
require "google/cloud/monitoring/v3/version"
|
26
|
+
|
27
|
+
module Google
|
28
|
+
module Cloud
|
29
|
+
module Monitoring
|
30
|
+
##
|
31
|
+
# To load this package, including all its services, and instantiate a client:
|
32
|
+
#
|
33
|
+
# require "google/cloud/monitoring/v3"
|
34
|
+
# client = ::Google::Cloud::Monitoring::V3::AlertPolicyService::Client.new
|
35
|
+
#
|
36
|
+
module V3
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2020 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
require "gapic/common"
|
20
|
+
require "gapic/config"
|
21
|
+
require "gapic/config/method"
|
22
|
+
|
23
|
+
require "google/cloud/monitoring/v3/version"
|
24
|
+
|
25
|
+
require "google/cloud/monitoring/v3/alert_policy_service/credentials"
|
26
|
+
require "google/cloud/monitoring/v3/alert_policy_service/paths"
|
27
|
+
require "google/cloud/monitoring/v3/alert_policy_service/client"
|
28
|
+
|
29
|
+
module Google
|
30
|
+
module Cloud
|
31
|
+
module Monitoring
|
32
|
+
module V3
|
33
|
+
##
|
34
|
+
# The AlertPolicyService API is used to manage (list, create, delete,
|
35
|
+
# edit) alert policies in Stackdriver Monitoring. An alerting policy is
|
36
|
+
# a description of the conditions under which some aspect of your
|
37
|
+
# system is considered to be "unhealthy" and the ways to notify
|
38
|
+
# people or services about this state. In addition to using this API, alert
|
39
|
+
# policies can also be managed through
|
40
|
+
# [Stackdriver Monitoring](https://cloud.google.com/monitoring/docs/),
|
41
|
+
# which can be reached by clicking the "Monitoring" tab in
|
42
|
+
# [Cloud Console](https://console.cloud.google.com/).
|
43
|
+
#
|
44
|
+
# To load this service and instantiate a client:
|
45
|
+
#
|
46
|
+
# require "google/cloud/monitoring/v3/alert_policy_service"
|
47
|
+
# client = ::Google::Cloud::Monitoring::V3::AlertPolicyService::Client.new
|
48
|
+
#
|
49
|
+
module AlertPolicyService
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
helper_path = ::File.join __dir__, "alert_policy_service", "helpers.rb"
|
57
|
+
require "google/cloud/monitoring/v3/alert_policy_service/helpers" if ::File.file? helper_path
|
@@ -0,0 +1,772 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2020 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
require "google/cloud/errors"
|
20
|
+
require "google/monitoring/v3/alert_service_pb"
|
21
|
+
|
22
|
+
module Google
|
23
|
+
module Cloud
|
24
|
+
module Monitoring
|
25
|
+
module V3
|
26
|
+
module AlertPolicyService
|
27
|
+
##
|
28
|
+
# Client for the AlertPolicyService service.
|
29
|
+
#
|
30
|
+
# The AlertPolicyService API is used to manage (list, create, delete,
|
31
|
+
# edit) alert policies in Stackdriver Monitoring. An alerting policy is
|
32
|
+
# a description of the conditions under which some aspect of your
|
33
|
+
# system is considered to be "unhealthy" and the ways to notify
|
34
|
+
# people or services about this state. In addition to using this API, alert
|
35
|
+
# policies can also be managed through
|
36
|
+
# [Stackdriver Monitoring](https://cloud.google.com/monitoring/docs/),
|
37
|
+
# which can be reached by clicking the "Monitoring" tab in
|
38
|
+
# [Cloud Console](https://console.cloud.google.com/).
|
39
|
+
#
|
40
|
+
class Client
|
41
|
+
include Paths
|
42
|
+
|
43
|
+
# @private
|
44
|
+
attr_reader :alert_policy_service_stub
|
45
|
+
|
46
|
+
##
|
47
|
+
# Configure the AlertPolicyService Client class.
|
48
|
+
#
|
49
|
+
# See {::Google::Cloud::Monitoring::V3::AlertPolicyService::Client::Configuration}
|
50
|
+
# for a description of the configuration fields.
|
51
|
+
#
|
52
|
+
# ## Example
|
53
|
+
#
|
54
|
+
# To modify the configuration for all AlertPolicyService clients:
|
55
|
+
#
|
56
|
+
# ::Google::Cloud::Monitoring::V3::AlertPolicyService::Client.configure do |config|
|
57
|
+
# config.timeout = 10.0
|
58
|
+
# end
|
59
|
+
#
|
60
|
+
# @yield [config] Configure the Client client.
|
61
|
+
# @yieldparam config [Client::Configuration]
|
62
|
+
#
|
63
|
+
# @return [Client::Configuration]
|
64
|
+
#
|
65
|
+
def self.configure
|
66
|
+
@configure ||= begin
|
67
|
+
namespace = ["Google", "Cloud", "Monitoring", "V3"]
|
68
|
+
parent_config = while namespace.any?
|
69
|
+
parent_name = namespace.join "::"
|
70
|
+
parent_const = const_get parent_name
|
71
|
+
break parent_const.configure if parent_const&.respond_to? :configure
|
72
|
+
namespace.pop
|
73
|
+
end
|
74
|
+
default_config = Client::Configuration.new parent_config
|
75
|
+
|
76
|
+
default_config.rpcs.list_alert_policies.timeout = 30.0
|
77
|
+
default_config.rpcs.list_alert_policies.retry_policy = {
|
78
|
+
initial_delay: 0.1,
|
79
|
+
max_delay: 30.0,
|
80
|
+
multiplier: 1.3,
|
81
|
+
retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
|
82
|
+
}
|
83
|
+
|
84
|
+
default_config.rpcs.get_alert_policy.timeout = 30.0
|
85
|
+
default_config.rpcs.get_alert_policy.retry_policy = {
|
86
|
+
initial_delay: 0.1,
|
87
|
+
max_delay: 30.0,
|
88
|
+
multiplier: 1.3,
|
89
|
+
retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
|
90
|
+
}
|
91
|
+
|
92
|
+
default_config.rpcs.create_alert_policy.timeout = 30.0
|
93
|
+
|
94
|
+
default_config.rpcs.delete_alert_policy.timeout = 30.0
|
95
|
+
default_config.rpcs.delete_alert_policy.retry_policy = {
|
96
|
+
initial_delay: 0.1,
|
97
|
+
max_delay: 30.0,
|
98
|
+
multiplier: 1.3,
|
99
|
+
retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
|
100
|
+
}
|
101
|
+
|
102
|
+
default_config.rpcs.update_alert_policy.timeout = 30.0
|
103
|
+
|
104
|
+
default_config
|
105
|
+
end
|
106
|
+
yield @configure if block_given?
|
107
|
+
@configure
|
108
|
+
end
|
109
|
+
|
110
|
+
##
|
111
|
+
# Configure the AlertPolicyService Client instance.
|
112
|
+
#
|
113
|
+
# The configuration is set to the derived mode, meaning that values can be changed,
|
114
|
+
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
115
|
+
# should be made on {Client.configure}.
|
116
|
+
#
|
117
|
+
# See {::Google::Cloud::Monitoring::V3::AlertPolicyService::Client::Configuration}
|
118
|
+
# for a description of the configuration fields.
|
119
|
+
#
|
120
|
+
# @yield [config] Configure the Client client.
|
121
|
+
# @yieldparam config [Client::Configuration]
|
122
|
+
#
|
123
|
+
# @return [Client::Configuration]
|
124
|
+
#
|
125
|
+
def configure
|
126
|
+
yield @config if block_given?
|
127
|
+
@config
|
128
|
+
end
|
129
|
+
|
130
|
+
##
|
131
|
+
# Create a new AlertPolicyService client object.
|
132
|
+
#
|
133
|
+
# ## Examples
|
134
|
+
#
|
135
|
+
# To create a new AlertPolicyService client with the default
|
136
|
+
# configuration:
|
137
|
+
#
|
138
|
+
# client = ::Google::Cloud::Monitoring::V3::AlertPolicyService::Client.new
|
139
|
+
#
|
140
|
+
# To create a new AlertPolicyService client with a custom
|
141
|
+
# configuration:
|
142
|
+
#
|
143
|
+
# client = ::Google::Cloud::Monitoring::V3::AlertPolicyService::Client.new do |config|
|
144
|
+
# config.timeout = 10.0
|
145
|
+
# end
|
146
|
+
#
|
147
|
+
# @yield [config] Configure the AlertPolicyService client.
|
148
|
+
# @yieldparam config [Client::Configuration]
|
149
|
+
#
|
150
|
+
def initialize
|
151
|
+
# These require statements are intentionally placed here to initialize
|
152
|
+
# the gRPC module only when it's required.
|
153
|
+
# See https://github.com/googleapis/toolkit/issues/446
|
154
|
+
require "gapic/grpc"
|
155
|
+
require "google/monitoring/v3/alert_service_services_pb"
|
156
|
+
|
157
|
+
# Create the configuration object
|
158
|
+
@config = Configuration.new Client.configure
|
159
|
+
|
160
|
+
# Yield the configuration if needed
|
161
|
+
yield @config if block_given?
|
162
|
+
|
163
|
+
# Create credentials
|
164
|
+
credentials = @config.credentials
|
165
|
+
credentials ||= Credentials.default scope: @config.scope
|
166
|
+
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
167
|
+
credentials = Credentials.new credentials, scope: @config.scope
|
168
|
+
end
|
169
|
+
@quota_project_id = @config.quota_project
|
170
|
+
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
171
|
+
|
172
|
+
@alert_policy_service_stub = ::Gapic::ServiceStub.new(
|
173
|
+
::Google::Cloud::Monitoring::V3::AlertPolicyService::Stub,
|
174
|
+
credentials: credentials,
|
175
|
+
endpoint: @config.endpoint,
|
176
|
+
channel_args: @config.channel_args,
|
177
|
+
interceptors: @config.interceptors
|
178
|
+
)
|
179
|
+
end
|
180
|
+
|
181
|
+
# Service calls
|
182
|
+
|
183
|
+
##
|
184
|
+
# Lists the existing alerting policies for the project.
|
185
|
+
#
|
186
|
+
# @overload list_alert_policies(request, options = nil)
|
187
|
+
# Pass arguments to `list_alert_policies` via a request object, either of type
|
188
|
+
# {::Google::Cloud::Monitoring::V3::ListAlertPoliciesRequest} or an equivalent Hash.
|
189
|
+
#
|
190
|
+
# @param request [::Google::Cloud::Monitoring::V3::ListAlertPoliciesRequest, ::Hash]
|
191
|
+
# A request object representing the call parameters. Required. To specify no
|
192
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
193
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
194
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
195
|
+
#
|
196
|
+
# @overload list_alert_policies(name: nil, filter: nil, order_by: nil, page_size: nil, page_token: nil)
|
197
|
+
# Pass arguments to `list_alert_policies` via keyword arguments. Note that at
|
198
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
199
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
200
|
+
#
|
201
|
+
# @param name [::String]
|
202
|
+
# Required. The project whose alert policies are to be listed. The format is:
|
203
|
+
#
|
204
|
+
# projects/[PROJECT_ID_OR_NUMBER]
|
205
|
+
#
|
206
|
+
# Note that this field names the parent container in which the alerting
|
207
|
+
# policies to be listed are stored. To retrieve a single alerting policy
|
208
|
+
# by name, use the
|
209
|
+
# {::Google::Cloud::Monitoring::V3::AlertPolicyService::Client#get_alert_policy GetAlertPolicy}
|
210
|
+
# operation, instead.
|
211
|
+
# @param filter [::String]
|
212
|
+
# If provided, this field specifies the criteria that must be met by
|
213
|
+
# alert policies to be included in the response.
|
214
|
+
#
|
215
|
+
# For more details, see [sorting and
|
216
|
+
# filtering](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering).
|
217
|
+
# @param order_by [::String]
|
218
|
+
# A comma-separated list of fields by which to sort the result. Supports
|
219
|
+
# the same set of field references as the `filter` field. Entries can be
|
220
|
+
# prefixed with a minus sign to sort by the field in descending order.
|
221
|
+
#
|
222
|
+
# For more details, see [sorting and
|
223
|
+
# filtering](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering).
|
224
|
+
# @param page_size [::Integer]
|
225
|
+
# The maximum number of results to return in a single response.
|
226
|
+
# @param page_token [::String]
|
227
|
+
# If this field is not empty then it must contain the `nextPageToken` value
|
228
|
+
# returned by a previous call to this method. Using this field causes the
|
229
|
+
# method to return more results from the previous method call.
|
230
|
+
#
|
231
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
232
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Monitoring::V3::AlertPolicy>]
|
233
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
234
|
+
#
|
235
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::Monitoring::V3::AlertPolicy>]
|
236
|
+
#
|
237
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
238
|
+
#
|
239
|
+
def list_alert_policies request, options = nil
|
240
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
241
|
+
|
242
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Monitoring::V3::ListAlertPoliciesRequest
|
243
|
+
|
244
|
+
# Converts hash and nil to an options object
|
245
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
246
|
+
|
247
|
+
# Customize the options with defaults
|
248
|
+
metadata = @config.rpcs.list_alert_policies.metadata.to_h
|
249
|
+
|
250
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
251
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
252
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
253
|
+
gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
|
254
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
255
|
+
|
256
|
+
header_params = {
|
257
|
+
"name" => request.name
|
258
|
+
}
|
259
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
260
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
261
|
+
|
262
|
+
options.apply_defaults timeout: @config.rpcs.list_alert_policies.timeout,
|
263
|
+
metadata: metadata,
|
264
|
+
retry_policy: @config.rpcs.list_alert_policies.retry_policy
|
265
|
+
options.apply_defaults metadata: @config.metadata,
|
266
|
+
retry_policy: @config.retry_policy
|
267
|
+
|
268
|
+
@alert_policy_service_stub.call_rpc :list_alert_policies, request, options: options do |response, operation|
|
269
|
+
response = ::Gapic::PagedEnumerable.new @alert_policy_service_stub, :list_alert_policies, request, response, operation, options
|
270
|
+
yield response, operation if block_given?
|
271
|
+
return response
|
272
|
+
end
|
273
|
+
rescue ::GRPC::BadStatus => e
|
274
|
+
raise ::Google::Cloud::Error.from_error(e)
|
275
|
+
end
|
276
|
+
|
277
|
+
##
|
278
|
+
# Gets a single alerting policy.
|
279
|
+
#
|
280
|
+
# @overload get_alert_policy(request, options = nil)
|
281
|
+
# Pass arguments to `get_alert_policy` via a request object, either of type
|
282
|
+
# {::Google::Cloud::Monitoring::V3::GetAlertPolicyRequest} or an equivalent Hash.
|
283
|
+
#
|
284
|
+
# @param request [::Google::Cloud::Monitoring::V3::GetAlertPolicyRequest, ::Hash]
|
285
|
+
# A request object representing the call parameters. Required. To specify no
|
286
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
287
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
288
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
289
|
+
#
|
290
|
+
# @overload get_alert_policy(name: nil)
|
291
|
+
# Pass arguments to `get_alert_policy` via keyword arguments. Note that at
|
292
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
293
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
294
|
+
#
|
295
|
+
# @param name [::String]
|
296
|
+
# Required. The alerting policy to retrieve. The format is:
|
297
|
+
#
|
298
|
+
# projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID]
|
299
|
+
#
|
300
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
301
|
+
# @yieldparam response [::Google::Cloud::Monitoring::V3::AlertPolicy]
|
302
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
303
|
+
#
|
304
|
+
# @return [::Google::Cloud::Monitoring::V3::AlertPolicy]
|
305
|
+
#
|
306
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
307
|
+
#
|
308
|
+
def get_alert_policy request, options = nil
|
309
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
310
|
+
|
311
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Monitoring::V3::GetAlertPolicyRequest
|
312
|
+
|
313
|
+
# Converts hash and nil to an options object
|
314
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
315
|
+
|
316
|
+
# Customize the options with defaults
|
317
|
+
metadata = @config.rpcs.get_alert_policy.metadata.to_h
|
318
|
+
|
319
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
320
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
321
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
322
|
+
gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
|
323
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
324
|
+
|
325
|
+
header_params = {
|
326
|
+
"name" => request.name
|
327
|
+
}
|
328
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
329
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
330
|
+
|
331
|
+
options.apply_defaults timeout: @config.rpcs.get_alert_policy.timeout,
|
332
|
+
metadata: metadata,
|
333
|
+
retry_policy: @config.rpcs.get_alert_policy.retry_policy
|
334
|
+
options.apply_defaults metadata: @config.metadata,
|
335
|
+
retry_policy: @config.retry_policy
|
336
|
+
|
337
|
+
@alert_policy_service_stub.call_rpc :get_alert_policy, request, options: options do |response, operation|
|
338
|
+
yield response, operation if block_given?
|
339
|
+
return response
|
340
|
+
end
|
341
|
+
rescue ::GRPC::BadStatus => e
|
342
|
+
raise ::Google::Cloud::Error.from_error(e)
|
343
|
+
end
|
344
|
+
|
345
|
+
##
|
346
|
+
# Creates a new alerting policy.
|
347
|
+
#
|
348
|
+
# @overload create_alert_policy(request, options = nil)
|
349
|
+
# Pass arguments to `create_alert_policy` via a request object, either of type
|
350
|
+
# {::Google::Cloud::Monitoring::V3::CreateAlertPolicyRequest} or an equivalent Hash.
|
351
|
+
#
|
352
|
+
# @param request [::Google::Cloud::Monitoring::V3::CreateAlertPolicyRequest, ::Hash]
|
353
|
+
# A request object representing the call parameters. Required. To specify no
|
354
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
355
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
356
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
357
|
+
#
|
358
|
+
# @overload create_alert_policy(name: nil, alert_policy: nil)
|
359
|
+
# Pass arguments to `create_alert_policy` via keyword arguments. Note that at
|
360
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
361
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
362
|
+
#
|
363
|
+
# @param name [::String]
|
364
|
+
# Required. The project in which to create the alerting policy. The format is:
|
365
|
+
#
|
366
|
+
# projects/[PROJECT_ID_OR_NUMBER]
|
367
|
+
#
|
368
|
+
# Note that this field names the parent container in which the alerting
|
369
|
+
# policy will be written, not the name of the created policy. The alerting
|
370
|
+
# policy that is returned will have a name that contains a normalized
|
371
|
+
# representation of this name as a prefix but adds a suffix of the form
|
372
|
+
# `/alertPolicies/[ALERT_POLICY_ID]`, identifying the policy in the
|
373
|
+
# container.
|
374
|
+
# @param alert_policy [::Google::Cloud::Monitoring::V3::AlertPolicy, ::Hash]
|
375
|
+
# Required. The requested alerting policy. You should omit the `name` field in this
|
376
|
+
# policy. The name will be returned in the new policy, including
|
377
|
+
# a new `[ALERT_POLICY_ID]` value.
|
378
|
+
#
|
379
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
380
|
+
# @yieldparam response [::Google::Cloud::Monitoring::V3::AlertPolicy]
|
381
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
382
|
+
#
|
383
|
+
# @return [::Google::Cloud::Monitoring::V3::AlertPolicy]
|
384
|
+
#
|
385
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
386
|
+
#
|
387
|
+
def create_alert_policy request, options = nil
|
388
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
389
|
+
|
390
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Monitoring::V3::CreateAlertPolicyRequest
|
391
|
+
|
392
|
+
# Converts hash and nil to an options object
|
393
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
394
|
+
|
395
|
+
# Customize the options with defaults
|
396
|
+
metadata = @config.rpcs.create_alert_policy.metadata.to_h
|
397
|
+
|
398
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
399
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
400
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
401
|
+
gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
|
402
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
403
|
+
|
404
|
+
header_params = {
|
405
|
+
"name" => request.name
|
406
|
+
}
|
407
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
408
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
409
|
+
|
410
|
+
options.apply_defaults timeout: @config.rpcs.create_alert_policy.timeout,
|
411
|
+
metadata: metadata,
|
412
|
+
retry_policy: @config.rpcs.create_alert_policy.retry_policy
|
413
|
+
options.apply_defaults metadata: @config.metadata,
|
414
|
+
retry_policy: @config.retry_policy
|
415
|
+
|
416
|
+
@alert_policy_service_stub.call_rpc :create_alert_policy, request, options: options do |response, operation|
|
417
|
+
yield response, operation if block_given?
|
418
|
+
return response
|
419
|
+
end
|
420
|
+
rescue ::GRPC::BadStatus => e
|
421
|
+
raise ::Google::Cloud::Error.from_error(e)
|
422
|
+
end
|
423
|
+
|
424
|
+
##
|
425
|
+
# Deletes an alerting policy.
|
426
|
+
#
|
427
|
+
# @overload delete_alert_policy(request, options = nil)
|
428
|
+
# Pass arguments to `delete_alert_policy` via a request object, either of type
|
429
|
+
# {::Google::Cloud::Monitoring::V3::DeleteAlertPolicyRequest} or an equivalent Hash.
|
430
|
+
#
|
431
|
+
# @param request [::Google::Cloud::Monitoring::V3::DeleteAlertPolicyRequest, ::Hash]
|
432
|
+
# A request object representing the call parameters. Required. To specify no
|
433
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
434
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
435
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
436
|
+
#
|
437
|
+
# @overload delete_alert_policy(name: nil)
|
438
|
+
# Pass arguments to `delete_alert_policy` via keyword arguments. Note that at
|
439
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
440
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
441
|
+
#
|
442
|
+
# @param name [::String]
|
443
|
+
# Required. The alerting policy to delete. The format is:
|
444
|
+
#
|
445
|
+
# projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID]
|
446
|
+
#
|
447
|
+
# For more information, see {::Google::Cloud::Monitoring::V3::AlertPolicy AlertPolicy}.
|
448
|
+
#
|
449
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
450
|
+
# @yieldparam response [::Google::Protobuf::Empty]
|
451
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
452
|
+
#
|
453
|
+
# @return [::Google::Protobuf::Empty]
|
454
|
+
#
|
455
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
456
|
+
#
|
457
|
+
def delete_alert_policy request, options = nil
|
458
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
459
|
+
|
460
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Monitoring::V3::DeleteAlertPolicyRequest
|
461
|
+
|
462
|
+
# Converts hash and nil to an options object
|
463
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
464
|
+
|
465
|
+
# Customize the options with defaults
|
466
|
+
metadata = @config.rpcs.delete_alert_policy.metadata.to_h
|
467
|
+
|
468
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
469
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
470
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
471
|
+
gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
|
472
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
473
|
+
|
474
|
+
header_params = {
|
475
|
+
"name" => request.name
|
476
|
+
}
|
477
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
478
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
479
|
+
|
480
|
+
options.apply_defaults timeout: @config.rpcs.delete_alert_policy.timeout,
|
481
|
+
metadata: metadata,
|
482
|
+
retry_policy: @config.rpcs.delete_alert_policy.retry_policy
|
483
|
+
options.apply_defaults metadata: @config.metadata,
|
484
|
+
retry_policy: @config.retry_policy
|
485
|
+
|
486
|
+
@alert_policy_service_stub.call_rpc :delete_alert_policy, request, options: options do |response, operation|
|
487
|
+
yield response, operation if block_given?
|
488
|
+
return response
|
489
|
+
end
|
490
|
+
rescue ::GRPC::BadStatus => e
|
491
|
+
raise ::Google::Cloud::Error.from_error(e)
|
492
|
+
end
|
493
|
+
|
494
|
+
##
|
495
|
+
# Updates an alerting policy. You can either replace the entire policy with
|
496
|
+
# a new one or replace only certain fields in the current alerting policy by
|
497
|
+
# specifying the fields to be updated via `updateMask`. Returns the
|
498
|
+
# updated alerting policy.
|
499
|
+
#
|
500
|
+
# @overload update_alert_policy(request, options = nil)
|
501
|
+
# Pass arguments to `update_alert_policy` via a request object, either of type
|
502
|
+
# {::Google::Cloud::Monitoring::V3::UpdateAlertPolicyRequest} or an equivalent Hash.
|
503
|
+
#
|
504
|
+
# @param request [::Google::Cloud::Monitoring::V3::UpdateAlertPolicyRequest, ::Hash]
|
505
|
+
# A request object representing the call parameters. Required. To specify no
|
506
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
507
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
508
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
509
|
+
#
|
510
|
+
# @overload update_alert_policy(update_mask: nil, alert_policy: nil)
|
511
|
+
# Pass arguments to `update_alert_policy` via keyword arguments. Note that at
|
512
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
513
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
514
|
+
#
|
515
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
516
|
+
# Optional. A list of alerting policy field names. If this field is not
|
517
|
+
# empty, each listed field in the existing alerting policy is set to the
|
518
|
+
# value of the corresponding field in the supplied policy (`alert_policy`),
|
519
|
+
# or to the field's default value if the field is not in the supplied
|
520
|
+
# alerting policy. Fields not listed retain their previous value.
|
521
|
+
#
|
522
|
+
# Examples of valid field masks include `display_name`, `documentation`,
|
523
|
+
# `documentation.content`, `documentation.mime_type`, `user_labels`,
|
524
|
+
# `user_label.nameofkey`, `enabled`, `conditions`, `combiner`, etc.
|
525
|
+
#
|
526
|
+
# If this field is empty, then the supplied alerting policy replaces the
|
527
|
+
# existing policy. It is the same as deleting the existing policy and
|
528
|
+
# adding the supplied policy, except for the following:
|
529
|
+
#
|
530
|
+
# + The new policy will have the same `[ALERT_POLICY_ID]` as the former
|
531
|
+
# policy. This gives you continuity with the former policy in your
|
532
|
+
# notifications and incidents.
|
533
|
+
# + Conditions in the new policy will keep their former `[CONDITION_ID]` if
|
534
|
+
# the supplied condition includes the `name` field with that
|
535
|
+
# `[CONDITION_ID]`. If the supplied condition omits the `name` field,
|
536
|
+
# then a new `[CONDITION_ID]` is created.
|
537
|
+
# @param alert_policy [::Google::Cloud::Monitoring::V3::AlertPolicy, ::Hash]
|
538
|
+
# Required. The updated alerting policy or the updated values for the
|
539
|
+
# fields listed in `update_mask`.
|
540
|
+
# If `update_mask` is not empty, any fields in this policy that are
|
541
|
+
# not in `update_mask` are ignored.
|
542
|
+
#
|
543
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
544
|
+
# @yieldparam response [::Google::Cloud::Monitoring::V3::AlertPolicy]
|
545
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
546
|
+
#
|
547
|
+
# @return [::Google::Cloud::Monitoring::V3::AlertPolicy]
|
548
|
+
#
|
549
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
550
|
+
#
|
551
|
+
def update_alert_policy request, options = nil
|
552
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
553
|
+
|
554
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Monitoring::V3::UpdateAlertPolicyRequest
|
555
|
+
|
556
|
+
# Converts hash and nil to an options object
|
557
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
558
|
+
|
559
|
+
# Customize the options with defaults
|
560
|
+
metadata = @config.rpcs.update_alert_policy.metadata.to_h
|
561
|
+
|
562
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
563
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
564
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
565
|
+
gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
|
566
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
567
|
+
|
568
|
+
header_params = {
|
569
|
+
"alert_policy.name" => request.alert_policy.name
|
570
|
+
}
|
571
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
572
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
573
|
+
|
574
|
+
options.apply_defaults timeout: @config.rpcs.update_alert_policy.timeout,
|
575
|
+
metadata: metadata,
|
576
|
+
retry_policy: @config.rpcs.update_alert_policy.retry_policy
|
577
|
+
options.apply_defaults metadata: @config.metadata,
|
578
|
+
retry_policy: @config.retry_policy
|
579
|
+
|
580
|
+
@alert_policy_service_stub.call_rpc :update_alert_policy, request, options: options do |response, operation|
|
581
|
+
yield response, operation if block_given?
|
582
|
+
return response
|
583
|
+
end
|
584
|
+
rescue ::GRPC::BadStatus => e
|
585
|
+
raise ::Google::Cloud::Error.from_error(e)
|
586
|
+
end
|
587
|
+
|
588
|
+
##
|
589
|
+
# Configuration class for the AlertPolicyService API.
|
590
|
+
#
|
591
|
+
# This class represents the configuration for AlertPolicyService,
|
592
|
+
# providing control over timeouts, retry behavior, logging, transport
|
593
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
594
|
+
# applied individually to specific RPCs. See
|
595
|
+
# {::Google::Cloud::Monitoring::V3::AlertPolicyService::Client::Configuration::Rpcs}
|
596
|
+
# for a list of RPCs that can be configured independently.
|
597
|
+
#
|
598
|
+
# Configuration can be applied globally to all clients, or to a single client
|
599
|
+
# on construction.
|
600
|
+
#
|
601
|
+
# # Examples
|
602
|
+
#
|
603
|
+
# To modify the global config, setting the timeout for list_alert_policies
|
604
|
+
# to 20 seconds, and all remaining timeouts to 10 seconds:
|
605
|
+
#
|
606
|
+
# ::Google::Cloud::Monitoring::V3::AlertPolicyService::Client.configure do |config|
|
607
|
+
# config.timeout = 10.0
|
608
|
+
# config.rpcs.list_alert_policies.timeout = 20.0
|
609
|
+
# end
|
610
|
+
#
|
611
|
+
# To apply the above configuration only to a new client:
|
612
|
+
#
|
613
|
+
# client = ::Google::Cloud::Monitoring::V3::AlertPolicyService::Client.new do |config|
|
614
|
+
# config.timeout = 10.0
|
615
|
+
# config.rpcs.list_alert_policies.timeout = 20.0
|
616
|
+
# end
|
617
|
+
#
|
618
|
+
# @!attribute [rw] endpoint
|
619
|
+
# The hostname or hostname:port of the service endpoint.
|
620
|
+
# Defaults to `"monitoring.googleapis.com"`.
|
621
|
+
# @return [::String]
|
622
|
+
# @!attribute [rw] credentials
|
623
|
+
# Credentials to send with calls. You may provide any of the following types:
|
624
|
+
# * (`String`) The path to a service account key file in JSON format
|
625
|
+
# * (`Hash`) A service account key as a Hash
|
626
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
627
|
+
# (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
|
628
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
629
|
+
# (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
|
630
|
+
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
631
|
+
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
632
|
+
# * (`nil`) indicating no credentials
|
633
|
+
# @return [::Object]
|
634
|
+
# @!attribute [rw] scope
|
635
|
+
# The OAuth scopes
|
636
|
+
# @return [::Array<::String>]
|
637
|
+
# @!attribute [rw] lib_name
|
638
|
+
# The library name as recorded in instrumentation and logging
|
639
|
+
# @return [::String]
|
640
|
+
# @!attribute [rw] lib_version
|
641
|
+
# The library version as recorded in instrumentation and logging
|
642
|
+
# @return [::String]
|
643
|
+
# @!attribute [rw] channel_args
|
644
|
+
# Extra parameters passed to the gRPC channel. Note: this is ignored if a
|
645
|
+
# `GRPC::Core::Channel` object is provided as the credential.
|
646
|
+
# @return [::Hash]
|
647
|
+
# @!attribute [rw] interceptors
|
648
|
+
# An array of interceptors that are run before calls are executed.
|
649
|
+
# @return [::Array<::GRPC::ClientInterceptor>]
|
650
|
+
# @!attribute [rw] timeout
|
651
|
+
# The call timeout in seconds.
|
652
|
+
# @return [::Numeric]
|
653
|
+
# @!attribute [rw] metadata
|
654
|
+
# Additional gRPC headers to be sent with the call.
|
655
|
+
# @return [::Hash{::Symbol=>::String}]
|
656
|
+
# @!attribute [rw] retry_policy
|
657
|
+
# The retry policy. The value is a hash with the following keys:
|
658
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
659
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
660
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
661
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
662
|
+
# trigger a retry.
|
663
|
+
# @return [::Hash]
|
664
|
+
# @!attribute [rw] quota_project
|
665
|
+
# A separate project against which to charge quota.
|
666
|
+
# @return [::String]
|
667
|
+
#
|
668
|
+
class Configuration
|
669
|
+
extend ::Gapic::Config
|
670
|
+
|
671
|
+
config_attr :endpoint, "monitoring.googleapis.com", ::String
|
672
|
+
config_attr :credentials, nil do |value|
|
673
|
+
allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
674
|
+
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
675
|
+
allowed.any? { |klass| klass === value }
|
676
|
+
end
|
677
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
678
|
+
config_attr :lib_name, nil, ::String, nil
|
679
|
+
config_attr :lib_version, nil, ::String, nil
|
680
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
|
681
|
+
config_attr :interceptors, nil, ::Array, nil
|
682
|
+
config_attr :timeout, nil, ::Numeric, nil
|
683
|
+
config_attr :metadata, nil, ::Hash, nil
|
684
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
685
|
+
config_attr :quota_project, nil, ::String, nil
|
686
|
+
|
687
|
+
# @private
|
688
|
+
def initialize parent_config = nil
|
689
|
+
@parent_config = parent_config unless parent_config.nil?
|
690
|
+
|
691
|
+
yield self if block_given?
|
692
|
+
end
|
693
|
+
|
694
|
+
##
|
695
|
+
# Configurations for individual RPCs
|
696
|
+
# @return [Rpcs]
|
697
|
+
#
|
698
|
+
def rpcs
|
699
|
+
@rpcs ||= begin
|
700
|
+
parent_rpcs = nil
|
701
|
+
parent_rpcs = @parent_config.rpcs if @parent_config&.respond_to? :rpcs
|
702
|
+
Rpcs.new parent_rpcs
|
703
|
+
end
|
704
|
+
end
|
705
|
+
|
706
|
+
##
|
707
|
+
# Configuration RPC class for the AlertPolicyService API.
|
708
|
+
#
|
709
|
+
# Includes fields providing the configuration for each RPC in this service.
|
710
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
711
|
+
# the following configuration fields:
|
712
|
+
#
|
713
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
|
714
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
|
715
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
716
|
+
# include the following keys:
|
717
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
718
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
719
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
720
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
721
|
+
# trigger a retry.
|
722
|
+
#
|
723
|
+
class Rpcs
|
724
|
+
##
|
725
|
+
# RPC-specific configuration for `list_alert_policies`
|
726
|
+
# @return [::Gapic::Config::Method]
|
727
|
+
#
|
728
|
+
attr_reader :list_alert_policies
|
729
|
+
##
|
730
|
+
# RPC-specific configuration for `get_alert_policy`
|
731
|
+
# @return [::Gapic::Config::Method]
|
732
|
+
#
|
733
|
+
attr_reader :get_alert_policy
|
734
|
+
##
|
735
|
+
# RPC-specific configuration for `create_alert_policy`
|
736
|
+
# @return [::Gapic::Config::Method]
|
737
|
+
#
|
738
|
+
attr_reader :create_alert_policy
|
739
|
+
##
|
740
|
+
# RPC-specific configuration for `delete_alert_policy`
|
741
|
+
# @return [::Gapic::Config::Method]
|
742
|
+
#
|
743
|
+
attr_reader :delete_alert_policy
|
744
|
+
##
|
745
|
+
# RPC-specific configuration for `update_alert_policy`
|
746
|
+
# @return [::Gapic::Config::Method]
|
747
|
+
#
|
748
|
+
attr_reader :update_alert_policy
|
749
|
+
|
750
|
+
# @private
|
751
|
+
def initialize parent_rpcs = nil
|
752
|
+
list_alert_policies_config = parent_rpcs&.list_alert_policies if parent_rpcs&.respond_to? :list_alert_policies
|
753
|
+
@list_alert_policies = ::Gapic::Config::Method.new list_alert_policies_config
|
754
|
+
get_alert_policy_config = parent_rpcs&.get_alert_policy if parent_rpcs&.respond_to? :get_alert_policy
|
755
|
+
@get_alert_policy = ::Gapic::Config::Method.new get_alert_policy_config
|
756
|
+
create_alert_policy_config = parent_rpcs&.create_alert_policy if parent_rpcs&.respond_to? :create_alert_policy
|
757
|
+
@create_alert_policy = ::Gapic::Config::Method.new create_alert_policy_config
|
758
|
+
delete_alert_policy_config = parent_rpcs&.delete_alert_policy if parent_rpcs&.respond_to? :delete_alert_policy
|
759
|
+
@delete_alert_policy = ::Gapic::Config::Method.new delete_alert_policy_config
|
760
|
+
update_alert_policy_config = parent_rpcs&.update_alert_policy if parent_rpcs&.respond_to? :update_alert_policy
|
761
|
+
@update_alert_policy = ::Gapic::Config::Method.new update_alert_policy_config
|
762
|
+
|
763
|
+
yield self if block_given?
|
764
|
+
end
|
765
|
+
end
|
766
|
+
end
|
767
|
+
end
|
768
|
+
end
|
769
|
+
end
|
770
|
+
end
|
771
|
+
end
|
772
|
+
end
|