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,53 @@
|
|
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 "googleauth"
|
20
|
+
|
21
|
+
module Google
|
22
|
+
module Cloud
|
23
|
+
module Monitoring
|
24
|
+
module V3
|
25
|
+
module ServiceMonitoringService
|
26
|
+
# Credentials for the ServiceMonitoringService API.
|
27
|
+
class Credentials < ::Google::Auth::Credentials
|
28
|
+
self.scope = [
|
29
|
+
"https://www.googleapis.com/auth/cloud-platform",
|
30
|
+
"https://www.googleapis.com/auth/monitoring",
|
31
|
+
"https://www.googleapis.com/auth/monitoring.read"
|
32
|
+
]
|
33
|
+
self.env_vars = [
|
34
|
+
"MONITORING_CREDENTIALS",
|
35
|
+
"MONITORING_KEYFILE",
|
36
|
+
"GOOGLE_CLOUD_CREDENTIALS",
|
37
|
+
"GOOGLE_CLOUD_KEYFILE",
|
38
|
+
"GCLOUD_KEYFILE",
|
39
|
+
"MONITORING_CREDENTIALS_JSON",
|
40
|
+
"MONITORING_KEYFILE_JSON",
|
41
|
+
"GOOGLE_CLOUD_CREDENTIALS_JSON",
|
42
|
+
"GOOGLE_CLOUD_KEYFILE_JSON",
|
43
|
+
"GCLOUD_KEYFILE_JSON"
|
44
|
+
]
|
45
|
+
self.paths = [
|
46
|
+
"~/.config/google_cloud/application_default_credentials.json"
|
47
|
+
]
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,185 @@
|
|
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
|
+
|
20
|
+
module Google
|
21
|
+
module Cloud
|
22
|
+
module Monitoring
|
23
|
+
module V3
|
24
|
+
module ServiceMonitoringService
|
25
|
+
# Path helper methods for the ServiceMonitoringService API.
|
26
|
+
module Paths
|
27
|
+
##
|
28
|
+
# Create a fully-qualified Folder resource string.
|
29
|
+
#
|
30
|
+
# The resource will be in the following format:
|
31
|
+
#
|
32
|
+
# `folders/{folder}`
|
33
|
+
#
|
34
|
+
# @param folder [String]
|
35
|
+
#
|
36
|
+
# @return [::String]
|
37
|
+
def folder_path folder:
|
38
|
+
"folders/#{folder}"
|
39
|
+
end
|
40
|
+
|
41
|
+
##
|
42
|
+
# Create a fully-qualified Organization resource string.
|
43
|
+
#
|
44
|
+
# The resource will be in the following format:
|
45
|
+
#
|
46
|
+
# `organizations/{organization}`
|
47
|
+
#
|
48
|
+
# @param organization [String]
|
49
|
+
#
|
50
|
+
# @return [::String]
|
51
|
+
def organization_path organization:
|
52
|
+
"organizations/#{organization}"
|
53
|
+
end
|
54
|
+
|
55
|
+
##
|
56
|
+
# Create a fully-qualified Project resource string.
|
57
|
+
#
|
58
|
+
# The resource will be in the following format:
|
59
|
+
#
|
60
|
+
# `projects/{project}`
|
61
|
+
#
|
62
|
+
# @param project [String]
|
63
|
+
#
|
64
|
+
# @return [::String]
|
65
|
+
def project_path project:
|
66
|
+
"projects/#{project}"
|
67
|
+
end
|
68
|
+
|
69
|
+
##
|
70
|
+
# Create a fully-qualified Service resource string.
|
71
|
+
#
|
72
|
+
# @overload service_path(project:, service:)
|
73
|
+
# The resource will be in the following format:
|
74
|
+
#
|
75
|
+
# `projects/{project}/services/{service}`
|
76
|
+
#
|
77
|
+
# @param project [String]
|
78
|
+
# @param service [String]
|
79
|
+
#
|
80
|
+
# @overload service_path(organization:, service:)
|
81
|
+
# The resource will be in the following format:
|
82
|
+
#
|
83
|
+
# `organizations/{organization}/services/{service}`
|
84
|
+
#
|
85
|
+
# @param organization [String]
|
86
|
+
# @param service [String]
|
87
|
+
#
|
88
|
+
# @overload service_path(folder:, service:)
|
89
|
+
# The resource will be in the following format:
|
90
|
+
#
|
91
|
+
# `folders/{folder}/services/{service}`
|
92
|
+
#
|
93
|
+
# @param folder [String]
|
94
|
+
# @param service [String]
|
95
|
+
#
|
96
|
+
# @return [::String]
|
97
|
+
def service_path **args
|
98
|
+
resources = {
|
99
|
+
"project:service" => (proc do |project:, service:|
|
100
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
101
|
+
|
102
|
+
"projects/#{project}/services/#{service}"
|
103
|
+
end),
|
104
|
+
"organization:service" => (proc do |organization:, service:|
|
105
|
+
raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/"
|
106
|
+
|
107
|
+
"organizations/#{organization}/services/#{service}"
|
108
|
+
end),
|
109
|
+
"folder:service" => (proc do |folder:, service:|
|
110
|
+
raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/"
|
111
|
+
|
112
|
+
"folders/#{folder}/services/#{service}"
|
113
|
+
end)
|
114
|
+
}
|
115
|
+
|
116
|
+
resource = resources[args.keys.sort.join(":")]
|
117
|
+
raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
|
118
|
+
resource.call(**args)
|
119
|
+
end
|
120
|
+
|
121
|
+
##
|
122
|
+
# Create a fully-qualified ServiceLevelObjective resource string.
|
123
|
+
#
|
124
|
+
# @overload service_level_objective_path(project:, service:, service_level_objective:)
|
125
|
+
# The resource will be in the following format:
|
126
|
+
#
|
127
|
+
# `projects/{project}/services/{service}/serviceLevelObjectives/{service_level_objective}`
|
128
|
+
#
|
129
|
+
# @param project [String]
|
130
|
+
# @param service [String]
|
131
|
+
# @param service_level_objective [String]
|
132
|
+
#
|
133
|
+
# @overload service_level_objective_path(organization:, service:, service_level_objective:)
|
134
|
+
# The resource will be in the following format:
|
135
|
+
#
|
136
|
+
# `organizations/{organization}/services/{service}/serviceLevelObjectives/{service_level_objective}`
|
137
|
+
#
|
138
|
+
# @param organization [String]
|
139
|
+
# @param service [String]
|
140
|
+
# @param service_level_objective [String]
|
141
|
+
#
|
142
|
+
# @overload service_level_objective_path(folder:, service:, service_level_objective:)
|
143
|
+
# The resource will be in the following format:
|
144
|
+
#
|
145
|
+
# `folders/{folder}/services/{service}/serviceLevelObjectives/{service_level_objective}`
|
146
|
+
#
|
147
|
+
# @param folder [String]
|
148
|
+
# @param service [String]
|
149
|
+
# @param service_level_objective [String]
|
150
|
+
#
|
151
|
+
# @return [::String]
|
152
|
+
def service_level_objective_path **args
|
153
|
+
resources = {
|
154
|
+
"project:service:service_level_objective" => (proc do |project:, service:, service_level_objective:|
|
155
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
156
|
+
raise ::ArgumentError, "service cannot contain /" if service.to_s.include? "/"
|
157
|
+
|
158
|
+
"projects/#{project}/services/#{service}/serviceLevelObjectives/#{service_level_objective}"
|
159
|
+
end),
|
160
|
+
"organization:service:service_level_objective" => (proc do |organization:, service:, service_level_objective:|
|
161
|
+
raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/"
|
162
|
+
raise ::ArgumentError, "service cannot contain /" if service.to_s.include? "/"
|
163
|
+
|
164
|
+
"organizations/#{organization}/services/#{service}/serviceLevelObjectives/#{service_level_objective}"
|
165
|
+
end),
|
166
|
+
"folder:service:service_level_objective" => (proc do |folder:, service:, service_level_objective:|
|
167
|
+
raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/"
|
168
|
+
raise ::ArgumentError, "service cannot contain /" if service.to_s.include? "/"
|
169
|
+
|
170
|
+
"folders/#{folder}/services/#{service}/serviceLevelObjectives/#{service_level_objective}"
|
171
|
+
end)
|
172
|
+
}
|
173
|
+
|
174
|
+
resource = resources[args.keys.sort.join(":")]
|
175
|
+
raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
|
176
|
+
resource.call(**args)
|
177
|
+
end
|
178
|
+
|
179
|
+
extend self
|
180
|
+
end
|
181
|
+
end
|
182
|
+
end
|
183
|
+
end
|
184
|
+
end
|
185
|
+
end
|
@@ -0,0 +1,56 @@
|
|
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/uptime_check_service/credentials"
|
26
|
+
require "google/cloud/monitoring/v3/uptime_check_service/paths"
|
27
|
+
require "google/cloud/monitoring/v3/uptime_check_service/client"
|
28
|
+
|
29
|
+
module Google
|
30
|
+
module Cloud
|
31
|
+
module Monitoring
|
32
|
+
module V3
|
33
|
+
##
|
34
|
+
# The UptimeCheckService API is used to manage (list, create, delete, edit)
|
35
|
+
# Uptime check configurations in the Stackdriver Monitoring product. An Uptime
|
36
|
+
# check is a piece of configuration that determines which resources and
|
37
|
+
# services to monitor for availability. These configurations can also be
|
38
|
+
# configured interactively by navigating to the [Cloud Console]
|
39
|
+
# (http://console.cloud.google.com), selecting the appropriate project,
|
40
|
+
# clicking on "Monitoring" on the left-hand side to navigate to Stackdriver,
|
41
|
+
# and then clicking on "Uptime".
|
42
|
+
#
|
43
|
+
# To load this service and instantiate a client:
|
44
|
+
#
|
45
|
+
# require "google/cloud/monitoring/v3/uptime_check_service"
|
46
|
+
# client = ::Google::Cloud::Monitoring::V3::UptimeCheckService::Client.new
|
47
|
+
#
|
48
|
+
module UptimeCheckService
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
helper_path = ::File.join __dir__, "uptime_check_service", "helpers.rb"
|
56
|
+
require "google/cloud/monitoring/v3/uptime_check_service/helpers" if ::File.file? helper_path
|
@@ -0,0 +1,822 @@
|
|
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/uptime_service_pb"
|
21
|
+
|
22
|
+
module Google
|
23
|
+
module Cloud
|
24
|
+
module Monitoring
|
25
|
+
module V3
|
26
|
+
module UptimeCheckService
|
27
|
+
##
|
28
|
+
# Client for the UptimeCheckService service.
|
29
|
+
#
|
30
|
+
# The UptimeCheckService API is used to manage (list, create, delete, edit)
|
31
|
+
# Uptime check configurations in the Stackdriver Monitoring product. An Uptime
|
32
|
+
# check is a piece of configuration that determines which resources and
|
33
|
+
# services to monitor for availability. These configurations can also be
|
34
|
+
# configured interactively by navigating to the [Cloud Console]
|
35
|
+
# (http://console.cloud.google.com), selecting the appropriate project,
|
36
|
+
# clicking on "Monitoring" on the left-hand side to navigate to Stackdriver,
|
37
|
+
# and then clicking on "Uptime".
|
38
|
+
#
|
39
|
+
class Client
|
40
|
+
include Paths
|
41
|
+
|
42
|
+
# @private
|
43
|
+
attr_reader :uptime_check_service_stub
|
44
|
+
|
45
|
+
##
|
46
|
+
# Configure the UptimeCheckService Client class.
|
47
|
+
#
|
48
|
+
# See {::Google::Cloud::Monitoring::V3::UptimeCheckService::Client::Configuration}
|
49
|
+
# for a description of the configuration fields.
|
50
|
+
#
|
51
|
+
# ## Example
|
52
|
+
#
|
53
|
+
# To modify the configuration for all UptimeCheckService clients:
|
54
|
+
#
|
55
|
+
# ::Google::Cloud::Monitoring::V3::UptimeCheckService::Client.configure do |config|
|
56
|
+
# config.timeout = 10.0
|
57
|
+
# end
|
58
|
+
#
|
59
|
+
# @yield [config] Configure the Client client.
|
60
|
+
# @yieldparam config [Client::Configuration]
|
61
|
+
#
|
62
|
+
# @return [Client::Configuration]
|
63
|
+
#
|
64
|
+
def self.configure
|
65
|
+
@configure ||= begin
|
66
|
+
namespace = ["Google", "Cloud", "Monitoring", "V3"]
|
67
|
+
parent_config = while namespace.any?
|
68
|
+
parent_name = namespace.join "::"
|
69
|
+
parent_const = const_get parent_name
|
70
|
+
break parent_const.configure if parent_const&.respond_to? :configure
|
71
|
+
namespace.pop
|
72
|
+
end
|
73
|
+
default_config = Client::Configuration.new parent_config
|
74
|
+
|
75
|
+
default_config.rpcs.list_uptime_check_configs.timeout = 30.0
|
76
|
+
default_config.rpcs.list_uptime_check_configs.retry_policy = {
|
77
|
+
initial_delay: 0.1,
|
78
|
+
max_delay: 30.0,
|
79
|
+
multiplier: 1.3,
|
80
|
+
retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
|
81
|
+
}
|
82
|
+
|
83
|
+
default_config.rpcs.get_uptime_check_config.timeout = 30.0
|
84
|
+
default_config.rpcs.get_uptime_check_config.retry_policy = {
|
85
|
+
initial_delay: 0.1,
|
86
|
+
max_delay: 30.0,
|
87
|
+
multiplier: 1.3,
|
88
|
+
retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
|
89
|
+
}
|
90
|
+
|
91
|
+
default_config.rpcs.create_uptime_check_config.timeout = 30.0
|
92
|
+
|
93
|
+
default_config.rpcs.update_uptime_check_config.timeout = 30.0
|
94
|
+
|
95
|
+
default_config.rpcs.delete_uptime_check_config.timeout = 30.0
|
96
|
+
default_config.rpcs.delete_uptime_check_config.retry_policy = {
|
97
|
+
initial_delay: 0.1,
|
98
|
+
max_delay: 30.0,
|
99
|
+
multiplier: 1.3,
|
100
|
+
retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
|
101
|
+
}
|
102
|
+
|
103
|
+
default_config.rpcs.list_uptime_check_ips.timeout = 30.0
|
104
|
+
default_config.rpcs.list_uptime_check_ips.retry_policy = {
|
105
|
+
initial_delay: 0.1,
|
106
|
+
max_delay: 30.0,
|
107
|
+
multiplier: 1.3,
|
108
|
+
retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
|
109
|
+
}
|
110
|
+
|
111
|
+
default_config
|
112
|
+
end
|
113
|
+
yield @configure if block_given?
|
114
|
+
@configure
|
115
|
+
end
|
116
|
+
|
117
|
+
##
|
118
|
+
# Configure the UptimeCheckService Client instance.
|
119
|
+
#
|
120
|
+
# The configuration is set to the derived mode, meaning that values can be changed,
|
121
|
+
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
122
|
+
# should be made on {Client.configure}.
|
123
|
+
#
|
124
|
+
# See {::Google::Cloud::Monitoring::V3::UptimeCheckService::Client::Configuration}
|
125
|
+
# for a description of the configuration fields.
|
126
|
+
#
|
127
|
+
# @yield [config] Configure the Client client.
|
128
|
+
# @yieldparam config [Client::Configuration]
|
129
|
+
#
|
130
|
+
# @return [Client::Configuration]
|
131
|
+
#
|
132
|
+
def configure
|
133
|
+
yield @config if block_given?
|
134
|
+
@config
|
135
|
+
end
|
136
|
+
|
137
|
+
##
|
138
|
+
# Create a new UptimeCheckService client object.
|
139
|
+
#
|
140
|
+
# ## Examples
|
141
|
+
#
|
142
|
+
# To create a new UptimeCheckService client with the default
|
143
|
+
# configuration:
|
144
|
+
#
|
145
|
+
# client = ::Google::Cloud::Monitoring::V3::UptimeCheckService::Client.new
|
146
|
+
#
|
147
|
+
# To create a new UptimeCheckService client with a custom
|
148
|
+
# configuration:
|
149
|
+
#
|
150
|
+
# client = ::Google::Cloud::Monitoring::V3::UptimeCheckService::Client.new do |config|
|
151
|
+
# config.timeout = 10.0
|
152
|
+
# end
|
153
|
+
#
|
154
|
+
# @yield [config] Configure the UptimeCheckService client.
|
155
|
+
# @yieldparam config [Client::Configuration]
|
156
|
+
#
|
157
|
+
def initialize
|
158
|
+
# These require statements are intentionally placed here to initialize
|
159
|
+
# the gRPC module only when it's required.
|
160
|
+
# See https://github.com/googleapis/toolkit/issues/446
|
161
|
+
require "gapic/grpc"
|
162
|
+
require "google/monitoring/v3/uptime_service_services_pb"
|
163
|
+
|
164
|
+
# Create the configuration object
|
165
|
+
@config = Configuration.new Client.configure
|
166
|
+
|
167
|
+
# Yield the configuration if needed
|
168
|
+
yield @config if block_given?
|
169
|
+
|
170
|
+
# Create credentials
|
171
|
+
credentials = @config.credentials
|
172
|
+
credentials ||= Credentials.default scope: @config.scope
|
173
|
+
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
174
|
+
credentials = Credentials.new credentials, scope: @config.scope
|
175
|
+
end
|
176
|
+
@quota_project_id = @config.quota_project
|
177
|
+
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
178
|
+
|
179
|
+
@uptime_check_service_stub = ::Gapic::ServiceStub.new(
|
180
|
+
::Google::Cloud::Monitoring::V3::UptimeCheckService::Stub,
|
181
|
+
credentials: credentials,
|
182
|
+
endpoint: @config.endpoint,
|
183
|
+
channel_args: @config.channel_args,
|
184
|
+
interceptors: @config.interceptors
|
185
|
+
)
|
186
|
+
end
|
187
|
+
|
188
|
+
# Service calls
|
189
|
+
|
190
|
+
##
|
191
|
+
# Lists the existing valid Uptime check configurations for the project
|
192
|
+
# (leaving out any invalid configurations).
|
193
|
+
#
|
194
|
+
# @overload list_uptime_check_configs(request, options = nil)
|
195
|
+
# Pass arguments to `list_uptime_check_configs` via a request object, either of type
|
196
|
+
# {::Google::Cloud::Monitoring::V3::ListUptimeCheckConfigsRequest} or an equivalent Hash.
|
197
|
+
#
|
198
|
+
# @param request [::Google::Cloud::Monitoring::V3::ListUptimeCheckConfigsRequest, ::Hash]
|
199
|
+
# A request object representing the call parameters. Required. To specify no
|
200
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
201
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
202
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
203
|
+
#
|
204
|
+
# @overload list_uptime_check_configs(parent: nil, page_size: nil, page_token: nil)
|
205
|
+
# Pass arguments to `list_uptime_check_configs` via keyword arguments. Note that at
|
206
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
207
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
208
|
+
#
|
209
|
+
# @param parent [::String]
|
210
|
+
# Required. The project whose Uptime check configurations are listed. The format is:
|
211
|
+
#
|
212
|
+
# projects/[PROJECT_ID_OR_NUMBER]
|
213
|
+
# @param page_size [::Integer]
|
214
|
+
# The maximum number of results to return in a single response. The server
|
215
|
+
# may further constrain the maximum number of results returned in a single
|
216
|
+
# page. If the page_size is <=0, the server will decide the number of results
|
217
|
+
# to be returned.
|
218
|
+
# @param page_token [::String]
|
219
|
+
# If this field is not empty then it must contain the `nextPageToken` value
|
220
|
+
# returned by a previous call to this method. Using this field causes the
|
221
|
+
# method to return more results from the previous method call.
|
222
|
+
#
|
223
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
224
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Monitoring::V3::UptimeCheckConfig>]
|
225
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
226
|
+
#
|
227
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::Monitoring::V3::UptimeCheckConfig>]
|
228
|
+
#
|
229
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
230
|
+
#
|
231
|
+
def list_uptime_check_configs request, options = nil
|
232
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
233
|
+
|
234
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Monitoring::V3::ListUptimeCheckConfigsRequest
|
235
|
+
|
236
|
+
# Converts hash and nil to an options object
|
237
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
238
|
+
|
239
|
+
# Customize the options with defaults
|
240
|
+
metadata = @config.rpcs.list_uptime_check_configs.metadata.to_h
|
241
|
+
|
242
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
243
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
244
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
245
|
+
gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
|
246
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
247
|
+
|
248
|
+
header_params = {
|
249
|
+
"parent" => request.parent
|
250
|
+
}
|
251
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
252
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
253
|
+
|
254
|
+
options.apply_defaults timeout: @config.rpcs.list_uptime_check_configs.timeout,
|
255
|
+
metadata: metadata,
|
256
|
+
retry_policy: @config.rpcs.list_uptime_check_configs.retry_policy
|
257
|
+
options.apply_defaults metadata: @config.metadata,
|
258
|
+
retry_policy: @config.retry_policy
|
259
|
+
|
260
|
+
@uptime_check_service_stub.call_rpc :list_uptime_check_configs, request, options: options do |response, operation|
|
261
|
+
response = ::Gapic::PagedEnumerable.new @uptime_check_service_stub, :list_uptime_check_configs, request, response, operation, options
|
262
|
+
yield response, operation if block_given?
|
263
|
+
return response
|
264
|
+
end
|
265
|
+
rescue ::GRPC::BadStatus => e
|
266
|
+
raise ::Google::Cloud::Error.from_error(e)
|
267
|
+
end
|
268
|
+
|
269
|
+
##
|
270
|
+
# Gets a single Uptime check configuration.
|
271
|
+
#
|
272
|
+
# @overload get_uptime_check_config(request, options = nil)
|
273
|
+
# Pass arguments to `get_uptime_check_config` via a request object, either of type
|
274
|
+
# {::Google::Cloud::Monitoring::V3::GetUptimeCheckConfigRequest} or an equivalent Hash.
|
275
|
+
#
|
276
|
+
# @param request [::Google::Cloud::Monitoring::V3::GetUptimeCheckConfigRequest, ::Hash]
|
277
|
+
# A request object representing the call parameters. Required. To specify no
|
278
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
279
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
280
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
281
|
+
#
|
282
|
+
# @overload get_uptime_check_config(name: nil)
|
283
|
+
# Pass arguments to `get_uptime_check_config` via keyword arguments. Note that at
|
284
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
285
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
286
|
+
#
|
287
|
+
# @param name [::String]
|
288
|
+
# Required. The Uptime check configuration to retrieve. The format is:
|
289
|
+
#
|
290
|
+
# projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID]
|
291
|
+
#
|
292
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
293
|
+
# @yieldparam response [::Google::Cloud::Monitoring::V3::UptimeCheckConfig]
|
294
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
295
|
+
#
|
296
|
+
# @return [::Google::Cloud::Monitoring::V3::UptimeCheckConfig]
|
297
|
+
#
|
298
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
299
|
+
#
|
300
|
+
def get_uptime_check_config request, options = nil
|
301
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
302
|
+
|
303
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Monitoring::V3::GetUptimeCheckConfigRequest
|
304
|
+
|
305
|
+
# Converts hash and nil to an options object
|
306
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
307
|
+
|
308
|
+
# Customize the options with defaults
|
309
|
+
metadata = @config.rpcs.get_uptime_check_config.metadata.to_h
|
310
|
+
|
311
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
312
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
313
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
314
|
+
gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
|
315
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
316
|
+
|
317
|
+
header_params = {
|
318
|
+
"name" => request.name
|
319
|
+
}
|
320
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
321
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
322
|
+
|
323
|
+
options.apply_defaults timeout: @config.rpcs.get_uptime_check_config.timeout,
|
324
|
+
metadata: metadata,
|
325
|
+
retry_policy: @config.rpcs.get_uptime_check_config.retry_policy
|
326
|
+
options.apply_defaults metadata: @config.metadata,
|
327
|
+
retry_policy: @config.retry_policy
|
328
|
+
|
329
|
+
@uptime_check_service_stub.call_rpc :get_uptime_check_config, request, options: options do |response, operation|
|
330
|
+
yield response, operation if block_given?
|
331
|
+
return response
|
332
|
+
end
|
333
|
+
rescue ::GRPC::BadStatus => e
|
334
|
+
raise ::Google::Cloud::Error.from_error(e)
|
335
|
+
end
|
336
|
+
|
337
|
+
##
|
338
|
+
# Creates a new Uptime check configuration.
|
339
|
+
#
|
340
|
+
# @overload create_uptime_check_config(request, options = nil)
|
341
|
+
# Pass arguments to `create_uptime_check_config` via a request object, either of type
|
342
|
+
# {::Google::Cloud::Monitoring::V3::CreateUptimeCheckConfigRequest} or an equivalent Hash.
|
343
|
+
#
|
344
|
+
# @param request [::Google::Cloud::Monitoring::V3::CreateUptimeCheckConfigRequest, ::Hash]
|
345
|
+
# A request object representing the call parameters. Required. To specify no
|
346
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
347
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
348
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
349
|
+
#
|
350
|
+
# @overload create_uptime_check_config(parent: nil, uptime_check_config: nil)
|
351
|
+
# Pass arguments to `create_uptime_check_config` via keyword arguments. Note that at
|
352
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
353
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
354
|
+
#
|
355
|
+
# @param parent [::String]
|
356
|
+
# Required. The project in which to create the Uptime check. The format is:
|
357
|
+
#
|
358
|
+
# projects/[PROJECT_ID_OR_NUMBER]
|
359
|
+
# @param uptime_check_config [::Google::Cloud::Monitoring::V3::UptimeCheckConfig, ::Hash]
|
360
|
+
# Required. The new Uptime check configuration.
|
361
|
+
#
|
362
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
363
|
+
# @yieldparam response [::Google::Cloud::Monitoring::V3::UptimeCheckConfig]
|
364
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
365
|
+
#
|
366
|
+
# @return [::Google::Cloud::Monitoring::V3::UptimeCheckConfig]
|
367
|
+
#
|
368
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
369
|
+
#
|
370
|
+
def create_uptime_check_config request, options = nil
|
371
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
372
|
+
|
373
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Monitoring::V3::CreateUptimeCheckConfigRequest
|
374
|
+
|
375
|
+
# Converts hash and nil to an options object
|
376
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
377
|
+
|
378
|
+
# Customize the options with defaults
|
379
|
+
metadata = @config.rpcs.create_uptime_check_config.metadata.to_h
|
380
|
+
|
381
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
382
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
383
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
384
|
+
gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
|
385
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
386
|
+
|
387
|
+
header_params = {
|
388
|
+
"parent" => request.parent
|
389
|
+
}
|
390
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
391
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
392
|
+
|
393
|
+
options.apply_defaults timeout: @config.rpcs.create_uptime_check_config.timeout,
|
394
|
+
metadata: metadata,
|
395
|
+
retry_policy: @config.rpcs.create_uptime_check_config.retry_policy
|
396
|
+
options.apply_defaults metadata: @config.metadata,
|
397
|
+
retry_policy: @config.retry_policy
|
398
|
+
|
399
|
+
@uptime_check_service_stub.call_rpc :create_uptime_check_config, request, options: options do |response, operation|
|
400
|
+
yield response, operation if block_given?
|
401
|
+
return response
|
402
|
+
end
|
403
|
+
rescue ::GRPC::BadStatus => e
|
404
|
+
raise ::Google::Cloud::Error.from_error(e)
|
405
|
+
end
|
406
|
+
|
407
|
+
##
|
408
|
+
# Updates an Uptime check configuration. You can either replace the entire
|
409
|
+
# configuration with a new one or replace only certain fields in the current
|
410
|
+
# configuration by specifying the fields to be updated via `updateMask`.
|
411
|
+
# Returns the updated configuration.
|
412
|
+
#
|
413
|
+
# @overload update_uptime_check_config(request, options = nil)
|
414
|
+
# Pass arguments to `update_uptime_check_config` via a request object, either of type
|
415
|
+
# {::Google::Cloud::Monitoring::V3::UpdateUptimeCheckConfigRequest} or an equivalent Hash.
|
416
|
+
#
|
417
|
+
# @param request [::Google::Cloud::Monitoring::V3::UpdateUptimeCheckConfigRequest, ::Hash]
|
418
|
+
# A request object representing the call parameters. Required. To specify no
|
419
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
420
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
421
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
422
|
+
#
|
423
|
+
# @overload update_uptime_check_config(update_mask: nil, uptime_check_config: nil)
|
424
|
+
# Pass arguments to `update_uptime_check_config` via keyword arguments. Note that at
|
425
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
426
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
427
|
+
#
|
428
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
429
|
+
# Optional. If present, only the listed fields in the current Uptime check
|
430
|
+
# configuration are updated with values from the new configuration. If this
|
431
|
+
# field is empty, then the current configuration is completely replaced with
|
432
|
+
# the new configuration.
|
433
|
+
# @param uptime_check_config [::Google::Cloud::Monitoring::V3::UptimeCheckConfig, ::Hash]
|
434
|
+
# Required. If an `updateMask` has been specified, this field gives
|
435
|
+
# the values for the set of fields mentioned in the `updateMask`. If an
|
436
|
+
# `updateMask` has not been given, this Uptime check configuration replaces
|
437
|
+
# the current configuration. If a field is mentioned in `updateMask` but
|
438
|
+
# the corresonding field is omitted in this partial Uptime check
|
439
|
+
# configuration, it has the effect of deleting/clearing the field from the
|
440
|
+
# configuration on the server.
|
441
|
+
#
|
442
|
+
# The following fields can be updated: `display_name`,
|
443
|
+
# `http_check`, `tcp_check`, `timeout`, `content_matchers`, and
|
444
|
+
# `selected_regions`.
|
445
|
+
#
|
446
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
447
|
+
# @yieldparam response [::Google::Cloud::Monitoring::V3::UptimeCheckConfig]
|
448
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
449
|
+
#
|
450
|
+
# @return [::Google::Cloud::Monitoring::V3::UptimeCheckConfig]
|
451
|
+
#
|
452
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
453
|
+
#
|
454
|
+
def update_uptime_check_config request, options = nil
|
455
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
456
|
+
|
457
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Monitoring::V3::UpdateUptimeCheckConfigRequest
|
458
|
+
|
459
|
+
# Converts hash and nil to an options object
|
460
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
461
|
+
|
462
|
+
# Customize the options with defaults
|
463
|
+
metadata = @config.rpcs.update_uptime_check_config.metadata.to_h
|
464
|
+
|
465
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
466
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
467
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
468
|
+
gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
|
469
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
470
|
+
|
471
|
+
header_params = {
|
472
|
+
"uptime_check_config.name" => request.uptime_check_config.name
|
473
|
+
}
|
474
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
475
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
476
|
+
|
477
|
+
options.apply_defaults timeout: @config.rpcs.update_uptime_check_config.timeout,
|
478
|
+
metadata: metadata,
|
479
|
+
retry_policy: @config.rpcs.update_uptime_check_config.retry_policy
|
480
|
+
options.apply_defaults metadata: @config.metadata,
|
481
|
+
retry_policy: @config.retry_policy
|
482
|
+
|
483
|
+
@uptime_check_service_stub.call_rpc :update_uptime_check_config, request, options: options do |response, operation|
|
484
|
+
yield response, operation if block_given?
|
485
|
+
return response
|
486
|
+
end
|
487
|
+
rescue ::GRPC::BadStatus => e
|
488
|
+
raise ::Google::Cloud::Error.from_error(e)
|
489
|
+
end
|
490
|
+
|
491
|
+
##
|
492
|
+
# Deletes an Uptime check configuration. Note that this method will fail
|
493
|
+
# if the Uptime check configuration is referenced by an alert policy or
|
494
|
+
# other dependent configs that would be rendered invalid by the deletion.
|
495
|
+
#
|
496
|
+
# @overload delete_uptime_check_config(request, options = nil)
|
497
|
+
# Pass arguments to `delete_uptime_check_config` via a request object, either of type
|
498
|
+
# {::Google::Cloud::Monitoring::V3::DeleteUptimeCheckConfigRequest} or an equivalent Hash.
|
499
|
+
#
|
500
|
+
# @param request [::Google::Cloud::Monitoring::V3::DeleteUptimeCheckConfigRequest, ::Hash]
|
501
|
+
# A request object representing the call parameters. Required. To specify no
|
502
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
503
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
504
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
505
|
+
#
|
506
|
+
# @overload delete_uptime_check_config(name: nil)
|
507
|
+
# Pass arguments to `delete_uptime_check_config` via keyword arguments. Note that at
|
508
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
509
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
510
|
+
#
|
511
|
+
# @param name [::String]
|
512
|
+
# Required. The Uptime check configuration to delete. The format is:
|
513
|
+
#
|
514
|
+
# projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID]
|
515
|
+
#
|
516
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
517
|
+
# @yieldparam response [::Google::Protobuf::Empty]
|
518
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
519
|
+
#
|
520
|
+
# @return [::Google::Protobuf::Empty]
|
521
|
+
#
|
522
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
523
|
+
#
|
524
|
+
def delete_uptime_check_config request, options = nil
|
525
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
526
|
+
|
527
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Monitoring::V3::DeleteUptimeCheckConfigRequest
|
528
|
+
|
529
|
+
# Converts hash and nil to an options object
|
530
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
531
|
+
|
532
|
+
# Customize the options with defaults
|
533
|
+
metadata = @config.rpcs.delete_uptime_check_config.metadata.to_h
|
534
|
+
|
535
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
536
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
537
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
538
|
+
gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
|
539
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
540
|
+
|
541
|
+
header_params = {
|
542
|
+
"name" => request.name
|
543
|
+
}
|
544
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
545
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
546
|
+
|
547
|
+
options.apply_defaults timeout: @config.rpcs.delete_uptime_check_config.timeout,
|
548
|
+
metadata: metadata,
|
549
|
+
retry_policy: @config.rpcs.delete_uptime_check_config.retry_policy
|
550
|
+
options.apply_defaults metadata: @config.metadata,
|
551
|
+
retry_policy: @config.retry_policy
|
552
|
+
|
553
|
+
@uptime_check_service_stub.call_rpc :delete_uptime_check_config, request, options: options do |response, operation|
|
554
|
+
yield response, operation if block_given?
|
555
|
+
return response
|
556
|
+
end
|
557
|
+
rescue ::GRPC::BadStatus => e
|
558
|
+
raise ::Google::Cloud::Error.from_error(e)
|
559
|
+
end
|
560
|
+
|
561
|
+
##
|
562
|
+
# Returns the list of IP addresses that checkers run from
|
563
|
+
#
|
564
|
+
# @overload list_uptime_check_ips(request, options = nil)
|
565
|
+
# Pass arguments to `list_uptime_check_ips` via a request object, either of type
|
566
|
+
# {::Google::Cloud::Monitoring::V3::ListUptimeCheckIpsRequest} or an equivalent Hash.
|
567
|
+
#
|
568
|
+
# @param request [::Google::Cloud::Monitoring::V3::ListUptimeCheckIpsRequest, ::Hash]
|
569
|
+
# A request object representing the call parameters. Required. To specify no
|
570
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
571
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
572
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
573
|
+
#
|
574
|
+
# @overload list_uptime_check_ips(page_size: nil, page_token: nil)
|
575
|
+
# Pass arguments to `list_uptime_check_ips` via keyword arguments. Note that at
|
576
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
577
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
578
|
+
#
|
579
|
+
# @param page_size [::Integer]
|
580
|
+
# The maximum number of results to return in a single response. The server
|
581
|
+
# may further constrain the maximum number of results returned in a single
|
582
|
+
# page. If the page_size is <=0, the server will decide the number of results
|
583
|
+
# to be returned.
|
584
|
+
# NOTE: this field is not yet implemented
|
585
|
+
# @param page_token [::String]
|
586
|
+
# If this field is not empty then it must contain the `nextPageToken` value
|
587
|
+
# returned by a previous call to this method. Using this field causes the
|
588
|
+
# method to return more results from the previous method call.
|
589
|
+
# NOTE: this field is not yet implemented
|
590
|
+
#
|
591
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
592
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Monitoring::V3::UptimeCheckIp>]
|
593
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
594
|
+
#
|
595
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::Monitoring::V3::UptimeCheckIp>]
|
596
|
+
#
|
597
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
598
|
+
#
|
599
|
+
def list_uptime_check_ips request, options = nil
|
600
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
601
|
+
|
602
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Monitoring::V3::ListUptimeCheckIpsRequest
|
603
|
+
|
604
|
+
# Converts hash and nil to an options object
|
605
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
606
|
+
|
607
|
+
# Customize the options with defaults
|
608
|
+
metadata = @config.rpcs.list_uptime_check_ips.metadata.to_h
|
609
|
+
|
610
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
611
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
612
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
613
|
+
gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
|
614
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
615
|
+
|
616
|
+
options.apply_defaults timeout: @config.rpcs.list_uptime_check_ips.timeout,
|
617
|
+
metadata: metadata,
|
618
|
+
retry_policy: @config.rpcs.list_uptime_check_ips.retry_policy
|
619
|
+
options.apply_defaults metadata: @config.metadata,
|
620
|
+
retry_policy: @config.retry_policy
|
621
|
+
|
622
|
+
@uptime_check_service_stub.call_rpc :list_uptime_check_ips, request, options: options do |response, operation|
|
623
|
+
response = ::Gapic::PagedEnumerable.new @uptime_check_service_stub, :list_uptime_check_ips, request, response, operation, options
|
624
|
+
yield response, operation if block_given?
|
625
|
+
return response
|
626
|
+
end
|
627
|
+
rescue ::GRPC::BadStatus => e
|
628
|
+
raise ::Google::Cloud::Error.from_error(e)
|
629
|
+
end
|
630
|
+
|
631
|
+
##
|
632
|
+
# Configuration class for the UptimeCheckService API.
|
633
|
+
#
|
634
|
+
# This class represents the configuration for UptimeCheckService,
|
635
|
+
# providing control over timeouts, retry behavior, logging, transport
|
636
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
637
|
+
# applied individually to specific RPCs. See
|
638
|
+
# {::Google::Cloud::Monitoring::V3::UptimeCheckService::Client::Configuration::Rpcs}
|
639
|
+
# for a list of RPCs that can be configured independently.
|
640
|
+
#
|
641
|
+
# Configuration can be applied globally to all clients, or to a single client
|
642
|
+
# on construction.
|
643
|
+
#
|
644
|
+
# # Examples
|
645
|
+
#
|
646
|
+
# To modify the global config, setting the timeout for list_uptime_check_configs
|
647
|
+
# to 20 seconds, and all remaining timeouts to 10 seconds:
|
648
|
+
#
|
649
|
+
# ::Google::Cloud::Monitoring::V3::UptimeCheckService::Client.configure do |config|
|
650
|
+
# config.timeout = 10.0
|
651
|
+
# config.rpcs.list_uptime_check_configs.timeout = 20.0
|
652
|
+
# end
|
653
|
+
#
|
654
|
+
# To apply the above configuration only to a new client:
|
655
|
+
#
|
656
|
+
# client = ::Google::Cloud::Monitoring::V3::UptimeCheckService::Client.new do |config|
|
657
|
+
# config.timeout = 10.0
|
658
|
+
# config.rpcs.list_uptime_check_configs.timeout = 20.0
|
659
|
+
# end
|
660
|
+
#
|
661
|
+
# @!attribute [rw] endpoint
|
662
|
+
# The hostname or hostname:port of the service endpoint.
|
663
|
+
# Defaults to `"monitoring.googleapis.com"`.
|
664
|
+
# @return [::String]
|
665
|
+
# @!attribute [rw] credentials
|
666
|
+
# Credentials to send with calls. You may provide any of the following types:
|
667
|
+
# * (`String`) The path to a service account key file in JSON format
|
668
|
+
# * (`Hash`) A service account key as a Hash
|
669
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
670
|
+
# (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
|
671
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
672
|
+
# (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
|
673
|
+
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
674
|
+
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
675
|
+
# * (`nil`) indicating no credentials
|
676
|
+
# @return [::Object]
|
677
|
+
# @!attribute [rw] scope
|
678
|
+
# The OAuth scopes
|
679
|
+
# @return [::Array<::String>]
|
680
|
+
# @!attribute [rw] lib_name
|
681
|
+
# The library name as recorded in instrumentation and logging
|
682
|
+
# @return [::String]
|
683
|
+
# @!attribute [rw] lib_version
|
684
|
+
# The library version as recorded in instrumentation and logging
|
685
|
+
# @return [::String]
|
686
|
+
# @!attribute [rw] channel_args
|
687
|
+
# Extra parameters passed to the gRPC channel. Note: this is ignored if a
|
688
|
+
# `GRPC::Core::Channel` object is provided as the credential.
|
689
|
+
# @return [::Hash]
|
690
|
+
# @!attribute [rw] interceptors
|
691
|
+
# An array of interceptors that are run before calls are executed.
|
692
|
+
# @return [::Array<::GRPC::ClientInterceptor>]
|
693
|
+
# @!attribute [rw] timeout
|
694
|
+
# The call timeout in seconds.
|
695
|
+
# @return [::Numeric]
|
696
|
+
# @!attribute [rw] metadata
|
697
|
+
# Additional gRPC headers to be sent with the call.
|
698
|
+
# @return [::Hash{::Symbol=>::String}]
|
699
|
+
# @!attribute [rw] retry_policy
|
700
|
+
# The retry policy. The value is a hash with the following keys:
|
701
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
702
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
703
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
704
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
705
|
+
# trigger a retry.
|
706
|
+
# @return [::Hash]
|
707
|
+
# @!attribute [rw] quota_project
|
708
|
+
# A separate project against which to charge quota.
|
709
|
+
# @return [::String]
|
710
|
+
#
|
711
|
+
class Configuration
|
712
|
+
extend ::Gapic::Config
|
713
|
+
|
714
|
+
config_attr :endpoint, "monitoring.googleapis.com", ::String
|
715
|
+
config_attr :credentials, nil do |value|
|
716
|
+
allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
717
|
+
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
718
|
+
allowed.any? { |klass| klass === value }
|
719
|
+
end
|
720
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
721
|
+
config_attr :lib_name, nil, ::String, nil
|
722
|
+
config_attr :lib_version, nil, ::String, nil
|
723
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
|
724
|
+
config_attr :interceptors, nil, ::Array, nil
|
725
|
+
config_attr :timeout, nil, ::Numeric, nil
|
726
|
+
config_attr :metadata, nil, ::Hash, nil
|
727
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
728
|
+
config_attr :quota_project, nil, ::String, nil
|
729
|
+
|
730
|
+
# @private
|
731
|
+
def initialize parent_config = nil
|
732
|
+
@parent_config = parent_config unless parent_config.nil?
|
733
|
+
|
734
|
+
yield self if block_given?
|
735
|
+
end
|
736
|
+
|
737
|
+
##
|
738
|
+
# Configurations for individual RPCs
|
739
|
+
# @return [Rpcs]
|
740
|
+
#
|
741
|
+
def rpcs
|
742
|
+
@rpcs ||= begin
|
743
|
+
parent_rpcs = nil
|
744
|
+
parent_rpcs = @parent_config.rpcs if @parent_config&.respond_to? :rpcs
|
745
|
+
Rpcs.new parent_rpcs
|
746
|
+
end
|
747
|
+
end
|
748
|
+
|
749
|
+
##
|
750
|
+
# Configuration RPC class for the UptimeCheckService API.
|
751
|
+
#
|
752
|
+
# Includes fields providing the configuration for each RPC in this service.
|
753
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
754
|
+
# the following configuration fields:
|
755
|
+
#
|
756
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
|
757
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
|
758
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
759
|
+
# include the following keys:
|
760
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
761
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
762
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
763
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
764
|
+
# trigger a retry.
|
765
|
+
#
|
766
|
+
class Rpcs
|
767
|
+
##
|
768
|
+
# RPC-specific configuration for `list_uptime_check_configs`
|
769
|
+
# @return [::Gapic::Config::Method]
|
770
|
+
#
|
771
|
+
attr_reader :list_uptime_check_configs
|
772
|
+
##
|
773
|
+
# RPC-specific configuration for `get_uptime_check_config`
|
774
|
+
# @return [::Gapic::Config::Method]
|
775
|
+
#
|
776
|
+
attr_reader :get_uptime_check_config
|
777
|
+
##
|
778
|
+
# RPC-specific configuration for `create_uptime_check_config`
|
779
|
+
# @return [::Gapic::Config::Method]
|
780
|
+
#
|
781
|
+
attr_reader :create_uptime_check_config
|
782
|
+
##
|
783
|
+
# RPC-specific configuration for `update_uptime_check_config`
|
784
|
+
# @return [::Gapic::Config::Method]
|
785
|
+
#
|
786
|
+
attr_reader :update_uptime_check_config
|
787
|
+
##
|
788
|
+
# RPC-specific configuration for `delete_uptime_check_config`
|
789
|
+
# @return [::Gapic::Config::Method]
|
790
|
+
#
|
791
|
+
attr_reader :delete_uptime_check_config
|
792
|
+
##
|
793
|
+
# RPC-specific configuration for `list_uptime_check_ips`
|
794
|
+
# @return [::Gapic::Config::Method]
|
795
|
+
#
|
796
|
+
attr_reader :list_uptime_check_ips
|
797
|
+
|
798
|
+
# @private
|
799
|
+
def initialize parent_rpcs = nil
|
800
|
+
list_uptime_check_configs_config = parent_rpcs&.list_uptime_check_configs if parent_rpcs&.respond_to? :list_uptime_check_configs
|
801
|
+
@list_uptime_check_configs = ::Gapic::Config::Method.new list_uptime_check_configs_config
|
802
|
+
get_uptime_check_config_config = parent_rpcs&.get_uptime_check_config if parent_rpcs&.respond_to? :get_uptime_check_config
|
803
|
+
@get_uptime_check_config = ::Gapic::Config::Method.new get_uptime_check_config_config
|
804
|
+
create_uptime_check_config_config = parent_rpcs&.create_uptime_check_config if parent_rpcs&.respond_to? :create_uptime_check_config
|
805
|
+
@create_uptime_check_config = ::Gapic::Config::Method.new create_uptime_check_config_config
|
806
|
+
update_uptime_check_config_config = parent_rpcs&.update_uptime_check_config if parent_rpcs&.respond_to? :update_uptime_check_config
|
807
|
+
@update_uptime_check_config = ::Gapic::Config::Method.new update_uptime_check_config_config
|
808
|
+
delete_uptime_check_config_config = parent_rpcs&.delete_uptime_check_config if parent_rpcs&.respond_to? :delete_uptime_check_config
|
809
|
+
@delete_uptime_check_config = ::Gapic::Config::Method.new delete_uptime_check_config_config
|
810
|
+
list_uptime_check_ips_config = parent_rpcs&.list_uptime_check_ips if parent_rpcs&.respond_to? :list_uptime_check_ips
|
811
|
+
@list_uptime_check_ips = ::Gapic::Config::Method.new list_uptime_check_ips_config
|
812
|
+
|
813
|
+
yield self if block_given?
|
814
|
+
end
|
815
|
+
end
|
816
|
+
end
|
817
|
+
end
|
818
|
+
end
|
819
|
+
end
|
820
|
+
end
|
821
|
+
end
|
822
|
+
end
|