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 NotificationChannelService
|
26
|
+
# Credentials for the NotificationChannelService 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,179 @@
|
|
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 NotificationChannelService
|
25
|
+
# Path helper methods for the NotificationChannelService 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 NotificationChannel resource string.
|
43
|
+
#
|
44
|
+
# @overload notification_channel_path(project:, notification_channel:)
|
45
|
+
# The resource will be in the following format:
|
46
|
+
#
|
47
|
+
# `projects/{project}/notificationChannels/{notification_channel}`
|
48
|
+
#
|
49
|
+
# @param project [String]
|
50
|
+
# @param notification_channel [String]
|
51
|
+
#
|
52
|
+
# @overload notification_channel_path(organization:, notification_channel:)
|
53
|
+
# The resource will be in the following format:
|
54
|
+
#
|
55
|
+
# `organizations/{organization}/notificationChannels/{notification_channel}`
|
56
|
+
#
|
57
|
+
# @param organization [String]
|
58
|
+
# @param notification_channel [String]
|
59
|
+
#
|
60
|
+
# @overload notification_channel_path(folder:, notification_channel:)
|
61
|
+
# The resource will be in the following format:
|
62
|
+
#
|
63
|
+
# `folders/{folder}/notificationChannels/{notification_channel}`
|
64
|
+
#
|
65
|
+
# @param folder [String]
|
66
|
+
# @param notification_channel [String]
|
67
|
+
#
|
68
|
+
# @return [::String]
|
69
|
+
def notification_channel_path **args
|
70
|
+
resources = {
|
71
|
+
"notification_channel:project" => (proc do |project:, notification_channel:|
|
72
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
73
|
+
|
74
|
+
"projects/#{project}/notificationChannels/#{notification_channel}"
|
75
|
+
end),
|
76
|
+
"notification_channel:organization" => (proc do |organization:, notification_channel:|
|
77
|
+
raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/"
|
78
|
+
|
79
|
+
"organizations/#{organization}/notificationChannels/#{notification_channel}"
|
80
|
+
end),
|
81
|
+
"folder:notification_channel" => (proc do |folder:, notification_channel:|
|
82
|
+
raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/"
|
83
|
+
|
84
|
+
"folders/#{folder}/notificationChannels/#{notification_channel}"
|
85
|
+
end)
|
86
|
+
}
|
87
|
+
|
88
|
+
resource = resources[args.keys.sort.join(":")]
|
89
|
+
raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
|
90
|
+
resource.call(**args)
|
91
|
+
end
|
92
|
+
|
93
|
+
##
|
94
|
+
# Create a fully-qualified NotificationChannelDescriptor resource string.
|
95
|
+
#
|
96
|
+
# @overload notification_channel_descriptor_path(project:, channel_descriptor:)
|
97
|
+
# The resource will be in the following format:
|
98
|
+
#
|
99
|
+
# `projects/{project}/notificationChannelDescriptors/{channel_descriptor}`
|
100
|
+
#
|
101
|
+
# @param project [String]
|
102
|
+
# @param channel_descriptor [String]
|
103
|
+
#
|
104
|
+
# @overload notification_channel_descriptor_path(organization:, channel_descriptor:)
|
105
|
+
# The resource will be in the following format:
|
106
|
+
#
|
107
|
+
# `organizations/{organization}/notificationChannelDescriptors/{channel_descriptor}`
|
108
|
+
#
|
109
|
+
# @param organization [String]
|
110
|
+
# @param channel_descriptor [String]
|
111
|
+
#
|
112
|
+
# @overload notification_channel_descriptor_path(folder:, channel_descriptor:)
|
113
|
+
# The resource will be in the following format:
|
114
|
+
#
|
115
|
+
# `folders/{folder}/notificationChannelDescriptors/{channel_descriptor}`
|
116
|
+
#
|
117
|
+
# @param folder [String]
|
118
|
+
# @param channel_descriptor [String]
|
119
|
+
#
|
120
|
+
# @return [::String]
|
121
|
+
def notification_channel_descriptor_path **args
|
122
|
+
resources = {
|
123
|
+
"channel_descriptor:project" => (proc do |project:, channel_descriptor:|
|
124
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
125
|
+
|
126
|
+
"projects/#{project}/notificationChannelDescriptors/#{channel_descriptor}"
|
127
|
+
end),
|
128
|
+
"channel_descriptor:organization" => (proc do |organization:, channel_descriptor:|
|
129
|
+
raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/"
|
130
|
+
|
131
|
+
"organizations/#{organization}/notificationChannelDescriptors/#{channel_descriptor}"
|
132
|
+
end),
|
133
|
+
"channel_descriptor:folder" => (proc do |folder:, channel_descriptor:|
|
134
|
+
raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/"
|
135
|
+
|
136
|
+
"folders/#{folder}/notificationChannelDescriptors/#{channel_descriptor}"
|
137
|
+
end)
|
138
|
+
}
|
139
|
+
|
140
|
+
resource = resources[args.keys.sort.join(":")]
|
141
|
+
raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
|
142
|
+
resource.call(**args)
|
143
|
+
end
|
144
|
+
|
145
|
+
##
|
146
|
+
# Create a fully-qualified Organization resource string.
|
147
|
+
#
|
148
|
+
# The resource will be in the following format:
|
149
|
+
#
|
150
|
+
# `organizations/{organization}`
|
151
|
+
#
|
152
|
+
# @param organization [String]
|
153
|
+
#
|
154
|
+
# @return [::String]
|
155
|
+
def organization_path organization:
|
156
|
+
"organizations/#{organization}"
|
157
|
+
end
|
158
|
+
|
159
|
+
##
|
160
|
+
# Create a fully-qualified Project resource string.
|
161
|
+
#
|
162
|
+
# The resource will be in the following format:
|
163
|
+
#
|
164
|
+
# `projects/{project}`
|
165
|
+
#
|
166
|
+
# @param project [String]
|
167
|
+
#
|
168
|
+
# @return [::String]
|
169
|
+
def project_path project:
|
170
|
+
"projects/#{project}"
|
171
|
+
end
|
172
|
+
|
173
|
+
extend self
|
174
|
+
end
|
175
|
+
end
|
176
|
+
end
|
177
|
+
end
|
178
|
+
end
|
179
|
+
end
|
@@ -0,0 +1,52 @@
|
|
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/service_monitoring_service/credentials"
|
26
|
+
require "google/cloud/monitoring/v3/service_monitoring_service/paths"
|
27
|
+
require "google/cloud/monitoring/v3/service_monitoring_service/client"
|
28
|
+
|
29
|
+
module Google
|
30
|
+
module Cloud
|
31
|
+
module Monitoring
|
32
|
+
module V3
|
33
|
+
##
|
34
|
+
# The Cloud Monitoring Service-Oriented Monitoring API has endpoints for
|
35
|
+
# managing and querying aspects of a workspace's services. These include the
|
36
|
+
# `Service`'s monitored resources, its Service-Level Objectives, and a taxonomy
|
37
|
+
# of categorized Health Metrics.
|
38
|
+
#
|
39
|
+
# To load this service and instantiate a client:
|
40
|
+
#
|
41
|
+
# require "google/cloud/monitoring/v3/service_monitoring_service"
|
42
|
+
# client = ::Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client.new
|
43
|
+
#
|
44
|
+
module ServiceMonitoringService
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
helper_path = ::File.join __dir__, "service_monitoring_service", "helpers.rb"
|
52
|
+
require "google/cloud/monitoring/v3/service_monitoring_service/helpers" if ::File.file? helper_path
|
@@ -0,0 +1,1168 @@
|
|
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/service_service_pb"
|
21
|
+
|
22
|
+
module Google
|
23
|
+
module Cloud
|
24
|
+
module Monitoring
|
25
|
+
module V3
|
26
|
+
module ServiceMonitoringService
|
27
|
+
##
|
28
|
+
# Client for the ServiceMonitoringService service.
|
29
|
+
#
|
30
|
+
# The Cloud Monitoring Service-Oriented Monitoring API has endpoints for
|
31
|
+
# managing and querying aspects of a workspace's services. These include the
|
32
|
+
# `Service`'s monitored resources, its Service-Level Objectives, and a taxonomy
|
33
|
+
# of categorized Health Metrics.
|
34
|
+
#
|
35
|
+
class Client
|
36
|
+
include Paths
|
37
|
+
|
38
|
+
# @private
|
39
|
+
attr_reader :service_monitoring_service_stub
|
40
|
+
|
41
|
+
##
|
42
|
+
# Configure the ServiceMonitoringService Client class.
|
43
|
+
#
|
44
|
+
# See {::Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client::Configuration}
|
45
|
+
# for a description of the configuration fields.
|
46
|
+
#
|
47
|
+
# ## Example
|
48
|
+
#
|
49
|
+
# To modify the configuration for all ServiceMonitoringService clients:
|
50
|
+
#
|
51
|
+
# ::Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client.configure do |config|
|
52
|
+
# config.timeout = 10.0
|
53
|
+
# end
|
54
|
+
#
|
55
|
+
# @yield [config] Configure the Client client.
|
56
|
+
# @yieldparam config [Client::Configuration]
|
57
|
+
#
|
58
|
+
# @return [Client::Configuration]
|
59
|
+
#
|
60
|
+
def self.configure
|
61
|
+
@configure ||= begin
|
62
|
+
namespace = ["Google", "Cloud", "Monitoring", "V3"]
|
63
|
+
parent_config = while namespace.any?
|
64
|
+
parent_name = namespace.join "::"
|
65
|
+
parent_const = const_get parent_name
|
66
|
+
break parent_const.configure if parent_const&.respond_to? :configure
|
67
|
+
namespace.pop
|
68
|
+
end
|
69
|
+
default_config = Client::Configuration.new parent_config
|
70
|
+
|
71
|
+
default_config.rpcs.create_service.timeout = 30.0
|
72
|
+
|
73
|
+
default_config.rpcs.get_service.timeout = 30.0
|
74
|
+
default_config.rpcs.get_service.retry_policy = {
|
75
|
+
initial_delay: 0.1,
|
76
|
+
max_delay: 30.0,
|
77
|
+
multiplier: 1.3,
|
78
|
+
retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
|
79
|
+
}
|
80
|
+
|
81
|
+
default_config.rpcs.list_services.timeout = 30.0
|
82
|
+
default_config.rpcs.list_services.retry_policy = {
|
83
|
+
initial_delay: 0.1,
|
84
|
+
max_delay: 30.0,
|
85
|
+
multiplier: 1.3,
|
86
|
+
retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
|
87
|
+
}
|
88
|
+
|
89
|
+
default_config.rpcs.update_service.timeout = 30.0
|
90
|
+
|
91
|
+
default_config.rpcs.delete_service.timeout = 30.0
|
92
|
+
default_config.rpcs.delete_service.retry_policy = {
|
93
|
+
initial_delay: 0.1,
|
94
|
+
max_delay: 30.0,
|
95
|
+
multiplier: 1.3,
|
96
|
+
retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
|
97
|
+
}
|
98
|
+
|
99
|
+
default_config.rpcs.create_service_level_objective.timeout = 30.0
|
100
|
+
|
101
|
+
default_config.rpcs.get_service_level_objective.timeout = 30.0
|
102
|
+
default_config.rpcs.get_service_level_objective.retry_policy = {
|
103
|
+
initial_delay: 0.1,
|
104
|
+
max_delay: 30.0,
|
105
|
+
multiplier: 1.3,
|
106
|
+
retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
|
107
|
+
}
|
108
|
+
|
109
|
+
default_config.rpcs.list_service_level_objectives.timeout = 30.0
|
110
|
+
default_config.rpcs.list_service_level_objectives.retry_policy = {
|
111
|
+
initial_delay: 0.1,
|
112
|
+
max_delay: 30.0,
|
113
|
+
multiplier: 1.3,
|
114
|
+
retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
|
115
|
+
}
|
116
|
+
|
117
|
+
default_config.rpcs.update_service_level_objective.timeout = 30.0
|
118
|
+
|
119
|
+
default_config.rpcs.delete_service_level_objective.timeout = 30.0
|
120
|
+
default_config.rpcs.delete_service_level_objective.retry_policy = {
|
121
|
+
initial_delay: 0.1,
|
122
|
+
max_delay: 30.0,
|
123
|
+
multiplier: 1.3,
|
124
|
+
retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
|
125
|
+
}
|
126
|
+
|
127
|
+
default_config
|
128
|
+
end
|
129
|
+
yield @configure if block_given?
|
130
|
+
@configure
|
131
|
+
end
|
132
|
+
|
133
|
+
##
|
134
|
+
# Configure the ServiceMonitoringService Client instance.
|
135
|
+
#
|
136
|
+
# The configuration is set to the derived mode, meaning that values can be changed,
|
137
|
+
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
138
|
+
# should be made on {Client.configure}.
|
139
|
+
#
|
140
|
+
# See {::Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client::Configuration}
|
141
|
+
# for a description of the configuration fields.
|
142
|
+
#
|
143
|
+
# @yield [config] Configure the Client client.
|
144
|
+
# @yieldparam config [Client::Configuration]
|
145
|
+
#
|
146
|
+
# @return [Client::Configuration]
|
147
|
+
#
|
148
|
+
def configure
|
149
|
+
yield @config if block_given?
|
150
|
+
@config
|
151
|
+
end
|
152
|
+
|
153
|
+
##
|
154
|
+
# Create a new ServiceMonitoringService client object.
|
155
|
+
#
|
156
|
+
# ## Examples
|
157
|
+
#
|
158
|
+
# To create a new ServiceMonitoringService client with the default
|
159
|
+
# configuration:
|
160
|
+
#
|
161
|
+
# client = ::Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client.new
|
162
|
+
#
|
163
|
+
# To create a new ServiceMonitoringService client with a custom
|
164
|
+
# configuration:
|
165
|
+
#
|
166
|
+
# client = ::Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client.new do |config|
|
167
|
+
# config.timeout = 10.0
|
168
|
+
# end
|
169
|
+
#
|
170
|
+
# @yield [config] Configure the ServiceMonitoringService client.
|
171
|
+
# @yieldparam config [Client::Configuration]
|
172
|
+
#
|
173
|
+
def initialize
|
174
|
+
# These require statements are intentionally placed here to initialize
|
175
|
+
# the gRPC module only when it's required.
|
176
|
+
# See https://github.com/googleapis/toolkit/issues/446
|
177
|
+
require "gapic/grpc"
|
178
|
+
require "google/monitoring/v3/service_service_services_pb"
|
179
|
+
|
180
|
+
# Create the configuration object
|
181
|
+
@config = Configuration.new Client.configure
|
182
|
+
|
183
|
+
# Yield the configuration if needed
|
184
|
+
yield @config if block_given?
|
185
|
+
|
186
|
+
# Create credentials
|
187
|
+
credentials = @config.credentials
|
188
|
+
credentials ||= Credentials.default scope: @config.scope
|
189
|
+
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
190
|
+
credentials = Credentials.new credentials, scope: @config.scope
|
191
|
+
end
|
192
|
+
@quota_project_id = @config.quota_project
|
193
|
+
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
194
|
+
|
195
|
+
@service_monitoring_service_stub = ::Gapic::ServiceStub.new(
|
196
|
+
::Google::Cloud::Monitoring::V3::ServiceMonitoringService::Stub,
|
197
|
+
credentials: credentials,
|
198
|
+
endpoint: @config.endpoint,
|
199
|
+
channel_args: @config.channel_args,
|
200
|
+
interceptors: @config.interceptors
|
201
|
+
)
|
202
|
+
end
|
203
|
+
|
204
|
+
# Service calls
|
205
|
+
|
206
|
+
##
|
207
|
+
# Create a `Service`.
|
208
|
+
#
|
209
|
+
# @overload create_service(request, options = nil)
|
210
|
+
# Pass arguments to `create_service` via a request object, either of type
|
211
|
+
# {::Google::Cloud::Monitoring::V3::CreateServiceRequest} or an equivalent Hash.
|
212
|
+
#
|
213
|
+
# @param request [::Google::Cloud::Monitoring::V3::CreateServiceRequest, ::Hash]
|
214
|
+
# A request object representing the call parameters. Required. To specify no
|
215
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
216
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
217
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
218
|
+
#
|
219
|
+
# @overload create_service(parent: nil, service_id: nil, service: nil)
|
220
|
+
# Pass arguments to `create_service` via keyword arguments. Note that at
|
221
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
222
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
223
|
+
#
|
224
|
+
# @param parent [::String]
|
225
|
+
# Required. Resource name of the parent workspace. The format is:
|
226
|
+
#
|
227
|
+
# projects/[PROJECT_ID_OR_NUMBER]
|
228
|
+
# @param service_id [::String]
|
229
|
+
# Optional. The Service id to use for this Service. If omitted, an id will be
|
230
|
+
# generated instead. Must match the pattern `[a-z0-9\-]+`
|
231
|
+
# @param service [::Google::Cloud::Monitoring::V3::Service, ::Hash]
|
232
|
+
# Required. The `Service` to create.
|
233
|
+
#
|
234
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
235
|
+
# @yieldparam response [::Google::Cloud::Monitoring::V3::Service]
|
236
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
237
|
+
#
|
238
|
+
# @return [::Google::Cloud::Monitoring::V3::Service]
|
239
|
+
#
|
240
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
241
|
+
#
|
242
|
+
def create_service request, options = nil
|
243
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
244
|
+
|
245
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Monitoring::V3::CreateServiceRequest
|
246
|
+
|
247
|
+
# Converts hash and nil to an options object
|
248
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
249
|
+
|
250
|
+
# Customize the options with defaults
|
251
|
+
metadata = @config.rpcs.create_service.metadata.to_h
|
252
|
+
|
253
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
254
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
255
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
256
|
+
gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
|
257
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
258
|
+
|
259
|
+
header_params = {
|
260
|
+
"parent" => request.parent
|
261
|
+
}
|
262
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
263
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
264
|
+
|
265
|
+
options.apply_defaults timeout: @config.rpcs.create_service.timeout,
|
266
|
+
metadata: metadata,
|
267
|
+
retry_policy: @config.rpcs.create_service.retry_policy
|
268
|
+
options.apply_defaults metadata: @config.metadata,
|
269
|
+
retry_policy: @config.retry_policy
|
270
|
+
|
271
|
+
@service_monitoring_service_stub.call_rpc :create_service, request, options: options do |response, operation|
|
272
|
+
yield response, operation if block_given?
|
273
|
+
return response
|
274
|
+
end
|
275
|
+
rescue ::GRPC::BadStatus => e
|
276
|
+
raise ::Google::Cloud::Error.from_error(e)
|
277
|
+
end
|
278
|
+
|
279
|
+
##
|
280
|
+
# Get the named `Service`.
|
281
|
+
#
|
282
|
+
# @overload get_service(request, options = nil)
|
283
|
+
# Pass arguments to `get_service` via a request object, either of type
|
284
|
+
# {::Google::Cloud::Monitoring::V3::GetServiceRequest} or an equivalent Hash.
|
285
|
+
#
|
286
|
+
# @param request [::Google::Cloud::Monitoring::V3::GetServiceRequest, ::Hash]
|
287
|
+
# A request object representing the call parameters. Required. To specify no
|
288
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
289
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
290
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
291
|
+
#
|
292
|
+
# @overload get_service(name: nil)
|
293
|
+
# Pass arguments to `get_service` via keyword arguments. Note that at
|
294
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
295
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
296
|
+
#
|
297
|
+
# @param name [::String]
|
298
|
+
# Required. Resource name of the `Service`. The format is:
|
299
|
+
#
|
300
|
+
# projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]
|
301
|
+
#
|
302
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
303
|
+
# @yieldparam response [::Google::Cloud::Monitoring::V3::Service]
|
304
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
305
|
+
#
|
306
|
+
# @return [::Google::Cloud::Monitoring::V3::Service]
|
307
|
+
#
|
308
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
309
|
+
#
|
310
|
+
def get_service request, options = nil
|
311
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
312
|
+
|
313
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Monitoring::V3::GetServiceRequest
|
314
|
+
|
315
|
+
# Converts hash and nil to an options object
|
316
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
317
|
+
|
318
|
+
# Customize the options with defaults
|
319
|
+
metadata = @config.rpcs.get_service.metadata.to_h
|
320
|
+
|
321
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
322
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
323
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
324
|
+
gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
|
325
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
326
|
+
|
327
|
+
header_params = {
|
328
|
+
"name" => request.name
|
329
|
+
}
|
330
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
331
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
332
|
+
|
333
|
+
options.apply_defaults timeout: @config.rpcs.get_service.timeout,
|
334
|
+
metadata: metadata,
|
335
|
+
retry_policy: @config.rpcs.get_service.retry_policy
|
336
|
+
options.apply_defaults metadata: @config.metadata,
|
337
|
+
retry_policy: @config.retry_policy
|
338
|
+
|
339
|
+
@service_monitoring_service_stub.call_rpc :get_service, request, options: options do |response, operation|
|
340
|
+
yield response, operation if block_given?
|
341
|
+
return response
|
342
|
+
end
|
343
|
+
rescue ::GRPC::BadStatus => e
|
344
|
+
raise ::Google::Cloud::Error.from_error(e)
|
345
|
+
end
|
346
|
+
|
347
|
+
##
|
348
|
+
# List `Service`s for this workspace.
|
349
|
+
#
|
350
|
+
# @overload list_services(request, options = nil)
|
351
|
+
# Pass arguments to `list_services` via a request object, either of type
|
352
|
+
# {::Google::Cloud::Monitoring::V3::ListServicesRequest} or an equivalent Hash.
|
353
|
+
#
|
354
|
+
# @param request [::Google::Cloud::Monitoring::V3::ListServicesRequest, ::Hash]
|
355
|
+
# A request object representing the call parameters. Required. To specify no
|
356
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
357
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
358
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
359
|
+
#
|
360
|
+
# @overload list_services(parent: nil, filter: nil, page_size: nil, page_token: nil)
|
361
|
+
# Pass arguments to `list_services` via keyword arguments. Note that at
|
362
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
363
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
364
|
+
#
|
365
|
+
# @param parent [::String]
|
366
|
+
# Required. Resource name of the parent containing the listed services, either a
|
367
|
+
# project or a Monitoring Workspace. The formats are:
|
368
|
+
#
|
369
|
+
# projects/[PROJECT_ID_OR_NUMBER]
|
370
|
+
# workspaces/[HOST_PROJECT_ID_OR_NUMBER]
|
371
|
+
# @param filter [::String]
|
372
|
+
# A filter specifying what `Service`s to return. The filter currently
|
373
|
+
# supports the following fields:
|
374
|
+
#
|
375
|
+
# - `identifier_case`
|
376
|
+
# - `app_engine.module_id`
|
377
|
+
# - `cloud_endpoints.service`
|
378
|
+
# - `cluster_istio.location`
|
379
|
+
# - `cluster_istio.cluster_name`
|
380
|
+
# - `cluster_istio.service_namespace`
|
381
|
+
# - `cluster_istio.service_name`
|
382
|
+
#
|
383
|
+
# `identifier_case` refers to which option in the identifier oneof is
|
384
|
+
# populated. For example, the filter `identifier_case = "CUSTOM"` would match
|
385
|
+
# all services with a value for the `custom` field. Valid options are
|
386
|
+
# "CUSTOM", "APP_ENGINE", "CLOUD_ENDPOINTS", and "CLUSTER_ISTIO".
|
387
|
+
# @param page_size [::Integer]
|
388
|
+
# A non-negative number that is the maximum number of results to return.
|
389
|
+
# When 0, use default page size.
|
390
|
+
# @param page_token [::String]
|
391
|
+
# If this field is not empty then it must contain the `nextPageToken` value
|
392
|
+
# returned by a previous call to this method. Using this field causes the
|
393
|
+
# method to return additional results from the previous method call.
|
394
|
+
#
|
395
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
396
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Monitoring::V3::Service>]
|
397
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
398
|
+
#
|
399
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::Monitoring::V3::Service>]
|
400
|
+
#
|
401
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
402
|
+
#
|
403
|
+
def list_services request, options = nil
|
404
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
405
|
+
|
406
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Monitoring::V3::ListServicesRequest
|
407
|
+
|
408
|
+
# Converts hash and nil to an options object
|
409
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
410
|
+
|
411
|
+
# Customize the options with defaults
|
412
|
+
metadata = @config.rpcs.list_services.metadata.to_h
|
413
|
+
|
414
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
415
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
416
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
417
|
+
gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
|
418
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
419
|
+
|
420
|
+
header_params = {
|
421
|
+
"parent" => request.parent
|
422
|
+
}
|
423
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
424
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
425
|
+
|
426
|
+
options.apply_defaults timeout: @config.rpcs.list_services.timeout,
|
427
|
+
metadata: metadata,
|
428
|
+
retry_policy: @config.rpcs.list_services.retry_policy
|
429
|
+
options.apply_defaults metadata: @config.metadata,
|
430
|
+
retry_policy: @config.retry_policy
|
431
|
+
|
432
|
+
@service_monitoring_service_stub.call_rpc :list_services, request, options: options do |response, operation|
|
433
|
+
response = ::Gapic::PagedEnumerable.new @service_monitoring_service_stub, :list_services, request, response, operation, options
|
434
|
+
yield response, operation if block_given?
|
435
|
+
return response
|
436
|
+
end
|
437
|
+
rescue ::GRPC::BadStatus => e
|
438
|
+
raise ::Google::Cloud::Error.from_error(e)
|
439
|
+
end
|
440
|
+
|
441
|
+
##
|
442
|
+
# Update this `Service`.
|
443
|
+
#
|
444
|
+
# @overload update_service(request, options = nil)
|
445
|
+
# Pass arguments to `update_service` via a request object, either of type
|
446
|
+
# {::Google::Cloud::Monitoring::V3::UpdateServiceRequest} or an equivalent Hash.
|
447
|
+
#
|
448
|
+
# @param request [::Google::Cloud::Monitoring::V3::UpdateServiceRequest, ::Hash]
|
449
|
+
# A request object representing the call parameters. Required. To specify no
|
450
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
451
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
452
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
453
|
+
#
|
454
|
+
# @overload update_service(service: nil, update_mask: nil)
|
455
|
+
# Pass arguments to `update_service` via keyword arguments. Note that at
|
456
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
457
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
458
|
+
#
|
459
|
+
# @param service [::Google::Cloud::Monitoring::V3::Service, ::Hash]
|
460
|
+
# Required. The `Service` to draw updates from.
|
461
|
+
# The given `name` specifies the resource to update.
|
462
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
463
|
+
# A set of field paths defining which fields to use for the update.
|
464
|
+
#
|
465
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
466
|
+
# @yieldparam response [::Google::Cloud::Monitoring::V3::Service]
|
467
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
468
|
+
#
|
469
|
+
# @return [::Google::Cloud::Monitoring::V3::Service]
|
470
|
+
#
|
471
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
472
|
+
#
|
473
|
+
def update_service request, options = nil
|
474
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
475
|
+
|
476
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Monitoring::V3::UpdateServiceRequest
|
477
|
+
|
478
|
+
# Converts hash and nil to an options object
|
479
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
480
|
+
|
481
|
+
# Customize the options with defaults
|
482
|
+
metadata = @config.rpcs.update_service.metadata.to_h
|
483
|
+
|
484
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
485
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
486
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
487
|
+
gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
|
488
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
489
|
+
|
490
|
+
header_params = {
|
491
|
+
"service.name" => request.service.name
|
492
|
+
}
|
493
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
494
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
495
|
+
|
496
|
+
options.apply_defaults timeout: @config.rpcs.update_service.timeout,
|
497
|
+
metadata: metadata,
|
498
|
+
retry_policy: @config.rpcs.update_service.retry_policy
|
499
|
+
options.apply_defaults metadata: @config.metadata,
|
500
|
+
retry_policy: @config.retry_policy
|
501
|
+
|
502
|
+
@service_monitoring_service_stub.call_rpc :update_service, request, options: options do |response, operation|
|
503
|
+
yield response, operation if block_given?
|
504
|
+
return response
|
505
|
+
end
|
506
|
+
rescue ::GRPC::BadStatus => e
|
507
|
+
raise ::Google::Cloud::Error.from_error(e)
|
508
|
+
end
|
509
|
+
|
510
|
+
##
|
511
|
+
# Soft delete this `Service`.
|
512
|
+
#
|
513
|
+
# @overload delete_service(request, options = nil)
|
514
|
+
# Pass arguments to `delete_service` via a request object, either of type
|
515
|
+
# {::Google::Cloud::Monitoring::V3::DeleteServiceRequest} or an equivalent Hash.
|
516
|
+
#
|
517
|
+
# @param request [::Google::Cloud::Monitoring::V3::DeleteServiceRequest, ::Hash]
|
518
|
+
# A request object representing the call parameters. Required. To specify no
|
519
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
520
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
521
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
522
|
+
#
|
523
|
+
# @overload delete_service(name: nil)
|
524
|
+
# Pass arguments to `delete_service` via keyword arguments. Note that at
|
525
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
526
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
527
|
+
#
|
528
|
+
# @param name [::String]
|
529
|
+
# Required. Resource name of the `Service` to delete. The format is:
|
530
|
+
#
|
531
|
+
# projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]
|
532
|
+
#
|
533
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
534
|
+
# @yieldparam response [::Google::Protobuf::Empty]
|
535
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
536
|
+
#
|
537
|
+
# @return [::Google::Protobuf::Empty]
|
538
|
+
#
|
539
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
540
|
+
#
|
541
|
+
def delete_service request, options = nil
|
542
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
543
|
+
|
544
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Monitoring::V3::DeleteServiceRequest
|
545
|
+
|
546
|
+
# Converts hash and nil to an options object
|
547
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
548
|
+
|
549
|
+
# Customize the options with defaults
|
550
|
+
metadata = @config.rpcs.delete_service.metadata.to_h
|
551
|
+
|
552
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
553
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
554
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
555
|
+
gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
|
556
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
557
|
+
|
558
|
+
header_params = {
|
559
|
+
"name" => request.name
|
560
|
+
}
|
561
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
562
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
563
|
+
|
564
|
+
options.apply_defaults timeout: @config.rpcs.delete_service.timeout,
|
565
|
+
metadata: metadata,
|
566
|
+
retry_policy: @config.rpcs.delete_service.retry_policy
|
567
|
+
options.apply_defaults metadata: @config.metadata,
|
568
|
+
retry_policy: @config.retry_policy
|
569
|
+
|
570
|
+
@service_monitoring_service_stub.call_rpc :delete_service, request, options: options do |response, operation|
|
571
|
+
yield response, operation if block_given?
|
572
|
+
return response
|
573
|
+
end
|
574
|
+
rescue ::GRPC::BadStatus => e
|
575
|
+
raise ::Google::Cloud::Error.from_error(e)
|
576
|
+
end
|
577
|
+
|
578
|
+
##
|
579
|
+
# Create a `ServiceLevelObjective` for the given `Service`.
|
580
|
+
#
|
581
|
+
# @overload create_service_level_objective(request, options = nil)
|
582
|
+
# Pass arguments to `create_service_level_objective` via a request object, either of type
|
583
|
+
# {::Google::Cloud::Monitoring::V3::CreateServiceLevelObjectiveRequest} or an equivalent Hash.
|
584
|
+
#
|
585
|
+
# @param request [::Google::Cloud::Monitoring::V3::CreateServiceLevelObjectiveRequest, ::Hash]
|
586
|
+
# A request object representing the call parameters. Required. To specify no
|
587
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
588
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
589
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
590
|
+
#
|
591
|
+
# @overload create_service_level_objective(parent: nil, service_level_objective_id: nil, service_level_objective: nil)
|
592
|
+
# Pass arguments to `create_service_level_objective` via keyword arguments. Note that at
|
593
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
594
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
595
|
+
#
|
596
|
+
# @param parent [::String]
|
597
|
+
# Required. Resource name of the parent `Service`. The format is:
|
598
|
+
#
|
599
|
+
# projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]
|
600
|
+
# @param service_level_objective_id [::String]
|
601
|
+
# Optional. The ServiceLevelObjective id to use for this
|
602
|
+
# ServiceLevelObjective. If omitted, an id will be generated instead. Must
|
603
|
+
# match the pattern `[a-z0-9\-]+`
|
604
|
+
# @param service_level_objective [::Google::Cloud::Monitoring::V3::ServiceLevelObjective, ::Hash]
|
605
|
+
# Required. The `ServiceLevelObjective` to create.
|
606
|
+
# The provided `name` will be respected if no `ServiceLevelObjective` exists
|
607
|
+
# with this name.
|
608
|
+
#
|
609
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
610
|
+
# @yieldparam response [::Google::Cloud::Monitoring::V3::ServiceLevelObjective]
|
611
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
612
|
+
#
|
613
|
+
# @return [::Google::Cloud::Monitoring::V3::ServiceLevelObjective]
|
614
|
+
#
|
615
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
616
|
+
#
|
617
|
+
def create_service_level_objective request, options = nil
|
618
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
619
|
+
|
620
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Monitoring::V3::CreateServiceLevelObjectiveRequest
|
621
|
+
|
622
|
+
# Converts hash and nil to an options object
|
623
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
624
|
+
|
625
|
+
# Customize the options with defaults
|
626
|
+
metadata = @config.rpcs.create_service_level_objective.metadata.to_h
|
627
|
+
|
628
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
629
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
630
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
631
|
+
gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
|
632
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
633
|
+
|
634
|
+
header_params = {
|
635
|
+
"parent" => request.parent
|
636
|
+
}
|
637
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
638
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
639
|
+
|
640
|
+
options.apply_defaults timeout: @config.rpcs.create_service_level_objective.timeout,
|
641
|
+
metadata: metadata,
|
642
|
+
retry_policy: @config.rpcs.create_service_level_objective.retry_policy
|
643
|
+
options.apply_defaults metadata: @config.metadata,
|
644
|
+
retry_policy: @config.retry_policy
|
645
|
+
|
646
|
+
@service_monitoring_service_stub.call_rpc :create_service_level_objective, request, options: options do |response, operation|
|
647
|
+
yield response, operation if block_given?
|
648
|
+
return response
|
649
|
+
end
|
650
|
+
rescue ::GRPC::BadStatus => e
|
651
|
+
raise ::Google::Cloud::Error.from_error(e)
|
652
|
+
end
|
653
|
+
|
654
|
+
##
|
655
|
+
# Get a `ServiceLevelObjective` by name.
|
656
|
+
#
|
657
|
+
# @overload get_service_level_objective(request, options = nil)
|
658
|
+
# Pass arguments to `get_service_level_objective` via a request object, either of type
|
659
|
+
# {::Google::Cloud::Monitoring::V3::GetServiceLevelObjectiveRequest} or an equivalent Hash.
|
660
|
+
#
|
661
|
+
# @param request [::Google::Cloud::Monitoring::V3::GetServiceLevelObjectiveRequest, ::Hash]
|
662
|
+
# A request object representing the call parameters. Required. To specify no
|
663
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
664
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
665
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
666
|
+
#
|
667
|
+
# @overload get_service_level_objective(name: nil, view: nil)
|
668
|
+
# Pass arguments to `get_service_level_objective` via keyword arguments. Note that at
|
669
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
670
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
671
|
+
#
|
672
|
+
# @param name [::String]
|
673
|
+
# Required. Resource name of the `ServiceLevelObjective` to get. The format is:
|
674
|
+
#
|
675
|
+
# projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]/serviceLevelObjectives/[SLO_NAME]
|
676
|
+
# @param view [::Google::Cloud::Monitoring::V3::ServiceLevelObjective::View]
|
677
|
+
# View of the `ServiceLevelObjective` to return. If `DEFAULT`, return the
|
678
|
+
# `ServiceLevelObjective` as originally defined. If `EXPLICIT` and the
|
679
|
+
# `ServiceLevelObjective` is defined in terms of a `BasicSli`, replace the
|
680
|
+
# `BasicSli` with a `RequestBasedSli` spelling out how the SLI is computed.
|
681
|
+
#
|
682
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
683
|
+
# @yieldparam response [::Google::Cloud::Monitoring::V3::ServiceLevelObjective]
|
684
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
685
|
+
#
|
686
|
+
# @return [::Google::Cloud::Monitoring::V3::ServiceLevelObjective]
|
687
|
+
#
|
688
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
689
|
+
#
|
690
|
+
def get_service_level_objective request, options = nil
|
691
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
692
|
+
|
693
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Monitoring::V3::GetServiceLevelObjectiveRequest
|
694
|
+
|
695
|
+
# Converts hash and nil to an options object
|
696
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
697
|
+
|
698
|
+
# Customize the options with defaults
|
699
|
+
metadata = @config.rpcs.get_service_level_objective.metadata.to_h
|
700
|
+
|
701
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
702
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
703
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
704
|
+
gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
|
705
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
706
|
+
|
707
|
+
header_params = {
|
708
|
+
"name" => request.name
|
709
|
+
}
|
710
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
711
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
712
|
+
|
713
|
+
options.apply_defaults timeout: @config.rpcs.get_service_level_objective.timeout,
|
714
|
+
metadata: metadata,
|
715
|
+
retry_policy: @config.rpcs.get_service_level_objective.retry_policy
|
716
|
+
options.apply_defaults metadata: @config.metadata,
|
717
|
+
retry_policy: @config.retry_policy
|
718
|
+
|
719
|
+
@service_monitoring_service_stub.call_rpc :get_service_level_objective, request, options: options do |response, operation|
|
720
|
+
yield response, operation if block_given?
|
721
|
+
return response
|
722
|
+
end
|
723
|
+
rescue ::GRPC::BadStatus => e
|
724
|
+
raise ::Google::Cloud::Error.from_error(e)
|
725
|
+
end
|
726
|
+
|
727
|
+
##
|
728
|
+
# List the `ServiceLevelObjective`s for the given `Service`.
|
729
|
+
#
|
730
|
+
# @overload list_service_level_objectives(request, options = nil)
|
731
|
+
# Pass arguments to `list_service_level_objectives` via a request object, either of type
|
732
|
+
# {::Google::Cloud::Monitoring::V3::ListServiceLevelObjectivesRequest} or an equivalent Hash.
|
733
|
+
#
|
734
|
+
# @param request [::Google::Cloud::Monitoring::V3::ListServiceLevelObjectivesRequest, ::Hash]
|
735
|
+
# A request object representing the call parameters. Required. To specify no
|
736
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
737
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
738
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
739
|
+
#
|
740
|
+
# @overload list_service_level_objectives(parent: nil, filter: nil, page_size: nil, page_token: nil, view: nil)
|
741
|
+
# Pass arguments to `list_service_level_objectives` via keyword arguments. Note that at
|
742
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
743
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
744
|
+
#
|
745
|
+
# @param parent [::String]
|
746
|
+
# Required. Resource name of the parent containing the listed SLOs, either a
|
747
|
+
# project or a Monitoring Workspace. The formats are:
|
748
|
+
#
|
749
|
+
# projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]
|
750
|
+
# workspaces/[HOST_PROJECT_ID_OR_NUMBER]/services/-
|
751
|
+
# @param filter [::String]
|
752
|
+
# A filter specifying what `ServiceLevelObjective`s to return.
|
753
|
+
# @param page_size [::Integer]
|
754
|
+
# A non-negative number that is the maximum number of results to return.
|
755
|
+
# When 0, use default page size.
|
756
|
+
# @param page_token [::String]
|
757
|
+
# If this field is not empty then it must contain the `nextPageToken` value
|
758
|
+
# returned by a previous call to this method. Using this field causes the
|
759
|
+
# method to return additional results from the previous method call.
|
760
|
+
# @param view [::Google::Cloud::Monitoring::V3::ServiceLevelObjective::View]
|
761
|
+
# View of the `ServiceLevelObjective`s to return. If `DEFAULT`, return each
|
762
|
+
# `ServiceLevelObjective` as originally defined. If `EXPLICIT` and the
|
763
|
+
# `ServiceLevelObjective` is defined in terms of a `BasicSli`, replace the
|
764
|
+
# `BasicSli` with a `RequestBasedSli` spelling out how the SLI is computed.
|
765
|
+
#
|
766
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
767
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Monitoring::V3::ServiceLevelObjective>]
|
768
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
769
|
+
#
|
770
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::Monitoring::V3::ServiceLevelObjective>]
|
771
|
+
#
|
772
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
773
|
+
#
|
774
|
+
def list_service_level_objectives request, options = nil
|
775
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
776
|
+
|
777
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Monitoring::V3::ListServiceLevelObjectivesRequest
|
778
|
+
|
779
|
+
# Converts hash and nil to an options object
|
780
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
781
|
+
|
782
|
+
# Customize the options with defaults
|
783
|
+
metadata = @config.rpcs.list_service_level_objectives.metadata.to_h
|
784
|
+
|
785
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
786
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
787
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
788
|
+
gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
|
789
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
790
|
+
|
791
|
+
header_params = {
|
792
|
+
"parent" => request.parent
|
793
|
+
}
|
794
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
795
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
796
|
+
|
797
|
+
options.apply_defaults timeout: @config.rpcs.list_service_level_objectives.timeout,
|
798
|
+
metadata: metadata,
|
799
|
+
retry_policy: @config.rpcs.list_service_level_objectives.retry_policy
|
800
|
+
options.apply_defaults metadata: @config.metadata,
|
801
|
+
retry_policy: @config.retry_policy
|
802
|
+
|
803
|
+
@service_monitoring_service_stub.call_rpc :list_service_level_objectives, request, options: options do |response, operation|
|
804
|
+
response = ::Gapic::PagedEnumerable.new @service_monitoring_service_stub, :list_service_level_objectives, request, response, operation, options
|
805
|
+
yield response, operation if block_given?
|
806
|
+
return response
|
807
|
+
end
|
808
|
+
rescue ::GRPC::BadStatus => e
|
809
|
+
raise ::Google::Cloud::Error.from_error(e)
|
810
|
+
end
|
811
|
+
|
812
|
+
##
|
813
|
+
# Update the given `ServiceLevelObjective`.
|
814
|
+
#
|
815
|
+
# @overload update_service_level_objective(request, options = nil)
|
816
|
+
# Pass arguments to `update_service_level_objective` via a request object, either of type
|
817
|
+
# {::Google::Cloud::Monitoring::V3::UpdateServiceLevelObjectiveRequest} or an equivalent Hash.
|
818
|
+
#
|
819
|
+
# @param request [::Google::Cloud::Monitoring::V3::UpdateServiceLevelObjectiveRequest, ::Hash]
|
820
|
+
# A request object representing the call parameters. Required. To specify no
|
821
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
822
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
823
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
824
|
+
#
|
825
|
+
# @overload update_service_level_objective(service_level_objective: nil, update_mask: nil)
|
826
|
+
# Pass arguments to `update_service_level_objective` via keyword arguments. Note that at
|
827
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
828
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
829
|
+
#
|
830
|
+
# @param service_level_objective [::Google::Cloud::Monitoring::V3::ServiceLevelObjective, ::Hash]
|
831
|
+
# Required. The `ServiceLevelObjective` to draw updates from.
|
832
|
+
# The given `name` specifies the resource to update.
|
833
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
834
|
+
# A set of field paths defining which fields to use for the update.
|
835
|
+
#
|
836
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
837
|
+
# @yieldparam response [::Google::Cloud::Monitoring::V3::ServiceLevelObjective]
|
838
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
839
|
+
#
|
840
|
+
# @return [::Google::Cloud::Monitoring::V3::ServiceLevelObjective]
|
841
|
+
#
|
842
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
843
|
+
#
|
844
|
+
def update_service_level_objective request, options = nil
|
845
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
846
|
+
|
847
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Monitoring::V3::UpdateServiceLevelObjectiveRequest
|
848
|
+
|
849
|
+
# Converts hash and nil to an options object
|
850
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
851
|
+
|
852
|
+
# Customize the options with defaults
|
853
|
+
metadata = @config.rpcs.update_service_level_objective.metadata.to_h
|
854
|
+
|
855
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
856
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
857
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
858
|
+
gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
|
859
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
860
|
+
|
861
|
+
header_params = {
|
862
|
+
"service_level_objective.name" => request.service_level_objective.name
|
863
|
+
}
|
864
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
865
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
866
|
+
|
867
|
+
options.apply_defaults timeout: @config.rpcs.update_service_level_objective.timeout,
|
868
|
+
metadata: metadata,
|
869
|
+
retry_policy: @config.rpcs.update_service_level_objective.retry_policy
|
870
|
+
options.apply_defaults metadata: @config.metadata,
|
871
|
+
retry_policy: @config.retry_policy
|
872
|
+
|
873
|
+
@service_monitoring_service_stub.call_rpc :update_service_level_objective, request, options: options do |response, operation|
|
874
|
+
yield response, operation if block_given?
|
875
|
+
return response
|
876
|
+
end
|
877
|
+
rescue ::GRPC::BadStatus => e
|
878
|
+
raise ::Google::Cloud::Error.from_error(e)
|
879
|
+
end
|
880
|
+
|
881
|
+
##
|
882
|
+
# Delete the given `ServiceLevelObjective`.
|
883
|
+
#
|
884
|
+
# @overload delete_service_level_objective(request, options = nil)
|
885
|
+
# Pass arguments to `delete_service_level_objective` via a request object, either of type
|
886
|
+
# {::Google::Cloud::Monitoring::V3::DeleteServiceLevelObjectiveRequest} or an equivalent Hash.
|
887
|
+
#
|
888
|
+
# @param request [::Google::Cloud::Monitoring::V3::DeleteServiceLevelObjectiveRequest, ::Hash]
|
889
|
+
# A request object representing the call parameters. Required. To specify no
|
890
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
891
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
892
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
893
|
+
#
|
894
|
+
# @overload delete_service_level_objective(name: nil)
|
895
|
+
# Pass arguments to `delete_service_level_objective` via keyword arguments. Note that at
|
896
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
897
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
898
|
+
#
|
899
|
+
# @param name [::String]
|
900
|
+
# Required. Resource name of the `ServiceLevelObjective` to delete. The format is:
|
901
|
+
#
|
902
|
+
# projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]/serviceLevelObjectives/[SLO_NAME]
|
903
|
+
#
|
904
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
905
|
+
# @yieldparam response [::Google::Protobuf::Empty]
|
906
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
907
|
+
#
|
908
|
+
# @return [::Google::Protobuf::Empty]
|
909
|
+
#
|
910
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
911
|
+
#
|
912
|
+
def delete_service_level_objective request, options = nil
|
913
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
914
|
+
|
915
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Monitoring::V3::DeleteServiceLevelObjectiveRequest
|
916
|
+
|
917
|
+
# Converts hash and nil to an options object
|
918
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
919
|
+
|
920
|
+
# Customize the options with defaults
|
921
|
+
metadata = @config.rpcs.delete_service_level_objective.metadata.to_h
|
922
|
+
|
923
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
924
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
925
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
926
|
+
gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
|
927
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
928
|
+
|
929
|
+
header_params = {
|
930
|
+
"name" => request.name
|
931
|
+
}
|
932
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
933
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
934
|
+
|
935
|
+
options.apply_defaults timeout: @config.rpcs.delete_service_level_objective.timeout,
|
936
|
+
metadata: metadata,
|
937
|
+
retry_policy: @config.rpcs.delete_service_level_objective.retry_policy
|
938
|
+
options.apply_defaults metadata: @config.metadata,
|
939
|
+
retry_policy: @config.retry_policy
|
940
|
+
|
941
|
+
@service_monitoring_service_stub.call_rpc :delete_service_level_objective, request, options: options do |response, operation|
|
942
|
+
yield response, operation if block_given?
|
943
|
+
return response
|
944
|
+
end
|
945
|
+
rescue ::GRPC::BadStatus => e
|
946
|
+
raise ::Google::Cloud::Error.from_error(e)
|
947
|
+
end
|
948
|
+
|
949
|
+
##
|
950
|
+
# Configuration class for the ServiceMonitoringService API.
|
951
|
+
#
|
952
|
+
# This class represents the configuration for ServiceMonitoringService,
|
953
|
+
# providing control over timeouts, retry behavior, logging, transport
|
954
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
955
|
+
# applied individually to specific RPCs. See
|
956
|
+
# {::Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client::Configuration::Rpcs}
|
957
|
+
# for a list of RPCs that can be configured independently.
|
958
|
+
#
|
959
|
+
# Configuration can be applied globally to all clients, or to a single client
|
960
|
+
# on construction.
|
961
|
+
#
|
962
|
+
# # Examples
|
963
|
+
#
|
964
|
+
# To modify the global config, setting the timeout for create_service
|
965
|
+
# to 20 seconds, and all remaining timeouts to 10 seconds:
|
966
|
+
#
|
967
|
+
# ::Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client.configure do |config|
|
968
|
+
# config.timeout = 10.0
|
969
|
+
# config.rpcs.create_service.timeout = 20.0
|
970
|
+
# end
|
971
|
+
#
|
972
|
+
# To apply the above configuration only to a new client:
|
973
|
+
#
|
974
|
+
# client = ::Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client.new do |config|
|
975
|
+
# config.timeout = 10.0
|
976
|
+
# config.rpcs.create_service.timeout = 20.0
|
977
|
+
# end
|
978
|
+
#
|
979
|
+
# @!attribute [rw] endpoint
|
980
|
+
# The hostname or hostname:port of the service endpoint.
|
981
|
+
# Defaults to `"monitoring.googleapis.com"`.
|
982
|
+
# @return [::String]
|
983
|
+
# @!attribute [rw] credentials
|
984
|
+
# Credentials to send with calls. You may provide any of the following types:
|
985
|
+
# * (`String`) The path to a service account key file in JSON format
|
986
|
+
# * (`Hash`) A service account key as a Hash
|
987
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
988
|
+
# (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
|
989
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
990
|
+
# (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
|
991
|
+
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
992
|
+
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
993
|
+
# * (`nil`) indicating no credentials
|
994
|
+
# @return [::Object]
|
995
|
+
# @!attribute [rw] scope
|
996
|
+
# The OAuth scopes
|
997
|
+
# @return [::Array<::String>]
|
998
|
+
# @!attribute [rw] lib_name
|
999
|
+
# The library name as recorded in instrumentation and logging
|
1000
|
+
# @return [::String]
|
1001
|
+
# @!attribute [rw] lib_version
|
1002
|
+
# The library version as recorded in instrumentation and logging
|
1003
|
+
# @return [::String]
|
1004
|
+
# @!attribute [rw] channel_args
|
1005
|
+
# Extra parameters passed to the gRPC channel. Note: this is ignored if a
|
1006
|
+
# `GRPC::Core::Channel` object is provided as the credential.
|
1007
|
+
# @return [::Hash]
|
1008
|
+
# @!attribute [rw] interceptors
|
1009
|
+
# An array of interceptors that are run before calls are executed.
|
1010
|
+
# @return [::Array<::GRPC::ClientInterceptor>]
|
1011
|
+
# @!attribute [rw] timeout
|
1012
|
+
# The call timeout in seconds.
|
1013
|
+
# @return [::Numeric]
|
1014
|
+
# @!attribute [rw] metadata
|
1015
|
+
# Additional gRPC headers to be sent with the call.
|
1016
|
+
# @return [::Hash{::Symbol=>::String}]
|
1017
|
+
# @!attribute [rw] retry_policy
|
1018
|
+
# The retry policy. The value is a hash with the following keys:
|
1019
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
1020
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
1021
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
1022
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
1023
|
+
# trigger a retry.
|
1024
|
+
# @return [::Hash]
|
1025
|
+
# @!attribute [rw] quota_project
|
1026
|
+
# A separate project against which to charge quota.
|
1027
|
+
# @return [::String]
|
1028
|
+
#
|
1029
|
+
class Configuration
|
1030
|
+
extend ::Gapic::Config
|
1031
|
+
|
1032
|
+
config_attr :endpoint, "monitoring.googleapis.com", ::String
|
1033
|
+
config_attr :credentials, nil do |value|
|
1034
|
+
allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
1035
|
+
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
1036
|
+
allowed.any? { |klass| klass === value }
|
1037
|
+
end
|
1038
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
1039
|
+
config_attr :lib_name, nil, ::String, nil
|
1040
|
+
config_attr :lib_version, nil, ::String, nil
|
1041
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
|
1042
|
+
config_attr :interceptors, nil, ::Array, nil
|
1043
|
+
config_attr :timeout, nil, ::Numeric, nil
|
1044
|
+
config_attr :metadata, nil, ::Hash, nil
|
1045
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
1046
|
+
config_attr :quota_project, nil, ::String, nil
|
1047
|
+
|
1048
|
+
# @private
|
1049
|
+
def initialize parent_config = nil
|
1050
|
+
@parent_config = parent_config unless parent_config.nil?
|
1051
|
+
|
1052
|
+
yield self if block_given?
|
1053
|
+
end
|
1054
|
+
|
1055
|
+
##
|
1056
|
+
# Configurations for individual RPCs
|
1057
|
+
# @return [Rpcs]
|
1058
|
+
#
|
1059
|
+
def rpcs
|
1060
|
+
@rpcs ||= begin
|
1061
|
+
parent_rpcs = nil
|
1062
|
+
parent_rpcs = @parent_config.rpcs if @parent_config&.respond_to? :rpcs
|
1063
|
+
Rpcs.new parent_rpcs
|
1064
|
+
end
|
1065
|
+
end
|
1066
|
+
|
1067
|
+
##
|
1068
|
+
# Configuration RPC class for the ServiceMonitoringService API.
|
1069
|
+
#
|
1070
|
+
# Includes fields providing the configuration for each RPC in this service.
|
1071
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
1072
|
+
# the following configuration fields:
|
1073
|
+
#
|
1074
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
|
1075
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
|
1076
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
1077
|
+
# include the following keys:
|
1078
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
1079
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
1080
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
1081
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
1082
|
+
# trigger a retry.
|
1083
|
+
#
|
1084
|
+
class Rpcs
|
1085
|
+
##
|
1086
|
+
# RPC-specific configuration for `create_service`
|
1087
|
+
# @return [::Gapic::Config::Method]
|
1088
|
+
#
|
1089
|
+
attr_reader :create_service
|
1090
|
+
##
|
1091
|
+
# RPC-specific configuration for `get_service`
|
1092
|
+
# @return [::Gapic::Config::Method]
|
1093
|
+
#
|
1094
|
+
attr_reader :get_service
|
1095
|
+
##
|
1096
|
+
# RPC-specific configuration for `list_services`
|
1097
|
+
# @return [::Gapic::Config::Method]
|
1098
|
+
#
|
1099
|
+
attr_reader :list_services
|
1100
|
+
##
|
1101
|
+
# RPC-specific configuration for `update_service`
|
1102
|
+
# @return [::Gapic::Config::Method]
|
1103
|
+
#
|
1104
|
+
attr_reader :update_service
|
1105
|
+
##
|
1106
|
+
# RPC-specific configuration for `delete_service`
|
1107
|
+
# @return [::Gapic::Config::Method]
|
1108
|
+
#
|
1109
|
+
attr_reader :delete_service
|
1110
|
+
##
|
1111
|
+
# RPC-specific configuration for `create_service_level_objective`
|
1112
|
+
# @return [::Gapic::Config::Method]
|
1113
|
+
#
|
1114
|
+
attr_reader :create_service_level_objective
|
1115
|
+
##
|
1116
|
+
# RPC-specific configuration for `get_service_level_objective`
|
1117
|
+
# @return [::Gapic::Config::Method]
|
1118
|
+
#
|
1119
|
+
attr_reader :get_service_level_objective
|
1120
|
+
##
|
1121
|
+
# RPC-specific configuration for `list_service_level_objectives`
|
1122
|
+
# @return [::Gapic::Config::Method]
|
1123
|
+
#
|
1124
|
+
attr_reader :list_service_level_objectives
|
1125
|
+
##
|
1126
|
+
# RPC-specific configuration for `update_service_level_objective`
|
1127
|
+
# @return [::Gapic::Config::Method]
|
1128
|
+
#
|
1129
|
+
attr_reader :update_service_level_objective
|
1130
|
+
##
|
1131
|
+
# RPC-specific configuration for `delete_service_level_objective`
|
1132
|
+
# @return [::Gapic::Config::Method]
|
1133
|
+
#
|
1134
|
+
attr_reader :delete_service_level_objective
|
1135
|
+
|
1136
|
+
# @private
|
1137
|
+
def initialize parent_rpcs = nil
|
1138
|
+
create_service_config = parent_rpcs&.create_service if parent_rpcs&.respond_to? :create_service
|
1139
|
+
@create_service = ::Gapic::Config::Method.new create_service_config
|
1140
|
+
get_service_config = parent_rpcs&.get_service if parent_rpcs&.respond_to? :get_service
|
1141
|
+
@get_service = ::Gapic::Config::Method.new get_service_config
|
1142
|
+
list_services_config = parent_rpcs&.list_services if parent_rpcs&.respond_to? :list_services
|
1143
|
+
@list_services = ::Gapic::Config::Method.new list_services_config
|
1144
|
+
update_service_config = parent_rpcs&.update_service if parent_rpcs&.respond_to? :update_service
|
1145
|
+
@update_service = ::Gapic::Config::Method.new update_service_config
|
1146
|
+
delete_service_config = parent_rpcs&.delete_service if parent_rpcs&.respond_to? :delete_service
|
1147
|
+
@delete_service = ::Gapic::Config::Method.new delete_service_config
|
1148
|
+
create_service_level_objective_config = parent_rpcs&.create_service_level_objective if parent_rpcs&.respond_to? :create_service_level_objective
|
1149
|
+
@create_service_level_objective = ::Gapic::Config::Method.new create_service_level_objective_config
|
1150
|
+
get_service_level_objective_config = parent_rpcs&.get_service_level_objective if parent_rpcs&.respond_to? :get_service_level_objective
|
1151
|
+
@get_service_level_objective = ::Gapic::Config::Method.new get_service_level_objective_config
|
1152
|
+
list_service_level_objectives_config = parent_rpcs&.list_service_level_objectives if parent_rpcs&.respond_to? :list_service_level_objectives
|
1153
|
+
@list_service_level_objectives = ::Gapic::Config::Method.new list_service_level_objectives_config
|
1154
|
+
update_service_level_objective_config = parent_rpcs&.update_service_level_objective if parent_rpcs&.respond_to? :update_service_level_objective
|
1155
|
+
@update_service_level_objective = ::Gapic::Config::Method.new update_service_level_objective_config
|
1156
|
+
delete_service_level_objective_config = parent_rpcs&.delete_service_level_objective if parent_rpcs&.respond_to? :delete_service_level_objective
|
1157
|
+
@delete_service_level_objective = ::Gapic::Config::Method.new delete_service_level_objective_config
|
1158
|
+
|
1159
|
+
yield self if block_given?
|
1160
|
+
end
|
1161
|
+
end
|
1162
|
+
end
|
1163
|
+
end
|
1164
|
+
end
|
1165
|
+
end
|
1166
|
+
end
|
1167
|
+
end
|
1168
|
+
end
|